Skip to content

Commit 8c096f9

Browse files
committed
chore: disable buggy configuration cache
1 parent bf66d32 commit 8c096f9

File tree

7 files changed

+40
-66
lines changed

7 files changed

+40
-66
lines changed

gradle.properties

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@ org.gradle.parallel=true
44
org.gradle.caching=true
55
org.gradle.daemon=true
66
org.gradle.configureondemand=true
7-
org.gradle.configuration-cache=true
7+
org.gradle.configuration-cache=false
88
org.gradle.configuration-cache.problems=warn
99
org.gradle.kotlin.dsl.allWarningsAsErrors=true
1010
# org.gradle.logging.stacktrace=all
1111
# org.gradle.unsafe.isolated-projects=true
12-
# org.gradle.configuration-cache.max-problems=5
1312
# org.gradle.welcome=never
1413
# org.gradle.console=rich
1514
# org.gradle.debug=true
1615
# org.gradle.warning.mode=[all|fail]
17-
# systemProp.https.protocols=TLSv1.2,TLSv1.3
1816

1917
## Kotlin
2018
kotlin.code.style=official
@@ -26,10 +24,6 @@ kotlinx.atomicfu.enableJsIrTransformation=true
2624
kotlinx.atomicfu.enableNativeIrTransformations=true
2725
kotlin.suppressGradlePluginWarnings=IncorrectCompileOnlyDependencyWarning
2826

29-
# Share JVM artifacts as class files
30-
# kotlin.jvm.addClassesVariant=true
31-
# org.gradle.java.compile-classpath-packaging=true
32-
3327
## Kotlin/JS
3428
kotlin.js.yarn=false
3529

@@ -69,5 +63,5 @@ enableMavenSnapshot=false
6963
# Other projects
7064
composeBuild=true
7165
springBoot=false
72-
nativeBuild=false
66+
nativeBuild=true
7367
debug=false

gradle/build-logic/src/main/kotlin/common/Multiplatform.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ fun KotlinMultiplatformExtension.jsTarget() {
170170
}
171171
generateTypeScriptDefinitions()
172172
compilerOptions { configureKotlinJs() }
173-
testRuns.configureEach { executionTask.configure { configureTestReport() } }
173+
testRuns.configureEach { executionTask.configure {} }
174174
}
175175

176176
sourceSets {
@@ -226,7 +226,7 @@ fun KotlinMultiplatformExtension.wasmJsTarget() {
226226
}
227227
generateTypeScriptDefinitions()
228228
compilerOptions { configureKotlinJs() }
229-
testRuns.configureEach { executionTask.configure { configureTestReport() } }
229+
testRuns.configureEach { executionTask.configure {} }
230230
}
231231

232232
sourceSets {

gradle/build-logic/src/main/kotlin/common/ProjectExtns.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import org.jetbrains.kotlin.gradle.dsl.*
3232
import org.jetbrains.kotlin.gradle.plugin.*
3333
import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask
3434
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
35-
import org.jetbrains.kotlin.gradle.testing.internal.KotlinTestReport
3635

3736
// val logger = LoggerFactory.getLogger("build-logic")
3837

@@ -559,8 +558,6 @@ fun TestLoggingContainer.configureLogEvents() {
559558
}
560559
}
561560

562-
fun KotlinTestReport.configureTestReport() {}
563-
564561
fun KotlinJsCompilerOptions.configureKotlinJs() {
565562
// freeCompilerArgs.addAll("-Xir-per-file")
566563
// target = "es2015"

gradle/build-logic/src/main/kotlin/dev.suresh.plugin.kotlin.docs.gradle.kts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,8 @@ spotless {
9393
val ktfmtVersion = libs.versions.ktfmt.get()
9494
kotlin {
9595
ktfmt(ktfmtVersion)
96-
target("**/*.kt")
97-
targetExclude("**/build/**")
96+
target("src/**/*.kts", "src/**/*.kt")
9897
trimTrailingWhitespace()
99-
endWithNewline()
10098
// licenseHeader(rootProject.file("gradle/license-header.txt"))
10199
}
102100

@@ -105,15 +103,13 @@ spotless {
105103
target("**/*.gradle.kts")
106104
targetExclude("**/build/**")
107105
trimTrailingWhitespace()
108-
endWithNewline()
109106
}
110107

111108
format("misc") {
112-
target("**/*.md", ".gitignore", "**/.kte")
109+
target("**/*.md", "**/.kte")
113110
targetExclude("**/build/**")
114111
trimTrailingWhitespace()
115112
indentWithSpaces(2)
116-
endWithNewline()
117113
}
118114
}
119115

gradle/build-logic/src/main/kotlin/dev.suresh.plugin.kotlin.jvm.gradle.kts

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ apply(plugin = "dev.suresh.plugin.depreports")
3333
// Load the build script from a file
3434
// apply(from = rootDir.resolve("project.plugin.gradle.kts"))
3535

36-
val rootProjectName = rootProject.name
37-
val projectName = project.name
38-
val projectVersion = project.version.toString()
39-
val projectGroup = project.group.toString()
40-
val gradleVersion = gradle.gradleVersion
41-
4236
java {
4337
withSourcesJar()
4438
withJavadocJar()
@@ -84,6 +78,7 @@ redacted {
8478

8579
// kopy { functions = KopyFunctions.Copy }
8680

81+
// Java agent configuration for jib
8782
val javaAgent by configurations.registering { isTransitive = false }
8883

8984
tasks {
@@ -101,34 +96,36 @@ tasks {
10196
withType<Jar>().configureEach {
10297
manifest {
10398
attributes(
104-
// "Automatic-Module-Name" to projectGroup,
99+
// "Automatic-Module-Name" to project.group,
105100
"Enable-Native-Access" to "ALL-UNNAMED",
106101
"Built-By" to System.getProperty("user.name"),
107102
"Built-Jdk" to System.getProperty("java.runtime.version"),
108103
"Built-OS" to
109104
"${System.getProperty("os.name")} ${System.getProperty("os.arch")} ${System.getProperty("os.version")}",
110105
"Build-Timestamp" to DateTimeFormatter.ISO_INSTANT.format(ZonedDateTime.now()),
111-
"Created-By" to "Gradle $gradleVersion",
112-
Attributes.Name.IMPLEMENTATION_TITLE.toString() to projectName,
113-
Attributes.Name.IMPLEMENTATION_VERSION.toString() to projectVersion,
114-
Attributes.Name.IMPLEMENTATION_VENDOR.toString() to projectGroup,
106+
"Created-By" to "Gradle ${gradle.gradleVersion}",
107+
Attributes.Name.IMPLEMENTATION_TITLE.toString() to project.name,
108+
Attributes.Name.IMPLEMENTATION_VERSION.toString() to project.version,
109+
Attributes.Name.IMPLEMENTATION_VENDOR.toString() to project.group,
115110
)
116111
}
117112
duplicatesStrategy = DuplicatesStrategy.WARN
118113
}
119114

120115
processResources {
121-
inputs.property("version", projectVersion)
116+
inputs.property("version", project.version.toString())
122117
filesMatching("**/*-res.txt") {
123118
expand(
124-
"name" to rootProjectName,
125-
"module" to projectName,
126-
"version" to projectVersion,
119+
"name" to rootProject.name,
120+
"module" to project.name,
121+
"version" to project.version,
127122
)
128123
}
129124
filesMatching("**/*.yaml") {
130125
filter { line ->
131-
line.replace("{project.name}", rootProjectName).replace("{project.version}", projectVersion)
126+
line
127+
.replace("{project.name}", rootProject.name)
128+
.replace("{project.version}", project.version.toString())
132129
}
133130
}
134131
}
@@ -153,7 +150,7 @@ tasks {
153150
jarFile = shadowJar.flatMap { it.archiveFile }
154151
// javaOpts = application.applicationDefaultJvmArgs
155152
javaOpts = named<JavaExec>("run").get().jvmArgs
156-
execJarFile = layout.buildDirectory.dir("libs").map { it.file("${projectName}-app") }
153+
execJarFile = layout.buildDirectory.dir("libs").map { it.file("${project.name}-app") }
157154
onlyIf { OperatingSystem.current().isUnix }
158155
}
159156

@@ -187,8 +184,8 @@ tasks {
187184
"""
188185
|Application modules for OpenJDK-${javaRelease.get()} are,
189186
|${modules.split(",")
190-
.mapIndexed { i, module -> " ${(i + 1).toString().padStart(2)}) $module" }
191-
.joinToString(System.lineSeparator())}
187+
.mapIndexed { i, module -> " ${(i + 1).toString().padStart(2)}) $module" }
188+
.joinToString(System.lineSeparator())}
192189
"""
193190
.trimMargin())
194191
}
@@ -218,7 +215,7 @@ tasks {
218215
withType<BuildDockerTask>().configureEach {
219216
doLast {
220217
val portMapping = jib?.container?.ports.orEmpty().joinToString(" ") { "-p $it:$it" }
221-
val image = jib?.to?.image ?: projectName
218+
val image = jib?.to?.image ?: project.name
222219
val tag = jib?.to?.tags?.firstOrNull() ?: "latest"
223220
val env =
224221
jib?.container
@@ -229,7 +226,7 @@ tasks {
229226
logger.lifecycle(
230227
TextColors.cyan(
231228
"""
232-
|Run: docker run -it --rm --name $projectName $portMapping $env $image:$tag
229+
|Run: docker run -it --rm --name ${project.name} $portMapping $env $image:$tag
233230
"""
234231
.trimMargin()))
235232
}

gradle/build-logic/src/main/kotlin/dev.suresh.plugin.kotlin.mpp.gradle.kts

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,9 @@ plugins {
3131
// dev.mokkery
3232
}
3333

34-
val rootProjectName = rootProject.name
35-
val projectName = project.name
36-
val projectVersion = project.version.toString()
37-
val projectGroup = project.group.toString()
38-
val gradleVersion = gradle.gradleVersion
39-
4034
kotlin {
4135
commonTarget()
42-
when (projectName) {
36+
when (project.name) {
4337
sharedProjectName -> {
4438
jvmTarget()
4539
jsTarget()
@@ -130,27 +124,29 @@ tasks {
130124
"Built-OS" to
131125
"${System.getProperty("os.name")} ${System.getProperty("os.arch")} ${System.getProperty("os.version")}",
132126
"Build-Timestamp" to DateTimeFormatter.ISO_INSTANT.format(ZonedDateTime.now()),
133-
"Created-By" to "Gradle $gradleVersion",
134-
Attributes.Name.IMPLEMENTATION_TITLE.toString() to projectName,
135-
Attributes.Name.IMPLEMENTATION_VERSION.toString() to projectVersion,
136-
Attributes.Name.IMPLEMENTATION_VENDOR.toString() to projectGroup,
127+
"Created-By" to "Gradle ${gradle.gradleVersion}",
128+
Attributes.Name.IMPLEMENTATION_TITLE.toString() to project.name,
129+
Attributes.Name.IMPLEMENTATION_VERSION.toString() to project.version,
130+
Attributes.Name.IMPLEMENTATION_VENDOR.toString() to project.group,
137131
)
138132
}
139133
duplicatesStrategy = DuplicatesStrategy.WARN
140134
}
141135

142136
withType<ProcessResources>().configureEach {
143-
inputs.property("version", projectVersion)
137+
inputs.property("version", project.version.toString())
144138
filesMatching("**/*-res.txt") {
145139
expand(
146-
"name" to rootProjectName,
147-
"module" to projectName,
148-
"version" to projectVersion,
140+
"name" to rootProject.name,
141+
"module" to project.name,
142+
"version" to project.version,
149143
)
150144
}
151145
filesMatching("**/*.yaml") {
152146
filter { line ->
153-
line.replace("{project.name}", rootProjectName).replace("{project.version}", projectVersion)
147+
line
148+
.replace("{project.name}", rootProject.name)
149+
.replace("{project.version}", project.version.toString())
154150
}
155151
}
156152
}
@@ -174,7 +170,7 @@ tasks {
174170
jarFile = named<Jar>("shadowJar").flatMap { it.archiveFile }
175171
// javaOpts = application.applicationDefaultJvmArgs
176172
javaOpts = named<JavaExec>("run").get().jvmArgs
177-
execJarFile = layout.buildDirectory.dir("libs").map { it.file("${projectName}-app") }
173+
execJarFile = layout.buildDirectory.dir("libs").map { it.file("${project.name}-app") }
178174
onlyIf { OperatingSystem.current().isUnix }
179175
}
180176

gradle/build-logic/src/main/kotlin/dev.suresh.plugin.root.gradle.kts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,8 @@ tasks {
8282
withType<AbstractArchiveTask>().configureEach {
8383
isPreserveFileTimestamps = false
8484
isReproducibleFileOrder = true
85-
dirPermissions {
86-
// 0b111111101
87-
unix("rwxrwxr-x")
88-
}
89-
filePermissions {
90-
// 0b110110100
91-
unix("rw-rw-r--")
92-
}
85+
dirPermissions { unix("rwxrwxr-x") }
86+
filePermissions { unix("rw-rw-r--") }
9387
}
9488

9589
val githubActionOutput by registering {
@@ -178,7 +172,7 @@ tasks {
178172
// distributionUrl = "${Repo.GRADLE_DISTRO}/gradle-$gradleVersion-bin.zip"
179173
}
180174

181-
// dependencyAnalysis { issues { this.all { onAny { severity("warn") } } } }
175+
// withType<UpdateDaemonJvm> { jvmVersion = gradleDaemonJvm }
182176

183177
defaultTasks("clean", "tasks", "--all")
184178
}

0 commit comments

Comments
 (0)