forked from JohnLCaron/egk-ec-mixnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
103 lines (90 loc) · 2.96 KB
/
build.gradle.kts
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
98
99
100
101
102
103
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.9.22"
application
alias(libs.plugins.serialization)
}
group = "org.cryptobiotic"
version = "2.1-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
implementation(files("libs/egk-ec-2.1-SNAPSHOT.jar"))
implementation(files("libs/verificatum-vecj-2.2.0.jar"))
implementation(libs.bundles.eglib)
// implementation(libs.bundles.xmlutil)
implementation(libs.bundles.logging)
testImplementation("org.jetbrains.kotlin:kotlin-test")
}
///// LOOK
tasks {
val ENABLE_PREVIEW = "--enable-preview"
withType<JavaCompile>() {
options.compilerArgs.add(ENABLE_PREVIEW)
// Optionally we can show which preview feature we use.
options.compilerArgs.add("-Xlint:preview")
// options.compilerArgs.add("--enable-native-access=org.openjdk.jextract")
// Explicitly setting compiler option --release
// is needed when we wouldn't set the
// sourceCompatiblity and targetCompatibility
// properties of the Java plugin extension.
options.release.set(17)
}
withType<Test>().all {
useJUnitPlatform()
minHeapSize = "512m"
maxHeapSize = "8g"
jvmArgs = listOf("-Xss128m", "--enable-preview")
// Make tests run in parallel
// More info: https://www.jvt.me/posts/2021/03/11/gradle-speed-parallel/
systemProperties["junit.jupiter.execution.parallel.enabled"] = "true"
systemProperties["junit.jupiter.execution.parallel.mode.default"] = "concurrent"
systemProperties["junit.jupiter.execution.parallel.mode.classes.default"] = "concurrent"
}
withType<JavaExec>().all {
jvmArgs("--enable-preview")
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "17"
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
kotlin {
jvmToolchain(17)
}
tasks.test {
useJUnitPlatform()
}
tasks.register<Jar>("uberJar") {
archiveClassifier = "uber"
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes("Main-Class" to "org.cryptobiotic.mixnet.RunVerifier")
}
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
})
}
/*
tasks.register("fatJar", Jar::class.java) {
archiveClassifier.set("all")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveBaseName = "egkmixnet"
manifest {
attributes("Main-Class" to "org.cryptobiotic.mixnet.RunVerifier")
}
from(configurations.runtimeClasspath.get()
.onEach { println("add from runtimeClasspath: ${it.name}") }
.map { if (it.isDirectory) it else zipTree(it) })
val sourcesMain = sourceSets.main.get()
sourcesMain.allSource.forEach { println("add from sources: ${it.name}") }
from(sourcesMain.output)
}
*/