-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
116 lines (96 loc) · 3.25 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
buildscript {
ext {
kotlinVersion = '1.3.41'
kotlinxVersion = '1.2.2'
vertxVersion = '3.8.0'
junitJupiterEngineVersion = '5.2.0'
log4jVersion = '2.12.0'
}
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
plugins {
id 'java-library'
//id "org.jetbrains.kotlin.jvm" version "1.3.41"
id "org.jetbrains.kotlin.jvm"
//id 'com.github.johnrengelman.shadow' version '5.1.0'
id 'com.github.johnrengelman.shadow'
//id 'application'
}
repositories {
mavenLocal()
jcenter()
}
group = 'cn.foperate'
version = '0.0.2'
sourceSets {
main.kotlin.srcDirs += 'src/main/kotlin'
main.java.srcDirs += 'src/main/java'
}
application {
mainClassName = 'io.vertx.core.Launcher'
}
def mainVerticleName = 'cn.foperate.httpproxy.MainVerticle'
def watchForChange = 'src/**/*'
def doOnChange = './gradlew classes'
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxVersion"
implementation "io.vertx:vertx-core:$vertxVersion"
implementation "io.vertx:vertx-web:$vertxVersion"
implementation "io.vertx:vertx-redis-client:$vertxVersion"
implementation "io.vertx:vertx-mysql-client:$vertxVersion" // 还是技术预览状态,暂时不用
implementation "io.vertx:vertx-lang-kotlin:$vertxVersion"
implementation "io.vertx:vertx-lang-kotlin-coroutines:$vertxVersion"
compileOnly "io.vertx:vertx-codegen:$vertxVersion"
implementation "commons-codec:commons-codec:1.11"
implementation "com.google.guava:guava:27.0.1-jre"
implementation "org.apache.logging.log4j:log4j-core:$log4jVersion"
//implementation "org.apache.logging.log4j:log4j-api:2.12.0"
implementation "org.apache.logging.log4j:log4j-jul:$log4jVersion"
//implementation 'log4j:log4j:1.2.17'
implementation 'com.alibaba:fastjson:1.2.59'
implementation 'com.beust:jcommander:1.48'
testImplementation "io.vertx:vertx-junit5:$vertxVersion"
testRuntime("org.junit.jupiter:junit-jupiter-engine:$junitJupiterEngineVersion")
}
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
tasks.withType(KotlinCompile).all {
//compileKotlin {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
kotlinOptions {
jvmTarget = "1.8"
suppressWarnings = true
// apiVersion = '1.3'
// languageVersion = '1.3'
}
}
shadowJar {
classifier = 'all' // 表示在打包的最后加上all后缀
manifest {
attributes 'Main-Class': 'io.vertx.core.Launcher'
attributes 'Main-Verticle': mainVerticleName
}
mergeServiceFiles {
include 'META-INF/services/io.vertx.core.spi.VerticleFactory'
}
archiveName("proxy-all.jar")
}
test {
useJUnitPlatform()
testLogging {
events 'PASSED', 'FAILED', 'SKIPPED'
}
}
/*run {
args = ['run', mainVerticleName, "--redeploy=$watchForChange", "--launcher-class=$mainClassName", "--on-redeploy=$doOnChange"]
}*/
/*task wrapper(type: Wrapper) {
gradleVersion = "5.5.1"
}*/