-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
85 lines (74 loc) · 2.13 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
plugins {
id 'com.github.johnrengelman.shadow' version '5.1.0'
id "application"
id "idea"
id 'org.jetbrains.kotlin.jvm' version '1.5.31'
}
group 'io.vproxy'
version loadVersion()
mainClassName = 'io.vproxy.vpss.Main'
shadowJar {
archiveName = 'vpss.jar'
}
jar {
manifest {
attributes 'Main-Class': mainClassName
}
}
sourceCompatibility = 11.0
targetCompatibility = 11.0
compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"
compileKotlin {
kotlinOptions {
jvmTarget = '11'
freeCompilerArgs += '-Xjvm-default=enable'
freeCompilerArgs += '-Xassertions=jvm'
}
destinationDir = compileJava.destinationDir
}
compileTestKotlin {
kotlinOptions {
jvmTarget = '11'
freeCompilerArgs += '-Xjvm-default=enable'
}
}
compileJava {
doFirst {
options.compilerArgs << '--module-path' << classpath.asPath
}
options.compilerArgs << '--add-modules' << [
'io.vproxy.app',
'io.vproxy.core',
'io.vproxy.lib',
'io.vproxy.base',
'kotlin.stdlib',
'kotlinx.coroutines.core.jvm',
].join(',')
}
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://s01.oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: '1.5.31'
implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core-jvm', version: '1.5.2'
compileOnly group: 'io.vproxy', name: 'vproxy-all', version: 'MAVEN-LOCAL'
runtimeOnly files('./vproxy-no-kt-runtime.jar')
}
def loadVersion() {
def PREFIX = "const val VERSION = \""
def SUFFIX = "\" // _THE_VERSION_"
def ver = file(projectDir.getAbsolutePath() + "/src/main/kotlin/io/vproxy/vpss/util/Consts.kt")
def lines = ver.getText().split("\n")
for (def line : lines) {
line = line.trim()
if (line.startsWith(PREFIX) && line.endsWith(SUFFIX)) {
return line.substring(PREFIX.length(), line.length() - SUFFIX.length())
}
}
return "unknown"
}