-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle
62 lines (53 loc) · 1.36 KB
/
build.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
Gradle root build file
Project: HomeSetup
Created: 5th March, 2022
Copyright (c) 2024, HomeSetup team
*/
plugins {
id 'idea'
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7"
}
idea {
module {
settings {
rootModuleType = 'PYTHON_MODULE'
}
sourceDirs += file('bin')
sourceDirs += file('dotfiles')
testSourceDirs += file('tests')
excludeDirs += file('.idea')
excludeDirs += file('.gradle')
excludeDirs += file('.vscode')
excludeDirs += file('run-configs')
}
}
tasks.withType(Exec) {
doFirst {
println commandLine
}
}
String detectPython() {
def pythonHome = System.getenv('PYTHON_HOME') ?: null
if (pythonHome != null) {
return pythonHome + '/python3'
}
def output = new ByteArrayOutputStream()
exec {
commandLine 'bash', '-c', 'command -v python3'
standardOutput = output
}
pythonHome = output.toString().trim()
assert pythonHome != null && !pythonHome.isEmpty(), "Could not find any installed python3 version"
return pythonHome
}
ext {
bash = "bash${bashVersion}"
versionFile = "$rootDir/.VERSION"
verbose = findProperty('verbose') ?: false
python = detectPython()
}
apply from: "$projectDir/gradle.properties"
apply from: "$projectDir/gradle/versioning.gradle"
apply from: "$projectDir/gradle/bash.gradle"
apply from: "$projectDir/gradle/idea.gradle"