-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
80 lines (63 loc) · 2.51 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
/*
Copyright 2019 Neopsis, All Rights Reserved.
*/
plugins {
id 'com.tridium.niagara-signing'
id 'com.tridium.niagara' apply false
id 'com.tridium.niagara-module' apply false
id 'com.tridium.niagara-rjs' apply false
}
def getGradleProperty(String propName) {
if (gradle.hasProperty(propName)) {
gradle.getProperty(propName)
} else {
// Get system property, or, failing that, fall back to environment variable
// This allows setting, e.g., -Pniagara_home=blah
System.getProperty(propName) ?: System.getenv(propName)
}
}
ext.niagara_home = getGradleProperty('niagara_home')
ext.niagara_dev_home = getGradleProperty('niagara_dev_home')
ext.niagara_user_home = getGradleProperty('niagara_user_home')
gradle.beforeProject { p ->
configure(p) {
def vendorSettings = file("${rootDir}/vendor.gradle")
if (vendorSettings.exists()) {
apply from: vendorSettings
}
apply from: "${rootDir}/gradle/niagara.gradle"
}
}
task buildZip(type: Zip) {
group 'niagara'
def baseName = rootProject.name
dependsOn baseName + '-wb:clean'
dependsOn baseName + '-wb:jar'
apply from: file("${rootDir}/vendor.gradle")
def version = rootProject.version
def envasVersion = '0.9.20'
def commonsVersion = '4.0.3'
def chartsVersion = '3.21.20'
def outputFile = file("${gradle.ext.niagara_modules}/release.txt")
outputs.file outputFile
outputFile.write baseName + ": " + version + "\n"
outputFile.append "envas: " + envasVersion + "\n"
outputFile.append "envasCommons: " + commonsVersion + "\n"
outputFile.append "envasAmCharts: " + chartsVersion + "\n"
outputFile.append "niagara: " + "${gradle.ext.niagara_release}"
from "${gradle.ext.niagara_modules}"
include baseName + "-*-" + version + ".jar"
include "envas-*-" + envasVersion + ".jar"
include "envasCommons-*-" + commonsVersion + ".jar"
include "envasAmCharts-*-" + chartsVersion + ".jar"
include "release.txt"
rename baseName + '-(.+)-' + version + '.jar', baseName + '-$1.jar'
rename 'envas-(.+)-' + envasVersion + '.jar', 'envas-$1.jar'
rename 'envasCommons-(.+)-' + commonsVersion + '.jar', 'envasCommons-$1.jar'
rename 'envasAmCharts-(.+)-' + chartsVersion + '.jar', 'envasAmCharts-$1.jar'
archiveName = baseName + '-' + version + '.zip'
destinationDir = file(file("${gradle.ext.niagara_modules}").getParent())
doLast {
outputFile.delete()
}
}