Skip to content

Commit

Permalink
chore(gradle): Simpler Kotlin DSL Property Assignment (#784)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Rayapoullé <scott.rayapoulle@adevinta.com>
  • Loading branch information
SimonMarquis and soulcramer authored Jun 24, 2024
1 parent 656144d commit 61d7d8e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ package com.adevinta.spark
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.assign
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.named
import org.gradle.kotlin.dsl.withType
Expand Down Expand Up @@ -57,8 +58,8 @@ internal class SparkDokkaPlugin : Plugin<Project> {
}

private fun Project.configureRootProject() = tasks.named<DokkaMultiModuleTask>("dokkaHtmlMultiModule") {
moduleName.set("Spark")
outputDirectory.set(layout.buildDirectory.dir("dokka"))
moduleName = "Spark"
outputDirectory = layout.buildDirectory.dir("dokka")
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
fun File.recursiveAssets() = walk().filter(File::isFile)
// https://github.com/Kotlin/dokka/issues/3400
Expand Down Expand Up @@ -91,9 +92,9 @@ internal class SparkDokkaPlugin : Plugin<Project> {
// FIXME(android): https://github.com/Kotlin/dokka/issues/2876
sourceLink {
val url = "https://github.com/Adevinta/spark-android/tree/main/${project.name}/src/main/kotlin"
localDirectory.set(projectDir.resolve("src"))
remoteUrl.set(URI(url).toURL())
remoteLineSuffix.set("#L")
localDirectory = projectDir.resolve("src")
remoteUrl = URI(url).toURL()
remoteLineSuffix = "#L"
}
}
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> { configureFooterMessage() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import org.gradle.api.Project
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.assign
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.provideDelegate
Expand Down Expand Up @@ -96,22 +97,22 @@ internal class SparkPublishingPlugin : Plugin<Project> {
}

private fun MavenPublication.configurePom() = pom {
name.set("Spark")
description.set("Spark Design System")
url.set("https://github.com/adevinta/spark-android")
name = "Spark"
description = "Spark Design System"
url = "https://github.com/adevinta/spark-android"
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/MIT")
name = "MIT License"
url = "https://opensource.org/licenses/MIT"
}
}
scm {
url.set("https://github.com/adevinta/spark-android")
url = "https://github.com/adevinta/spark-android"
}
developers {
developer {
name.set("Adevinta Engineers")
email.set("engineers@adevinta.com")
name = "Adevinta Engineers"
email = "engineers@adevinta.com"
}
}
}
Expand Down

0 comments on commit 61d7d8e

Please sign in to comment.