Skip to content

Commit

Permalink
Merge pull request #23 from benken-parasoft/maven-runner-macosx-aarch64
Browse files Browse the repository at this point in the history
fix maven-plugin and runner not working with JDK for "macosx.aarch64"
  • Loading branch information
basilevs committed Dec 2, 2023
2 parents 1c135e4 + 43c85e1 commit 13f0f74
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 13 deletions.
Expand Up @@ -19,23 +19,41 @@ public class PlatformUtil {
* @return The classifier of current platform in form of os.ws.arch
*/
public static String getEclipseClassifier() {
return String.format("%s.%s", getOS().classifier, getArch());
return String.format("%s.%s", getOS().classifier, getArch()); //$NON-NLS-1$
}

public static String getArch() {
String result = System.getProperty("os.arch");
if (result.contains("64") || getOS() == OS.MACOSX) {
return "x86_64";
String result = System.getProperty("os.arch"); //$NON-NLS-1$
if (result != null) {
result = result.toLowerCase();
switch (result) {
case "x86": //$NON-NLS-1$
case "x86_64": //$NON-NLS-1$
case "aarch64": //$NON-NLS-1$
return result;
case "i386": //$NON-NLS-1$
case "i486": //$NON-NLS-1$
case "i586": //$NON-NLS-1$
case "i686": //$NON-NLS-1$
case "pentium": //$NON-NLS-1$
return "x86"; //$NON-NLS-1$
case "amd64": //$NON-NLS-1$
case "em64t": //$NON-NLS-1$
case "universal": //$NON-NLS-1$
return "x86_64"; //$NON-NLS-1$
default:
break;
}
}
return "x86";
throw new IllegalStateException(String.format("Unsupported \"os.arch\": %s", result)); //$NON-NLS-1$
}

public static OS getOS() {
String osName = System.getProperty("os.name").toLowerCase();
if (osName.contains("win")) {
String osName = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$
if (osName.contains("win")) { //$NON-NLS-1$
return OS.WIN;
}
if (osName.contains("mac")) {
if (osName.contains("mac")) { //$NON-NLS-1$
return OS.MACOSX;
}
return OS.LINUX;
Expand Down
2 changes: 1 addition & 1 deletion releng/Jenkinsfile.groovy
Expand Up @@ -15,7 +15,7 @@ class Build implements Serializable {
private final String BUILD_CONTAINER_NAME="ubuntu"
private final String BUILD_CONTAINER="""
- name: $BUILD_CONTAINER_NAME
image: basilevs/ubuntu-rcptt:3.6.1
image: basilevs/ubuntu-rcptt:3.6.2
tty: true
resources:
limits:
Expand Down
6 changes: 3 additions & 3 deletions releng/buildenv/ubuntu/Dockerfile
Expand Up @@ -8,17 +8,17 @@ COPY openjdk-r_ubuntu_ppa.gpg /etc/apt/trusted.gpg.d/
## Install a java 11, a webkit and a javafx
RUN apt-get -y update \
&& apt-get install -y \
openjdk-11-jdk \
openjdk-17-jdk \
libwebkit2gtk-4.0 \
openjfx \
&& apt-get clean

## Install a maven
ARG MAVEN_VERSION=3.5.4
ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries
ARG BASE_URL=https://archive.apache.org/dist/maven/maven-3/
ARG MAVEN_HOME=/usr/share/maven

RUN wget -O /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
RUN wget -O /tmp/apache-maven.tar.gz ${BASE_URL}/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
&& mkdir ${MAVEN_HOME} \
&& tar -xzf /tmp/apache-maven.tar.gz -C ${MAVEN_HOME} --strip-components=1 \
&& rm -f /tmp/apache-maven.tar.gz \
Expand Down
Expand Up @@ -599,6 +599,16 @@
version="0.0.0"
unpack="false"/>

<plugin
id="org.eclipse.equinox.launcher.cocoa.macosx.aarch64"
os="macosx"
ws="cocoa"
arch="aarch64"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"/>

<plugin
id="org.eclipse.equinox.launcher.cocoa.macosx.x86_64"
os="macosx"
Expand Down
5 changes: 5 additions & 0 deletions runner/pom.xml
Expand Up @@ -78,6 +78,11 @@
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>aarch64</arch>
</environment>
</environments>
</configuration>
</plugin>
Expand Down
2 changes: 2 additions & 0 deletions runner/product/rcptt.runner.product
Expand Up @@ -121,6 +121,7 @@
<plugin id="org.eclipse.equinox.jsp.jasper"/>
<plugin id="org.eclipse.equinox.jsp.jasper.registry"/>
<plugin id="org.eclipse.equinox.launcher"/>
<plugin id="org.eclipse.equinox.launcher.cocoa.macosx.aarch64" fragment="true"/>
<plugin id="org.eclipse.equinox.launcher.cocoa.macosx.x86_64" fragment="true"/>
<plugin id="org.eclipse.equinox.launcher.gtk.linux.x86_64"/>
<plugin id="org.eclipse.equinox.launcher.win32.win32.x86_64" fragment="true"/>
Expand Down Expand Up @@ -279,6 +280,7 @@
<plugin id="org.eclipse.rcptt.watson.jobs"/>
<plugin id="org.eclipse.rcptt.zephyr"/>
<plugin id="org.eclipse.swt"/>
<plugin id="org.eclipse.swt.cocoa.macosx.aarch64" fragment="true"/>
<plugin id="org.eclipse.swt.cocoa.macosx.x86_64" fragment="true"/>
<plugin id="org.eclipse.swt.gtk.linux.x86_64"/>
<plugin id="org.eclipse.swt.win32.win32.x86_64" fragment="true"/>
Expand Down
5 changes: 4 additions & 1 deletion runtime/tests/pom.xml
Expand Up @@ -29,7 +29,10 @@
<useUIThread>true</useUIThread>
<argLine>-Daj.weaving.verbose=true
-Dorg.aspectj.weaver.showWeaveInfo=true
-Dorg.aspectj.osgi.verbose=true</argLine>
-Dorg.aspectj.osgi.verbose=true
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-modules=ALL-SYSTEM
</argLine>
<frameworkExtensions>
<frameworkExtension>
<groupId>p2.osgi.bundle</groupId>
Expand Down

0 comments on commit 13f0f74

Please sign in to comment.