Skip to content

Commit b2a086e

Browse files
Merge pull request #2 from AllTheMods/feature/upgrade-dependencies
Version Upgrades
2 parents 8bc5416 + 9b6e981 commit b2a086e

File tree

13 files changed

+329
-436
lines changed

13 files changed

+329
-436
lines changed

.github/workflows/gradle.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This workflow will build a Java project with Gradle
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3+
4+
name: Java CI with Gradle
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
types: [ opened, synchronize, reopened ]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-20.04
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up JDK 8
18+
uses: actions/setup-java@v2
19+
with:
20+
java-version: '8'
21+
distribution: 'zulu'
22+
- name: Cache Gradle packages
23+
uses: actions/cache@v2
24+
with:
25+
path: |
26+
~/.gradle/caches
27+
~/.gradle/wrapper
28+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
29+
restore-keys: |
30+
${{ runner.os }}-gradle-
31+
- name: Grant execute permission for gradlew
32+
run: chmod +x gradlew
33+
- name: Build with Gradle
34+
run: ./gradlew build

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release Build
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-20.04
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up JDK 8
16+
uses: actions/setup-java@v2
17+
with:
18+
java-version: '8'
19+
distribution: 'zulu'
20+
- name: Grant execute permission for gradlew
21+
run: chmod +x gradlew
22+
- name: Build with Gradle
23+
run: ./gradlew build
24+
- name: Upload Release Asset
25+
id: upload-release-assets
26+
uses: alexellis/upload-assets@0.2.3
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
with:
30+
asset_paths: '["build/distributions/*.zip", "build/libs/*.jar"]'

build.gradle

Lines changed: 25 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
plugins {
22
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"
66
}
77

8-
group = 'atm.bloodworkxgaming'
9-
version = '2.1.0'
10-
11-
sourceCompatibility = 1.8
8+
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
129

1310
repositories {
1411
mavenCentral()
15-
16-
maven {
17-
name = 'DVS1'
18-
url = 'http://dvs1.progwml6.com/files/maven'
19-
}
2012
}
2113

2214
compileJava.options.encoding = 'UTF-8'
@@ -25,94 +17,45 @@ tasks.withType(JavaCompile) {
2517
options.encoding = 'UTF-8'
2618
}
2719

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)
3221

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+
}
3332

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'
4035

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'
4341

44-
compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.16.20'
42+
testImplementation 'junit:junit:4.13.2'
4543
}
4644

45+
tasks.build.dependsOn shadowJar
4746
shadowJar {
48-
classifier = ""
47+
archiveClassifier.set('')
4948
}
5049

5150
jar {
5251
manifest {
5352
attributes(
54-
'Class-Path': configurations.compile.collect { it.getName() }.join(' '),
5553
'Main-Class': 'atm.bloodworkxgaming.serverstarter.ServerStarterKt'
5654
)
5755
}
5856
}
5957

6058

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-
11659
task depsize {
11760
group = "help"
11861
doLast {

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
group=atm.bloodworkxgaming
2+
version=2.0.2
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Sat Feb 08 22:19:47 CET 2020
2-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
31
distributionBase=GRADLE_USER_HOME
42
distributionPath=wrapper/dists
5-
zipStorePath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
64
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)