Skip to content

Commit d28c387

Browse files
committed
refactor(Gradle): Use (incubating) simple property assigment
Make use of syntactic sugar to simplify property assign, see [1]. [1]: https://docs.gradle.org/8.2/release-notes.html#simple-property-assignment-in-kotlin-dsl-enabled-by-default Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent 665b9d1 commit d28c387

File tree

6 files changed

+30
-30
lines changed

6 files changed

+30
-30
lines changed

buildSrc/src/main/kotlin/ort-application-conventions.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ application {
4141
}
4242

4343
graalvmNative {
44-
toolchainDetection.set(true)
44+
toolchainDetection = true
4545

4646
// For options see https://graalvm.github.io/native-build-tools/latest/gradle-plugin.html.
4747
binaries {
4848
named("main") {
49-
imageName.set(application.applicationName)
49+
imageName = application.applicationName
5050

5151
val initializeAtBuildTime = listOf(
5252
"ch.qos.logback.classic.Level",
@@ -66,7 +66,7 @@ graalvmNative {
6666
}
6767

6868
metadataRepository {
69-
enabled.set(true)
69+
enabled = true
7070
}
7171
}
7272

buildSrc/src/main/kotlin/ort-kotlin-conventions.gradle.kts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ testing {
6969
register<JvmTestSuite>("funTest") {
7070
sources {
7171
kotlin {
72-
testType.set(TestSuiteType.FUNCTIONAL_TEST)
72+
testType = TestSuiteType.FUNCTIONAL_TEST
7373
}
7474
}
7575
}
@@ -125,7 +125,7 @@ val mergeDetektReports = if (rootProject.tasks.findByName(mergeDetektReportsTask
125125
rootProject.tasks.named<ReportMergeTask>(mergeDetektReportsTaskName)
126126
} else {
127127
rootProject.tasks.register<ReportMergeTask>(mergeDetektReportsTaskName) {
128-
output.set(rootProject.buildDir.resolve("reports/detekt/merged.sarif"))
128+
output = rootProject.buildDir.resolve("reports/detekt/merged.sarif")
129129
}
130130
}
131131

@@ -135,16 +135,16 @@ tasks.withType<Detekt> detekt@{
135135
dependsOn(":detekt-rules:assemble")
136136

137137
reports {
138-
html.required.set(false)
138+
html.required = false
139139

140140
// TODO: Enable this once https://github.com/detekt/detekt/issues/5034 is resolved and use the merged
141141
// Markdown file as a GitHub Action job summary, see
142142
// https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/.
143-
md.required.set(false)
143+
md.required = false
144144

145-
sarif.required.set(true)
146-
txt.required.set(false)
147-
xml.required.set(false)
145+
sarif.required = true
146+
txt.required = false
147+
xml.required = false
148148
}
149149

150150
mergeDetektReports.configure {
@@ -176,7 +176,7 @@ tasks.withType<KotlinCompile>().configureEach {
176176
}
177177

178178
val sourcesJar by tasks.registering(Jar::class) {
179-
archiveClassifier.set("sources")
179+
archiveClassifier = "sources"
180180
from(sourceSets.main.get().allSource)
181181
}
182182

@@ -186,7 +186,7 @@ tasks.register<Jar>("docsHtmlJar") {
186186

187187
dependsOn(tasks.dokkatooGeneratePublicationHtml)
188188
from(tasks.dokkatooGeneratePublicationHtml.flatMap { it.outputDirectory })
189-
archiveClassifier.set("htmldoc")
189+
archiveClassifier = "htmldoc"
190190
}
191191

192192
val docsJavadocJar by tasks.registering(Jar::class) {
@@ -195,7 +195,7 @@ val docsJavadocJar by tasks.registering(Jar::class) {
195195

196196
dependsOn(tasks.dokkatooGeneratePublicationJavadoc)
197197
from(tasks.dokkatooGeneratePublicationJavadoc.flatMap { it.outputDirectory })
198-
archiveClassifier.set("javadoc")
198+
archiveClassifier = "javadoc"
199199
}
200200

201201
tasks.withType<Test>().configureEach {
@@ -253,7 +253,7 @@ tasks.named("check") {
253253
tasks.named<JacocoReport>("jacocoTestReport") {
254254
reports {
255255
// Enable XML in addition to HTML for CI integration.
256-
xml.required.set(true)
256+
xml.required = true
257257
}
258258
}
259259

@@ -266,7 +266,7 @@ tasks.register<JacocoReport>("jacocoFunTestReport") {
266266

267267
reports {
268268
// Enable XML in addition to HTML for CI integration.
269-
xml.required.set(true)
269+
xml.required = true
270270
}
271271
}
272272

@@ -292,16 +292,16 @@ configure<PublishingExtension> {
292292
pom {
293293
licenses {
294294
license {
295-
name.set("Apache-2.0")
296-
url.set("https://www.apache.org/licenses/LICENSE-2.0")
295+
name = "Apache-2.0"
296+
url = "https://www.apache.org/licenses/LICENSE-2.0"
297297
}
298298
}
299299

300300
scm {
301-
connection.set("scm:git:https://github.com/oss-review-toolkit/ort.git")
302-
developerConnection.set("scm:git:[email protected]:oss-review-toolkit/ort.git")
303-
tag.set(version.toString())
304-
url.set("https://github.com/oss-review-toolkit/ort")
301+
connection = "scm:git:https://github.com/oss-review-toolkit/ort.git"
302+
developerConnection = "scm:git:[email protected]:oss-review-toolkit/ort.git"
303+
tag = version.toString()
304+
url = "https://github.com/oss-review-toolkit/ort"
305305
}
306306
}
307307
}

buildSrc/src/main/kotlin/ort-plugins-conventions.gradle.kts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@ configure<PublishingExtension> {
5252
pom {
5353
licenses {
5454
license {
55-
name.set("Apache-2.0")
56-
url.set("https://www.apache.org/licenses/LICENSE-2.0")
55+
name = "Apache-2.0"
56+
url = "https://www.apache.org/licenses/LICENSE-2.0"
5757
}
5858
}
5959

6060
scm {
61-
connection.set("scm:git:https://github.com/oss-review-toolkit/ort.git")
62-
developerConnection.set("scm:git:[email protected]:oss-review-toolkit/ort.git")
63-
tag.set(version.toString())
64-
url.set("https://github.com/oss-review-toolkit/ort")
61+
connection = "scm:git:https://github.com/oss-review-toolkit/ort.git"
62+
developerConnection = "scm:git:[email protected]:oss-review-toolkit/ort.git"
63+
tag = version.toString()
64+
url = "https://github.com/oss-review-toolkit/ort"
6565
}
6666
}
6767
}

cli/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ plugins {
2424

2525
application {
2626
applicationName = "ort"
27-
mainClass.set("org.ossreviewtoolkit.cli.OrtMainKt")
27+
mainClass = "org.ossreviewtoolkit.cli.OrtMainKt"
2828
}
2929

3030
dependencies {

helper-cli/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ plugins {
2424

2525
application {
2626
applicationName = "orth"
27-
mainClass.set("org.ossreviewtoolkit.helper.HelperMainKt")
27+
mainClass = "org.ossreviewtoolkit.helper.HelperMainKt"
2828
}
2929

3030
dependencies {

plugins/package-managers/gradle-plugin/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ tasks.register<Jar>("fatJar") {
4343
description = "Creates a fat JAR that includes all required runtime dependencies."
4444
group = "Build"
4545

46-
archiveClassifier.set("fat")
46+
archiveClassifier = "fat"
4747

4848
from(sourceSets.main.get().output)
4949
dependsOn(configurations.runtimeClasspath)

0 commit comments

Comments
 (0)