-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
Showing
15 changed files
with
278 additions
and
364 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"]) | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.