-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
36 lines (30 loc) · 1.12 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
import java.nio.file.StandardCopyOption
fun checkIntegrity(): Boolean {
var envVar: String? = System.getenv("IAS_ROOT")
if (envVar==null) {
return false
}
return true
}
tasks.register("build") {
doFirst {
if (!checkIntegrity()) {
throw GradleException("Integrity check not passed: IAS_ROOT is undefined")
}
logger.lifecycle("Building IAS")
}
}
tasks.register("install") {
var envVar: String? = System.getenv("IAS_ROOT")
val extension = gradle as ExtensionAware
val gitBranchStr = extension.extra["GitBranch"].toString()
org.jetbrains.kotlin.konan.file.File(envVar + "/" + "RELEASE.txt").writeText("Built from git branch " + gitBranchStr)
val licFile = File("LICENSE.md")
val outLicFile = File(envVar + "/" + "LICENSE.md")
java.nio.file.Files.copy(licFile.toPath(), outLicFile.toPath(), StandardCopyOption.REPLACE_EXISTING)
val readmeFile = File("README.md")
val outReadmeFile = File(envVar + "/" + "README.md")
java.nio.file.Files.copy(readmeFile.toPath(), outReadmeFile.toPath(), StandardCopyOption.REPLACE_EXISTING)
}
subprojects {
}