1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-10 17:55:39 +02:00

Move all dependencies to maven direct where possible

Includes:

- Sign all artifacts, particularly 3rd party with CDT's PGP key
- Using maven version managed and updated by EF Webmasters
- Update to latest SnakeYAML
- Move some 3rd party dependencies to Import-Package (instead of
  Require-Bundle)
This commit is contained in:
Jonah Graham 2023-05-01 13:55:20 -04:00
parent 33c30fa819
commit 460c0021aa
13 changed files with 144 additions and 33 deletions

19
Jenkinsfile vendored
View file

@ -8,12 +8,22 @@ pipeline {
timestamps() timestamps()
} }
stages { stages {
stage('initialize PGP') {
steps {
container('cdt') {
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING')]) {
sh 'gpg --batch --import "${KEYRING}"'
sh 'for fpr in $(gpg --list-keys --with-colons | awk -F: \'/fpr:/ {print $10}\' | sort -u); do echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key ${fpr} trust; done'
}
}
}
}
stage('Code Formatting Checks') { stage('Code Formatting Checks') {
steps { steps {
container('cdt') { container('cdt') {
timeout(activity: true, time: 30) { timeout(activity: true, time: 30) {
withEnv(['MAVEN_OPTS=-XX:MaxRAMPercentage=60.0']) { withEnv(['MAVEN_OPTS=-XX:MaxRAMPercentage=60.0']) {
sh 'MVN="/usr/share/maven/bin/mvn -Dmaven.repo.local=/home/jenkins/.m2/repository \ sh 'MVN="/jipp/tools/apache-maven/latest/bin/mvn -Dmaven.repo.local=/home/jenkins/.m2/repository \
--settings /home/jenkins/.m2/settings.xml" ./releng/scripts/check_code_cleanliness.sh' --settings /home/jenkins/.m2/settings.xml" ./releng/scripts/check_code_cleanliness.sh'
} }
} }
@ -25,8 +35,10 @@ pipeline {
container('cdt') { container('cdt') {
timeout(activity: true, time: 20) { timeout(activity: true, time: 20) {
withEnv(['MAVEN_OPTS=-XX:MaxRAMPercentage=60.0']) { withEnv(['MAVEN_OPTS=-XX:MaxRAMPercentage=60.0']) {
sh "/usr/share/maven/bin/mvn \ withCredentials([string(credentialsId: 'gpg-passphrase', variable: 'KEYRING_PASSPHRASE')]) {
sh '''/jipp/tools/apache-maven/latest/bin/mvn \
clean verify -B -V \ clean verify -B -V \
-Dgpg.passphrase="${KEYRING_PASSPHRASE}" \
-Dmaven.test.failure.ignore=true \ -Dmaven.test.failure.ignore=true \
-DexcludedGroups=flakyTest,slowTest \ -DexcludedGroups=flakyTest,slowTest \
-P baseline-compare-and-replace \ -P baseline-compare-and-replace \
@ -38,7 +50,8 @@ pipeline {
-Dcdt.tests.dsf.gdb.versions=gdb.10,gdbserver.10 \ -Dcdt.tests.dsf.gdb.versions=gdb.10,gdbserver.10 \
-Dmaven.repo.local=/home/jenkins/.m2/repository \ -Dmaven.repo.local=/home/jenkins/.m2/repository \
--settings /home/jenkins/.m2/settings.xml \ --settings /home/jenkins/.m2/settings.xml \
" '''
}
} }
} }
} }

View file

@ -14,7 +14,6 @@ Export-Package: org.eclipse.cdt.managedbuilder.core.tests,
org.eclipse.cdt.projectmodel.tests org.eclipse.cdt.projectmodel.tests
Require-Bundle: org.eclipse.core.runtime, Require-Bundle: org.eclipse.core.runtime,
org.junit, org.junit,
org.junit.jupiter.api,
org.eclipse.core.resources, org.eclipse.core.resources,
org.eclipse.ui, org.eclipse.ui,
org.eclipse.ui.ide, org.eclipse.ui.ide,
@ -26,4 +25,6 @@ Require-Bundle: org.eclipse.core.runtime,
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-17 Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: org.eclipse.cdt.managedbuilder.core.tests Automatic-Module-Name: org.eclipse.cdt.managedbuilder.core.tests
Import-Package: com.google.gson Import-Package: com.google.gson,
org.junit.jupiter.api;version="[5.9.3,6.0.0)",
org.junit.jupiter.api.function;version="[5.9.3,6.0.0)"

View file

@ -4,10 +4,10 @@ Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.cdt.cmake.core.tests Bundle-SymbolicName: org.eclipse.cdt.cmake.core.tests
Bundle-Version: 1.0.0.qualifier Bundle-Version: 1.0.0.qualifier
Fragment-Host: org.eclipse.cdt.cmake.core;bundle-version="1.5.0" Fragment-Host: org.eclipse.cdt.cmake.core;bundle-version="1.5.0"
Import-Package: org.assertj.core.api;version="[3.24.2,4.0.0)",
org.junit.jupiter.api;version="[5.9.3,6.0.0)"
Automatic-Module-Name: org.eclipse.cdt.cmake.core.tests Automatic-Module-Name: org.eclipse.cdt.cmake.core.tests
Bundle-Vendor: %Bundle-Vendor Bundle-Vendor: %Bundle-Vendor
Bundle-Copyright: %Bundle-Copyright Bundle-Copyright: %Bundle-Copyright
Require-Bundle: org.junit, Require-Bundle: org.junit
org.junit.jupiter.api,
org.assertj;bundle-version="3.14.0"

View file

@ -22,6 +22,7 @@ import java.util.List;
import org.eclipse.cdt.cmake.core.internal.properties.CMakePropertiesBean; import org.eclipse.cdt.cmake.core.internal.properties.CMakePropertiesBean;
import org.eclipse.cdt.cmake.core.properties.CMakeGenerator; import org.eclipse.cdt.cmake.core.properties.CMakeGenerator;
import org.junit.Test; import org.junit.Test;
import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.CustomClassLoaderConstructor; import org.yaml.snakeyaml.constructor.CustomClassLoaderConstructor;
@ -56,7 +57,7 @@ public class CMakePropertiesEvolutionTest {
extraArgs.add("arg2"); extraArgs.add("arg2");
props.setExtraArguments(extraArgs); props.setExtraArguments(extraArgs);
Yaml yaml = new Yaml(new CustomClassLoaderConstructor(this.getClass().getClassLoader())); Yaml yaml = new Yaml(new CustomClassLoaderConstructor(this.getClass().getClassLoader(), new LoaderOptions()));
String output = yaml.dump(props); String output = yaml.dump(props);
// try to load as evolved properties.. // try to load as evolved properties..

View file

@ -12,8 +12,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.cdt.core;bundle-version="5.12.0", org.eclipse.cdt.core;bundle-version="5.12.0",
org.eclipse.tools.templates.freemarker;bundle-version="1.2.200", org.eclipse.tools.templates.freemarker;bundle-version="1.2.200",
com.google.gson, com.google.gson,
org.eclipse.cdt.jsoncdb.core, org.eclipse.cdt.jsoncdb.core
org.yaml.snakeyaml;bundle-version="[1.14.0,2.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-17 Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.cdt.cmake.core, Export-Package: org.eclipse.cdt.cmake.core,
@ -21,4 +20,6 @@ Export-Package: org.eclipse.cdt.cmake.core,
org.eclipse.cdt.cmake.core.properties org.eclipse.cdt.cmake.core.properties
Automatic-Module-Name: org.eclipse.cdt.cmake.core Automatic-Module-Name: org.eclipse.cdt.cmake.core
Bundle-Localization: plugin Bundle-Localization: plugin
Import-Package: org.eclipse.core.variables Import-Package: org.eclipse.core.variables,
org.yaml.snakeyaml;version="[2.0.0,3.0.0)",
org.yaml.snakeyaml.constructor;version="[2.0.0,3.0.0)"

View file

@ -27,6 +27,7 @@ import org.eclipse.cdt.cmake.core.internal.properties.CMakePropertiesBean;
import org.eclipse.cdt.cmake.core.properties.CMakeGenerator; import org.eclipse.cdt.cmake.core.properties.CMakeGenerator;
import org.eclipse.cdt.cmake.core.properties.ICMakeProperties; import org.eclipse.cdt.cmake.core.properties.ICMakeProperties;
import org.eclipse.cdt.cmake.core.properties.ICMakePropertiesController; import org.eclipse.cdt.cmake.core.properties.ICMakePropertiesController;
import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.CustomClassLoaderConstructor; import org.yaml.snakeyaml.constructor.CustomClassLoaderConstructor;
@ -66,8 +67,9 @@ class CMakePropertiesController implements ICMakePropertiesController {
CMakePropertiesBean props = null; CMakePropertiesBean props = null;
if (Files.exists(storageFile)) { if (Files.exists(storageFile)) {
try (InputStream is = Files.newInputStream(storageFile)) { try (InputStream is = Files.newInputStream(storageFile)) {
props = new Yaml(new CustomClassLoaderConstructor(this.getClass().getClassLoader())).loadAs(is, var classLoader = this.getClass().getClassLoader();
CMakePropertiesBean.class); var clConstructor = new CustomClassLoaderConstructor(classLoader, new LoaderOptions());
props = new Yaml(clConstructor).loadAs(is, CMakePropertiesBean.class);
// props is null here if if no document was available in the file // props is null here if if no document was available in the file
} }
} }

View file

@ -20,6 +20,11 @@ spec:
readOnly: true readOnly: true
- name: m2-repo - name: m2-repo
mountPath: /home/jenkins/.m2/repository mountPath: /home/jenkins/.m2/repository
- name: "jenkins-home"
mountPath: "/home/jenkins"
readOnly: false
- name: tools
mountPath: /jipp/tools
- name: jnlp - name: jnlp
resources: resources:
requests: requests:
@ -37,3 +42,8 @@ spec:
path: settings.xml path: settings.xml
- name: m2-repo - name: m2-repo
emptyDir: {} emptyDir: {}
- name: "jenkins-home"
emptyDir: {}
- name: tools
persistentVolumeClaim:
claimName: tools-claim-jiro-cdt

19
pom.xml
View file

@ -30,7 +30,7 @@
runs with. It may work with older versions, but this is not runs with. It may work with older versions, but this is not
tested or supported. --> tested or supported. -->
<required-maven-version>3.6.3</required-maven-version> <required-maven-version>3.6.3</required-maven-version>
<tycho-version>3.0.3</tycho-version> <tycho-version>3.0.5</tycho-version>
<cbi-plugins.version>1.3.4</cbi-plugins.version> <cbi-plugins.version>1.3.4</cbi-plugins.version>
<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
<cdt-site>http://ci.eclipse.org/cdt/job/cdt-master/lastSuccessfulBuild/artifact/releng/org.eclipse.cdt.repo/target/repository</cdt-site> <cdt-site>http://ci.eclipse.org/cdt/job/cdt-master/lastSuccessfulBuild/artifact/releng/org.eclipse.cdt.repo/target/repository</cdt-site>
@ -990,6 +990,23 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-gpg-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>pgpsigner</id>
<goals>
<goal>sign-p2-artifacts</goal>
</goals>
<configuration>
<keyname>4F23165B6AC51B15</keyname>
<skipIfJarsigned>false</skipIfJarsigned>
</configuration>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>

View file

@ -246,7 +246,7 @@
<repository <repository
url="https://download.eclipse.org/tools/orbit/downloads/drops/R20201118194144/repository"/> url="https://download.eclipse.org/tools/orbit/downloads/drops/R20201118194144/repository"/>
<repository <repository
url="https://download.eclipse.org/tools/orbit/downloads/latest-R/"/> url="https://download.eclipse.org/oomph/simrel-orbit/milestone/latest/"/>
<repository <repository
url="https://download.eclipse.org/technology/swtbot/releases/latest"/> url="https://download.eclipse.org/technology/swtbot/releases/latest"/>
<repository <repository

View file

@ -28,4 +28,19 @@
<build> <build>
<finalName>${project.artifactId}</finalName> <finalName>${project.artifactId}</finalName>
</build> </build>
<profiles>
<profile>
<id>production</id>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-gpg-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project> </project>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?> <?pde version="3.8"?>
<target name="cdt" sequenceNumber="135"> <target name="cdt" sequenceNumber="139">
<locations> <locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit"> <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/cbi/updates/license/" /> <repository location="https://download.eclipse.org/cbi/updates/license/" />
@ -51,23 +51,13 @@
<unit id="org.eclipse.wildwebdeveloper.embedder.node.feature.feature.group" version="0.0.0" /> <unit id="org.eclipse.wildwebdeveloper.embedder.node.feature.feature.group" version="0.0.0" />
</location> </location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit"> <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20230302014618/repository/" /> <repository location="https://download.eclipse.org/tools/orbit/downloads/latest-R/" />
<unit id="com.google.gson" version="0.0.0" />
<unit id="com.sun.xml.bind" version="2.3.3.v20221203-1659" /> <unit id="com.sun.xml.bind" version="2.3.3.v20221203-1659" />
<unit id="javax.activation" version="1.2.2.v20221203-1659" /> <unit id="javax.activation" version="1.2.2.v20221203-1659" />
<unit id="jakarta.xml.bind" version="2.3.3.v20221203-1659" /> <unit id="jakarta.xml.bind" version="2.3.3.v20221203-1659" />
<unit id="org.antlr.runtime" version="0.0.0" /> <unit id="org.hamcrest" version="2.2.0.v20210711-0821" />
<unit id="org.apache.commons.compress" version="0.0.0" /> <unit id="org.hamcrest.core" version="1.3.0.v20180420-1519" />
<unit id="org.assertj" version="0.0.0" /> <unit id="org.junit" version="4.13.2.v20211018-1956" />
<unit id="org.freemarker" version="0.0.0" />
<unit id="org.hamcrest" version="0.0.0" />
<unit id="org.hamcrest.core" version="0.0.0" />
<unit id="org.junit" version="0.0.0" />
<unit id="org.junit.jupiter.api" version="0.0.0" />
<unit id="org.mockito.mockito-core" version="0.0.0" />
<unit id="org.yaml.snakeyaml" version="0.0.0" />
<unit id="com.sun.jna" version="5.8.0.v20210503-0343" />
<unit id="com.sun.jna.platform" version="5.8.0.v20221112-0806" />
<unit id="javax.activation" version="2.0.0.v20221203-1659" /> <unit id="javax.activation" version="2.0.0.v20221203-1659" />
<unit id="javax.xml" version="1.4.1.v20220503-2331" /> <unit id="javax.xml" version="1.4.1.v20220503-2331" />
</location> </location>
@ -92,6 +82,66 @@
<version>1.7.36</version> <version>1.7.36</version>
<type>jar</type> <type>jar</type>
</dependency> </dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.23.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.24.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.32</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.3</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.9.3</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.3.1</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna-platform</artifactId>
<version>5.13.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.13.0</version>
<type>jar</type>
</dependency>
</dependencies> </dependencies>
</location> </location>
</locations> </locations>

View file

@ -31,7 +31,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId> <artifactId>build-helper-maven-plugin</artifactId>
<version>3.3.0</version> <version>3.4.0</version>
<executions> <executions>
<execution> <execution>
<id>attach-artifacts</id> <id>attach-artifacts</id>

View file

@ -9,7 +9,6 @@ Require-Bundle: org.junit,
org.eclipse.tm.terminal.control;bundle-version="4.5.0", org.eclipse.tm.terminal.control;bundle-version="4.5.0",
org.eclipse.core.runtime, org.eclipse.core.runtime,
org.eclipse.ui, org.eclipse.ui,
org.junit.jupiter.api,
org.opentest4j org.opentest4j
Bundle-RequiredExecutionEnvironment: JavaSE-17 Bundle-RequiredExecutionEnvironment: JavaSE-17
Export-Package: org.eclipse.tm.internal.terminal.connector;x-internal:=true, Export-Package: org.eclipse.tm.internal.terminal.connector;x-internal:=true,
@ -21,4 +20,6 @@ Export-Package: org.eclipse.tm.internal.terminal.connector;x-internal:=true,
org.eclipse.tm.internal.terminal.textcanvas;x-internal:=true, org.eclipse.tm.internal.terminal.textcanvas;x-internal:=true,
org.eclipse.tm.terminal.model, org.eclipse.tm.terminal.model,
org.eclipse.tm.terminal.test org.eclipse.tm.terminal.test
Import-Package: org.junit.jupiter.api;version="[5.9.3,6.0.0)",
org.junit.jupiter.api.function;version="[5.9.3,6.0.0)"
Automatic-Module-Name: org.eclipse.tm.terminal.test Automatic-Module-Name: org.eclipse.tm.terminal.test