forked from kotlinx/ast
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
53 lines (47 loc) · 1.36 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
46
47
48
49
50
51
52
53
buildscript {
dependencies {
// add the antlr-kotlin-gradle-plugin to the classpath
classpath("${Versions.antlrKotlinGroup}:antlr-kotlin-gradle-plugin:${Versions.antlrKotlin}")
}
}
plugins {
base
kotlin("multiplatform") version Versions.kotlin 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()
jcenter()
// used to download antlr-kotlin runtime
maven("https://jitpack.io")
}
}
tasks.withType<Wrapper> {
gradleVersion = Versions.gradle
distributionType = Wrapper.DistributionType.ALL
}
dependencies {
// Make the root project archives configuration depend on every subproject
subprojects.forEach {
archives(it)
}
}