-
Notifications
You must be signed in to change notification settings - Fork 76
/
deterministic.gradle
33 lines (29 loc) · 1.32 KB
/
deterministic.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
import static org.gradle.api.JavaVersion.VERSION_1_8
configurations {
compileClasspath { Configuration c -> deterministic(c) }
//runtimeClasspath { Configuration c -> deterministic(c) }
}
private final void deterministic(Configuration configuration) {
if (configuration.state == Configuration.State.UNRESOLVED) {
// Ensure that this module uses the deterministic Corda artifacts.
configuration.resolutionStrategy.dependencySubstitution {
substitute module("$corda_release_group:corda-serialization") with module("$corda_release_group:corda-serialization-deterministic:$corda_release_version")
substitute module("$corda_release_group:corda-core") with module("$corda_release_group:corda-core-deterministic:$corda_release_version")
}
}
}
tasks.withType(JavaCompile) {
// The DJVM only supports byte-code up to Java 8.
sourceCompatibility = VERSION_1_8
targetCompatibility = VERSION_1_8
}
tasks.withType(AbstractCompile) {
// This is a bit ugly, but Gradle isn't recognising the KotlinCompile task
// as it does the built-in JavaCompile task.
if (it.class.name.startsWith('org.jetbrains.kotlin.gradle.tasks.KotlinCompile')) {
kotlinOptions {
// The DJVM only supports byte-code up to Java 8.
jvmTarget = VERSION_1_8
}
}
}