-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
126 lines (110 loc) · 2.94 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
plugins {
id 'java'
id 'java-library'
id 'maven-publish'
id "org.jetbrains.kotlin.jvm" version "1.4.31"
}
group 'parspice'
version '1.0'
repositories {
mavenCentral()
}
sourceSets {
bench {
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
benchImplementation files("${System.getenv("JNISPICE_ROOT")}/src/JNISpice/")
benchImplementation group: 'org.apache.commons', name: 'commons-math3', version: '3.0'
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'parspice'
from components.java
}
}
}
task testJar(type: Jar, dependsOn: classes) {
manifest {
attributes 'Implementation-Title': 'ParSPICE Testing Jar'
}
archiveBaseName.set("testing")
archiveVersion.set("")
from {
sourceSets.test.output
}
from {
configurations.testCompileClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
duplicatesStrategy DuplicatesStrategy.INCLUDE
with jar
}
tasks.test.dependsOn(tasks.testJar)
test {
useJUnitPlatform()
}
compileBenchKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
doFirst {
if (System.getenv("JNISPICE_ROOT") == null) {
println "Please set JNISPICE_ROOT environment variable"
throw new IOException("JNISPICE_ROOT was null")
}
}
}
task benchJar(type: Jar, dependsOn: classes) {
manifest {
attributes 'Implementation-Title': 'ParSPICE Benchmarking Jar'
}
archiveBaseName.set("bench")
archiveVersion.set("")
from {
sourceSets.bench.output
}
from {
configurations.benchCompileClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
duplicatesStrategy DuplicatesStrategy.INCLUDE
with jar
}
task runBenchmark(type: JavaExec, dependsOn: benchJar) {
description = "Run the benchmarking jar"
classpath = files(tasks.benchJar)
main = "parspiceBench.BenchmarkKt"
onlyIf {
tasks.benchJar.didWork || !file("benchmark_log.csv").exists()
}
}
task benchmark(type: JavaExec, dependsOn: runBenchmark) {
description = "Performs simple regression on benchmark data"
classpath = files(tasks.benchJar)
main = "parspiceBench.AnalysisKt"
}
clean {
delete "benchmark_log.csv"
}
task printInfo() {
doFirst {
println "Configurations:"
configurations.each { conf ->
println conf.name
}
println ""
}
doLast{
println "Source Sets:"
sourceSets.each { srcSet ->
println "["+srcSet.name+"]"
print "-->Source directories: "+srcSet.allJava.srcDirs+"\n"
print "-->Output directories: "+srcSet.output.classesDirs.files+"\n"
println ""
}
}
}