-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
91 lines (76 loc) · 2.16 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import java.util.*
plugins {
java
kotlin("jvm") version "1.4.30"
`maven-publish`
}
fun runCommand(command: String): String {
val stream = Runtime.getRuntime().exec(command)
.apply { waitFor() }.inputStream
return stream.reader().readText().trim()
}
val localProperties = run {
val props = Properties()
val file = file("$rootDir/local.properties")
if (file.exists()) props.load(file.inputStream())
props
}
allprojects {
repositories {
mavenCentral()
jcenter()
google()
}
}
subprojects {
apply(plugin = "maven-publish")
group = "com.minikorp"
version = runCommand("$rootDir/scripts/latest-version.sh")
val modules = arrayOf("drill-common", "drill-processor")
if (this.name in modules) {
afterEvaluate {
val sourcesJar by tasks.creating(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}
this.publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/minikorp/drill")
credentials {
username = "minikorp"
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications {
register("gpr", MavenPublication::class) {
from(components["java"])
artifact(sourcesJar)
}
}
}
}
}
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
testImplementation("junit", "junit", "4.12")
// Make the root project archives configuration depend on every subproject
subprojects.forEach {
archives(it)
}
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
}