Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,19 @@ jobs:
tar xf cef.tar.bz2 $VERSION/LICENSE.txt $VERSION/Resources --strip-components 1
tar xf cef.tar.bz2 $VERSION/Release/libcef.lib --strip-components 2
tar xf cef.tar.bz2 --wildcards $VERSION/Release/*.dll --wildcards $VERSION/Release/*.bin --strip-components 2
cp -r *.dll *.bin Resources/* LICENSE.txt ../../java/org.eclipse.set.browser.cef.win32/res/cef
ls -avl ../../java/org.eclipse.set.browser.cef.win32/res/cef
cp -r *.dll *.bin Resources/* LICENSE.txt ../../java/org.eclipse.set.browser.lib/res
ls -avl ../../java/org.eclipse.set.browser.lib/res
working-directory: cef/Release

- name: Fetch Rust binaries
uses: actions/download-artifact@v8
with:
name: chromium-swt-libs
path: java/org.eclipse.set.browser.lib/res/

- name: Copy CEF
run: |
cp -a java/org.eclipse.set.browser.cef.win32/res/cef/. java/org.eclipse.set.browser.lib/res/

- name: Build
working-directory: java
Expand Down
12 changes: 0 additions & 12 deletions java/org.eclipse.set.browser.cef.win32/.classpath

This file was deleted.

1 change: 0 additions & 1 deletion java/org.eclipse.set.browser.cef.win32/.gitignore

This file was deleted.

28 changes: 0 additions & 28 deletions java/org.eclipse.set.browser.cef.win32/.project

This file was deleted.

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions java/org.eclipse.set.browser.cef.win32/META-INF/MANIFEST.MF

This file was deleted.

4 changes: 0 additions & 4 deletions java/org.eclipse.set.browser.cef.win32/build.properties

This file was deleted.

Empty file.
7 changes: 4 additions & 3 deletions java/org.eclipse.set.browser.lib/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ Bundle-Version: 2.8.0.qualifier
Automatic-Module-Name: org.eclipse.set.browser.bin
Bundle-RequiredExecutionEnvironment: JavaSE-21
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.swt,
org.eclipse.set.browser.cef.win32
org.eclipse.swt
Import-Package:
org.apache.commons.io,
org.eclipse.swt.internal,
org.osgi.framework
Export-Package: org.eclipse.set.browser.lib
Export-Package: org.eclipse.set.browser.cef.win32,
org.eclipse.set.browser.lib
Bundle-ClassPath: res/,
.
Bundle-Vendor: Eclipse Signalling Engineering Toolbox
Eclipse-BundleShape: dir
Original file line number Diff line number Diff line change
Expand Up @@ -31,61 +31,78 @@
public class CEFResource {
private static boolean hasBeenExtracted = false;

private static Path getTempPathForExtraction() {
return Paths.get(System.getenv("APPDATA"), "Eclipse SET", "cef", "dev", "extracted").toAbsolutePath();
}

/**
* @return the path to the extracted CEF files
*/
public static Path getPath() {
final Bundle bundle = FrameworkUtil.getBundle(CEFResource.class.getClassLoader()).orElseThrow();
Path bundleLocation = FileLocator.getBundleFileLocation(bundle).orElseThrow().toPath().toAbsolutePath();
if (Files.isDirectory(bundleLocation))
return bundleLocation.resolve("cef");
final Bundle bundle = FrameworkUtil
.getBundle(CEFResource.class.getClassLoader())
.orElseThrow();
final Path bundleLocation = FileLocator.getBundleFileLocation(bundle)
.orElseThrow()
.toPath()
.toAbsolutePath();
if (Files.isDirectory(bundleLocation)) {
return bundleLocation.resolve("res");
}

// Due to a M2E limitation, Eclipse-BundleShape is not respected when working
// with a maven dependency from within Eclipse (Tycho handles this correctly for
// production builds). For development, instead extract the jar to a temporary
// Due to a M2E limitation, Eclipse-BundleShape is not respected when
// working
// with a maven dependency from within Eclipse (Tycho handles this
// correctly for
// production builds). For development, instead extract the jar to a
// temporary
// path, once per execution
Path tempPath = getTempPathForExtraction();
final Path tempPath = getTempPathForExtraction();

if (hasBeenExtracted) {
return tempPath.resolve("cef");
return tempPath.resolve("res");
}
hasBeenExtracted = true;
try (Stream<Path> files = Files.walk(tempPath)) {
files.sorted(Comparator.reverseOrder()).map(Path::toFile).forEach(File::delete);
} catch (IOException e) {
files.sorted(Comparator.reverseOrder())
.map(Path::toFile)
.forEach(File::delete);
} catch (final IOException e) {
// ignore
}
try (JarFile jar = new JarFile(bundleLocation.toString())) {
// Create directories
Enumeration<JarEntry> entries = jar.entries();
while (entries.hasMoreElements()) {
JarEntry entry = entries.nextElement();
final JarEntry entry = entries.nextElement();
if (entry.isDirectory()) {
new File(tempPath.resolve(entry.getName()).toString()).mkdirs();
new File(tempPath.resolve(entry.getName()).toString())
.mkdirs();
}
}

// Write files
entries = jar.entries();
while (entries.hasMoreElements()) {
JarEntry entry = entries.nextElement();
final JarEntry entry = entries.nextElement();
if (!entry.isDirectory()) {
File file = new File(tempPath.resolve(entry.getName()).toString());
try (InputStream is = jar.getInputStream(entry); FileOutputStream os = new FileOutputStream(file)) {
final File file = new File(
tempPath.resolve(entry.getName()).toString());
try (InputStream is = jar.getInputStream(entry);
FileOutputStream os = new FileOutputStream(file)) {
is.transferTo(os);
}

}
}

return tempPath.resolve("cef");
} catch (IOException e) {
return tempPath.resolve("res");
} catch (final IOException e) {
// ignore
}
return null;
}

private static Path getTempPathForExtraction() {
return Paths
.get(System.getenv("APPDATA"), "Eclipse SET", "cef", "dev",
"extracted")
.toAbsolutePath();
}
}
3 changes: 1 addition & 2 deletions java/org.eclipse.set.browser/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ Bundle-Version: 2.8.0.qualifier
Automatic-Module-Name: org.eclipse.set.browser
Bundle-RequiredExecutionEnvironment: JavaSE-21
Require-Bundle: org.eclipse.swt,
org.eclipse.set.browser.lib,
org.eclipse.set.browser.cef.win32
org.eclipse.set.browser.lib
Bundle-ClassPath: .
Export-Package: org.eclipse.set.browser,
org.eclipse.set.browser.cef,
Expand Down
1 change: 0 additions & 1 deletion java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<modules>
<module>org.eclipse.set.browser</module>
<module>org.eclipse.set.browser.lib</module>
<module>org.eclipse.set.browser.cef.win32</module>
<module>org.eclipse.set.browser.releng.target</module>
</modules>

Expand Down
Loading