-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.kts
53 lines (51 loc) · 1.48 KB
/
setup.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
import java.io.File
fun lang(language: String) = "https://github.com/devkt-plugins/$language-devkt.git"
fun github(org: String, repo: String) = "https://github.com/$org/$repo.git"
fun coding(org: String, repo: String) = "https://git.coding.net/$org/$repo.git"
val target = File("target").apply { if (!exists()) mkdir() }
listOf(
lang("julia"),
lang("json"),
lang("solidity"),
lang("emmylua"),
lang("la-clojure"),
lang("yaml"),
lang("toml"),
lang("rust"),
lang("properties"),
// coding("ice1000", "pilang-devkt"),
github("covscript", "covscript-devkt")
)
.asSequence()
.onEach { repository ->
ProcessBuilder()
.command("git", "clone", repository)
.directory(null)
.inheritIO()
.start()
.waitFor()
}
.map { it.split('/') }
.mapNotNull { it.lastOrNull() }
.map { it.removeSuffix(".git") }
.map { File(it) }
.onEach { project ->
ProcessBuilder()
.command("bash", "gradlew", "jar", "--info", "--warning-mode=all")
.directory(project)
.inheritIO()
.start()
.waitFor()
}
.map { it.resolve("build") }
.map { it.resolve("libs") }
.flatMap {
it
.listFiles()
.orEmpty()
.filterNotNull()
.asSequence()
}
.filter { it.extension == "jar" }
.onEach { it.copyTo(target.resolve(it.name), overwrite = true) }
.forEach { println("Collected ${it.nameWithoutExtension}") }