Skip to content

Commit

Permalink
Merge pull request #63 from cryptomator/feature/jdk22
Browse files Browse the repository at this point in the history
Build project with JDK 22
  • Loading branch information
infeo committed May 16, 2024
2 parents 4db325b + 50c34ad commit 42625ff
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'temurin'
cache: 'maven'
- name: Cache SonarCloud packages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fetch-depth: 2
- uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'temurin'
cache: 'maven'
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
with:
runner-os: 'ubuntu-latest'
java-distribution: 'temurin'
java-version: 21
java-version: 22
secrets:
nvd-api-key: ${{ secrets.NVD_API_KEY }}
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
2 changes: 1 addition & 1 deletion .github/workflows/publish-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
ref: "refs/tags/${{ github.event.inputs.tag }}"
- uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'temurin'
cache: 'maven'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'temurin'
cache: 'maven'
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
Expand Down
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 17 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@
<configuration>
<rules>
<requireJavaVersion>
<message>You need at least JDK 11.0.3 to build this project.</message>
<version>[11.0.3,)</version>
<message>You need at least JDK 22 to build this project.</message>
<version>[22,)</version>
</requireJavaVersion>
</rules>
</configuration>
Expand Down Expand Up @@ -171,6 +171,20 @@
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
<execution>
<id>java22</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>22</release>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/main/java22</compileSourceRoot>
</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
Expand Down Expand Up @@ -228,6 +242,7 @@
<argument>--update</argument>
<argument>--file=${project.build.directory}/${project.build.finalName}.jar</argument>
<argument>META-INF/versions/9/module-info.class</argument>
<argument>META-INF/versions/22/module-info.class</argument>
</arguments>
</configuration>
</execution>
Expand Down
27 changes: 27 additions & 0 deletions src/main/java22/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import org.cryptomator.cryptolib.api.CryptorProvider;

/**
* This module provides the highlevel cryptographic API used by Cryptomator.
*
* @uses CryptorProvider See {@link CryptorProvider#forScheme(CryptorProvider.Scheme)}
* @provides CryptorProvider Providers for {@link org.cryptomator.cryptolib.api.CryptorProvider.Scheme#SIV_CTRMAC SIV/CTR-then-MAC}
* and {@link org.cryptomator.cryptolib.api.CryptorProvider.Scheme#SIV_GCM SIV/GCM}
*/
module org.cryptomator.cryptolib {
requires static org.bouncycastle.provider; // will be shaded
requires static org.bouncycastle.pkix; // will be shaded
requires org.cryptomator.siv;
requires com.google.gson;
requires transitive com.google.common;
requires org.slf4j;

exports org.cryptomator.cryptolib.api;
exports org.cryptomator.cryptolib.common;

opens org.cryptomator.cryptolib.common to com.google.gson;

uses CryptorProvider;

provides CryptorProvider
with org.cryptomator.cryptolib.v1.CryptorProviderImpl, org.cryptomator.cryptolib.v2.CryptorProviderImpl;
}

0 comments on commit 42625ff

Please sign in to comment.