-
Notifications
You must be signed in to change notification settings - Fork 23
/
build.gradle.kts
45 lines (40 loc) · 1.15 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
buildscript {
dependencies {
// add the antlr-kotlin-gradle-plugin to the classpath
classpath(libs.comStrumenta.antlrKotlinGradlePlugin)
}
}
plugins {
base
alias(libs.plugins.kotlin.multiplatform) apply false
}
// a small hack: the variable must be named like the property
// jitpack will pass -Pversion=..., so `val version` is required here.
val version: String by project
// we create an alias here...
val versionProperty = version
// do the same for group
val group: String by project
val groupProperty = if (group.endsWith("kotlinx.ast")) {
group
} else {
// just another jitpack hack
"$group.ast"
}
allprojects {
// ... because `version` is another var here.
// when version is hardcoded here, jitpack can not overwrite it.
// the default version can now be changed in gradle.properties
version = versionProperty
group = groupProperty
repositories {
mavenLocal()
mavenCentral()
// used to download antlr-kotlin runtime
maven("https://jitpack.io")
}
}
tasks.withType<Wrapper> {
gradleVersion = "8.10"
distributionType = Wrapper.DistributionType.ALL
}