Skip to content

Commit 03939e8

Browse files
committed
durian-swt (root) can now compile and test against swt-evolve too
1 parent 861fdf7 commit 03939e8

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

durian-swt/build.gradle

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,34 @@ p2deps {
1010
it.platformNone()
1111
}
1212
}
13-
into 'compileOnly', {
14-
p2repo "https://download.eclipse.org/eclipse/updates/$VER_ECLIPSE_PLATFORM/"
15-
install 'org.eclipse.swt'
13+
if (VER_SWT_EVOLVE.isEmpty()) {
14+
into 'compileOnly', {
15+
p2repo "https://download.eclipse.org/eclipse/updates/$VER_ECLIPSE_PLATFORM/"
16+
install 'org.eclipse.swt'
17+
}
18+
into 'testImplementation', {
19+
p2repo "https://download.eclipse.org/eclipse/updates/$VER_ECLIPSE_PLATFORM/"
20+
install 'org.eclipse.swt'
21+
install 'org.eclipse.swt.svg'
22+
}
1623
}
17-
into 'testImplementation', {
18-
p2repo "https://download.eclipse.org/eclipse/updates/$VER_ECLIPSE_PLATFORM/"
19-
install 'org.eclipse.swt'
20-
install 'org.eclipse.swt.svg'
24+
}
25+
if (!VER_SWT_EVOLVE.isEmpty()) {
26+
def swtPlatform = com.diffplug.common.swt.os.SwtPlatform.getRunning()
27+
String equoOs;
28+
if ('win32' == swtPlatform.os) {
29+
equoOs = 'windows'
30+
} else if ('macosx' == swtPlatform.os) {
31+
equoOs = 'macos'
32+
} else if ('linux' == swtPlatform.os) {
33+
equoOs = 'linux'
34+
} else {
35+
throw UnsupportedOperationException("Unknown os in " + swtPlatform)
36+
}
37+
String swtEvolve = "dev.equo:swt-evolve:${VER_SWT_EVOLVE}:${equoOs}-${swtPlatform.arch}"
38+
dependencies {
39+
compileOnly swtEvolve
40+
testImplementation swtEvolve
2141
}
2242
}
2343
dependencies {

0 commit comments

Comments
 (0)