-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
79 lines (75 loc) · 2.7 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
plugins {
id 'com.diffplug.blowdryer'
id 'com.diffplug.spotless-changelog'
}
group = 'com.diffplug.durian'
spotlessChangelog {
changelogFile 'CHANGES.md'
}
repositories { mavenCentral() }
allprojects {
apply from: 干.file('base/changelog.gradle')
}
apply from: 干.file('spotless/freshmark.gradle')
apply from: 干.file('base/sonatype.gradle')
subprojects { subProject ->
apply plugin: 'java-library'
apply from: 干.file('base/java.gradle')
apply from: 干.file('spotless/java.gradle')
ext.maven_name = subProject.name
ext.javadoc_links = [
"https://javadoc.io/doc/com.diffplug.durian/durian-core/${VER_DURIAN}",
"https://javadoc.io/doc/com.diffplug.durian/durian-collect/${VER_DURIAN}",
"https://javadoc.io/doc/com.diffplug.durian/durian-concurrent/${VER_DURIAN}",
"https://javadoc.io/doc/com.diffplug.durian/durian-debug/${VER_DURIAN_DEBUG}",
"https://javadoc.io/doc/com.diffplug.durian/durian-rx/${VER_DURIAN_RX}",
"https://javadoc.io/doc/io.reactivex.rxjava2/rxjava/${VER_RXJAVA}",
'https://docs.oracle.com/javase/8/docs/api/'
].join(' ')
apply from: 干.file('base/maven.gradle')
apply from: 干.file('base/sonatype.gradle')
javadoc {
options.linksOffline 'https://help.eclipse.org/2019-12/topic/org.eclipse.platform.doc.isv/reference/api/', rootProject.file('gradle/javadoc-eclipse').absolutePath
}
if (subProject.name == 'durian-swt') {
// configured there
} else if (subProject.name == 'durian-swt.os') {
dependencies {
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
testImplementation "junit:junit:$VER_JUNIT"
}
tasks.register('osMain', JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'com.diffplug.common.swt.os.OS'
}
} else {
String platformCode = project.name.substring('durian-swt.'.length())
String SWT_TO_USE = platformCode.endsWith("x86") ? SWT_VERSION_X86 : SWT_VERSION
apply plugin: 'dev.equo.p2deps'
p2deps {
into 'api', {
p2repo "https://download.eclipse.org/eclipse/updates/$SWT_TO_USE/"
install "org.eclipse.swt.$platformCode"
addFilter 'no-platform-filter', {
it.platform(com.diffplug.common.swt.os.SwtPlatform.parseWsOsArch(platformCode))
}
}
}
dependencies {
api project(':durian-swt')
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.name.contains('${osgi.platform}')) {
details.useTarget('org.eclipse.platform:org.eclipse.swt:' + details.requested.version)
}
}
}
// the manifest should be a fragment
def swtPlatform = com.diffplug.common.swt.os.SwtPlatform.parseWsOsArch(platformCode)
jar.manifest.attributes (
'Fragment-Host': 'durian-swt',
'Eclipse-PlatformFilter': swtPlatform.platformFilter(),
)
}
}