-
Notifications
You must be signed in to change notification settings - Fork 174
/
Copy pathbuild.gradle
208 lines (172 loc) · 6.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
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
plugins {
id 'jacoco'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
}
nexusPublishing {
repositories {
sonatype()
}
}
def projectsVersion = '4.0.0-beta4-SNAPSHOT'
def isReleaseVersion = !projectsVersion.endsWith("SNAPSHOT")
allprojects {
apply plugin: 'idea'
group = 'com.github.gumtreediff'
version = projectsVersion
repositories {
mavenCentral()
}
}
subprojects {
apply plugin: 'java'
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
compileJava {
options.compilerArgs << '-Xlint:deprecation'
}
java {
withJavadocJar()
withSourcesJar()
}
javadoc {
options.addBooleanOption('html5', true)
}
apply plugin: 'checkstyle'
checkstyle {
configFile = rootProject.file('gumtree_checkstyle.xml')
configProperties = [suppressionFile: "${rootProject.file('checkstyle_ignore.xml')}"]
ignoreFailures = false
showViolations = true
}
dependencies {
annotationProcessor 'org.atteo.classindex:classindex:3.13'
implementation 'org.atteo.classindex:classindex:3.13'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation 'org.hamcrest:hamcrest-library:2.2'
}
test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
events "passed", "skipped", "failed"
}
reports.html.required = false
}
}
configure(subprojects.findAll { it.name != 'core' }) {
dependencies {
implementation project(':core')
}
}
configure(subprojects.findAll { it.name.startsWith('gen.antlr3') }) {
apply plugin: 'antlr'
dependencies {
antlr 'org.antlr:antlr:3.5.3'
}
if (it.name.startsWith('gen.antlr3-')) {
dependencies {
implementation project(':gen.antlr3')
}
}
sourceSets.configureEach {
var generateGrammarSource = tasks.named(getTaskName("generate", "GrammarSource"))
java.srcDir(generateGrammarSource.map { files() })
}
}
configure(subprojects.findAll { it.name.startsWith('gen.antlr4') }) {
apply plugin: 'antlr'
dependencies {
antlr 'org.antlr:antlr4:4.13.0'
}
if (it.name.startsWith('gen.antlr4-')) {
dependencies {
implementation project(':gen.antlr4')
}
}
sourceSets.configureEach {
var generateGrammarSource = tasks.named(getTaskName("generate", "GrammarSource"))
java.srcDir(generateGrammarSource.map { files() })
}
}
def projectDescriptions = [
'client': 'GumTree abstract client module.',
'client.diff': 'GumTree diff client.',
'core': 'GumTree core module.', 'gen.antlr3': 'GumTree abstract AntLR module.',
'gen.antlr3-antlr': 'GumTree tree generator for AntLR grammars (AntLR based)',
'gen.antlr3-json': 'GumTree tree generator for JSON code (AntLR based).',
'gen.antlr3-php': 'GumTree tree generator for PHP code (AntLR based).',
'gen.antlr3-r': 'GumTree tree generator for R code (AntLR based).',
'gen.antlr3-xml': 'GumTree tree generator for XML code (AntLR based).',
'gen.antlr4': 'GumTree abstract AntLR4 module.',
'gen.antlr4-matlab': 'GumTree abstract AntLR4 module.',
'gen.c': 'GumTree tree generator for C code. Requires cgum.',
'gen.css': 'GumTree tree generator for CSS code based on ph-css.',
'gen.javaparser': 'GumTree tree generator for Java code (JavaParser based).',
'gen.jdt': 'GumTree tree generator for Java code (Eclipse JDT based).',
'gen.js': 'GumTree tree generator for JavaScript code (Rhino based).',
'gen.js-acorn': 'GumTree tree generator for JS. Requires jsparser.',
'gen.python': 'GumTree tree generator for Python. Requires pythonparser.',
'gen.ruby': 'GumTree tree generator for Ruby code (JRuby based).',
'gen.srcml': 'GumTree tree generator for C/C++, C# and Java code. Requires srcml.',
'gen.treesitter': 'GumTree tree generator for Python. Requires tree-sitter-parser.',
'gen.treesitter-ng': 'GumTree tree generator for tree-sitter-ng.',
'gen.xml': 'GumTree tree generator for XML code (JSoup based).',
'gen.yaml': 'GumTree tree generator for YAML code (SnakeYAML based).',
]
configure(subprojects.findAll { !(it.name in ['dist', 'dist-native', 'benchmark']) }) { subproject ->
apply plugin: "maven-publish"
apply plugin: "signing"
publishing {
publications {
gumtreeDist(MavenPublication) {
from(components.java)
pom {
name = "GumTree ${subproject.name}"
description = projectDescriptions[subproject.name]
url = 'https://github.com/GumTreeDiff/gumtree/'
scm {
connection = 'scm:git:https://github.com/GumTreeDiff/gumtree/'
developerConnection = 'scm:git:https://github.com/GumTreeDiff/gumtree/'
url = 'https://github.com/GumTreeDiff/gumtree/'
}
licenses {
license {
name = 'GNU Lesser General Public License v3.0'
url = 'h ttps://www.gnu.org/copyleft/lesser.html'
}
}
developers {
developer {
id = 'jre'
name = 'Jean-Rémy Falleri'
email = '[email protected]'
}
developer {
id = 'flop'
name = 'Floréal Morandat'
email = '[email protected]'
}
developer {
id = 'matias'
name = 'Matias Martinez'
email = '[email protected]'
}
}
}
}
}
}
signing {
required { isReleaseVersion }
useInMemoryPgpKeys(findProperty("gumtreeKey"), findProperty("gumtreeKeyPassphrase"))
sign publishing.publications.gumtreeDist
}
}
evaluationDependsOnChildren()
configure(subprojects) {
if (!project.hasProperty('testNative') && it.hasProperty('isNative') && it.isNative == true)
it.test.enabled = false
}