-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
67 lines (57 loc) · 2.39 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
plugins {
id 'java'
id 'org.graalvm.buildtools.native' version "0.9.12"
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
testImplementation(group: 'org.mockito', name: 'mockito-core', version: '4.6.1')
def junitVersion = providers.gradleProperty('junit.jupiter.version')
.forUseAtConfigurationTime()
.get()
testImplementation(platform("org.junit:junit-bom:${junitVersion}"))
testImplementation('org.junit.jupiter:junit-jupiter')
testCompileOnly(group: 'org.junit.jupiter', name: 'junit-jupiter-params', version:"${junitVersion}")
}
test {
useJUnitPlatform()
}
graalvmNative {
agent {
enableExperimentalPredefinedClasses = true
}
binaries {
main {
imageName = 'TestMockito'
mainClass = 'org.example.Main'
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(17)
}
jvmArgs(
// native-image default is Xmx14G
"-Xmx2G",
"-Xms2G"
)
debug = false
verbose = false
fallback = false
}
test {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(17)
}
// Enable Mockito
buildArgs.add('--rerun-class-initialization-at-runtime=net.bytebuddy.ClassFileVersion,net.bytebuddy.utility.dispatcher.JavaDispatcher,net.bytebuddy.utility.Invoker$Dispatcher')
buildArgs.add('--initialize-at-build-time=net.bytebuddy.description.method.MethodDescription$InDefinedShape$AbstractBase$ForLoadedExecutable,net.bytebuddy.description.type.TypeDescription$AbstractBase,net.bytebuddy.description.type.TypeDescription$ForLoadedType,net.bytebuddy.description.method.MethodDescription$ForLoadedMethod,net.bytebuddy.implementation.bind.annotation.Argument$BindingMechanic,net.bytebuddy.implementation.bind.annotation.Argument$BindingMechanic$1,net.bytebuddy.implementation.bind.annotation.Argument$BindingMechanic$2,net.bytebuddy.implementation.bind.annotation.Super$Instantiation$2')
jvmArgs(
// native-image default is Xmx14G
"-Xmx2G",
"-Xms2G"
)
enableExperimentalPredefinedClasses = true
}
}
}