Skip to content

Commit c932cff

Browse files
committed
build: deduplicate kotlin jvm config
1 parent 2480f04 commit c932cff

File tree

18 files changed

+75
-66
lines changed

18 files changed

+75
-66
lines changed

authorization/build.gradle.kts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
description = "Library that checks is allowed to do something"
22

33
plugins {
4-
kotlin("jvm")
4+
`modelix-kotlin-jvm-with-junit`
55
kotlin("plugin.serialization")
66
}
77

@@ -22,16 +22,6 @@ dependencies {
2222
testImplementation(kotlin("test"))
2323
}
2424

25-
tasks.getByName<Test>("test") {
26-
useJUnitPlatform()
27-
}
28-
29-
java {
30-
toolchain {
31-
languageVersion.set(JavaLanguageVersion.of(11))
32-
}
33-
}
34-
3525
publishing {
3626
publications {
3727
create<MavenPublication>("maven") {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import gradle.kotlin.dsl.accessors._8758bf21ec0488ee6f70886b9f0e8378.test
2+
3+
/*
4+
* Copyright (c) 2024.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
plugins {
20+
id("modelix-kotlin-jvm")
21+
}
22+
23+
tasks.test {
24+
useJUnitPlatform()
25+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
3+
/*
4+
* Copyright (c) 2024.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
plugins {
20+
kotlin("jvm")
21+
}
22+
23+
java {
24+
toolchain {
25+
languageVersion.set(JavaLanguageVersion.of(11))
26+
}
27+
}
28+
29+
kotlin {
30+
jvmToolchain(11)
31+
compilerOptions {
32+
jvmTarget.set(JvmTarget.JVM_11)
33+
}
34+
}

bulk-model-sync-gradle-test/build.gradle.kts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
plugins {
18-
kotlin("jvm")
18+
`modelix-kotlin-jvm-with-junit`
1919
id("org.modelix.bulk-model-sync")
2020
}
2121

@@ -32,14 +32,6 @@ dependencies {
3232
testImplementation(libs.xmlunit.core)
3333
}
3434

35-
tasks.test {
36-
useJUnitPlatform()
37-
}
38-
39-
kotlin {
40-
jvmToolchain(11)
41-
}
42-
4335
val repoDir = project.layout.buildDirectory.dir("test-repo").get().asFile
4436

4537
val copyTestRepo by tasks.registering(Sync::class) {

bulk-model-sync-gradle-test/graph-lang-api/build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id("org.modelix.model-api-gen")
3-
kotlin("jvm")
3+
`modelix-kotlin-jvm-with-junit`
44
}
55

66
repositories {
@@ -30,7 +30,6 @@ kotlin {
3030
sourceSets.named("main") {
3131
kotlin.srcDir(kotlinGenDir)
3232
}
33-
jvmToolchain(11)
3433
}
3534

3635
metamodel {

bulk-model-sync-gradle/build.gradle.kts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
kotlin("jvm")
2+
`modelix-kotlin-jvm-with-junit`
33
`java-gradle-plugin`
44
}
55

@@ -15,10 +15,6 @@ dependencies {
1515
testImplementation(kotlin("test"))
1616
}
1717

18-
kotlin {
19-
jvmToolchain(11)
20-
}
21-
2218
gradlePlugin {
2319
val modelSync by plugins.creating {
2420
id = "org.modelix.bulk-model-sync"

bulk-model-sync-lib/mps-test/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import org.modelix.copyMps
1818

1919
plugins {
20-
kotlin("jvm")
20+
`modelix-kotlin-jvm`
2121
// We are not building an actual plugin here.
2222
// We use/abuse the gradle-intellij-plugin run tests with MPS.
2323
// (With enough time and effort,

bulk-model-sync-mps/build.gradle.kts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import org.modelix.mpsHomeDir
22

33
plugins {
4-
kotlin("jvm")
5-
}
6-
7-
kotlin {
8-
jvmToolchain(11)
4+
`modelix-kotlin-jvm-with-junit`
95
}
106

117
dependencies {

metamodel-export/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import org.modelix.mpsHomeDir
22

33
plugins {
44
base
5-
kotlin("jvm")
5+
`modelix-kotlin-jvm-with-junit`
66
}
77

88
group = "org.modelix.mps"

model-api-gen-gradle/build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ plugins {
44
`java-gradle-plugin`
55
java
66

7-
// Apply the Kotlin JVM plugin to add support for Kotlin.
8-
kotlin("jvm")
7+
`modelix-kotlin-jvm-with-junit`
98
}
109

1110
dependencies {

0 commit comments

Comments
 (0)