Skip to content

Commit

Permalink
Update Gradle build
Browse files Browse the repository at this point in the history
* Bump version to 6.5
* Use Kotlin Gradle files
* * One single simple file instead of includes
* Remove doc publishing task; this is always done by CI
  • Loading branch information
kdubb committed Aug 20, 2020
1 parent 4c59a1d commit 3fd4721
Show file tree
Hide file tree
Showing 15 changed files with 278 additions and 364 deletions.
104 changes: 0 additions & 104 deletions build.gradle

This file was deleted.

215 changes: 215 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`java-library`
jacoco
`maven-publish`
signing

kotlin("jvm") version "1.3.72"
id("org.jetbrains.dokka") version "0.10.1"

id("net.minecrell.licenser") version "0.4.1"
id("org.jmailen.kotlinter") version "2.4.1"
}


group = "io.outfoxx"
version = "1.0.0-SNAPSHOT"
description = "A Kotlin/Java API for generating .swift source files."

val isSnapshot = "$version".endsWith("SNAPSHOT")


//
// DEPENDENCIES
//

// Versions

val guavaVersion = "22.0"
val junitJupiterVersion = "5.6.2"
val hamcrestVersion = "1.3"

repositories {
mavenCentral()
jcenter()
}

dependencies {

//
// LANGUAGES
//

// kotlin
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlin:kotlin-reflect")

//
// MISCELLANEOUS
//

implementation("com.google.guava:guava:$guavaVersion")

//
// TESTING
//

// junit
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion")
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion")
testImplementation("org.hamcrest:hamcrest-all:$hamcrestVersion")

}


//
// COMPILE
//

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

withSourcesJar()
withJavadocJar()
}

tasks {
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
}
}
}


//
// TEST
//

jacoco {
toolVersion = "0.8.5"
}

tasks {
test {
useJUnitPlatform()

finalizedBy(jacocoTestReport)
jacoco {}
}

jacocoTestReport {
dependsOn(test)
}
}


//
// DOCS
//

tasks {
dokka {
outputFormat = "html"
outputDirectory = "$buildDir/javadoc/${project.version}"
}

javadoc {
dependsOn(dokka)
}
}


//
// CHECKS
//

kotlinter {
indentSize = 2
}

license {
header = file("HEADER.txt")
include("**/*.kt")
}


//
// PUBLISHING
//

publishing {

publications {

create<MavenPublication>("mavenJava") {
from(components["java"])

pom {

name.set("Swift Poet")
description.set("SwiftPoet is a Kotlin and Java API for generating .swift source files.")
url.set("https://github.com/outfoxx/swiftpoet")

organization {
name.set("Outfox, Inc.")
url.set("https://outfoxx.io")
}

issueManagement {
system.set("GitHub")
url.set("https://github.com/outfoxx/swiftpoet/issues")
}

licenses {
license {
name.set("Apache License 2.0")
url.set("https://raw.githubusercontent.com/outfoxx/swiftpoet/master/LICENSE.txt")
distribution.set("repo")
}
}

scm {
url.set("https://github.com/outfoxx/swiftpoet")
connection.set("scm:https://github.com/outfoxx/swiftpoet.git")
developerConnection.set("scm:[email protected]:outfoxx/swiftpoet.git")
}

developers {
developer {
id.set("kdubb")
name.set("Kevin Wooten")
email.set("[email protected]")
}
}

}
}

}

repositories {

maven {
val snapshotUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
val releaseUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
url = uri(if (isSnapshot) snapshotUrl else releaseUrl)

credentials {
username = project.findProperty("ossrhUsername")?.toString()
password = project.findProperty("ossrhPassword")?.toString()
}
}

}

}


signing {
isRequired = !isSnapshot && gradle.taskGraph.hasTask("publishMavenJavaPublicationToMavenRepository")
sign(publishing.publications["mavenJava"])
}
32 changes: 0 additions & 32 deletions gradle/code-coverage.gradle

This file was deleted.

15 changes: 0 additions & 15 deletions gradle/compile-java.gradle

This file was deleted.

16 changes: 0 additions & 16 deletions gradle/compile-kotlin.gradle

This file was deleted.

Loading

0 comments on commit 3fd4721

Please sign in to comment.