From 9cd5d2ba56923bea36fd919f1e6528c15c26f22c Mon Sep 17 00:00:00 2001 From: Ben Liblit Date: Thu, 21 Dec 2017 09:06:59 -0600 Subject: [PATCH] Split generic Java setup from OSGi substitution setup --- build.gradle | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/build.gradle b/build.gradle index c3918cc41..2a6b39d28 100644 --- a/build.gradle +++ b/build.gradle @@ -1,24 +1,8 @@ //////////////////////////////////////////////////////////////////////// // -// find platform-specific SWT implementations +// common Java setup shared by multiple projects // -def osgi_platform - -switch (System.getProperty('os.name')) { - case ~/Mac OS X/: - osgi_platform = 'cocoa.macosx.x86_64' - break - case ~/Windows.*/: - osgi_platform = 'win32.win32.x86_64' - break - case ~/Linux/: - osgi_platform = 'gtk.linux.x86_64' - break -} - -System.setProperty('osgi.platform', osgi_platform) - subprojects { subproject -> // skip generic Java setup for the few projects that have no Java code whatsoever switch (subproject.name) { @@ -39,7 +23,31 @@ subprojects { subproject -> url 'https://repo.eclipse.org/content/groups/releases/' } } +} + +//////////////////////////////////////////////////////////////////////// +// +// find platform-specific SWT implementations +// + +def osgi_platform + +switch (System.getProperty('os.name')) { + case ~/Mac OS X/: + osgi_platform = 'cocoa.macosx.x86_64' + break + case ~/Windows.*/: + osgi_platform = 'win32.win32.x86_64' + break + case ~/Linux/: + osgi_platform = 'gtk.linux.x86_64' + break +} + +System.setProperty('osgi.platform', osgi_platform) + +subprojects { configurations.all { resolutionStrategy { // failOnVersionConflict()