-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
113 lines (94 loc) · 2.66 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.3.72"
application
}
group = "com.android"
version = "1.0.0-SNAPSHOT"
repositories {
mavenCentral()
jcenter()
google()
maven(url = "https://dl.bintray.com/s1m0nw1/KtsRunner")
}
dependencies {
implementation(kotlin("stdlib", "1.3.72"))
implementation(kotlin("reflect", "1.3.72"))
implementation("com.google.prefab:api:1.0.0")
implementation("com.github.ajalt:clikt:2.2.0")
implementation("de.swirtz:ktsRunner:0.0.7")
implementation("org.apache.maven:maven-core:3.6.2")
implementation("org.redundent:kotlin-xml-builder:1.5.3")
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.6.0-M1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.6.0-M1")
}
application {
// Define the main class for the application.
mainClassName = "com.android.ndkports.CliKt"
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.freeCompilerArgs += listOf(
"-progressive",
"-Xuse-experimental=kotlinx.serialization.ImplicitReflectionSerializer"
)
}
val portsBuildDir = buildDir.resolve("ports")
val allPorts = listOf("openssl", "curl", "jsoncpp")
// Can be specified in ~/.gradle/gradle.properties:
//
// ndkPath=/path/to/ndk
//
// Or on the command line:
//
// ./gradlew -PndkPath=/path/to/ndk run
val ndkPath: String by project
tasks.named<JavaExec>("run") {
// Order matters since we don't do any dependency sorting, so we can't just
// use the directory list.
args = listOf("--ndk", ndkPath, "-o", portsBuildDir.toString()) + allPorts
}
for (port in allPorts) {
distributions {
create(port) {
contents {
includeEmptyDirs = false
from(portsBuildDir.resolve(port)) {
include("**/*.aar")
include("**/*.pom")
}
}
}
}
tasks.named("${port}DistTar") {
dependsOn(":run")
}
tasks.named("${port}DistZip") {
dependsOn(":run")
}
}
distributions {
create("all") {
contents {
includeEmptyDirs = false
from(portsBuildDir) {
include("**/*.aar")
include("**/*.pom")
}
}
}
}
tasks.named("allDistTar") {
dependsOn(":run")
}
tasks.named("allDistZip") {
dependsOn(":run")
}
tasks.register("release") {
dependsOn(":allDistZip")
for (port in allPorts) {
dependsOn(":${port}DistZip")
}
}