-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.gradle
38 lines (32 loc) · 973 Bytes
/
settings.gradle
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
buildscript {
repositories {
maven { url 'https://packages.jetbrains.team/maven/p/hyperskill-hs-test/maven' }
maven { url 'https://jitpack.io' }
}
dependencies {
classpath "com.github.hyperskill:hs-gradle-plugin:release-SNAPSHOT"
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
}
static String sanitizeName(String name) {
return name.replaceAll("[ /\\\\:<>\"?*|()]", "_").replaceAll("(^[.]+)|([.]+\$)", "")
}
rootProject.projectDir.eachDirRecurse {
if (!isTaskDir(it) || it.path.contains(".idea")) {
return
}
def taskRelativePath = rootDir.toPath().relativize(it.toPath())
def parts = []
for (name in taskRelativePath) {
parts.add(sanitizeName(name.toString()))
}
def moduleName = parts.join("-")
include "$moduleName"
project(":$moduleName").projectDir = it
}
def isTaskDir(File dir) {
return new File(dir, "src").exists() || new File(dir, "test").exists()
}
include 'util'