Skip to content

Commit 1512c6e

Browse files
Set Bouncy Castle as optional feature in Gradle build
- Added bouncyCastle feature for marking Bouncy Castle libraries as optional
1 parent 4be5228 commit 1512c6e

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

build.gradle

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,19 @@ configurations.implementation.transitive = false
4949
def bouncycastleVersion = "1.80"
5050
def sshdVersion = "2.15.0"
5151

52+
java {
53+
withJavadocJar()
54+
withSourcesJar()
55+
registerFeature('bouncyCastle') {
56+
usingSourceSet(sourceSets.main)
57+
}
58+
}
59+
5260
dependencies {
5361
implementation "org.slf4j:slf4j-api:2.0.17"
54-
implementation "org.bouncycastle:bcprov-jdk18on:$bouncycastleVersion"
55-
implementation "org.bouncycastle:bcpkix-jdk18on:$bouncycastleVersion"
5662
implementation "com.hierynomus:asn-one:0.6.0"
63+
bouncyCastleImplementation "org.bouncycastle:bcprov-jdk18on:$bouncycastleVersion"
64+
bouncyCastleImplementation "org.bouncycastle:bcpkix-jdk18on:$bouncycastleVersion"
5765
}
5866

5967
license {
@@ -68,11 +76,6 @@ license {
6876
])
6977
}
7078

71-
java {
72-
withJavadocJar()
73-
withSourcesJar()
74-
}
75-
7679
if (!JavaVersion.current().isJava9Compatible()) {
7780
throw new GradleScriptException("Minimum compilation version is Java 9")
7881
}
@@ -98,6 +101,8 @@ testing {
98101
implementation "org.apache.sshd:sshd-sftp:$sshdVersion"
99102
implementation "org.apache.sshd:sshd-scp:$sshdVersion"
100103
implementation "ch.qos.logback:logback-classic:1.5.18"
104+
implementation "org.bouncycastle:bcprov-jdk18on:$bouncycastleVersion"
105+
implementation "org.bouncycastle:bcpkix-jdk18on:$bouncycastleVersion"
101106
}
102107

103108
targets {

0 commit comments

Comments
 (0)