diff --git a/binaries/org.eclipse.swt.cocoa.macosx.aarch64/build.properties b/binaries/org.eclipse.swt.cocoa.macosx.aarch64/build.properties index 447a154b876..313103324ab 100644 --- a/binaries/org.eclipse.swt.cocoa.macosx.aarch64/build.properties +++ b/binaries/org.eclipse.swt.cocoa.macosx.aarch64/build.properties @@ -13,7 +13,31 @@ custom = true bin.includes = .,*.jnilib,about_files/,about.html,fragment.properties bin.excludes = library/ -source.. = src/ +source.. = \ + ../../bundles/org.eclipse.swt/Eclipse SWT/cocoa,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/emulated/bidi,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/emulated/coolbar,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/emulated/expand,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/emulated/tooltip,\ + ../../bundles/org.eclipse.swt/Eclipse SWT PI/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT PI/cocoa,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Accessibility/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa,\ + ../../bundles/org.eclipse.swt/Eclipse SWT AWT/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Printing/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Printing/cocoa,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Program/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Program/cocoa,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Browser/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Browser/cocoa,\ + ../../bundles/org.eclipse.swt/Eclipse SWT WebKit/cocoa,\ + ../../bundles/org.eclipse.swt/Eclipse SWT OpenGL/cocoa,\ + ../../bundles/org.eclipse.swt/Eclipse SWT OpenGL/common src.includes = about.html,about_files/ pom.model.property.os=macosx diff --git a/binaries/org.eclipse.swt.cocoa.macosx.x86_64/build.properties b/binaries/org.eclipse.swt.cocoa.macosx.x86_64/build.properties index cced1f1ceb9..aeec876cd4f 100644 --- a/binaries/org.eclipse.swt.cocoa.macosx.x86_64/build.properties +++ b/binaries/org.eclipse.swt.cocoa.macosx.x86_64/build.properties @@ -13,7 +13,31 @@ custom = true bin.includes = .,*.jnilib,about_files/,about.html,fragment.properties bin.excludes = library/ -source.. = src/ +source.. = \ + ../../bundles/org.eclipse.swt/Eclipse SWT/cocoa,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/emulated/bidi,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/emulated/coolbar,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/emulated/expand,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/emulated/tooltip,\ + ../../bundles/org.eclipse.swt/Eclipse SWT PI/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT PI/cocoa,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Accessibility/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa,\ + ../../bundles/org.eclipse.swt/Eclipse SWT AWT/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Printing/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Printing/cocoa,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Program/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Program/cocoa,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Browser/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Browser/cocoa,\ + ../../bundles/org.eclipse.swt/Eclipse SWT WebKit/cocoa,\ + ../../bundles/org.eclipse.swt/Eclipse SWT OpenGL/cocoa,\ + ../../bundles/org.eclipse.swt/Eclipse SWT OpenGL/common src.includes = about.html,about_files/ pom.model.property.os=macosx diff --git a/binaries/org.eclipse.swt.gtk.linux.aarch64/build.properties b/binaries/org.eclipse.swt.gtk.linux.aarch64/build.properties index f64dc6ffd7d..0228600a1ca 100644 --- a/binaries/org.eclipse.swt.gtk.linux.aarch64/build.properties +++ b/binaries/org.eclipse.swt.gtk.linux.aarch64/build.properties @@ -12,7 +12,33 @@ custom = true bin.includes = .,*.so,about_files/,about.html,fragment.properties bin.excludes = library/ -source.. = src/ +source.. = \ + ../../bundles/org.eclipse.swt/Eclipse SWT/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/cairo,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/emulated/bidi,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/emulated/coolbar,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/emulated/taskbar,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT PI/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT PI/cairo,\ + ../../bundles/org.eclipse.swt/Eclipse SWT PI/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Accessibility/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT AWT/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT AWT/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Printing/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Printing/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Program/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Program/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Browser/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Browser/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT OpenGL/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT OpenGL/glx,\ + ../../bundles/org.eclipse.swt/Eclipse SWT OpenGL/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk src.includes = about.html,about_files/ pom.model.property.os=linux diff --git a/binaries/org.eclipse.swt.gtk.linux.loongarch64/build.properties b/binaries/org.eclipse.swt.gtk.linux.loongarch64/build.properties index 87f3d64a14e..5a1f7410b74 100644 --- a/binaries/org.eclipse.swt.gtk.linux.loongarch64/build.properties +++ b/binaries/org.eclipse.swt.gtk.linux.loongarch64/build.properties @@ -12,7 +12,33 @@ custom = true bin.includes = .,*.so,about_files/,about.html,fragment.properties bin.excludes = library/ -source.. = src/ +source.. = \ + ../../bundles/org.eclipse.swt/Eclipse SWT/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/cairo,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/emulated/bidi,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/emulated/coolbar,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/emulated/taskbar,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT PI/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT PI/cairo,\ + ../../bundles/org.eclipse.swt/Eclipse SWT PI/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Accessibility/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT AWT/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT AWT/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Printing/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Printing/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Program/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Program/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Browser/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Browser/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT OpenGL/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT OpenGL/glx,\ + ../../bundles/org.eclipse.swt/Eclipse SWT OpenGL/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk src.includes = about.html,about_files/ pom.model.property.os=linux diff --git a/binaries/org.eclipse.swt.gtk.linux.ppc64le/build.properties b/binaries/org.eclipse.swt.gtk.linux.ppc64le/build.properties index 4507c57cad2..3479dd06831 100644 --- a/binaries/org.eclipse.swt.gtk.linux.ppc64le/build.properties +++ b/binaries/org.eclipse.swt.gtk.linux.ppc64le/build.properties @@ -12,7 +12,33 @@ custom = true bin.includes = .,*.so,about_files/,about.html,fragment.properties bin.excludes = library/ -source.. = src/ +source.. = \ + ../../bundles/org.eclipse.swt/Eclipse SWT/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/cairo,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/emulated/bidi,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/emulated/coolbar,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/emulated/taskbar,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT PI/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT PI/cairo,\ + ../../bundles/org.eclipse.swt/Eclipse SWT PI/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Accessibility/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT AWT/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT AWT/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Printing/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Printing/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Program/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Program/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Browser/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Browser/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT OpenGL/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT OpenGL/glx,\ + ../../bundles/org.eclipse.swt/Eclipse SWT OpenGL/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk src.includes = about.html,about_files/ pom.model.property.os=linux diff --git a/binaries/org.eclipse.swt.gtk.linux.x86_64/build.properties b/binaries/org.eclipse.swt.gtk.linux.x86_64/build.properties index 528d181ca38..467c74faba6 100644 --- a/binaries/org.eclipse.swt.gtk.linux.x86_64/build.properties +++ b/binaries/org.eclipse.swt.gtk.linux.x86_64/build.properties @@ -13,7 +13,34 @@ custom = true bin.includes = .,*.so,about_files/,about.html,fragment.properties bin.excludes = library/ -source.. = src/ +source.. = \ + ../../bundles/org.eclipse.swt/Eclipse SWT/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/cairo,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/emulated/bidi,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/emulated/coolbar,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/emulated/taskbar,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT PI/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT PI/cairo,\ + ../../bundles/org.eclipse.swt/Eclipse SWT PI/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Accessibility/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT AWT/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT AWT/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Printing/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Printing/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Program/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Program/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Browser/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Browser/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT OpenGL/gtk,\ + ../../bundles/org.eclipse.swt/Eclipse SWT OpenGL/glx,\ + ../../bundles/org.eclipse.swt/Eclipse SWT OpenGL/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk + src.includes = about.html,about_files/ pom.model.property.os=linux diff --git a/binaries/org.eclipse.swt.win32.win32.x86_64/build.properties b/binaries/org.eclipse.swt.win32.win32.x86_64/build.properties index 3a85ba122e0..cfdeed51238 100644 --- a/binaries/org.eclipse.swt.win32.win32.x86_64/build.properties +++ b/binaries/org.eclipse.swt.win32.win32.x86_64/build.properties @@ -13,7 +13,27 @@ custom = true bin.includes = .,*.dll,about_files/,about.html,fragment.properties bin.excludes = library/ -source.. = src/ +source.. = \ + ../../bundles/org.eclipse.swt/Eclipse SWT/win32,\ + ../../bundles/org.eclipse.swt/Eclipse SWT/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT PI/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT PI/win32,\ + ../../bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Accessibility/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT AWT/win32,\ + ../../bundles/org.eclipse.swt/Eclipse SWT AWT/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Printing/win32,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Printing/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Program/win32,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Program/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Browser/common,\ + ../../bundles/org.eclipse.swt/Eclipse SWT Browser/win32,\ + ../../bundles/org.eclipse.swt/Eclipse SWT OpenGL/win32,\ + ../../bundles/org.eclipse.swt/Eclipse SWT OpenGL/common src.includes = about.html,about_files/ pom.model.property.os=win32 diff --git a/binaries/pom.xml b/binaries/pom.xml index 4f665a75d76..101698e88b7 100644 --- a/binaries/pom.xml +++ b/binaries/pom.xml @@ -112,20 +112,6 @@ true - - collect-java-sources - generate-sources - - run - - - - - - - - - build-native-binaries process-resources diff --git a/bundles/org.eclipse.swt/build-scripts/CollectSources.java b/bundles/org.eclipse.swt/build-scripts/CollectSources.java index d34676f91d2..a50a455cf7f 100644 --- a/bundles/org.eclipse.swt/build-scripts/CollectSources.java +++ b/bundles/org.eclipse.swt/build-scripts/CollectSources.java @@ -11,16 +11,17 @@ * Contributors: * Hannes Wellmann - initial API and implementation *******************************************************************************/ -import java.io.*; -import java.nio.file.*; -import java.util.*; -import java.util.stream.*; - -import javax.xml.parsers.*; - -import org.w3c.dom.*; -import org.w3c.dom.Node; -import org.xml.sax.*; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; /** * Script to collect the SWT sources for the specified native fragment. @@ -38,7 +39,7 @@ private static ScriptEnvironment read(String[] args) { } Path swtProjectRoot = Path.of("").toAbsolutePath(); if (!swtProjectRoot.endsWith(Path.of("bundles/org.eclipse.swt"))) { // Consistency check - throw new IllegalStateException("Sript must be excuted from org.eclipse.swt project"); + throw new IllegalStateException("Script must be executed from org.eclipse.swt project"); } Path binariesRoot = swtProjectRoot.getParent().getParent().resolve("binaries").toAbsolutePath(); Path targetDirectory = Path.of(args[1]); @@ -53,9 +54,6 @@ public static void main(String[] args) throws Exception { case "-nativeSources": collectNativeSources(env); break; - case "-javaSources": - collectJavaSources(env); - break; default: throw new IllegalArgumentException("Unexpected value: " + args[0]); } @@ -81,49 +79,6 @@ private static Map loadProperties(Path path) throws IOException } } - private static void collectJavaSources(ScriptEnvironment env) throws Exception { - Path classpathFile = env.binariesRoot.resolve(".classpath_" + env.ws); - Set srcClassPaths = readNativeJavaSourcesFromClasspath(classpathFile); - Set excludedExtensions = Set.of("_properties", "extras", "bridgesupport"); - System.out.println("Copy " + srcClassPaths.size() + " java source folders for " + env.ws); - copySubDirectories(env.swtProjectRoot, srcClassPaths, env.targetDirectory, excludedExtensions); - } - - private static Set readNativeJavaSourcesFromClasspath(Path classpathFile) - throws IOException, SAXException, ParserConfigurationException { - Element root = parseXMLFile(classpathFile); - Set srcPaths = new HashSet<>(); - if ("classpath".equals(root.getTagName())) { - for (Node child : children(root)) { - if (child instanceof Element classpathentry && "classpathentry".equals(classpathentry.getTagName()) - && getAttributeValue(classpathentry, "kind").equals("src") - && getAttributeValue(classpathentry, "output").isBlank()) { - srcPaths.add(getAttributeValue(classpathentry, "path")); - } - } - } - return srcPaths; - } - - private static Element parseXMLFile(Path classpathFile) - throws IOException, SAXException, ParserConfigurationException { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); - try (InputStream in = Files.newInputStream(classpathFile)) { - return factory.newDocumentBuilder().parse(in).getDocumentElement(); - } - } - - private static Iterable children(Node node) { - NodeList children = node.getChildNodes(); - return () -> IntStream.range(0, children.getLength()).mapToObj(children::item).iterator(); - } - - private static String getAttributeValue(Element classpathentry, String attributeName) { - Attr attribute = classpathentry.getAttributeNode(attributeName); - return attribute != null ? attribute.getValue() : ""; - } - private static void copySubDirectories(Path root, Collection allSources, Path target, Set excludedExtensions) throws IOException { System.out.println("from " + root + "\nto " + target);