Skip to content

Commit

Permalink
Modernize Gradle files (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikc5000 committed Nov 1, 2023
1 parent d734e6d commit f6cf63d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 27 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ tasks.register<DokkaMultiModuleTask>("dokkaMkdocsMultiModule") {
// This is deprecated, but doesn't seem to have a replacement yet
@Suppress("DEPRECATION")
addSubprojectChildTasks("dokkaMkdocsPartial")
outputDirectory.set(file("$rootDir/docs/api"))
outputDirectory = file("$rootDir/docs/api")
}

tasks.register("codegen") {
Expand Down
26 changes: 13 additions & 13 deletions buildSrc/src/main/kotlin/published-library.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tasks.register<DokkaTaskPartial>("dokkaMkdocsPartial") {
val javadocJar by tasks.registering(Jar::class) {
val dokkaHtml = tasks.named<DokkaTask>("dokkaHtml")
dependsOn(dokkaHtml)
archiveClassifier.set("javadoc")
archiveClassifier = "javadoc"
from(dokkaHtml.get().outputDirectory)
}

Expand Down Expand Up @@ -73,26 +73,26 @@ publishing {
}

pom {
name.set(pomName)
description.set(pomDescription)
url.set(pomUrl)
name = pomName
description = pomDescription
url = pomUrl
licenses {
license {
name.set(pomLicenseName)
url.set(pomLicenseUrl)
distribution.set(pomLicenseDist)
name = pomLicenseName
url = pomLicenseUrl
distribution = pomLicenseDist
}
}
developers {
developer {
id.set(pomDeveloperId)
name.set(pomDeveloperName)
id = pomDeveloperId
name = pomDeveloperName

}
}
scm {
connection.set(pomScmConnection)
url.set(pomScmUrl)
connection = pomScmConnection
url = pomScmUrl
}
}
}
Expand All @@ -106,8 +106,8 @@ tasks.withType<AbstractDokkaLeafTask>().configureEach {
dokkaSourceSets {
configureEach {
includes.from(project.file("MODULE.md"))
skipEmptyPackages.set(true)
skipDeprecated.set(true)
skipEmptyPackages = true
skipDeprecated = true
}
}
}
5 changes: 0 additions & 5 deletions extensions/parcelize/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ android {
isCoreLibraryDesugaringEnabled = true
}

sourceSets {
getByName("main").java.srcDirs("src/main/kotlin")
getByName("androidTest").java.srcDirs("src/androidTest/kotlin")
}

defaultConfig {
multiDexEnabled = true
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down
17 changes: 9 additions & 8 deletions tools/code-generator/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile

plugins {
alias(libs.plugins.kotlinJvm)
Expand All @@ -10,17 +11,17 @@ dependencies {
}

application {
mainClass.set("io.islandtime.codegen.MainKt")
mainClass = "io.islandtime.codegen.MainKt"
}

tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
sourceCompatibility = JavaVersion.VERSION_11.toString()
targetCompatibility = JavaVersion.VERSION_11.toString()
}

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")
tasks.withType<KotlinJvmCompile>().configureEach {
compilerOptions {
jvmTarget = JvmTarget.JVM_11
optIn.add("kotlin.RequiresOptIn")
}
}

0 comments on commit f6cf63d

Please sign in to comment.