forked from bcgit/bc-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
98 lines (78 loc) · 2.4 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
plugins {
id "biz.aQute.bnd.builder" version "7.0.0"
}
sourceSets {
java9 {
java {
srcDirs = ['src/main/jdk1.9']
}
}
}
dependencies {
implementation project(':core')
implementation project(':prov')
implementation project(':util')
java9Implementation project(':prov')
java9Implementation project(':util')
java9Implementation files(sourceSets.main.output.classesDirs) {
builtBy compileJava
}
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
}
compileJava {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(17)
}
targetCompatibility = 1.8;
sourceCompatibility = 1.8;
}
compileJava9Java {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(17)
}
sourceCompatibility = 9
targetCompatibility = 9
options.compilerArgs += [
'--module-path', "${bc_prov}${File.pathSeparator}${bc_util}"
]
options.sourcepath = files(['src/main/java', 'src/main/jdk1.9'])
}
jar.archiveBaseName = "bcpg-$vmrange"
task sourcesJar(type: Jar) {
archiveBaseName = jar.archiveBaseName
archiveClassifier = 'sources'
from sourceSets.main.allSource
exclude("**/*.so")
into('META-INF/versions/9') {
from sourceSets.java9.allSource
}
}
jar {
from sourceSets.main.output
into('META-INF/versions/9') {
from sourceSets.java9.output
}
String v = "${rootProject.extensions.ext.bundle_version}"
manifest.attributes('Multi-Release': 'true')
manifest.attributes('Bundle-RequiredExecutionEnvironment': 'JavaSE-1.8')
manifest.attributes('Bundle-Name': 'bcpg')
manifest.attributes('Bundle-SymbolicName': 'bcpg')
manifest.attributes('Export-Package': "org.bouncycastle.{apache|bcpg|gpg|openpgp}.*;version=${v}")
manifest.attributes('Import-Package': "java.*;resolution:=optional,javax.*;resolution:=optional,!org.bouncycastle.{apache|bcpg|gpg|openpgp|}.*,org.bouncycastle.*;version=\"[${v},${maxVersion})\"")
manifest.attributes('Bundle-Version': "${v}")
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveBaseName = jar.archiveBaseName
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
test {
forkEvery = 1;
maxParallelForks = 8;
maxHeapSize = "3g";
}