mirror of
https://codeberg.org/PGPainless/cert-d-java.git
synced 2024-12-22 05:37:58 +01:00
Apply changes to build scripts and ensure android API 10 compat for non-sqlite modules
This commit is contained in:
parent
67403d9201
commit
7b297d5fb5
6 changed files with 50 additions and 30 deletions
27
build.gradle
27
build.gradle
|
@ -37,18 +37,6 @@ allprojects {
|
|||
onlyIf { !sourceSets.main.allSource.files.isEmpty() }
|
||||
}
|
||||
|
||||
// For library modules, enable android api compatibility check
|
||||
if (it.name != 'cli') {
|
||||
// animalsniffer
|
||||
apply plugin: 'ru.vyarus.animalsniffer'
|
||||
dependencies {
|
||||
signature "net.sf.androidscents.signature:android-api-level-${minAndroidSdk}:2.3.3_r2@signature"
|
||||
}
|
||||
animalsniffer {
|
||||
sourceSets = [sourceSets.main]
|
||||
}
|
||||
}
|
||||
|
||||
// checkstyle
|
||||
checkstyle {
|
||||
toolVersion = '8.18'
|
||||
|
@ -74,7 +62,6 @@ allprojects {
|
|||
slf4jVersion = '1.7.32'
|
||||
logbackVersion = '1.2.9'
|
||||
junitVersion = '5.8.2'
|
||||
sopJavaVersion = '1.2.0'
|
||||
rootConfigDir = new File(rootDir, 'config')
|
||||
gitCommit = getGitCommit()
|
||||
isContinuousIntegrationEnvironment = Boolean.parseBoolean(System.getenv('CI'))
|
||||
|
@ -145,15 +132,15 @@ subprojects {
|
|||
artifact javadocJar
|
||||
artifact testsJar
|
||||
pom {
|
||||
name = 'PGPainless'
|
||||
description = 'Simple to use OpenPGP API for Java based on Bouncycastle'
|
||||
url = 'https://github.com/pgpainless/pgpainless'
|
||||
inceptionYear = '2018'
|
||||
name = 'Cert-D-Java'
|
||||
description = 'Shared PGP Certificate Directory for Java'
|
||||
url = 'https://github.com/pgpainless/cert-d-java'
|
||||
inceptionYear = '2022'
|
||||
|
||||
scm {
|
||||
url = 'https://github.com/pgpainless/pgpainless'
|
||||
connection = 'scm:https://github.com/pgpainless/pgpainless'
|
||||
developerConnection = 'scm:git://github.com/pgpainless/pgpainless.git'
|
||||
url = 'https://github.com/pgpainless/cert-d-java'
|
||||
connection = 'scm:https://github.com/pgpainless/cert-d-java'
|
||||
developerConnection = 'scm:git://github.com/pgpainless/cert-d-java.git'
|
||||
}
|
||||
|
||||
licenses {
|
||||
|
|
|
@ -12,7 +12,12 @@ repositories {
|
|||
mavenCentral()
|
||||
}
|
||||
|
||||
apply plugin: 'ru.vyarus.animalsniffer'
|
||||
|
||||
dependencies {
|
||||
// animal sniffer
|
||||
signature "net.sf.androidscents.signature:android-api-level-${minAndroidSdk}:2.3.3_r2@signature"
|
||||
|
||||
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
|
||||
testImplementation "org.junit.jupiter:junit-jupiter-params:$junitVersion"
|
||||
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
|
||||
|
@ -25,6 +30,10 @@ dependencies {
|
|||
api project(":pgp-certificate-store")
|
||||
}
|
||||
|
||||
animalsniffer {
|
||||
sourceSets = [sourceSets.main]
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
package pgp.cert_d;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
public class BaseDirectoryProvider {
|
||||
|
||||
|
@ -26,21 +25,38 @@ public class BaseDirectoryProvider {
|
|||
String STORE_NAME = "pgp.cert.d";
|
||||
if (osName.contains("win")) {
|
||||
// %APPDATA%\Roaming\pgp.cert.d
|
||||
return Paths.get(System.getenv("APPDATA"), "Roaming", STORE_NAME).toFile();
|
||||
String app_data = System.getenv("APPDATA");
|
||||
if (app_data == null) {
|
||||
throw new AssertionError("Cannot determine APPDATA directory.");
|
||||
}
|
||||
File roaming = new File(app_data, "Roaming");
|
||||
return new File(roaming, STORE_NAME);
|
||||
}
|
||||
|
||||
if (osName.contains("nux")) {
|
||||
// $XDG_DATA_HOME/pgp.cert.d
|
||||
String xdg_data_home = System.getenv("XDG_DATA_HOME");
|
||||
if (xdg_data_home != null) {
|
||||
return Paths.get(xdg_data_home, STORE_NAME).toFile();
|
||||
return new File(xdg_data_home, STORE_NAME);
|
||||
}
|
||||
String user_home = System.getProperty("user.home");
|
||||
if (user_home == null) {
|
||||
throw new AssertionError("Cannot determine user.home directory.");
|
||||
}
|
||||
// $HOME/.local/share/pgp.cert.d
|
||||
return Paths.get(System.getProperty("user.home"), ".local", "share", STORE_NAME).toFile();
|
||||
File local = new File(user_home, ".local");
|
||||
File share = new File(local, "share");
|
||||
return new File(share, STORE_NAME);
|
||||
}
|
||||
|
||||
if (osName.contains("mac")) {
|
||||
return Paths.get(System.getenv("HOME"), "Library", "Application Support", STORE_NAME).toFile();
|
||||
String home = System.getenv("HOME");
|
||||
if (home == null) {
|
||||
throw new AssertionError("Cannot determine HOME directory.");
|
||||
}
|
||||
File library = new File(home, "Library");
|
||||
File applicationSupport = new File(library, "Application Support");
|
||||
return new File(applicationSupport, STORE_NAME);
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("Unknown OS " + osName);
|
||||
|
|
|
@ -12,7 +12,12 @@ repositories {
|
|||
mavenCentral()
|
||||
}
|
||||
|
||||
apply plugin: 'ru.vyarus.animalsniffer'
|
||||
|
||||
dependencies {
|
||||
// animal sniffer
|
||||
signature "net.sf.androidscents.signature:android-api-level-${minAndroidSdk}:2.3.3_r2@signature"
|
||||
|
||||
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
|
||||
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
|
||||
|
||||
|
@ -21,6 +26,10 @@ dependencies {
|
|||
testImplementation "ch.qos.logback:logback-classic:$logbackVersion"
|
||||
}
|
||||
|
||||
animalsniffer {
|
||||
sourceSets = [sourceSets.main]
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
rootProject.name = 'cert-d-java'
|
||||
|
||||
include 'pgpainless-core',
|
||||
'pgpainless-sop',
|
||||
'pgpainless-cli'
|
||||
include 'pgp-cert-d-java',
|
||||
'pgp-cert-d-java-jdbc-sqlite-lookup',
|
||||
'pgp-certificate-store'
|
||||
|
||||
|
|
|
@ -4,10 +4,9 @@
|
|||
|
||||
allprojects {
|
||||
ext {
|
||||
shortVersion = '1.1.2'
|
||||
shortVersion = '0.1.0'
|
||||
isSnapshot = true
|
||||
minAndroidSdk = 10
|
||||
javaSourceCompatibility = 1.8
|
||||
bouncyCastleVersion = '1.70'
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue