Skip to content

Commit e011e3a

Browse files
committed
Fix gradle.properties for Windows
1 parent e809f4a commit e011e3a

File tree

5 files changed

+167
-4
lines changed

5 files changed

+167
-4
lines changed

compiler-plugin/gradle.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

compiler-plugin/gradle.properties

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#
2+
# Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3+
#
4+
5+
kotlin.code.style=official
6+
7+
kotlin.native.ignoreDisabledTargets=true
8+
9+
kotlin.daemon.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError
10+
kotlin.daemon.useFallbackStrategy=false
11+
12+
org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=768m
13+
org.gradle.daemon=true
14+
org.gradle.parallel=true
15+
org.gradle.workers.max=8
16+
org.gradle.caching=true
17+
org.gradle.configuration-cache=true
18+
19+
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
20+
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
21+
22+
# development mode for kotlinx.rpc gradle plugin. Uses local project paths to apply the compiler plugin
23+
kotlinx.rpc.plugin.internalDevelopment=true
24+
25+
# uncomment to debug compilation process
26+
#kotlin.compiler.execution.strategy=in-process
27+
28+
# Uncomment to skip attempts to publish Develocity build scans
29+
# Add this property to ~/.gradle/gradle.properties to avoid polluting git with unwanted changes
30+
#kotlinx.rpc.develocity.skipBuildScans=true
31+
32+
# Uncomment to skip adding git tags to Develocity build scan
33+
# Add this property to ~/.gradle/gradle.properties to avoid polluting git with unwanted changes
34+
#kotlinx.rpc.develocity.skipGitTags=true
35+
36+
# Uncomment to sync IDEA when working with Kotlin master builds
37+
#kotlinx.rpc.kotlinMasterBuild=true
38+
39+
# set to true when building IDE compiler plugin artifacts
40+
kotlinx.rpc.forIdeBuild=false

dokka-plugin/gradle.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

dokka-plugin/gradle.properties

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#
2+
# Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3+
#
4+
5+
kotlin.code.style=official
6+
7+
kotlin.native.ignoreDisabledTargets=true
8+
9+
kotlin.daemon.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError
10+
kotlin.daemon.useFallbackStrategy=false
11+
12+
org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=768m
13+
org.gradle.daemon=true
14+
org.gradle.parallel=true
15+
org.gradle.workers.max=8
16+
org.gradle.caching=true
17+
org.gradle.configuration-cache=true
18+
19+
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
20+
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
21+
22+
# development mode for kotlinx.rpc gradle plugin. Uses local project paths to apply the compiler plugin
23+
kotlinx.rpc.plugin.internalDevelopment=true
24+
25+
# uncomment to debug compilation process
26+
#kotlin.compiler.execution.strategy=in-process
27+
28+
# Uncomment to skip attempts to publish Develocity build scans
29+
# Add this property to ~/.gradle/gradle.properties to avoid polluting git with unwanted changes
30+
#kotlinx.rpc.develocity.skipBuildScans=true
31+
32+
# Uncomment to skip adding git tags to Develocity build scan
33+
# Add this property to ~/.gradle/gradle.properties to avoid polluting git with unwanted changes
34+
#kotlinx.rpc.develocity.skipGitTags=true
35+
36+
# Uncomment to sync IDEA when working with Kotlin master builds
37+
#kotlinx.rpc.kotlinMasterBuild=true
38+
39+
# set to true when building IDE compiler plugin artifacts
40+
kotlinx.rpc.forIdeBuild=false

gradle-conventions/src/main/kotlin/conventions-root.gradle.kts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ import util.tasks.registerChangelogTask
99
import util.tasks.registerDumpPlatformTableTask
1010
import util.tasks.registerVerifyPlatformTableTask
1111
import java.time.Year
12+
import kotlin.io.path.exists
13+
import kotlin.io.path.isDirectory
14+
import kotlin.io.path.listDirectoryEntries
15+
import kotlin.io.path.name
16+
import kotlin.io.path.readText
17+
import java.nio.file.Path
18+
import kotlin.io.path.createFile
1219

1320
plugins {
1421
id("org.jetbrains.dokka")
@@ -81,3 +88,43 @@ configureNpm()
8188
registerDumpPlatformTableTask()
8289
registerVerifyPlatformTableTask()
8390
registerChangelogTask()
91+
92+
fun Project.forEachSubproject(action: (String, Path, Path) -> Unit) {
93+
val globalRootDir: String by extra
94+
val root = Path.of(globalRootDir)
95+
val rootProperties = root.resolve("gradle.properties").readText()
96+
root.listDirectoryEntries()
97+
.filter { it.isDirectory() && it.name != "gradle-conventions-settings" && it.name != "gradle-conventions" }
98+
.forEach {
99+
val subProjectProperties = it.resolve("gradle.properties")
100+
val subProjectSettings = it.resolve("settings.gradle.kts")
101+
if (subProjectSettings.exists()) {
102+
action(rootProperties, it, subProjectProperties)
103+
}
104+
}
105+
}
106+
107+
val updateProperties = tasks.register("updateProperties") {
108+
forEachSubproject { rootProperties, _, subProjectProperties ->
109+
if (!subProjectProperties.exists()) {
110+
subProjectProperties.createFile()
111+
}
112+
113+
subProjectProperties.toFile().writeText(rootProperties)
114+
}
115+
}
116+
117+
gradle.afterProject {
118+
if (gradle.startParameter.taskNames.singleOrNull() == updateProperties.name) {
119+
return@afterProject
120+
}
121+
122+
forEachSubproject { rootProperties, parent, subProjectProperties ->
123+
if (!subProjectProperties.exists() || subProjectProperties.readText() != rootProperties) {
124+
throw GradleException(
125+
"'gradle.properties' file in ${parent.name} included project is not up-to-date with root. " +
126+
"Please, run `./gradlew ${updateProperties.name}"
127+
)
128+
}
129+
}
130+
}

gradle-plugin/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5-
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
65

76
plugins {
87
`kotlin-dsl`

gradle-plugin/gradle.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

gradle-plugin/gradle.properties

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#
2+
# Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3+
#
4+
5+
kotlin.code.style=official
6+
7+
kotlin.native.ignoreDisabledTargets=true
8+
9+
kotlin.daemon.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError
10+
kotlin.daemon.useFallbackStrategy=false
11+
12+
org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=768m
13+
org.gradle.daemon=true
14+
org.gradle.parallel=true
15+
org.gradle.workers.max=8
16+
org.gradle.caching=true
17+
org.gradle.configuration-cache=true
18+
19+
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
20+
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
21+
22+
# development mode for kotlinx.rpc gradle plugin. Uses local project paths to apply the compiler plugin
23+
kotlinx.rpc.plugin.internalDevelopment=true
24+
25+
# uncomment to debug compilation process
26+
#kotlin.compiler.execution.strategy=in-process
27+
28+
# Uncomment to skip attempts to publish Develocity build scans
29+
# Add this property to ~/.gradle/gradle.properties to avoid polluting git with unwanted changes
30+
#kotlinx.rpc.develocity.skipBuildScans=true
31+
32+
# Uncomment to skip adding git tags to Develocity build scan
33+
# Add this property to ~/.gradle/gradle.properties to avoid polluting git with unwanted changes
34+
#kotlinx.rpc.develocity.skipGitTags=true
35+
36+
# Uncomment to sync IDEA when working with Kotlin master builds
37+
#kotlinx.rpc.kotlinMasterBuild=true
38+
39+
# set to true when building IDE compiler plugin artifacts
40+
kotlinx.rpc.forIdeBuild=false

0 commit comments

Comments
 (0)