Skip to content

Commit

Permalink
SCANCLI-147 Add aarch64 distributions for Linux and MacOSX
Browse files Browse the repository at this point in the history
  • Loading branch information
henryju committed Jun 26, 2024
1 parent cf5980d commit a6b1600
Show file tree
Hide file tree
Showing 8 changed files with 275 additions and 51 deletions.
10 changes: 5 additions & 5 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ build_task:
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
script:
- source cirrus-env BUILD
- regular_mvn_build_deploy_analyze -Pdist-linux,dist-windows,dist-macosx
- regular_mvn_build_deploy_analyze -Pdist-linux-x64,dist-linux-aarch64,dist-windows-x64,dist-macosx-x64,dist-macosx-aarch64
cleanup_before_cache_script:
- cleanup_maven_repository

Expand Down Expand Up @@ -92,7 +92,7 @@ mend_scan_task:
ws_artifacts:
path: "whitesource/**/*"

linux_qa_java17_task:
linux_x64_qa_java17_task:
depends_on:
- build
<<: *ONLY_SONARSOURCE_QA
Expand All @@ -118,7 +118,7 @@ linux_qa_java17_task:
cleanup_before_cache_script:
- cleanup_maven_repository

win_qa_java17_task:
win_x64_qa_java17_task:
depends_on:
- build
<<: *ONLY_SONARSOURCE_QA
Expand All @@ -142,8 +142,8 @@ win_qa_java17_task:

promote_task:
depends_on:
- linux_qa_java17
- win_qa_java17
- linux_x64_qa_java17
- win_x64_qa_java17
<<: *ONLY_SONARSOURCE_QA_EXCEPT_ON_NIGHTLY_CRON
eks_container:
<<: *EKS_CONTAINER
Expand Down
20 changes: 5 additions & 15 deletions it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<!-- following properties must be set in command-line : sonar.runtimeVersion and sonarRunner.version -->

<maven.compiler.release>17</maven.compiler.release>
<orchestrator.version>4.1.0.495</orchestrator.version>
<orchestrator.version>5.0.0.2065</orchestrator.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -117,33 +117,23 @@
</configuration>
</execution>
<execution>
<id>get-linux-scanner</id>
<id>get-linux-x64-scanner</id>
<phase>initialize</phase>
<goals>
<goal>get</goal>
</goals>
<configuration>
<artifact>org.sonarsource.scanner.cli:sonar-scanner-cli:${env.PROJECT_VERSION}:zip:linux</artifact>
<artifact>org.sonarsource.scanner.cli:sonar-scanner-cli:${env.PROJECT_VERSION}:zip:linux-x64</artifact>
</configuration>
</execution>
<execution>
<id>get-windows-scanner</id>
<id>get-windows-x64-scanner</id>
<phase>initialize</phase>
<goals>
<goal>get</goal>
</goals>
<configuration>
<artifact>org.sonarsource.scanner.cli:sonar-scanner-cli:${env.PROJECT_VERSION}:zip:windows</artifact>
</configuration>
</execution>
<execution>
<id>get-macosx-scanner</id>
<phase>initialize</phase>
<goals>
<goal>get</goal>
</goals>
<configuration>
<artifact>org.sonarsource.scanner.cli:sonar-scanner-cli:${env.PROJECT_VERSION}:zip:macosx</artifact>
<artifact>org.sonarsource.scanner.cli:sonar-scanner-cli:${env.PROJECT_VERSION}:zip:windows-x64</artifact>
</configuration>
</execution>
</executions>
Expand Down
129 changes: 112 additions & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<jre.dirname.macosx>jdk-17.0.11+9-jre/Contents/Home</jre.dirname.macosx>

<!-- Release: enable publication to Bintray -->
<artifactsToPublish>${project.groupId}:${project.artifactId}:zip,${project.groupId}:${project.artifactId}:zip:linux,${project.groupId}:${project.artifactId}:zip:windows,${project.groupId}:${project.artifactId}:zip:macosx,${project.groupId}:${project.artifactId}:json:cyclonedx</artifactsToPublish>
<artifactsToPublish>${project.groupId}:${project.artifactId}:zip,${project.groupId}:${project.artifactId}:zip:linux-x64,${project.groupId}:${project.artifactId}:zip:linux-aarch64,${project.groupId}:${project.artifactId}:zip:windows-x64,${project.groupId}:${project.artifactId}:zip:macosx-x64,${project.groupId}:${project.artifactId}:zip:macosx-aarch64,${project.groupId}:${project.artifactId}:json:cyclonedx</artifactsToPublish>

<maven.compiler.release>17</maven.compiler.release>
</properties>
Expand Down Expand Up @@ -255,23 +255,23 @@

<profiles>
<profile>
<id>dist-linux</id>
<id>dist-linux-x64</id>
<build>
<plugins>
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<executions>
<execution>
<id>unpack-linux</id>
<id>unpack-linux-x64</id>
<phase>package</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.11%2B9/OpenJDK17U-jre_x64_linux_hotspot_17.0.11_9.tar.gz</url>
<unpack>true</unpack>
<outputDirectory>${unpack.dir}/linux</outputDirectory>
<outputDirectory>${unpack.dir}/linux-x64</outputDirectory>
<sha256>bcb1b7b8ad68c93093f09b591b7cb17161d39891f7d29d33a586f5a328603707</sha256>
</configuration>
</execution>
Expand All @@ -281,7 +281,7 @@
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assemble-linux</id>
<id>assemble-linux-x64</id>
<phase>package</phase>
<goals>
<goal>single</goal>
Expand All @@ -290,7 +290,55 @@
<finalName>sonar-scanner-${project.version}</finalName>
<escapeString>\</escapeString>
<descriptors>
<descriptor>src/main/assembly/dist-linux.xml</descriptor>
<descriptor>src/main/assembly/dist-linux-x64.xml</descriptor>
</descriptors>
<filters>
<filter>src/main/assembly/filter-dist.properties</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>dist-linux-aarch64</id>
<build>
<plugins>
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<executions>
<execution>
<id>unpack-linux-aarch64</id>
<phase>package</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.11%2B9/OpenJDK17U-jre_aarch64_linux_hotspot_17.0.11_9.tar.gz</url>
<unpack>true</unpack>
<outputDirectory>${unpack.dir}/linux-aarch64</outputDirectory>
<sha256>ccfa23c25790475c84df983cc5f729b94c04d9ea9863912deb15c6266782cf16</sha256>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assemble-linux-aarch64</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>sonar-scanner-${project.version}</finalName>
<escapeString>\</escapeString>
<descriptors>
<descriptor>src/main/assembly/dist-linux-aarch64.xml</descriptor>
</descriptors>
<filters>
<filter>src/main/assembly/filter-dist.properties</filter>
Expand All @@ -302,25 +350,24 @@
</plugins>
</build>
</profile>

<profile>
<id>dist-windows</id>
<id>dist-windows-x64</id>
<build>
<plugins>
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<executions>
<execution>
<id>unpack-windows</id>
<id>unpack-windows-x64</id>
<phase>package</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.11%2B9/OpenJDK17U-jre_x64_windows_hotspot_17.0.11_9.zip</url>
<unpack>true</unpack>
<outputDirectory>${unpack.dir}/windows</outputDirectory>
<outputDirectory>${unpack.dir}/windows-x64</outputDirectory>
<sha256>4bafe2e94439c8193fc8c68247cb0dbaf4e80265b903288f63f128304f129bbe</sha256>
</configuration>
</execution>
Expand All @@ -330,7 +377,7 @@
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assemble-windows</id>
<id>assemble-windows-x64</id>
<phase>package</phase>
<goals>
<goal>single</goal>
Expand All @@ -339,7 +386,7 @@
<finalName>sonar-scanner-${project.version}</finalName>
<escapeString>\</escapeString>
<descriptors>
<descriptor>src/main/assembly/dist-windows.xml</descriptor>
<descriptor>src/main/assembly/dist-windows-x64.xml</descriptor>
</descriptors>
<filters>
<filter>src/main/assembly/filter-dist.properties</filter>
Expand All @@ -352,23 +399,23 @@
</build>
</profile>
<profile>
<id>dist-macosx</id>
<id>dist-macosx-x64</id>
<build>
<plugins>
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<executions>
<execution>
<id>unpack-macosx</id>
<id>unpack-macosx-x64</id>
<phase>package</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.11%2B9/OpenJDK17U-jre_x64_mac_hotspot_17.0.11_9.tar.gz</url>
<unpack>true</unpack>
<outputDirectory>${unpack.dir}/macosx</outputDirectory>
<outputDirectory>${unpack.dir}/macosx-x64</outputDirectory>
<sha256>232c40bebd6ddbb673862e86e7e6e09bcfe399e5a53c8a6b77bf1ceab8edefd0</sha256>
</configuration>
</execution>
Expand All @@ -378,7 +425,55 @@
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assemble-macosx</id>
<id>assemble-macosx-x64</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>sonar-scanner-${project.version}</finalName>
<escapeString>\</escapeString>
<descriptors>
<descriptor>src/main/assembly/dist-macosx-x64.xml</descriptor>
</descriptors>
<filters>
<filter>src/main/assembly/filter-dist.properties</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>dist-macosx-aarch64</id>
<build>
<plugins>
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<executions>
<execution>
<id>unpack-macosx-aarch64</id>
<phase>package</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.11%2B9/OpenJDK17U-jre_aarch64_mac_hotspot_17.0.11_9.tar.gz</url>
<unpack>true</unpack>
<outputDirectory>${unpack.dir}/macosx-aarch64</outputDirectory>
<sha256>003d3e0a65a2f0633b8bfed42be133724b490acb323c174c708d3a446d5fc660</sha256>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assemble-macosx-aarch64</id>
<phase>package</phase>
<goals>
<goal>single</goal>
Expand All @@ -387,7 +482,7 @@
<finalName>sonar-scanner-${project.version}</finalName>
<escapeString>\</escapeString>
<descriptors>
<descriptor>src/main/assembly/dist-macosx.xml</descriptor>
<descriptor>src/main/assembly/dist-macosx-aarch64.xml</descriptor>
</descriptors>
<filters>
<filter>src/main/assembly/filter-dist.properties</filter>
Expand Down
71 changes: 71 additions & 0 deletions src/main/assembly/dist-linux-aarch64.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<assembly>
<id>linux-aarch64</id>
<formats>
<format>zip</format>
</formats>
<baseDirectory>sonar-scanner-${project.version}-linux-aarch64</baseDirectory>
<fileSets>

<!-- jre basic, except bin/ -->
<fileSet>
<directory>${unpack.dir}/linux-aarch64/${jre.dirname.linux}</directory>
<outputDirectory>jre</outputDirectory>
<excludes>
<exclude>bin/**</exclude>
<exclude>man/**</exclude>
<exclude>lib/jspawnhelper</exclude>
<exclude>lib/jexec</exclude>
<exclude>plugin/**</exclude>
</excludes>
</fileSet>

<!-- jre bin/java -->
<fileSet>
<directory>${unpack.dir}/linux-aarch64/${jre.dirname.linux}/bin</directory>
<outputDirectory>jre/bin</outputDirectory>
<includes>
<include>java</include>
</includes>
<fileMode>0755</fileMode>
</fileSet>

<!-- jre lib executable files -->
<fileSet>
<directory>${unpack.dir}/linux-aarch64/${jre.dirname.linux}/lib</directory>
<outputDirectory>jre/lib</outputDirectory>
<includes>
<include>jspawnhelper</include>
<include>jexec</include>
</includes>
<fileMode>0755</fileMode>
</fileSet>

<!-- scanner files -->
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>lib</outputDirectory>
<fileMode>0644</fileMode>
<includes>
<include>${scanner.jar}</include>
</includes>
</fileSet>
<fileSet>
<directory>src/main/assembly/conf</directory>
<outputDirectory>conf</outputDirectory>
<fileMode>0644</fileMode>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>src/main/assembly/bin</directory>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
<lineEnding>unix</lineEnding>
<filtered>true</filtered>
<includes>
<include>sonar-scanner</include>
<include>sonar-scanner-debug</include>
</includes>
</fileSet>
</fileSets>
</assembly>
Loading

0 comments on commit a6b1600

Please sign in to comment.