Skip to content
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

chore(gradle): Simpler Kotlin DSL Property Assignment #784

Merged
merged 3 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading