-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
162 lines (120 loc) · 4.38 KB
/
build.gradle
File metadata and controls
162 lines (120 loc) · 4.38 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'org.db4j', name: 'kilim', version: '2.0.2'
}
}
plugins {
id 'application'
id 'org.jetbrains.kotlin.jvm' version '1.3.61' apply false
id 'io.franzbecker.gradle-lombok' version '3.3.0' apply false
}
mainClassName = ""
allprojects {
apply plugin: 'io.franzbecker.gradle-lombok'
repositories {
mavenCentral()
mavenLocal()
jcenter()
maven { url "http://repo.maven.apache.org/maven2" }
maven { url "https://repo.adobe.com/nexus/content/repositories/public/"}
maven { url "https://dl.bintray.com/dv8fromtheworld/maven" }
maven { url "https://projectlombok.org/edge-releases" }
}
lombok {
version = "1.18.12"
}
}
subprojects {
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
mavenLocal()
jcenter()
maven { url "https://repo.maven.apache.org/maven2" }
maven { url "https://repo.adobe.com/nexus/content/repositories/public/"}
maven { url "https://dl.bintray.com/dv8fromtheworld/maven" }
maven { url "https://projectlombok.org/edge-releases" }
}
dependencies {
compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.25'
compile group: 'org.slf4j', name: 'slf4j-simple', version:'1.7.25'
compile group: 'com.google.guava', name: 'guava', version:'28.1-jre'
compile group: 'com.google.code.gson', name: 'gson', version:'2.8.2'
compile group: 'io.netty', name: 'netty-all', version:'4.1.17.Final'
compile group: 'com.googlecode.json-simple', name: 'json-simple', version:'1.1.1'
testCompile 'junit:junit:4.12'
compile group: 'org.json', name: 'json', version: '20190722'
compileOnly group: 'org.projectlombok', name: 'lombok', version: 'edge-SNAPSHOT'
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: 'edge-SNAPSHOT'
// https://mvnrepository.com/artifact/com.j256.two-factor-auth/two-factor-auth
compile group: 'com.j256.two-factor-auth', name: 'two-factor-auth', version: '1.0'//
// https://mvnrepository.com/artifact/net.sf.jopt-simple/jopt-simple
compile group: 'net.sf.jopt-simple', name: 'jopt-simple', version: '5.0.4'
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = '1.8'
freeCompilerArgs += '-include-runtime'
}
}
task collectJars(type: Copy) {
into "$rootDir/build/libs/"
from "$buildDir/libs/"
}
task collectDist {
doLast {
copy {
from fileTree(dir: "$buildDir/distributions/")
into "$rootDir/build/collected/"
}
}
}
collectDist.dependsOn(assembleDist)
collectJars.dependsOn( jar )
collectJars.group = "deployment"
collectDist.group = "deployment";
}
task cleanDist(type: Delete) {
delete "$rootDir/build/collected/"
}
task jarAll {
def serverProjects = ["kronos-central-server", "kronos-server", "kronos-update-server", "kronos-server-live" ]
serverProjects.each { dependsOn("$it:jar") }
doLast {
}
}
task mergeDist {
def serverProjects = ["kronos-central-server", "kronos-server", "kronos-update-server", "kronos-server-live" ]
serverProjects.each { dependsOn("$it:distZip", "$it:collectDist") }
doLast {
fileTree("$rootDir/build/collected/").each { file ->
if (file.name.endsWith(".zip"))
copy {
from zipTree(file).matching { include "*/lib/**" include "*/bin/**"}
into "$rootDir/build/collected/unpacked"
includeEmptyDirs = false
eachFile { fcd ->
fcd.relativePath = new RelativePath(true, fcd.relativePath.segments.drop(1))
}
}
}
}
}
task zipDeploy(type: Zip) {
dependsOn(mergeDist)
from fileTree("$rootDir/build/collected/unpacked/")
include "/bin/**"
include "/lib/**"
include "/**"
archiveFileName = "deploy.zip"
destinationDirectory = file("$rootDir/build/deploy/")
}
mergeDist.dependsOn(cleanDist)
mergeDist.group = "deployment"
jarAll.group = "deployment"
zipDeploy.group = "deployment"