Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
overheadhunter committed Apr 27, 2022
2 parents 952c5fa + ef29697 commit 299a04a
Show file tree
Hide file tree
Showing 27 changed files with 126 additions and 86 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,19 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
- uses: actions/setup-java@v2
with:
java-version: 11
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: Ensure to use tagged version
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/}
- name: Build and Test
id: buildAndTest
run: mvn -B clean install
run: mvn -B clean install -Pdependency-check
- uses: actions/upload-artifact@v2
with:
name: artifacts
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- uses: actions/setup-java@v1
- uses: actions/setup-java@v2
with:
java-version: 11
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/publish-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,26 @@ jobs:
- uses: actions/checkout@v2
with:
ref: "refs/tags/${{ github.event.inputs.tag }}"
- uses: actions/setup-java@v1
- uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'temurin'
java-version: 17
cache: 'maven'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_PASSWORD # env variable for token in deploy
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Enforce project version ${{ github.event.inputs.tag }}
run: mvn versions:set -B -DnewVersion=${{ github.event.inputs.tag }}
- name: Deploy
run: mvn deploy -B -DskipTests -Psign,deploy-central --no-transfer-progress
env:
MAVEN_OPTS: >
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
--add-opens=java.base/java.text=ALL-UNNAMED
--add-opens=java.desktop/java.awt.font=ALL-UNNAMED
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
12 changes: 4 additions & 8 deletions .github/workflows/publish-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@ jobs:
if: startsWith(github.ref, 'refs/tags/') # only allow publishing tagged versions
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
- uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'temurin'
java-version: 17
cache: 'maven'
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Enforce project version ${{ github.event.release.tag_name }}
run: mvn versions:set -B -DnewVersion=${{ github.event.release.tag_name }}
- name: Deploy
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.

68 changes: 44 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.cryptomator</groupId>
<artifactId>integrations-mac</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>

<name>Cryptomator Integrations for macOS</name>
<description>Provides optional macOS services used by Cryptomator</description>
Expand All @@ -27,16 +27,19 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.jdk.version>17</project.jdk.version>

<!-- runtime dependencies -->
<api.version>1.0.0</api.version>
<slf4j.version>1.7.32</slf4j.version>
<guava.version>31.0-jre</guava.version>
<gson.version>2.8.8</gson.version>
<api.version>1.1.0</api.version>
<slf4j.version>1.7.36</slf4j.version>

<!-- test dependencies -->
<junit.jupiter.version>5.8.1</junit.jupiter.version>
<mockito.version>3.12.4</mockito.version>
<junit.jupiter.version>5.8.2</junit.jupiter.version>
<mockito.version>4.4.0</mockito.version>

<!-- build plugin dependencies -->
<dependency-check.version>7.0.0</dependency-check.version>
<nexus-staging.version>1.6.8</nexus-staging.version>
</properties>

<licenses>
Expand All @@ -58,16 +61,6 @@
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>

<!-- JUnit / Mockito / Hamcrest -->
<dependency>
Expand Down Expand Up @@ -111,13 +104,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.10.1</version>
<configuration>
<compilerArgs>
<arg>-h</arg>
<arg>${project.basedir}/src/main/headers</arg>
</compilerArgs>
<release>11</release>
<release>${project.jdk.version}</release>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -222,7 +215,7 @@
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.1</version>
<version>3.3.2</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -233,7 +226,7 @@
</executions>
<configuration>
<quiet>true</quiet>
<release>11</release>
<release>${project.jdk.version}</release>
<tags>
<!-- workaround for "unknown tag: implNote", see https://blog.codefx.org/java/new-javadoc-tags/#Maven -->
<tag>
Expand Down Expand Up @@ -279,6 +272,33 @@
</build>

<profiles>
<profile>
<id>dependency-check</id>
<build>
<plugins>
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>${dependency-check.version}</version>
<configuration>
<cveValidForHours>24</cveValidForHours>
<failBuildOnCVSS>0</failBuildOnCVSS>
<skipTestScope>true</skipTestScope>
<detail>true</detail>
<suppressionFile>suppression.xml</suppressionFile>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>sign</id>
<build>
Expand Down Expand Up @@ -312,19 +332,19 @@
<repository>
<id>ossrh</id>
<name>Maven Central</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<version>${nexus-staging.version}</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import org.cryptomator.integrations.autostart.AutoStartProvider;
import org.cryptomator.integrations.keychain.KeychainAccessProvider;
import org.cryptomator.integrations.tray.TrayIntegrationProvider;
import org.cryptomator.integrations.uiappearance.UiAppearanceProvider;
import org.cryptomator.macos.autostart.MacAutoStartProvider;
import org.cryptomator.macos.keychain.MacSystemKeychainAccess;
import org.cryptomator.macos.tray.MacTrayIntegrationProvider;
import org.cryptomator.macos.uiappearance.MacUiAppearanceProvider;

module org.cryptomator.integrations.mac {
requires org.cryptomator.integrations.api;
requires org.slf4j;

provides AutoStartProvider with MacAutoStartProvider;
provides KeychainAccessProvider with MacSystemKeychainAccess;
provides TrayIntegrationProvider with MacTrayIntegrationProvider;
provides UiAppearanceProvider with MacUiAppearanceProvider;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

import org.cryptomator.integrations.autostart.AutoStartProvider;
import org.cryptomator.integrations.autostart.ToggleAutoStartFailedException;
import org.cryptomator.integrations.common.OperatingSystem;
import org.cryptomator.integrations.common.Priority;

@Priority(1000)
@OperatingSystem(OperatingSystem.Value.MAC)
public class MacAutoStartProvider implements AutoStartProvider {

private final MacLaunchServices launchServices;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package org.cryptomator.macos.keychain;

import org.cryptomator.integrations.common.OperatingSystem;
import org.cryptomator.integrations.common.Priority;
import org.cryptomator.integrations.keychain.KeychainAccessException;
import org.cryptomator.integrations.keychain.KeychainAccessProvider;
import org.cryptomator.macos.common.Localization;

@Priority(1000)
@OperatingSystem(OperatingSystem.Value.MAC)
public class MacSystemKeychainAccess implements KeychainAccessProvider {

private final MacKeychain keychain;
Expand All @@ -23,7 +27,7 @@ public String displayName() {
}

@Override
public void storePassphrase(String key, CharSequence passphrase) throws KeychainAccessException {
public void storePassphrase(String key, String displayName, CharSequence passphrase) throws KeychainAccessException {
keychain.storePassword(key, passphrase);
}

Expand All @@ -48,7 +52,7 @@ public void deletePassphrase(String key) throws KeychainAccessException {
}

@Override
public void changePassphrase(String key, CharSequence passphrase) throws KeychainAccessException {
public void changePassphrase(String key, String displayName, CharSequence passphrase) throws KeychainAccessException {
if (keychain.deletePassword(key)) {
keychain.storePassword(key, passphrase);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package org.cryptomator.macos.tray;

import org.cryptomator.integrations.common.OperatingSystem;
import org.cryptomator.integrations.common.Priority;
import org.cryptomator.integrations.tray.TrayIntegrationProvider;

@Priority(1000)
@OperatingSystem(OperatingSystem.Value.MAC)
public class MacTrayIntegrationProvider implements TrayIntegrationProvider {

private final ActivationPolicy activationPolicy;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.cryptomator.macos.uiappearance;

import org.cryptomator.integrations.common.OperatingSystem;
import org.cryptomator.integrations.common.Priority;
import org.cryptomator.integrations.uiappearance.Theme;
import org.cryptomator.integrations.uiappearance.UiAppearanceException;
import org.cryptomator.integrations.uiappearance.UiAppearanceListener;
Expand All @@ -8,6 +10,8 @@
import java.util.HashMap;
import java.util.Map;

@Priority(1000)
@OperatingSystem(OperatingSystem.Value.MAC)
public class MacUiAppearanceProvider implements UiAppearanceProvider {

private final MacSystemAppearance systemAppearance;
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/MacIntegrationsBundle_bn.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.cryptomator.macos.keychain.displayName=macOS এর কী চেইন
Empty file.
Empty file.
Empty file.
1 change: 1 addition & 0 deletions src/main/resources/MacIntegrationsBundle_he.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.cryptomator.macos.keychain.displayName=צרור מפתחות של macOS
1 change: 1 addition & 0 deletions src/main/resources/MacIntegrationsBundle_mk.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.cryptomator.macos.keychain.displayName=macOS ланец со клучеви
2 changes: 1 addition & 1 deletion src/main/resources/MacIntegrationsBundle_nb.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
org.cryptomator.macos.keychain.displayName=macOS Keychain
org.cryptomator.macos.keychain.displayName=macOS-nøkkelring
Empty file.
Empty file.
1 change: 1 addition & 0 deletions src/main/resources/MacIntegrationsBundle_uk.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.cryptomator.macos.keychain.displayName=Зв'язка ключів macOS
Empty file.
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
package org.cryptomator.macos.keychain;

import org.cryptomator.integrations.keychain.KeychainAccessProvider;
import org.cryptomator.macos.keychain.MacSystemKeychainAccess;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

import java.util.ServiceLoader;

public class KeychainAccessProviderTest {

@Test
@DisplayName("MacSystemKeychainAccess can be loaded")
public void testLoadMacSystemKeychainAccess() {
var loadedProviders = ServiceLoader.load(KeychainAccessProvider.class);
var provider = loadedProviders.stream()
.filter(p -> p.type().equals(MacSystemKeychainAccess.class))
.map(ServiceLoader.Provider::get)
.findAny();
var provider = KeychainAccessProvider.get().findAny();
Assertions.assertTrue(provider.isPresent());
Assertions.assertInstanceOf(MacSystemKeychainAccess.class, provider.get());
}

}
Loading

0 comments on commit 299a04a

Please sign in to comment.