-
Notifications
You must be signed in to change notification settings - Fork 22
/
build.gradle
93 lines (67 loc) · 2.08 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
plugins {
id "java"
id "com.github.node-gradle.node" version "7.0.1"
}
group 'org.polypheny'
description = 'The user interface for Polypheny-DB'
def versionMajor = 2
def versionMinor = 0
def versionQualifier = "-SNAPSHOT"
version = versionMajor + "." + versionMinor + versionQualifier
node {
version = '20.11.0'
//npmVersion = '6.14.11'
download = true
}
npmInstall.args = ['--package-lock', '--loglevel', 'warn']
npm_run_build.dependsOn(npmInstall)
jar.dependsOn(npm_run_build)
jar {
from 'dist' into 'webapp'
manifest {
attributes "Manifest-Version": "1.0"
attributes "Copyright": "The Polypheny Project"
attributes "Version": "$archiveVersion"
}
}
task licenseReport(type: NpxTask) {
command = 'license-checker-rseidelsohn'
args = ['--json', '--production', '--files', 'build/reports/licenses/files', '--out', 'build/reports/licenses/licenseReport.json']
}
//clean.dependsOn(npm_cache_clean)
clean {
delete "/dist"
delete "/build"
delete "/node_modules"
}
tasks.register('packageDistribution', Zip) {
archiveFileName = "polypheny-ui.zip"
destinationDirectory = file('publish')
from file('dist')
}
packageDistribution.dependsOn('build')
import org.apache.tools.ant.taskdefs.condition.Os
task publishToDotPolypheny {
def polyphenyHome
def uiSubfolder = "ui/"
// Check if the environment variable POLYPHENY_HOME exists
if (System.getenv("POLYPHENY_HOME")) {
polyphenyHome = System.getenv("POLYPHENY_HOME")
} else {
// Fallback to the user's home directory with .polypheny folder
polyphenyHome = new File(System.getProperty("user.home"), ".polypheny").absolutePath
}
def targetDir = new File(polyphenyHome, uiSubfolder)
targetDir.mkdirs()
doLast {
println "Copying UI files to: ${targetDir.absolutePath}"
def sourceDir = file("dist/")
copy {
from sourceDir
into targetDir
}
}
}
publishToDotPolypheny.dependsOn('packageDistribution')
// Add install task
task install(group: 'other', dependsOn: publishToDotPolypheny)