-
Notifications
You must be signed in to change notification settings - Fork 4
/
settings.gradle.kts
49 lines (35 loc) · 1.4 KB
/
settings.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
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: MIT-0
rootProject.name = "sfc"
pluginManagement {
fun String.runCommand(
workingDir: File = File("."),
timeoutAmount: Long = 60,
timeoutUnit: TimeUnit = TimeUnit.SECONDS
): String = ProcessBuilder(split("\\s(?=(?:[^'\"`]*(['\"`])[^'\"`]*\\1)*[^'\"`]*$)".toRegex()))
.directory(workingDir)
.redirectOutput(ProcessBuilder.Redirect.PIPE)
.redirectError(ProcessBuilder.Redirect.PIPE)
.start()
.apply { waitFor(timeoutAmount, timeoutUnit) }
.run {
val error = errorStream.bufferedReader().readText().trim()
if (error.isNotEmpty()) {
throw Exception(error)
}
inputStream.bufferedReader().readText().trim()
}
val versionFromGit = "git describe --tags --abbrev=0".runCommand(workingDir = rootDir).replace("v","")
(gradle as ExtensionAware).extensions.extraProperties.set("versionFromGit", versionFromGit)
}
//-----------------//
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}
listOf("core", "metrics", "adapters", "targets", "examples").forEach { p ->
File("$rootDir/$p/").listFiles()?.forEach {
if (it.isDirectory && File(it, "build.gradle.kts").exists()) {
include(":${p}:${it.name}")
}
}
}