Skip to content

Migrate to Kotlin DSL #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#171 Remove Groovy configuration from the build
  • Loading branch information
eyalroth committed Oct 9, 2021
commit e86aea3606fb0e282a89adeec6bf77fab4a8fe83
19 changes: 0 additions & 19 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,12 @@ pluginBundle {
}

apply(plugin = "maven-publish")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be moved to the plugins block

// TODO #171 remove once all groovy classes are migrated to kotlin
apply(plugin = "groovy")

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

// TODO #171 remove once all groovy classes are migrated to kotlin
val compileKotlinTask = tasks.compileKotlin.get()
tasks {
named<GroovyCompile>("compileGroovy") {
dependsOn(compileKotlin)
classpath = classpath.plus(files(compileKotlinTask.destinationDirectory))
}
}

dependencies {
compileOnly("org.scoverage:scalac-scoverage-plugin_2.13:1.4.2")
implementation(group = "commons-io", name = "commons-io", version = "2.6")
Expand Down Expand Up @@ -137,13 +126,6 @@ gradlePlugin {
testSourceSets(sourceSets["functionalTest"], sourceSets["crossScalaVersionTest"])
}

// TODO #171 remove once all groovy classes are migrated to kotlin
val groovydocJar by tasks.registering(Jar::class) {
from("$buildDir/docs/groovydoc")
archiveClassifier.set("groovydoc")
dependsOn(tasks["groovydoc"])
}

val kotlindocJar by tasks.registering(Jar::class) {
from(tasks.dokkaHtml.get().outputDirectory)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that instead of

from(tasks.dokkaHtml.get().outputDirectory)
dependsOn(tasks.dokkaHtml)

it is more idiomatic to rely on automatic dependencies propagation:

from(tasks.dokkaHtml)

Gradle will automatically add a dependency on the dokkaHtml task here if its provider is used directly as an input.

archiveClassifier.set("kotlindoc")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, is kotlindoc classifier something which is understood by tooling? It's just I never heard about it; from my knowledge, Kotlin API docs are packaged into the regular javadoc classifier JARs.

Expand Down Expand Up @@ -209,7 +191,6 @@ configure<PublishingExtension> {
}
}
from(components["java"])
artifact(groovydocJar)
artifact(kotlindocJar)
artifact(sourcesJar)
}
Expand Down