-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
76 lines (67 loc) · 1.89 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
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '7.1.1'
}
group 'org.definedim'
version '0.0.1'
repositories {
maven {
url 'https://maven.aliyun.com/repository/public/'
}
maven {
url 'https://maven.aliyun.com/repository/central'
}
mavenLocal()
mavenCentral()
}
dependencies {
implementation 'com.alibaba.fastjson2:fastjson2:2.0.37'
implementation 'org.apache.logging.log4j:log4j-core:2.20.0'
implementation 'org.apache.logging.log4j:log4j-api:2.20.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}
shadowJar {
manifest {
attributes(
// 运行主类的全称类名
'Main-Class': 'org.definedim.Main'
)
}
zip64 true
archiveClassifier.set('')
// 打包后的jar包文件名
archiveBaseName.set('definedim-' + version)
archiveVersion.set('')
}
test {
useJUnitPlatform()
}
def createDir = {
path ->
File dir = new File(path)
if (!dir.exists()) {
dir.mkdirs()
}
}
task buildNativeRust {
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
exec {
ExecSpec execSpec ->
executable 'cmd'
args '/c', "cd ${rootDir}\\native\\rust && cargo build"
standardOutput = out
}
ant.move file: "${rootDir}\\native\\rust\\target\\debug\\sm2_crypto.dll",
todir: "${rootDir}\\native\\"
} else {
exec {
ExecSpec execSpec ->
executable 'sh'
args '-c', "cd ${rootDir}/native/rust && cargo build"
standardOutput = out
}
ant.move file: "${rootDir}/native/rust/target/debug/libsm2_crypto.so",
todir: "${rootDir}/native/"
}
}