forked from caoccao/Javet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
95 lines (83 loc) · 2.43 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
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
/*
* Copyright 2021. caoccao.com Sam Cao
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
plugins {
java
`java-library`
`maven-publish`
}
repositories {
mavenCentral()
}
group = "com.caoccao.javet"
version = "1.0.6"
dependencies {
testImplementation("org.eclipse.jetty.websocket:websocket-server:9.4.38.v20210224")
testImplementation("org.eclipse.jetty.websocket:javax-websocket-server-impl:9.4.38.v20210224")
testImplementation("com.fasterxml.jackson.core:jackson-databind:2.12.2")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
}
afterEvaluate {
tasks.withType(JavaCompile::class) {
options.compilerArgs.add("-Xlint:unchecked")
options.compilerArgs.add("-Xlint:deprecation")
}
}
task<Exec>("buildJNIHeaders") {
mkdir("$buildDir/generated/tmp/jni")
project.exec {
workingDir("$projectDir")
commandLine(
"javac",
"-h",
"cpp/jni",
"-d",
"$buildDir/generated/tmp/jni",
"src/main/java/com/caoccao/javet/interop/INodeNative.java",
"src/main/java/com/caoccao/javet/interop/IV8Native.java",
"src/main/java/com/caoccao/javet/interop/NodeNative.java",
"src/main/java/com/caoccao/javet/interop/V8Native.java"
)
}
}
tasks.test {
useJUnitPlatform {
excludeTags("performance")
}
}
tasks.register<Test>("performanceTest") {
useJUnitPlatform {
includeTags("performance")
}
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
tasks.withType<Test> {
systemProperty("file.encoding", "UTF-8")
}
tasks.withType<Javadoc>{
options.encoding = "UTF-8"
}
// Allow for publishing to maven local
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
}