From 79a09e3249c27b03894786bdf079c5f07c067e58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jari-Matti=20M=C3=A4kel=C3=A4?= <jmjmak@utu.fi> Date: Fri, 22 Nov 2024 17:33:47 +0200 Subject: [PATCH] Remove extra functionality + add JPMS support + gitlab build --- .gitlab-ci.yml | 29 +++++++++ ci_settings.xml | 16 +++++ org.eclipse.jgit/src/module-info.java | 65 +++++++++++++++++++ .../jgit/util/time/ProposedTimestamp.java | 8 +-- pom.xml | 47 ++++++++++---- 5 files changed, 147 insertions(+), 18 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 ci_settings.xml create mode 100644 org.eclipse.jgit/src/module-info.java diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..35c0cdd36 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,29 @@ +image: maven:3-eclipse-temurin-17 + +variables: + MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true" + MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version" + +cache: + key: "$CI_JOB_NAME" + paths: + - .m2/repository + +stages: + - build + - deploy + +build: + stage: build + script: + - mvn install -s ci_settings.xml + artifacts: + paths: + - target/ + +deploy: + stage: deploy + rules: + - if: $CI_COMMIT_TAG + script: + - mvn deploy -s ci_settings.xml diff --git a/ci_settings.xml b/ci_settings.xml new file mode 100644 index 000000000..59c8c271c --- /dev/null +++ b/ci_settings.xml @@ -0,0 +1,16 @@ +<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd"> + <servers> + <server> + <id>gitlab-maven</id> + <configuration> + <httpHeaders> + <property> + <name>Job-Token</name> + <value>${env.CI_JOB_TOKEN}</value> + </property> + </httpHeaders> + </configuration> + </server> + </servers> +</settings> diff --git a/org.eclipse.jgit/src/module-info.java b/org.eclipse.jgit/src/module-info.java new file mode 100644 index 000000000..a5583e503 --- /dev/null +++ b/org.eclipse.jgit/src/module-info.java @@ -0,0 +1,65 @@ + +module org.eclipse.jgit { + requires org.slf4j; + requires org.apache.commons.codec; + requires com.googlecode.javaewah; + requires java.xml; + requires java.management; + //requires java.sql; + requires java.security.jgss; + exports org.eclipse.jgit.annotations; + exports org.eclipse.jgit.api; + exports org.eclipse.jgit.api.errors; + exports org.eclipse.jgit.attributes; + exports org.eclipse.jgit.blame; + exports org.eclipse.jgit.diff; + exports org.eclipse.jgit.dircache; + exports org.eclipse.jgit.errors; + exports org.eclipse.jgit.events; + exports org.eclipse.jgit.fnmatch; + exports org.eclipse.jgit.gitrepo; + exports org.eclipse.jgit.gitrepo.internal; + exports org.eclipse.jgit.hooks; + exports org.eclipse.jgit.ignore; + exports org.eclipse.jgit.ignore.internal; + exports org.eclipse.jgit.internal; + exports org.eclipse.jgit.internal.diff; + exports org.eclipse.jgit.internal.diffmergetool; + exports org.eclipse.jgit.internal.fsck; + exports org.eclipse.jgit.internal.revwalk; + exports org.eclipse.jgit.internal.storage.commitgraph; + exports org.eclipse.jgit.internal.storage.dfs; + exports org.eclipse.jgit.internal.storage.file; + exports org.eclipse.jgit.internal.storage.io; + exports org.eclipse.jgit.internal.storage.memory; + exports org.eclipse.jgit.internal.storage.pack; + exports org.eclipse.jgit.internal.storage.reftable; + exports org.eclipse.jgit.internal.submodule; + exports org.eclipse.jgit.internal.transport.connectivity; + exports org.eclipse.jgit.internal.transport.http; + exports org.eclipse.jgit.internal.transport.parser; + exports org.eclipse.jgit.internal.transport.ssh; + exports org.eclipse.jgit.internal.util; + exports org.eclipse.jgit.lib; + exports org.eclipse.jgit.lib.internal; + exports org.eclipse.jgit.logging; + exports org.eclipse.jgit.merge; + exports org.eclipse.jgit.nls; + exports org.eclipse.jgit.notes; + exports org.eclipse.jgit.patch; + exports org.eclipse.jgit.revplot; + exports org.eclipse.jgit.revwalk; + exports org.eclipse.jgit.revwalk.filter; + exports org.eclipse.jgit.storage.file; + exports org.eclipse.jgit.storage.pack; + exports org.eclipse.jgit.submodule; + exports org.eclipse.jgit.transport; + exports org.eclipse.jgit.transport.http; + exports org.eclipse.jgit.transport.resolver; + exports org.eclipse.jgit.treewalk; + exports org.eclipse.jgit.treewalk.filter; + exports org.eclipse.jgit.util; + exports org.eclipse.jgit.util.io; + exports org.eclipse.jgit.util.sha1; + exports org.eclipse.jgit.util.time; +} diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/time/ProposedTimestamp.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/time/ProposedTimestamp.java index a5ee1070d..67583c782 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/time/ProposedTimestamp.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/time/ProposedTimestamp.java @@ -13,7 +13,7 @@ import static java.util.concurrent.TimeUnit.MICROSECONDS; import static java.util.concurrent.TimeUnit.MILLISECONDS; -import java.sql.Timestamp; +//import java.sql.Timestamp; import java.time.Duration; import java.time.Instant; import java.util.Date; @@ -139,9 +139,9 @@ public Instant instant() { * * @return time since epoch, with up to microsecond resolution. */ - public Timestamp timestamp() { - return Timestamp.from(instant()); - } + //public Timestamp timestamp() { + // return Timestamp.from(instant()); + //} /** * Get time since epoch, with up to millisecond resolution. diff --git a/pom.xml b/pom.xml index b55429b95..cf9ec0067 100644 --- a/pom.xml +++ b/pom.xml @@ -409,6 +409,11 @@ <plugin> <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <release>${java.version}</release> + <source>${java.version}</source> + <target>${java.version}</target> + </configuration> </plugin> <plugin> @@ -724,7 +729,20 @@ </plugin> </plugins> </build> - + <modules> + <module>org.eclipse.jgit</module> + </modules> + <distributionManagement> + <repository> + <id>gitlab-maven</id> + <url>${env.CI_API_V4_URL}/projects/${env.CI_PROJECT_ID}/packages/maven</url> + </repository> + <snapshotRepository> + <id>gitlab-maven</id> + <url>${env.CI_API_V4_URL}/projects/${env.CI_PROJECT_ID}/packages/maven</url> + </snapshotRepository> + </distributionManagement> +<!-- <reporting> <plugins> <plugin> @@ -838,7 +856,7 @@ </plugin> </plugins> </reporting> - +--> <dependencyManagement> <dependencies> <dependency> @@ -1025,7 +1043,7 @@ </dependency> </dependencies> </dependencyManagement> - + <!-- <distributionManagement> <repository> <id>repo.eclipse.org</id> @@ -1059,16 +1077,16 @@ <compilerArgs> <arg>-XDcompilePolicy=simple</arg> <arg>-Xplugin:ErrorProne</arg> - <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg> - <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg> - <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg> - <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg> - <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg> - <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg> - <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg> - <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg> - <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg> - <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg> + <arg>-J- -add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg> + <arg>-J- -add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg> + <arg>-J- -add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg> + <arg>-J- -add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg> + <arg>-J- -add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg> + <arg>-J- -add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg> + <arg>-J- -add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg> + <arg>-J- -add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg> + <arg>-J- -add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg> + <arg>-J- -add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg> </compilerArgs> <annotationProcessorPaths> <path> @@ -1095,7 +1113,7 @@ <compilerId>eclipse</compilerId> <encoding>UTF-8</encoding> <release>${java.version}</release> - <!-- Passing arguments is a trainwreck, see https://issues.apache.org/jira/browse/MCOMPILER-123 --> + <!- - Passing arguments is a trainwreck, see https://issues.apache.org/jira/browse/MCOMPILER-123 - -> <compilerArguments> <properties>${project.basedir}/.settings/org.eclipse.jdt.core.prefs</properties> </compilerArguments> @@ -1196,5 +1214,6 @@ <module>org.eclipse.jgit.coverage</module> <module>org.eclipse.jgit.benchmarks</module> </modules> + --> </project> -- GitLab