Bug 549585 - Contribute Chromium support to SWT
Binaries included in commit.
Initial chromium contribution. Follows the existing swt structure for
building and packaging.
Added SWT.CHROMIUM constant and modified BrowserFactory classes.
Added new source plugin org.eclipse.swt.browser.chromium with the java,
c jni and rust source code.
This contains buildChromium.xml with ant tasks to build rust code.
Minimal modifications to existing ant build scripts to support building
and packaging chromium.swt fragments.
Binaries repo contains 3 new fragments with OS specific build and
binaries.
New Chromium Test class added.
Browser examples can be run by passing
-Dorg.eclipse.swt.browser.DefaultType=chromium.
It requires built fragment .jar added to classpath.
CEF binaries (3.3071.1649.g98725e6) are required to run examples and and
tests and should be put in
~/.swt/lib/*/*/chromium-3071/.
Can be obtained from
http://dl.maketechnology.io/chromium-cef/rls/repository
Build instructions:
As usual with mvn and -Dnative property to build natives. Two flags
introduced in fragment poms: -DskipRust (to skip building rust)
-DskipJni (to skip building chromium jni)
Build will download CEF in order to build. Only requirement should be
rust installed (https://www.rust-lang.org/).
Change-Id: I0cd18c3601690c6540d550c398ac7bac6ffa24fa
Signed-off-by: Guillermo Zunino <guillez@gmail.com>
diff --git a/bundles/org.eclipse.swt.browser.chromium.cocoa.macosx.x86_64/pom.xml b/bundles/org.eclipse.swt.browser.chromium.cocoa.macosx.x86_64/pom.xml
new file mode 100644
index 0000000..c3919b1
--- /dev/null
+++ b/bundles/org.eclipse.swt.browser.chromium.cocoa.macosx.x86_64/pom.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2020 Equo
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License 2.0 which is available at
+ http://www.eclipse.org/legal/epl-2.0.
+
+ SPDX-License-Identifier: EPL-2.0
+
+ Contributors:
+ Guillermo Zunino, Equo - initial implementation
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>binaries-parent</artifactId>
+ <groupId>eclipse.platform.swt.binaries</groupId>
+ <version>4.17.0-SNAPSHOT</version>
+ <relativePath>../binaries-parent/</relativePath>
+ </parent>
+ <groupId>org.eclipse.swt</groupId>
+ <artifactId>org.eclipse.swt.browser.chromium.cocoa.macosx.x86_64</artifactId>
+ <version>3.115.100-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+
+ <properties>
+ <os>macosx</os>
+ <ws>cocoa</ws>
+ <arch>x86_64</arch>
+ <buildid>${buildId}</buildid>
+ <skipRust>false</skipRust>
+ <skipJni>false</skipJni>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>swtdownload</id>
+ <phase>package</phase>
+ <configuration>
+ <target>
+ <ant antfile="build.xml" target="swtdownload"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-compiler-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <configuration>
+ <extraClasspathElements>
+ <dependency>
+ <groupId>org.eclipse.swt</groupId>
+ <artifactId>org.eclipse.swt.cocoa.macosx.x86_64</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </extraClasspathElements>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <!-- This has to be here. Profiles are not inheritable. -->
+ <profiles>
+ <profile>
+ <id>build-natives</id>
+ <activation>
+ <property>
+ <!-- This has to be hardcoded. Profiles are not allowed to use pom defined properties :-( -->
+ <name>native</name>
+ <value>cocoa.macosx.x86_64</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>natives-rust</id>
+ <phase>process-resources</phase>
+ <configuration>
+ <target>
+ <ant antfile="build.xml" target="build_chromium"/>
+ </target>
+ <skip>${skipRust}</skip>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>natives-jni</id>
+ <phase>process-resources</phase>
+ <configuration>
+ <target>
+ <property name="targets" value="chromium_install" />
+ <ant antfile="build.xml" target="build_libraries"/>
+ </target>
+ <skip>${skipJni}</skip>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>