-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
126 lines (102 loc) · 3.37 KB
/
build.gradle
File metadata and controls
126 lines (102 loc) · 3.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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'application'
apply plugin: 'org.junit.platform.gradle.plugin'
group = 'it.sagelab'
sourceCompatibility = 1.8
mainClassName = 'it.sagelab.specpro.Main'
applicationDefaultJvmArgs = ["-Xms1g", "-Xmx30g"]
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.1.0'
}
}
repositories {
mavenCentral()
}
dependencies {
compile('commons-cli:commons-cli:1.4')
compile('org.json:json:20171018')
compile('org.apache.directory.studio:org.apache.commons.io:2.4')
compile('org.apache.logging.log4j:log4j-api:2.11.2')
compile('org.apache.logging.log4j:log4j-core:2.11.2')
compile('org.antlr:antlr4:4.7')
compile('edu.stanford.nlp:stanford-corenlp:3.9.1')
compile('org.jgrapht:jgrapht-core:1.3.0')
compile('org.jgrapht:jgrapht-io:1.3.0')
testCompile('org.junit.jupiter:junit-jupiter-api:5.2.0')
testCompile('org.junit.jupiter:junit-jupiter-params:5.2.0')
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.2.0')
}
task updateVersionPropertiesFile() {
doLast {
def versionPropsFile = file('src/main/resources/version.properties')
Properties versionProps = new Properties()
if (!versionPropsFile.exists()) {
versionProps['version'] = "0.1.0"
versionProps['build'] = "0"
versionProps.store(versionPropsFile.newWriter(), null)
}
if (versionPropsFile.canRead()) {
versionProps.load(new FileInputStream(versionPropsFile))
def snapshot = true
def runTasks = gradle.startParameter.taskNames
def v = versionProps['version'].split("\\.")
if ('majorRelease' in runTasks) {
v[1] = (v[1].toInteger() + 1).toString();
v[2] = '0'
snapshot = false
} else if ('minorRelease' in runTasks) {
v[2] = (v[2].toInteger() + 1).toString();
snapshot = false
}
versionProps['version'] = v[0] + '.' + v[1] + '.' + v[2]
versionProps['snapshot'] = snapshot ? "True" : "False"
version = versionProps['version']
if(snapshot) {
version += '-SNAPSHOT'
}
versionProps['build'] = (versionProps['build'].toInteger() + 1).toString()
versionProps.store(versionPropsFile.newWriter(), null)
} else {
throw new FileNotFoundException("Could not read version.properties!")
}
}
}
processResources {
dependsOn updateVersionPropertiesFile
}
task minorRelease(dependsOn: build) {
group 'build'
}
task majorRelease(dependsOn: build) {
group 'build'
}
jar {
manifest {
attributes 'Main-Class': mainClassName
}
}
run {
if (project.hasProperty("appArgs")) {
args Eval.me(appArgs)
}
}
applicationDistribution.from("$projectDir") {
into ''
include 'README.md', 'LICENSE'
}
task createComputeCoverageApp(type: CreateStartScripts) {
mainClassName = 'it.sagelab.specpro.atg.ComputeCoverage'
classpath = startScripts.classpath
outputDir = startScripts.outputDir
applicationName = 'computeCoverage'
}
applicationDistribution.into("bin") {
duplicatesStrategy= DuplicatesStrategy.EXCLUDE
from(createComputeCoverageApp)
fileMode = 0755
}