-
Notifications
You must be signed in to change notification settings - Fork 30
/
build.gradle
139 lines (128 loc) · 4.52 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
plugins {
id 'com.diffplug.eclipse.mavencentral'
id 'com.diffplug.eclipse.excludebuildfolder'
}
apply plugin: 'com.diffplug.spotless-changelog'
spotlessChangelog {
changelogFile 'CHANGES.md'
}
apply plugin: 'com.diffplug.blowdryer'
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'
}
apply from: 干.file('base/java.gradle')
apply from: 干.file('base/changelog.gradle')
apply from: 干.file('base/gradle-plugin.gradle')
apply from: 干.file('spotless/freshmark.gradle')
apply from: 干.file('spotless/java.gradle')
apply from: 干.file('base/maven.gradle')
apply from: 干.file('base/sonatype.gradle')
spotless {
java {
targetExclude 'src/main/java/com/diffplug/gradle/eclipse/apt/**'
}
}
String VER_DURIAN = '1.2.0'
String VER_DURIAN_SWT = '4.3.0'
String VER_BNDLIB = '6.3.1'
String OLDEST_SUPPORTED_GRADLE = '5.1'
String VER_P2_BOOTSTRAP = '4.13.0'
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.16.1"
implementation "com.diffplug.spotless:spotless-lib:2.34.0"
implementation "com.squareup.okhttp3:okhttp:4.12.0"
implementation "com.squareup.okio:okio:3.9.0"
// OSGi
implementation "biz.aQute.bnd:biz.aQute.bndlib:${VER_BNDLIB}"
// testing
testImplementation "junit:junit:4.13.2"
testImplementation "org.assertj:assertj-core:3.26.0"
}
configurations.compileClasspath {
transitive = false
}
eclipseMavenCentral {
silenceEquoIDE()
release VER_P2_BOOTSTRAP, {
api 'org.eclipse.osgi'
api 'org.eclipse.osgi.compatibility.state'
compileOnly 'org.eclipse.core.jobs'
compileOnly 'org.eclipse.core.runtime'
compileOnly 'org.eclipse.core.resources'
compileOnly 'org.eclipse.e4.core.di'
compileOnly 'org.eclipse.equinox.common'
compileOnly 'org.eclipse.ui.workbench'
compileOnly 'org.eclipse.pde.core'
compileOnly 'org.eclipse.jdt.launching'
compileOnly 'org.eclipse.emf.ecore'
}
}
test {
if(JavaVersion.current() != JavaVersion.VERSION_1_8) {
jvmArgs '--add-modules=ALL-SYSTEM', '--add-opens=java.base/jdk.internal.loader=ALL-UNNAMED'
}
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': '*'
)
// 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 {
options.source("8")
// 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"
tags.set(Arrays.asList("eclipse"))
}
}
}
}