Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ plugins {

println("Environment setup:")
["BC_JDK8", "BC_JDK11", "BC_JDK17","BC_JDK21", "BC_JDK25"].each({ it ->
println("Looking for JDK ENV '${it}' found ${System.getenv(it)}");
println("Looking for JDK ENV '${it}' found ${System.getenv(it)}")
// if (System.getenv(it) == null) {
// throw new RuntimeException("Looking for JDK ENV '${it}' but found null, see README 'Environmental variables'");
// }
Expand All @@ -33,20 +33,20 @@ if (JavaVersion.current().isJava8Compatible()) {
}
}

def String deriveOSGIVersion(String prjVersion) {
String deriveOSGIVersion(String prjVersion) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either return type or def, not both ;-)

if (prjVersion.contains("-SNAPSHOT")) {
// Snapshots always extend to fourth level and terminate with time in seconds since epoch.
prjVersion = prjVersion.replace("-SNAPSHOT", "");
prjVersion = prjVersion.replace("-SNAPSHOT", "")
while (prjVersion.count(".") < 2) {
prjVersion = prjVersion + ".0";
prjVersion = prjVersion + ".0"
}
prjVersion = prjVersion + "." + System.currentTimeMillis().intdiv(1000L).intdiv(60).intdiv(60).intdiv(24);
prjVersion = prjVersion + "." + System.currentTimeMillis().intdiv(1000L).intdiv(60).intdiv(60).intdiv(24)
}
return prjVersion
}

ext {
bundle_version = deriveOSGIVersion(version.toString());
bundle_version = deriveOSGIVersion(version.toString())

// Number of parallel test forks: half the available processors (at least 1). Each test JVM is
// heavy (it re-runs the FIPS power-on self-tests on startup) and reserves a sizable heap, so
Expand All @@ -70,7 +70,7 @@ configure(allprojects.findAll {it.name != 'bom'}) {
}

dependencies {
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation 'junit:junit:4.13.2'
}
tasks.withType(JavaCompile).configureEach {
options.errorprone {
Expand Down Expand Up @@ -191,8 +191,8 @@ ext {
// unchanged: <module>-jdk18on-<version> with no debug info.
ext.releaseDebug = Boolean.parseBoolean(project.findProperty('release.debug')?.toString() ?: 'false')

JavaVersion current = JavaVersion.current();
String range;
JavaVersion current = JavaVersion.current()
String range
if (current.compareTo(JavaVersion.VERSION_1_8) <= 0) {
range = 'jdk15to18'
} else {
Expand All @@ -207,18 +207,18 @@ configure(subprojects.findAll {it.name != 'bom'}) {
apply plugin: 'maven-publish'


JavaVersion current = JavaVersion.current();
int releaseVersion = 8;
JavaVersion current = JavaVersion.current()
int releaseVersion = 8
if (current.compareTo(JavaVersion.VERSION_1_8) <= 0) {
releaseVersion = 5
}

compileJava {
options.release = releaseVersion;
options.release = releaseVersion
}

compileTestJava {
options.release = 8;
options.release = 8
}


Expand All @@ -236,8 +236,8 @@ configure(subprojects.findAll {it.name != 'bom'}) {
}

test {
forkEvery = 1;
maxParallelForks = 1;
forkEvery = 1
maxParallelForks = 1
maxHeapSize = "1536m"
testLogging.showStandardStreams = false

Expand Down Expand Up @@ -266,8 +266,8 @@ configure(subprojects.findAll {it.name != 'bom'}) {
}

checkstyle {
configFile = file("$rootDir/config/checkstyle/checkstyle.xml");
toolVersion = '14.0.0'; // your choice here
configFile = file("$rootDir/config/checkstyle/checkstyle.xml")
toolVersion = '14.0.0' // your choice here
sourceSets = [project.sourceSets.main]
}

Expand Down Expand Up @@ -307,7 +307,7 @@ configure(subprojects.findAll {it.name != 'bom'}) {
}

tasks.withType(JavaCompile).configureEach {
options.debug = releaseDebug;
options.debug = releaseDebug
}

tasks.withType(Test).configureEach {
Expand Down
14 changes: 5 additions & 9 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apply plugin: 'application'

dependencies {
implementation group: 'org.openjdk.jmh', name: 'jmh-core', version: '1.33'
annotationProcessor group: 'org.openjdk.jmh', name: 'jmh-generator-annprocess', version: '1.33'
implementation 'org.openjdk.jmh:jmh-core:1.33'
annotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.33'
}
application {
mainClass.set("org.bouncycastle.crypto.fpe.SP80038GMicroBenchmark")
Expand All @@ -14,8 +14,8 @@ test {
minHeapSize = "512m"
maxHeapSize = "8192m"

maxParallelForks = rootProject.ext.calcTestForks();
forkEvery = 1;
maxParallelForks = rootProject.ext.calcTestForks()
forkEvery = 1

jvmArgs = ['-Dtest.java.version.prefix=any']
}
Expand Down Expand Up @@ -104,11 +104,7 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
}

artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
assemble.dependsOn javadocJar, sourcesJar

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that jar was already part of assemble, so it does not need to be added here


publishing {
publications {
Expand Down
20 changes: 8 additions & 12 deletions jmail/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

plugins {
id "biz.aQute.bnd.builder" version "7.1.0"
id "biz.aQute.bnd.builder" version "7.2.3"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the old plugin caused Gradle deprecation warnings itself; fixed in 7.2.x so I bumped to newest 7.2.x release
note that 7.5.0 is already available, so this could be bumped further (not tested)

}

jar.archiveBaseName = "bcjmail-$vmrange"
Expand Down Expand Up @@ -31,12 +31,12 @@ dependencies {
implementation project(':util')
implementation project(':pkix')

implementation group: 'jakarta.mail', name: 'jakarta.mail-api', version: '2.0.1'
implementation group: 'jakarta.activation', name: 'jakarta.activation-api', version: '2.0.0'
implementation 'jakarta.mail:jakarta.mail-api:2.0.1'
implementation 'jakarta.activation:jakarta.activation-api:2.0.0'
// the same two as modules ("jakarta.mail", "jakarta.activation") for the module-info.java compile,
// resolved by coordinate so the path follows a version bump rather than naming a file under libs/.
jakartaModulePath group: 'jakarta.mail', name: 'jakarta.mail-api', version: '2.0.1'
jakartaModulePath group: 'jakarta.activation', name: 'jakarta.activation-api', version: '2.0.0'
jakartaModulePath 'jakarta.mail:jakarta.mail-api:2.0.1'
jakartaModulePath 'jakarta.activation:jakarta.activation-api:2.0.0'

java9Implementation files(sourceSets.main.output.classesDirs) {
builtBy compileJava
Expand Down Expand Up @@ -122,15 +122,11 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
}

artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
assemble.dependsOn javadocJar, sourcesJar

test {
forkEvery = 1;
maxParallelForks = 8;
forkEvery = 1
maxParallelForks = 8
}

compileJava9Java.dependsOn([":prov:jar", ":util:jar",":pkix:jar"])
Expand Down
16 changes: 6 additions & 10 deletions mail/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "biz.aQute.bnd.builder" version "7.1.0"
id "biz.aQute.bnd.builder" version "7.2.3"
}

jar.archiveBaseName = "bcmail-$vmrange"
Expand All @@ -21,11 +21,11 @@ dependencies {
implementation project(':util')
implementation project(':pkix')

implementation group: 'javax.mail', name: 'mail', version: '1.4'
implementation 'javax.mail:mail:1.4'
// javax.mail:mail:1.4 pulls in javax.activation:activation:1.1 transitively - both are
// needed as automatic modules ("mail", "activation") on the module-info.java compile path,
// since neither javax.mail nor javax.activation is a JDK-bundled module on Java 11+.
mailModulePath group: 'javax.mail', name: 'mail', version: '1.4'
mailModulePath 'javax.mail:mail:1.4'

java9Implementation files(sourceSets.main.output.classesDirs) {
builtBy compileJava
Expand Down Expand Up @@ -121,15 +121,11 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
}

artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
assemble.dependsOn javadocJar, sourcesJar

test {
forkEvery = 1;
maxParallelForks = 8;
forkEvery = 1
maxParallelForks = 8
jvmArgs = ['-Dtest.java.version.prefix=any']
}

Expand Down
16 changes: 4 additions & 12 deletions misc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ plugins {
// published mls module because it is a test tool for the RFC 9420 interoperability runner,
// not library API: shipping it in bcmls put classes needing io.grpc and com.google.protobuf
// into a published jar whose POM and OSGi manifest declared neither.
id 'com.google.protobuf' version '0.9.4'
// 0.9.6 stops using the multi-string dependency notation Gradle 9.1 deprecated.
id 'com.google.protobuf' version '0.9.6'
}

apply plugin: 'com.google.protobuf'
Expand All @@ -24,15 +25,6 @@ def protocVersion = '3.25.9'

jar.archiveBaseName = "bcmisc-$vmrange"

sourceSets {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since 0.9.5, the protobuf plugin writes to a different folder
since the plugin registers its srcDirs on its own, this section is not needed anyway

main {
java {
srcDirs 'build/generated/source/proto/main/grpc'
srcDirs 'build/generated/source/proto/main/java'
}
}
}

dependencies {
implementation project(':prov')
implementation project(':util')
Expand All @@ -42,7 +34,7 @@ dependencies {
implementation project(':tls')
implementation project(':mls')

implementation group: 'javax.mail', name: 'mail', version: '1.4'
implementation 'javax.mail:mail:1.4'

// The MLS interop harness only, and by coordinate rather than as hand-placed jars under
// test/libs, which were invisible both to Dependabot (see the note on files()/fileTree()
Expand All @@ -62,7 +54,7 @@ dependencies {
// via their main() methods; they need JUnit and the same javax.mail runtime
// as the examples themselves. PrintTestResult is carried as a per-module
// test copy under src/test (as every other module does).
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation 'junit:junit:4.13.2'
}

protobuf {
Expand Down
8 changes: 2 additions & 6 deletions mls/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

plugins {
// OSGI
id "biz.aQute.bnd.builder" version "7.1.0"
id "biz.aQute.bnd.builder" version "7.2.3"
// Generate IntelliJ IDEA's .idea & .iml project files
// id 'idea'
}
Expand Down Expand Up @@ -97,11 +97,7 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
}

artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
assemble.dependsOn javadocJar, sourcesJar

test {
jvmArgs = ['-Dtest.java.version.prefix=any']
Expand Down
16 changes: 6 additions & 10 deletions pg/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

plugins {
id "biz.aQute.bnd.builder" version "7.1.0"
id "biz.aQute.bnd.builder" version "7.2.3"
}

sourceSets {
Expand All @@ -22,7 +22,7 @@ dependencies {
builtBy compileJava
}

testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation 'junit:junit:4.13.2'
}

evaluationDependsOn(":prov")
Expand Down Expand Up @@ -133,16 +133,12 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
}

artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
assemble.dependsOn javadocJar, sourcesJar

test {
forkEvery = 1;
maxParallelForks = 8;
maxHeapSize = "3g";
forkEvery = 1
maxParallelForks = 8
maxHeapSize = "3g"
jvmArgs = ['-Dtest.java.version.prefix=any']
}

Expand Down
24 changes: 10 additions & 14 deletions pgsc/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

plugins {
id "biz.aQute.bnd.builder" version "7.1.0"
id "biz.aQute.bnd.builder" version "7.2.3"
}

sourceSets {
Expand Down Expand Up @@ -30,12 +30,12 @@ dependencies {
// without YubiKit; an application that wants the YubiKey backend adds
// com.yubico.yubikit:openpgp and com.yubico.yubikit:desktop
// to its own classpath, and gets a NoClassDefFoundError from the yubikey package if it does not.
compileOnly group: 'com.yubico.yubikit', name: 'openpgp', version: '3.2.0'
compileOnly group: 'com.yubico.yubikit', name: 'desktop', version: '3.2.0'
compileOnly 'com.yubico.yubikit:openpgp:3.2.0'
compileOnly 'com.yubico.yubikit:desktop:3.2.0'

testImplementation group: 'com.yubico.yubikit', name: 'openpgp', version: '3.2.0'
testImplementation group: 'com.yubico.yubikit', name: 'desktop', version: '3.2.0'
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation 'com.yubico.yubikit:openpgp:3.2.0'
testImplementation 'com.yubico.yubikit:desktop:3.2.0'
testImplementation 'junit:junit:4.13.2'
}

evaluationDependsOn(":core")
Expand Down Expand Up @@ -106,16 +106,12 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
}

artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
assemble.dependsOn javadocJar, sourcesJar

test {
forkEvery = 1;
maxParallelForks = 8;
maxHeapSize = "3g";
forkEvery = 1
maxParallelForks = 8
maxHeapSize = "3g"
jvmArgs = ['-Dtest.java.version.prefix=any']
}

Expand Down
Loading