-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
44 lines (35 loc) · 1.2 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
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.gradle.internal.os.OperatingSystem
plugins {
id 'java'
id 'application'
}
compileJava {
options.compilerArgs << "-h" << "${project.buildDir}/generated/sources/native/headers/main"
}
repositories {
jcenter()
}
dependencies {
testImplementation("junit:junit:4.12")
}
if (OperatingSystem.current().isMacOsX()) {
gradle.ext.agentPath = "libs/libheap-analyzer-native-agent.dylib"
} else if (OperatingSystem.current().isLinux()) {
gradle.ext.agentPath = "libs/libheap-analyzer-native-agent.so"
} else {
throw new StopActionException("Unsupported operating system: ${OperatingSystem.getDisplayName()}");
}
test {
testLogging.showStandardStreams(true)
testLogging.showExceptions(true)
testLogging.showCauses(true)
testLogging.showStackTraces(true)
testLogging.events(TestLogEvent.FAILED, TestLogEvent.PASSED, TestLogEvent.SKIPPED)
outputs.upToDateWhen { false }
jvmArgs "-agentpath:${project.buildDir}/${gradle.ext.agentPath}"
}
application {
mainClassName = 'net.enigma.test.toolkit.HeapAnalyzerExamples'
applicationDefaultJvmArgs = ["-agentpath:${project.buildDir}/${gradle.ext.agentPath}"]
}