Skip to content

Commit

Permalink
Link the sources in the build properties instead of copy by ant
Browse files Browse the repository at this point in the history
  • Loading branch information
laeubi committed Feb 6, 2024
1 parent 5a9e488 commit f77927e
Show file tree
Hide file tree
Showing 8 changed files with 204 additions and 19 deletions.
26 changes: 25 additions & 1 deletion binaries/org.eclipse.swt.cocoa.macosx.aarch64/build.properties
Expand Up @@ -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
Expand Down
26 changes: 25 additions & 1 deletion binaries/org.eclipse.swt.cocoa.macosx.x86_64/build.properties
Expand Up @@ -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
Expand Down
28 changes: 27 additions & 1 deletion binaries/org.eclipse.swt.gtk.linux.aarch64/build.properties
Expand Up @@ -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
Expand Down
28 changes: 27 additions & 1 deletion binaries/org.eclipse.swt.gtk.linux.loongarch64/build.properties
Expand Up @@ -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
Expand Down
28 changes: 27 additions & 1 deletion binaries/org.eclipse.swt.gtk.linux.ppc64le/build.properties
Expand Up @@ -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
Expand Down
29 changes: 28 additions & 1 deletion binaries/org.eclipse.swt.gtk.linux.x86_64/build.properties
Expand Up @@ -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
Expand Down
22 changes: 21 additions & 1 deletion binaries/org.eclipse.swt.win32.win32.x86_64/build.properties
Expand Up @@ -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
Expand Down
36 changes: 24 additions & 12 deletions bundles/org.eclipse.swt/build-scripts/CollectSources.java
Expand Up @@ -11,16 +11,28 @@
* Contributors:
* Hannes Wellmann - initial API and implementation
*******************************************************************************/
import java.io.*;
import java.nio.file.*;
import java.util.*;
import java.util.stream.*;
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.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.stream.IntStream;

import javax.xml.parsers.*;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.*;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.xml.sax.*;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

/**
* Script to collect the SWT sources for the specified native fragment.
Expand Down Expand Up @@ -82,11 +94,11 @@ private static Map<String, String> loadProperties(Path path) throws IOException
}

private static void collectJavaSources(ScriptEnvironment env) throws Exception {
Path classpathFile = env.binariesRoot.resolve(".classpath_" + env.ws);
Set<String> srcClassPaths = readNativeJavaSourcesFromClasspath(classpathFile);
Set<String> 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);
// Path classpathFile = env.binariesRoot.resolve(".classpath_" + env.ws);
// Set<String> srcClassPaths = readNativeJavaSourcesFromClasspath(classpathFile);
// Set<String> 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<String> readNativeJavaSourcesFromClasspath(Path classpathFile)
Expand Down

0 comments on commit f77927e

Please sign in to comment.