-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
54 lines (45 loc) · 1.37 KB
/
build.gradle
File metadata and controls
54 lines (45 loc) · 1.37 KB
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
/*
* This file was generated by the Gradle 'init' task.
*
* This is a general purpose Gradle build.
* Learn more about Gradle by exploring our samples at https://docs.gradle.org/8.1.1/samples
*/
plugins {
id 'base'
}
def homePath = System.properties['user.home']
def src = "$projectDir"
def schemaDir = "$projectDir/dof-cubesat"
def dofhelpersDir = "$projectDir/dof-helpers"
def schemaBuildDir = "$schemaDir/build"
def installDir = "$homePath/.cubesat-cli"
def binDir = "$installDir/bin"
tasks.register('hello') {
println "$projectDir"
println "$installDir"
println "$binDir"
}
tasks.register('buildSchema', Exec) {
commandLine "bash", "-c", "cd $schemaDir && ./gradlew build"
}
tasks.register('installDofhelpersNodeModules', Exec) {
commandLine "bash", "-c", "cd $dofhelpersDir && npm ci"
}
tasks.register('copyFilesToInstallDir', Copy) {
dependsOn(buildSchema)
dependsOn(installDofhelpersNodeModules)
from "$src"
into "$installDir"
}
tasks.register('createSymlinkToBin', Exec) {
dependsOn(copyFilesToInstallDir)
outputs.dir(layout.buildDirectory.dir("$binDir"))
.withPropertyName('outputDir')
commandLine "ln", "$installDir/cubesat_cli.py", "-sv", "$binDir/cubesat-cli"
}
tasks.register("install") {
dependsOn(createSymlinkToBin)
}
tasks.register("uninstall", Exec) {
commandLine "bash", "-c", "rm -rf $installDir"
}