1
1
plugins {
2
2
id ' java'
3
- id " org.jetbrains.kotlin.jvm " version " 1.2.51 "
4
- id " com.github.johnrengelman.shadow " version " 2.0.4 "
5
- id " com.github.breadmoirai.github-release " version " 2.2.9 "
3
+ id ' distribution '
4
+ id " org.jetbrains.kotlin.jvm " version " 1.4.32 "
5
+ id " com.github.johnrengelman.shadow " version " 6.1.0 "
6
6
}
7
7
8
- group = ' atm.bloodworkxgaming'
9
- version = ' 2.1.0'
10
-
11
- sourceCompatibility = 1.8
8
+ java. toolchain. languageVersion = JavaLanguageVersion . of(8 )
12
9
13
10
repositories {
14
11
mavenCentral()
15
-
16
- maven {
17
- name = ' DVS1'
18
- url = ' http://dvs1.progwml6.com/files/maven'
19
- }
20
12
}
21
13
22
14
compileJava. options. encoding = ' UTF-8'
@@ -25,94 +17,45 @@ tasks.withType(JavaCompile) {
25
17
options. encoding = ' UTF-8'
26
18
}
27
19
28
- dependencies {
29
- testCompile group : ' junit' , name : ' junit' , version : ' 4.12'
30
-
31
- compile group : ' org.yaml' , name : ' snakeyaml' , version : ' 1.21'
20
+ distTar. enabled(false )
32
21
22
+ distributions {
23
+ main {
24
+ contents {
25
+ from jar
26
+ filesMatching(" startserver.*" ) {
27
+ filter { it. replaceAll(" @@serverstarter-libVersion@@" , version as String ) }
28
+ }
29
+ }
30
+ }
31
+ }
33
32
34
- compile group : ' commons-io' , name : ' commons-io' , version : ' 2.6'
35
- compile ' com.squareup.okhttp3:okhttp:3.10.0'
36
-
37
- compile group : ' com.google.code.gson' , name : ' gson' , version : ' 2.8.4'
38
-
39
- compile(" org.jetbrains.kotlin:kotlin-stdlib-jdk8" )
33
+ dependencies {
34
+ implementation ' org.jetbrains.kotlin:kotlin-stdlib-jdk8'
40
35
41
- // https://mvnrepository.com/artifact/org.fusesource.jansi/jansi
42
- compile group : ' org.fusesource.jansi' , name : ' jansi' , version : ' 1.17.1'
36
+ implementation ' com.squareup.okhttp3:okhttp:4.9.3'
37
+ implementation ' org.yaml:snakeyaml:1.29'
38
+ implementation ' commons-io:commons-io:2.11.0'
39
+ implementation ' com.google.code.gson:gson:2.8.9'
40
+ implementation ' org.fusesource.jansi:jansi:1.17.1'
43
41
44
- compileOnly group : ' org.projectlombok ' , name : ' lombok ' , version : ' 1.16.20 '
42
+ testImplementation ' junit:junit:4.13.2 '
45
43
}
46
44
45
+ tasks. build. dependsOn shadowJar
47
46
shadowJar {
48
- classifier = " "
47
+ archiveClassifier . set( ' ' )
49
48
}
50
49
51
50
jar {
52
51
manifest {
53
52
attributes(
54
- ' Class-Path' : configurations. compile. collect { it. getName() }. join(' ' ),
55
53
' Main-Class' : ' atm.bloodworkxgaming.serverstarter.ServerStarterKt'
56
54
)
57
55
}
58
56
}
59
57
60
58
61
- tasks. build. dependsOn shadowJar
62
-
63
-
64
- task copyJar (type : Copy ) {
65
- dependsOn build
66
-
67
- from file(" $buildDir /libs/serverstarter-${ version} .jar" )
68
- into file(" $buildDir /dist/serverstarter-$version /" )
69
- }
70
-
71
- task packageDist (type : Copy ) {
72
- group = " build"
73
- dependsOn copyJar
74
-
75
- from file(" src/main/resources/startserver.bat" )
76
- from file(" src/main/resources/startserver.sh" )
77
- from file(" server-setup-config.yaml" )
78
- into file(" $buildDir /dist/serverstarter-$version /" )
79
-
80
- filter { it. replaceAll(" @@serverstarter-libVersion@@" , version as String ) }
81
- }
82
-
83
- task zipDist (type : Zip ) {
84
- dependsOn packageDist
85
- group = " build"
86
-
87
- from file(" $buildDir /dist/serverstarter-$version /" )
88
- include ' *'
89
- include ' */**'
90
- archiveName = " serverstarter-${ version} .zip"
91
- destinationDir = file(" $buildDir /release/" )
92
- }
93
-
94
-
95
- githubRelease {
96
- token = getGithubKey()
97
- owner = " Yoosk"
98
- repo = " ServerStarter"
99
-
100
- releaseAssets file(" $buildDir /release/serverstarter-${ version} .zip" )
101
- }
102
-
103
- tasks. githubRelease. dependsOn zipDist
104
-
105
- static String getGithubKey (){
106
- if (new File (' secrets.properties' ). exists()) {
107
-
108
- Properties props = new Properties ()
109
- props. load(new FileInputStream (new File (' secrets.properties' )))
110
- return props[' GITHUB_TOKEN' ]
111
- }
112
-
113
- return " "
114
- }
115
-
116
59
task depsize {
117
60
group = " help"
118
61
doLast {
0 commit comments