-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
80 lines (67 loc) · 2.05 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
apply plugin: 'java'
apply plugin: 'eclipse'
sourceCompatibility = 1.8
targetCompatibility = 1.8
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--dirty'
standardOutput = stdout
}
version = stdout.toString().trim()
test {
useTestNG()
}
configurations {
checkstylejar
}
repositories {
mavenCentral()
}
dependencies {
compile 'com.puppycrawl.tools:checkstyle:6.17'
testCompile 'com.google.code.findbugs:jsr305:3.0.1'
testCompile 'com.google.code.findbugs:annotations:3.0.1'
testCompile 'org.testng:testng:6.9.10'
}
processResources {
filesMatching('**/site.xml') {
expand VERSION: project.version
}
}
jar {
version = project.version
baseName = 'JSR305CheckstylePlugin'
manifest {
attributes(
'Bundle-Name': 'JSR305CheckstylePlugin',
'Bundle-SymbolicName': 'JSR305CheckstylePlugin;singleton:=true',
'Bundle-Version': version,
'Require-Bundle': 'net.sf.eclipsecs.checkstyle, net.sf.eclipsecs.core, net.sf.eclipsecs.ui',
'Bundle-RequiredExecutionEnvironment': 'J2SE-1.5',
'Eclipse-LazyStart': 'true',
'Eclipse-RegisterBuddy': 'net.sf.eclipsecs.core'
);
}
}
//known broken versions all < 6.16.1
//versions > 7 need java 8
['6.16.1', '6.17', '6.18', '6.19',
'7.0', '7.1', '7.1.1', '7.1.2', '7.2','7.3','7.4',
'7.5', '7.5.1','7.6','7.6.1', '7.7','7.8','7.8.1','7.8.2',
'8.0', '8.1', '8.2', '8.3', '8.4', '8.5',
'+' // the latest version
].each { name ->
def configname = "checkstylejar${name}"
def testname = "testversion${name}"
configurations.create(configname);
configurations[configname].extendsFrom(configurations.testRuntime);
configurations[configname].resolutionStrategy {
force "com.puppycrawl.tools:checkstyle:${name}"
}
tasks.create(name: testname, type: Test) {
useTestNG()
classpath = configurations[configname] + sourceSets.test.runtimeClasspath
outputs.upToDateWhen { false }
}
test.dependsOn(tasks[testname])
}