-
Notifications
You must be signed in to change notification settings - Fork 30
/
build.gradle
143 lines (134 loc) · 5.02 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
plugins {
// https://github.com/spotbugs/spotbugs-gradle-plugin/blob/master/CHANGELOG.md
id 'com.github.spotbugs' version '3.0.0'
}
apply plugin: 'com.diffplug.spotless-changelog'
spotlessChangelog {
changelogFile 'CHANGES.md'
}
apply plugin: 'com.diffplug.blowdryer'
apply from: 干.file('base/java8.gradle')
apply from: 干.file('base/changelog.gradle')
apply from: 干.file('base/gradle-plugin.gradle')
apply from: 干.file('base/maven.gradle')
apply from: 干.file('base/bintray.gradle')
apply from: 干.file('spotless/freshmark.gradle')
apply from: 干.file('spotless/java.gradle')
spotless {
java {
targetExclude 'src/main/java/com/diffplug/gradle/eclipse/apt/**'
}
}
String VER_DURIAN = '1.2.0'
String VER_DURIAN_SWT = '3.0.0'
String VER_BNDLIB = '5.0.0'
String OLDEST_SUPPORTED_GRADLE = '5.1'
dependencies {
// Compile misc
implementation "com.diffplug.durian:durian-core:${VER_DURIAN}"
implementation "com.diffplug.durian:durian-collect:${VER_DURIAN}"
implementation "com.diffplug.durian:durian-io:${VER_DURIAN}"
implementation "com.diffplug.durian:durian-swt.os:${VER_DURIAN_SWT}"
implementation "commons-io:commons-io:2.6"
implementation "com.diffplug.spotless:spotless-lib:1.5.1"
implementation "com.squareup.okhttp3:okhttp:4.3.1"
implementation "com.squareup.okio:okio:2.4.3"
// OSGi
implementation "biz.aQute.bnd:biz.aQute.bndlib:${VER_BNDLIB}"
// p2 (osgi used in 4.7.2 to match p2-bootstrap)
api "org.eclipse.platform:org.eclipse.osgi:3.12.50"
// eclipse 4.7.2
compileOnly 'org.eclipse.platform:org.eclipse.core.jobs:3.9.2'
compileOnly 'org.eclipse.platform:org.eclipse.core.runtime:3.13.0'
compileOnly 'org.eclipse.platform:org.eclipse.core.resources:3.12.0'
compileOnly 'org.eclipse.platform:org.eclipse.equinox.common:3.9.0'
compileOnly 'org.eclipse.platform:org.eclipse.ui.workbench:3.110.1'
compileOnly 'org.eclipse.pde:org.eclipse.pde.core:3.11.100'
compileOnly 'org.eclipse.jdt:org.eclipse.jdt.launching:3.9.51'
// from 4.6.3 cuz that's the latest one
compileOnly 'org.eclipse.emf:org.eclipse.emf.ecore:2.12.0'
// testing
testImplementation "junit:junit:4.13"
testImplementation "org.assertj:assertj-core:3.14.0"
}
configurations.all {
exclude group: 'org.eclipse.platform', module: 'org.eclipse.swt.${osgi.platform}'
exclude group: 'com.sun.jna', module: 'com.sun.jna'
exclude group: 'com.sun.jna', module: 'com.sun.jna.platform'
}
test.testLogging.exceptionFormat = 'full'
///////////////////
// OSGi metadata //
///////////////////
jar.manifest.attributes(
'Manifest-Version': '1.0',
'Bundle-SymbolicName': 'com.diffplug.gradle.goomph',
'Bundle-Name': 'com.diffplug.gradle.goomph',
'Bundle-Version': '0.0.0.SNAPSHOT',
'Export-Package': 'com.diffplug.gradle.osgi',
'Bundle-ClassPath': '.',
'Bundle-ManifestVersion': '2',
'DynamicImport-Package': '*'
)
//////////////
// FINDBUGS //
//////////////
spotbugs {
// https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md
toolVersion = '3.1.12'
sourceSets = [
sourceSets.main] // don't check the test code
ignoreFailures = false // bug free or it doesn't ship!
reportsDir = file('build/findbugs')
effort = 'max' // min|default|max
reportLevel = 'medium' // low|medium|high (low = sensitive to even minor mistakes)
omitVisitors = [] // bugs that we want to ignore
}
// HTML instead of XML
tasks.withType(com.github.spotbugs.SpotBugsTask) {
reports {
xml.enabled = false
html.enabled = true
}
}
// we'll want the findbugs annotations (they don't have a 3.0.1 version)
dependencies {
compileOnly 'com.google.code.findbugs:annotations:3.0.1'
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
}
///////////
// MAVEN //
///////////
javadoc {
// error on javadoc problem
options.addStringOption('Xwerror', '-quiet')
// setup links
options.linksOffline('https://docs.oracle.com/javase/8/docs/api/', 'gradle/javadoc/java8')
options.linksOffline("https://docs.gradle.org/${OLDEST_SUPPORTED_GRADLE}/javadoc/", 'gradle/javadoc/gradle')
options.linksOffline("https://www.javadoc.io/doc/biz.aQute.bnd/biz.aQute.bndlib/${VER_BNDLIB}/", 'gradle/javadoc/bndlib')
}
/////////////////////////////
// LEGACY REDIRECT PLUGINS //
/////////////////////////////
// plugin ids that we are migrating
def old_plugins = 'eclipseBuildProperties eclipseExcludeBuildFolder eclipseMavenCentral eclipseProjectDeps eclipseResourceFilters equinoxLaunch oomphIde p2AsMaven osgiBndManifest swtNativeDeps'.split()
gradlePlugin {
plugins {
for (plugin in old_plugins) {
register "${plugin}Legacy", {
String newId = 干.proj("plugin_${plugin}_id", "for ${plugin}: apply plugin: 'id'")
String newImpl = 干.proj("plugin_${plugin}_impl", "for ${plugin}: implementationClass")
String oldId;
if (newId.equals("com.diffplug.osgi.equinoxlaunch")) {
oldId = "com.diffplug.gradle.equinoxlaunch";
} else {
oldId = newId.replace("com.diffplug.", "com.diffplug.gradle.");
}
id = oldId
implementationClass = "${newImpl}\$Legacy"
displayName = "Back-compat alias to $newId"
description = "Back-compat alias to $newId"
}
}
}
}