Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm")
kotlin("kapt")
id("org.jetbrains.dokka")
signing
`maven-publish`
}
dependencies {
compileOnly("org.jetbrains.kotlin:kotlin-compiler-embeddable")
kapt("com.google.auto.service:auto-service:1.0.1")
compileOnly("com.google.auto.service:auto-service-annotations:1.0.1")
testImplementation(kotlin("test-junit5"))
testImplementation("org.jetbrains.kotlin:kotlin-compiler-embeddable")
testImplementation("com.github.tschuchortdev:kotlin-compile-testing:1.4.9")
testImplementation(enforcedPlatform("org.junit:junit-bom:5.9.1"))
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks.register("sourcesJar", Jar::class) {
group = "build"
description = "Assembles Kotlin sources"
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
dependsOn(tasks.classes)
}
tasks.register("dokkaJar", Jar::class) {
group = "documentation"
description = "Assembles Kotlin docs with Dokka"
archiveClassifier.set("javadoc")
from(tasks.dokkaHtml)
dependsOn(tasks.dokkaHtml)
}
signing {
setRequired(provider { gradle.taskGraph.hasTask("publish") })
sign(publishing.publications)
}
publishing {
publications {
create<MavenPublication>("default") {
from(components["java"])
artifact(tasks["sourcesJar"])
artifact(tasks["dokkaJar"])
pom {
name.set(project.name)
description.set("Kotlin compiler plugin to enable power assertions in the Kotlin programming language")
url.set("https://github.com/bnorm/kotlin-power-assert")
licenses {
license {
name.set("Apache License 2.0")
url.set("https://github.com/bnorm/kotlin-power-assert/blob/master/LICENSE.txt")
}
}
scm {
url.set("https://github.com/bnorm/kotlin-power-assert")
connection.set("scm:git:git://github.com/bnorm/kotlin-power-assert.git")
}
developers {
developer {
name.set("Brian Norman")
url.set("https://github.com/bnorm")
}
}
}
}
}
repositories {
if (
hasProperty("sonatypeUsername") &&
hasProperty("sonatypePassword") &&
hasProperty("sonatypeSnapshotUrl") &&
hasProperty("sonatypeReleaseUrl")
) {
maven {
val url = when {
"SNAPSHOT" in version.toString() -> property("sonatypeSnapshotUrl")
else -> property("sonatypeReleaseUrl")
} as String
setUrl(url)
credentials {
username = property("sonatypeUsername") as String
password = property("sonatypePassword") as String
}
}
}
maven {
name = "test"
setUrl("file://${rootProject.buildDir}/localMaven")
}
}
}