-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
58 lines (46 loc) · 1.69 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
plugins {
java
application
}
/*
Warning: This Gradle build file only exists to ease the developer experience when opening this project in an IDE. See the
extensive note in the file `settings.gradle.kts` for more information. This Gradle file is not meant to be used as an
example.
This build file will define the subproject `heterogeneous-foreign-memory/` as a Gradle project so that Intellij will
automatically recognize the source code provide a working "click the green play button to execute the program" experience.
But, importantly, this subproject still works as a standalone project without Gradle.
A good test for validating that this Gradle configuration works is to actually execute the main methods. Try it with:
* `./gradlew heterogeneous-foreign-memory:run`
A better test is to open this project in Intellij, wait for Intellij to make sense of the project, and then click the
green play buttons in the editor gutter on the "public static void main" method. The program should run.
*/
project("heterogeneous-foreign-memory") {
apply(plugin = "java")
apply(plugin = "application")
repositories {
mavenCentral()
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
sourceSets {
main {
java {
setSrcDirs(listOf("src"))
}
}
}
tasks {
withType(JavaCompile::class.java) {
options.compilerArgs.addAll(arrayOf("--enable-preview"))
}
withType<JavaExec> {
jvmArgs = listOf("--enable-preview")
}
}
application {
mainClass.set("JaggedSteppingWindowDemo")
}
}