-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
executable file
·192 lines (161 loc) · 4.64 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
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
/**
* AutoMerge
* Copyright (C) 2013-2014 Olaf Lessenich
* Copyright (C) 2014-2017 University of Passau, Germany
* Copyright (C) 2018-2019 Fengmin Zhu
* Copyright (C) 2019-2020 Tsinghua University
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olaf Lessenich <lessenic@fim.uni-passau.de>
* Georg Seibt <seibt@fim.uni-passau.de>
* Fengmin Zhu <zfm17@mails.tsinghua.edu.cn>
*/
import org.ajoberstar.grgit.Grgit
plugins {
id 'application'
id 'eclipse'
id 'idea'
id "org.ajoberstar.grgit" version "2.1.0"
id "com.github.hierynomus.license" version "0.14.0"
id "com.scuilion.syntastic" version "0.3.8"
id 'scala'
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
javadoc {
options.setEncoding 'UTF-8'
}
sourceSets {
main {
scala {
srcDir 'src'
}
java {
srcDirs = []
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile 'commons-io:commons-io:2.6'
compile 'commons-cli:commons-cli:1.4'
compile 'org.apache.commons:commons-math3:3.6.1'
compile 'commons-codec:commons-codec:1.11'
compile 'com.thoughtworks.xstream:xstream:1.4.10'
compile 'com.google.code.gson:gson:2.8.2'
compile 'de.uni-passau.fim.seibt:kvconfig:1.0'
compile project(':JNativeMerge')
compile files('lib/extendj.jar')
compile 'org.scala-lang:scala-library:2.12.4'
}
license {
header rootProject.file('LICENSE_HEADER')
exclude "de/fosd/jdime/matcher/unordered/assignmentProblem/HungarianAlgorithm.java"
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
def loggingConfigFile = file('AutoMergeLogging.properties')
def configFile = file('AutoMerge.properties')
def defaultOpts = ["-Xmx2048m", "-ea"]
startScripts {
applicationName = rootProject.name
mainClassName = "de.fosd.jdime.Main"
defaultJvmOpts = defaultOpts
}
distributions.with {
main.with {
def binDir = 'bin'
contents {
into binDir, {
from project.projectDir, {
include configFile.name
def getHeadCommit = {
def grgit = Grgit.open(dir: project.projectDir)
def head = grgit.head()
grgit.close()
head.id
}
expand([
commit: getHeadCommit()
])
}
from project.projectDir, {
include loggingConfigFile.name
}
}
}
}
}
installDist {
if (project.hasProperty('distDir')) {
destinationDir = file(project.property('distDir'))
}
}
run {
main = 'de.fosd.jdime.Main'
}
compileJava {
options.compilerArgs << "-Xlint:all"
}
def version = '1.0'
task buildJar(type: Jar) {
manifest {
attributes 'Implementation-Version': version,
'Main-Class': 'de.fosd.jdime.Main'
}
baseName = 'AutoMerge'
destinationDir = file('build/pack')
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
task pack(dependsOn: buildJar) {
copy {
from project.projectDir, {
include configFile.name
def getHeadCommit = {
def grgit = Grgit.open(dir: project.projectDir)
def head = grgit.head()
grgit.close()
head.id
}
expand([
commit: getHeadCommit()
])
}
from project.projectDir, {
include loggingConfigFile.name
}
into buildJar.destinationDir
}
}
task demo(type: Exec, dependsOn: installDist) {
// on linux
commandLine './demo.sh'
// store the output instead of printing to the console
standardOutput = new ByteArrayOutputStream()
// extension method stopTomcat.output() can be used to obtain the output:
ext.output = {
return standardOutput.toString()
}
}