-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
100 lines (86 loc) · 2.22 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
plugins {
id 'java'
id 'com.github.ben-manes.versions' version '0.52.0'
id 'se.patrikerdes.use-latest-versions' version '0.2.18'
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
group = 'org.perlonjava'
version = '1.0-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.ow2.asm:asm:9.7.1'
implementation 'org.ow2.asm:asm-util:9.7.1'
implementation 'com.ibm.icu:icu4j:76.1'
implementation 'com.alibaba.fastjson2:fastjson2:2.0.56'
implementation 'org.snakeyaml:snakeyaml-engine:2.9'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.12.0'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.12.0'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.12.0'
}
testing {
suites {
test {
useJUnitJupiter()
}
}
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << '-Xlint:-options'
options.compilerArgs << '-Xlint:deprecation'
}
tasks.withType(Test).configureEach {
jvmArgs += '--enable-native-access=ALL-UNNAMED'
}
allprojects {
tasks.withType(JavaExec).configureEach {
jvmArgs += '--enable-native-access=ALL-UNNAMED'
}
}
test {
useJUnitPlatform()
}
shadowJar {
archiveClassifier.set('')
destinationDirectory = file("$buildDir/../target")
manifest {
attributes 'Main-Class': 'org.perlonjava.Main'
}
exclude 'module-info.class'
exclude 'META-INF/MANIFEST.MF'
}
tasks.named('build') {
dependsOn shadowJar
}
sourceSets {
main {
resources {
srcDir 'src/main/perl'
srcDir 'src/main/resources'
include '**/*.pm'
include 'META-INF/services/**'
}
}
test {
resources {
srcDir 'src/test/resources'
}
}
}
tasks.named('processResources', Copy) {
from(sourceSets.main.resources.srcDirs) {
include '**/*.pm'
include 'META-INF/services/**'
}
into("$buildDir/resources/main")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
tasks.named('processTestResources', Copy) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}