mirror of
https://codeberg.org/PGPainless/cert-d-pgpainless.git
synced 2025-12-05 04:41:09 +01:00
Upgrade build system and depdencies
This commit is contained in:
parent
f061b076dc
commit
540dca6a24
11 changed files with 48 additions and 71 deletions
|
|
@ -1,6 +1,8 @@
|
||||||
pipeline:
|
steps:
|
||||||
run:
|
build:
|
||||||
image: gradle:7.5-jdk8
|
image: gradle:8.8-jdk11
|
||||||
|
when:
|
||||||
|
branch: main
|
||||||
commands:
|
commands:
|
||||||
- git checkout $CI_COMMIT_BRANCH
|
- git checkout $CI_COMMIT_BRANCH
|
||||||
# Code works
|
# Code works
|
||||||
|
|
@ -9,4 +11,6 @@ pipeline:
|
||||||
- gradle check javadocAll
|
- gradle check javadocAll
|
||||||
# Code has coverage
|
# Code has coverage
|
||||||
- gradle jacocoRootReport coveralls
|
- gradle jacocoRootReport coveralls
|
||||||
secrets: [COVERALLS_REPO_TOKEN]
|
environment:
|
||||||
|
COVERALLS_REPO_TOKEN:
|
||||||
|
from_secret: COVERALLS_REPO_TOKEN
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
# Code is licensed properly
|
# Code is licensed properly
|
||||||
# See https://reuse.software/
|
# See https://reuse.software/
|
||||||
pipeline:
|
steps:
|
||||||
reuse:
|
reuse:
|
||||||
|
when:
|
||||||
|
branch: main
|
||||||
image: fsfe/reuse:latest
|
image: fsfe/reuse:latest
|
||||||
commands:
|
commands:
|
||||||
- reuse lint
|
- reuse lint
|
||||||
27
build.gradle
27
build.gradle
|
|
@ -16,10 +16,6 @@ buildscript {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
|
||||||
id 'ru.vyarus.animalsniffer' version '1.5.3'
|
|
||||||
}
|
|
||||||
|
|
||||||
apply from: 'version.gradle'
|
apply from: 'version.gradle'
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
|
|
@ -38,7 +34,7 @@ allprojects {
|
||||||
|
|
||||||
// checkstyle
|
// checkstyle
|
||||||
checkstyle {
|
checkstyle {
|
||||||
toolVersion = '8.18'
|
toolVersion = '10.26.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
group 'org.pgpainless'
|
group 'org.pgpainless'
|
||||||
|
|
@ -65,8 +61,7 @@ allprojects {
|
||||||
isReleaseVersion = !isSnapshot
|
isReleaseVersion = !isSnapshot
|
||||||
signingRequired = !(isSnapshot || isContinuousIntegrationEnvironment)
|
signingRequired = !(isSnapshot || isContinuousIntegrationEnvironment)
|
||||||
sonatypeCredentialsAvailable = project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')
|
sonatypeCredentialsAvailable = project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')
|
||||||
sonatypeSnapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
|
sonatypeStagingUrl = 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/'
|
||||||
sonatypeStagingUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isSnapshot) {
|
if (isSnapshot) {
|
||||||
|
|
@ -83,7 +78,7 @@ allprojects {
|
||||||
}
|
}
|
||||||
|
|
||||||
jacoco {
|
jacoco {
|
||||||
toolVersion = "0.8.7"
|
toolVersion = "0.8.13"
|
||||||
}
|
}
|
||||||
|
|
||||||
jacocoTestReport {
|
jacocoTestReport {
|
||||||
|
|
@ -91,7 +86,7 @@ allprojects {
|
||||||
sourceDirectories.setFrom(project.files(sourceSets.main.allSource.srcDirs))
|
sourceDirectories.setFrom(project.files(sourceSets.main.allSource.srcDirs))
|
||||||
classDirectories.setFrom(project.files(sourceSets.main.output))
|
classDirectories.setFrom(project.files(sourceSets.main.output))
|
||||||
reports {
|
reports {
|
||||||
xml.enabled true
|
xml.required = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -109,15 +104,15 @@ subprojects {
|
||||||
apply plugin: 'signing'
|
apply plugin: 'signing'
|
||||||
|
|
||||||
task sourcesJar(type: Jar, dependsOn: classes) {
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||||
classifier = 'sources'
|
archiveClassifier = 'sources'
|
||||||
from sourceSets.main.allSource
|
from sourceSets.main.allSource
|
||||||
}
|
}
|
||||||
task javadocJar(type: Jar, dependsOn: javadoc) {
|
task javadocJar(type: Jar, dependsOn: javadoc) {
|
||||||
classifier = 'javadoc'
|
archiveClassifier = 'javadoc'
|
||||||
from javadoc.destinationDir
|
from javadoc.destinationDir
|
||||||
}
|
}
|
||||||
task testsJar(type: Jar, dependsOn: testClasses) {
|
task testsJar(type: Jar, dependsOn: testClasses) {
|
||||||
classifier = 'tests'
|
archiveClassifier = 'tests'
|
||||||
from sourceSets.test.output
|
from sourceSets.test.output
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -161,7 +156,7 @@ subprojects {
|
||||||
repositories {
|
repositories {
|
||||||
if (sonatypeCredentialsAvailable) {
|
if (sonatypeCredentialsAvailable) {
|
||||||
maven {
|
maven {
|
||||||
url isSnapshot ? sonatypeSnapshotUrl : sonatypeStagingUrl
|
url sonatypeStagingUrl
|
||||||
credentials {
|
credentials {
|
||||||
username = sonatypeUsername
|
username = sonatypeUsername
|
||||||
password = sonatypePassword
|
password = sonatypePassword
|
||||||
|
|
@ -214,7 +209,7 @@ task jacocoRootReport(type: JacocoReport) {
|
||||||
classDirectories.setFrom(files(subprojects.sourceSets.main.output))
|
classDirectories.setFrom(files(subprojects.sourceSets.main.output))
|
||||||
executionData.setFrom(files(subprojects.jacocoTestReport.executionData))
|
executionData.setFrom(files(subprojects.jacocoTestReport.executionData))
|
||||||
reports {
|
reports {
|
||||||
xml.enabled true
|
xml.required = true
|
||||||
xml.destination file("${buildDir}/reports/jacoco/test/jacocoTestReport.xml")
|
xml.destination file("${buildDir}/reports/jacoco/test/jacocoTestReport.xml")
|
||||||
}
|
}
|
||||||
// We could remove the following setOnlyIf line, but then
|
// We could remove the following setOnlyIf line, but then
|
||||||
|
|
@ -225,10 +220,6 @@ task jacocoRootReport(type: JacocoReport) {
|
||||||
}
|
}
|
||||||
|
|
||||||
task javadocAll(type: Javadoc) {
|
task javadocAll(type: Javadoc) {
|
||||||
def currentJavaVersion = JavaVersion.current()
|
|
||||||
if (currentJavaVersion.compareTo(JavaVersion.VERSION_1_9) >= 0) {
|
|
||||||
options.addStringOption("-release", "8");
|
|
||||||
}
|
|
||||||
source subprojects.collect {project ->
|
source subprojects.collect {project ->
|
||||||
project.sourceSets.main.allJava }
|
project.sourceSets.main.allJava }
|
||||||
destinationDir = new File(buildDir, 'javadoc')
|
destinationDir = new File(buildDir, 'javadoc')
|
||||||
|
|
|
||||||
|
|
@ -113,17 +113,6 @@ SPDX-License-Identifier: CC0-1.0
|
||||||
<property name="message" value="Indent must not use tab characters. Use space instead."/>
|
<property name="message" value="Indent must not use tab characters. Use space instead."/>
|
||||||
</module>
|
</module>
|
||||||
|
|
||||||
<module name="JavadocMethod">
|
|
||||||
<!-- TODO stricten those checks -->
|
|
||||||
<property name="scope" value="public"/>
|
|
||||||
<!--<property name="allowUndeclaredRTE" value="true"/>-->
|
|
||||||
<property name="allowMissingParamTags" value="true"/>
|
|
||||||
<property name="allowMissingThrowsTags" value="true"/>
|
|
||||||
<property name="allowMissingReturnTag" value="true"/>
|
|
||||||
<property name="allowMissingJavadoc" value="true"/>
|
|
||||||
<property name="suppressLoadErrors" value="true"/>
|
|
||||||
</module>
|
|
||||||
|
|
||||||
<module name="JavadocStyle">
|
<module name="JavadocStyle">
|
||||||
<property name="scope" value="public"/>
|
<property name="scope" value="public"/>
|
||||||
<property name="checkEmptyJavadoc" value="true"/>
|
<property name="checkEmptyJavadoc" value="true"/>
|
||||||
|
|
|
||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
|
@ -1,5 +1,5 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,14 @@
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'application'
|
id 'application'
|
||||||
id "com.github.johnrengelman.shadow" version "6.1.0"
|
id 'com.gradleup.shadow' version '8.3.6'
|
||||||
}
|
}
|
||||||
|
|
||||||
group 'org.pgpainless'
|
group 'org.pgpainless'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
mavenLocal()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
@ -19,7 +20,8 @@ dependencies {
|
||||||
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
|
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
implementation ("org.slf4j:slf4j-nop:$slf4jVersion")
|
// implementation ("org.slf4j:slf4j-nop:$slf4jVersion")
|
||||||
|
implementation "ch.qos.logback:logback-classic:$logbackVersion"
|
||||||
|
|
||||||
// pgp.cert.d using PGPainless
|
// pgp.cert.d using PGPainless
|
||||||
implementation project(":pgpainless-cert-d")
|
implementation project(":pgpainless-cert-d")
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ package pgp.cert_d.cli.commands;
|
||||||
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||||
import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
|
import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
|
||||||
import org.pgpainless.PGPainless;
|
import org.pgpainless.PGPainless;
|
||||||
|
import org.pgpainless.key.OpenPgpFingerprint;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.pgpainless.certificate_store.MergeCallbacks;
|
import org.pgpainless.certificate_store.MergeCallbacks;
|
||||||
|
|
@ -30,21 +31,22 @@ public class Import implements Runnable {
|
||||||
PGPPublicKeyRingCollection certificates = PGPainless.readKeyRing().publicKeyRingCollection(System.in);
|
PGPPublicKeyRingCollection certificates = PGPainless.readKeyRing().publicKeyRingCollection(System.in);
|
||||||
for (PGPPublicKeyRing cert : certificates) {
|
for (PGPPublicKeyRing cert : certificates) {
|
||||||
ByteArrayInputStream certIn = new ByteArrayInputStream(cert.getEncoded());
|
ByteArrayInputStream certIn = new ByteArrayInputStream(cert.getEncoded());
|
||||||
Certificate certificate = PGPCertDCli.getCertificateDirectory()
|
try {
|
||||||
.insert(certIn, MergeCallbacks.mergeWithExisting());
|
Certificate certificate = PGPCertDCli.getCertificateDirectory()
|
||||||
// CHECKSTYLE:OFF
|
.insert(certIn, MergeCallbacks.mergeWithExisting());
|
||||||
System.out.println(certificate.getFingerprint());
|
LOGGER.info(certificate.getFingerprint());
|
||||||
// CHECKSTYLE:ON
|
} catch (BadDataException e) {
|
||||||
|
LOGGER.error("Certificate " + OpenPgpFingerprint.of(cert) + " contains bad data.", e);
|
||||||
|
} catch (IOException e) {
|
||||||
|
LOGGER.error("IO error importing certificate " + OpenPgpFingerprint.of(cert), e);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
LOGGER.error("Thread interrupted while importing certificate " + OpenPgpFingerprint.of(cert), e);
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOGGER.error("IO-Error.", e);
|
LOGGER.error("IO-Error.", e);
|
||||||
System.exit(-1);
|
System.exit(1);
|
||||||
} catch (InterruptedException e) {
|
|
||||||
LOGGER.error("Thread interrupted.", e);
|
|
||||||
System.exit(-1);
|
|
||||||
} catch (BadDataException e) {
|
|
||||||
LOGGER.error("Certificate contains bad data.", e);
|
|
||||||
System.exit(-1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,13 @@
|
||||||
|
|
||||||
package pgp.cert_d.cli.commands;
|
package pgp.cert_d.cli.commands;
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPException;
|
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||||
import org.pgpainless.PGPainless;
|
import org.pgpainless.PGPainless;
|
||||||
import org.pgpainless.algorithm.KeyFlag;
|
import org.pgpainless.algorithm.KeyFlag;
|
||||||
import org.pgpainless.key.generation.KeyRingBuilder;
|
import org.pgpainless.key.generation.KeyRingBuilder;
|
||||||
import org.pgpainless.key.generation.KeySpec;
|
import org.pgpainless.key.generation.KeySpec;
|
||||||
import org.pgpainless.key.generation.type.KeyType;
|
import org.pgpainless.key.generation.type.KeyType;
|
||||||
import org.pgpainless.key.generation.type.eddsa.EdDSACurve;
|
import org.pgpainless.key.generation.type.eddsa_legacy.EdDSALegacyCurve;
|
||||||
import org.pgpainless.util.Passphrase;
|
import org.pgpainless.util.Passphrase;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
@ -24,8 +23,6 @@ import picocli.CommandLine;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.security.InvalidAlgorithmParameterException;
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
|
|
||||||
@CommandLine.Command(name = "setup",
|
@CommandLine.Command(name = "setup",
|
||||||
resourceBundle = "msg_setup")
|
resourceBundle = "msg_setup")
|
||||||
|
|
@ -86,12 +83,8 @@ public class Setup implements Runnable {
|
||||||
if (passphrase != null) {
|
if (passphrase != null) {
|
||||||
builder.setPassphrase(passphrase);
|
builder.setPassphrase(passphrase);
|
||||||
}
|
}
|
||||||
builder.setPrimaryKey(KeySpec.getBuilder(KeyType.EDDSA(EdDSACurve._Ed25519), KeyFlag.CERTIFY_OTHER));
|
builder.setPrimaryKey(KeySpec.getBuilder(KeyType.EDDSA_LEGACY(EdDSALegacyCurve._Ed25519), KeyFlag.CERTIFY_OTHER));
|
||||||
try {
|
|
||||||
trustRoot = builder.build();
|
trustRoot = builder.build();
|
||||||
} catch (NoSuchAlgorithmException | PGPException | InvalidAlgorithmParameterException e) {
|
|
||||||
throw new RuntimeException("Cannot generate trust-root OpenPGP key", e);
|
|
||||||
}
|
|
||||||
return trustRoot;
|
return trustRoot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,10 @@ group 'org.pgpainless'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
mavenLocal()
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'ru.vyarus.animalsniffer'
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// animal sniffer for ensuring Android API compatibility
|
|
||||||
signature "net.sf.androidscents.signature:android-api-level-${minAndroidSdk}:2.3.3_r2@signature"
|
|
||||||
|
|
||||||
// JUnit
|
// JUnit
|
||||||
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
|
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
|
||||||
|
|
@ -37,10 +34,6 @@ dependencies {
|
||||||
api "org.pgpainless:pgp-certificate-store:$pgpCertDJavaVersion"
|
api "org.pgpainless:pgp-certificate-store:$pgpCertDJavaVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
animalsniffer {
|
|
||||||
sourceSets = [sourceSets.main]
|
|
||||||
}
|
|
||||||
|
|
||||||
test {
|
test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ import org.pgpainless.certificate_store.PGPainlessCertD;
|
||||||
import org.pgpainless.key.OpenPgpFingerprint;
|
import org.pgpainless.key.OpenPgpFingerprint;
|
||||||
import org.pgpainless.key.generation.KeySpec;
|
import org.pgpainless.key.generation.KeySpec;
|
||||||
import org.pgpainless.key.generation.type.KeyType;
|
import org.pgpainless.key.generation.type.KeyType;
|
||||||
import org.pgpainless.key.generation.type.eddsa.EdDSACurve;
|
import org.pgpainless.key.generation.type.eddsa_legacy.EdDSALegacyCurve;
|
||||||
import pgp.cert_d.subkey_lookup.InMemorySubkeyLookupFactory;
|
import pgp.cert_d.subkey_lookup.InMemorySubkeyLookupFactory;
|
||||||
import pgp.certificate_store.certificate.Certificate;
|
import pgp.certificate_store.certificate.Certificate;
|
||||||
import pgp.certificate_store.certificate.KeyMaterial;
|
import pgp.certificate_store.certificate.KeyMaterial;
|
||||||
|
|
@ -94,7 +94,7 @@ public class SharedPGPCertificateDirectoryTest {
|
||||||
BadDataException, InterruptedException, BadNameException {
|
BadDataException, InterruptedException, BadNameException {
|
||||||
PGPSecretKeyRing key = PGPainless.buildKeyRing()
|
PGPSecretKeyRing key = PGPainless.buildKeyRing()
|
||||||
.addUserId("trust-root")
|
.addUserId("trust-root")
|
||||||
.setPrimaryKey(KeySpec.getBuilder(KeyType.EDDSA(EdDSACurve._Ed25519), KeyFlag.CERTIFY_OTHER))
|
.setPrimaryKey(KeySpec.getBuilder(KeyType.EDDSA_LEGACY(EdDSALegacyCurve._Ed25519), KeyFlag.CERTIFY_OTHER))
|
||||||
.build();
|
.build();
|
||||||
PGPPublicKeyRing trustRoot = PGPainless.extractCertificate(key);
|
PGPPublicKeyRing trustRoot = PGPainless.extractCertificate(key);
|
||||||
OpenPgpFingerprint fingerprint = OpenPgpFingerprint.of(trustRoot);
|
OpenPgpFingerprint fingerprint = OpenPgpFingerprint.of(trustRoot);
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,13 @@ allprojects {
|
||||||
shortVersion = '0.2.3'
|
shortVersion = '0.2.3'
|
||||||
isSnapshot = true
|
isSnapshot = true
|
||||||
minAndroidSdk = 10
|
minAndroidSdk = 10
|
||||||
javaSourceCompatibility = 1.8
|
javaSourceCompatibility = "11"
|
||||||
slf4jVersion = '1.7.36'
|
slf4jVersion = '1.7.36'
|
||||||
logbackVersion = '1.2.11'
|
logbackVersion = '1.5.13'
|
||||||
junitVersion = '5.8.2'
|
junitVersion = '5.8.2'
|
||||||
mockitoVersion = '4.5.1'
|
mockitoVersion = '4.5.1'
|
||||||
pgpainlessVersion = '1.5.6'
|
bouncyCastleVersion = '1.82'
|
||||||
|
pgpainlessVersion = '1.7.7'
|
||||||
pgpCertDJavaVersion = '0.2.2'
|
pgpCertDJavaVersion = '0.2.2'
|
||||||
picocliVersion = '4.6.3'
|
picocliVersion = '4.6.3'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue