-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
72 lines (63 loc) · 2.84 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
import groovy.xml.XmlUtil
wrapper {
jarFile = rootProject.file('.gradle-wrapper/gradle-wrapper.jar')
}
allprojects {
apply plugin: 'java'
compileJava {
sourceCompatibility = 17
targetCompatibility = 17
}
repositories {
maven {
url "https://repository.jboss.org/maven2"
}
}
}
task newRelease() {
ext.updateHyperIoTProperties = { hyperiotPlatformVersion ->
def props = new Properties();
def versionsFile = new File(project.projectDir.toString() + "/versions.properties")
def versionsContent = versionsFile.getText("UTF-8");
def fos = new FileOutputStream(versionsFile);
props.load(new StringReader(versionsContent));
props.setProperty("hyperIoTPlatformVersion", (String) hyperiotPlatformVersion)
props.store(fos, "Upgrade to karaf " + karafVersion + " and hyperiot version " + hyperIoTVersion)
}
ext.updateDistributionPom = { distributionPath ->
def parser = new groovy.xml.XmlParser()
def pomXmlFile = new File(distributionPath);
def pomXmlStr = pomXmlFile.getText('UTF-8')
def pomXml = parser.parseText(pomXmlStr)
pomXml.parent.version[0].value = hyperIoTVersion + "_karaf_" + karafVersion;
pomXmlStr = XmlUtil.serialize(pomXml);
def writer = pomXmlFile.newWriter();
writer.write(pomXmlStr)
writer.close()
}
ext.updateHyperIoTTestDistributionVersion = { karafVersion, hyperIoTVersion ->
updateDistributionPom('./containers-src/hyperiot-services-distribution-test/pom.xml')
}
ext.updateHyperIoTServicesVersion = { karafVersion, hyperIoTVersion ->
updateDistributionPom('./containers-src/hyperiot-services/pom.xml')
}
ext.updateServicesBrokerVersion = { karafVersion, hyperIoTVersion ->
updateDistributionPom('./containers-src/hyperiot-services-broker/pom.xml')
}
doLast {
def karafVersion = project.karafVersion
def hyperiotVersion = project.hyperIoTVersion
def hyperiotPlatformVersion = System.getProperty("hyperiot.platform.version");
if (hyperiotPlatformVersion == null || hyperiotPlatformVersion.isEmpty())
throw new RuntimeException("Invalid HyperIoT Plarform Version")
updateHyperIoTProperties(hyperiotPlatformVersion)
updateHyperIoTTestDistributionVersion(karafVersion, hyperiotVersion)
updateHyperIoTServicesVersion(karafVersion, hyperiotVersion)
updateServicesBrokerVersion(karafVersion, hyperiotVersion)
}
}
project.ext.publishRepoName = "ACSoftwareRepository"
project.ext.publishRepoUrl = "https://nexus.acsoftware.it/nexus/repository/maven-hyperiot/"
project.ext.publishRepoUsername = System.getProperty("publishRepoUsername","");
project.ext.publishRepoPassword = System.getProperty("publishRepoPassword","");
project.ext.stormVersion="2.7.0"