Skip to content

Commit

Permalink
Merge pull request #2 from AllTheMods/feature/upgrade-dependencies
Browse files Browse the repository at this point in the history
Version Upgrades
  • Loading branch information
jeremiahwinsley authored Dec 5, 2021
2 parents 8bc5416 + 9b6e981 commit b2a086e
Show file tree
Hide file tree
Showing 13 changed files with 329 additions and 436 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
push:
branches: [ master ]
pull_request:
types: [ opened, synchronize, reopened ]

jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'zulu'
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release Build

on:
push:
tags:
- 'v*'

jobs:
build:

runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'zulu'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Upload Release Asset
id: upload-release-assets
uses: alexellis/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: '["build/distributions/*.zip", "build/libs/*.jar"]'
107 changes: 25 additions & 82 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
plugins {
id 'java'
id "org.jetbrains.kotlin.jvm" version "1.2.51"
id "com.github.johnrengelman.shadow" version "2.0.4"
id "com.github.breadmoirai.github-release" version "2.2.9"
id 'distribution'
id "org.jetbrains.kotlin.jvm" version "1.4.32"
id "com.github.johnrengelman.shadow" version "6.1.0"
}

group = 'atm.bloodworkxgaming'
version = '2.1.0'

sourceCompatibility = 1.8
java.toolchain.languageVersion = JavaLanguageVersion.of(8)

repositories {
mavenCentral()

maven {
name = 'DVS1'
url = 'http://dvs1.progwml6.com/files/maven'
}
}

compileJava.options.encoding = 'UTF-8'
Expand All @@ -25,94 +17,45 @@ tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'

compile group: 'org.yaml', name: 'snakeyaml', version: '1.21'
distTar.enabled(false)

distributions {
main {
contents {
from jar
filesMatching("startserver.*") {
filter { it.replaceAll("@@serverstarter-libVersion@@", version as String) }
}
}
}
}

compile group: 'commons-io', name: 'commons-io', version: '2.6'
compile 'com.squareup.okhttp3:okhttp:3.10.0'

compile group: 'com.google.code.gson', name: 'gson', version: '2.8.4'

compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'

// https://mvnrepository.com/artifact/org.fusesource.jansi/jansi
compile group: 'org.fusesource.jansi', name: 'jansi', version: '1.17.1'
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
implementation 'org.yaml:snakeyaml:1.29'
implementation 'commons-io:commons-io:2.11.0'
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'org.fusesource.jansi:jansi:1.17.1'

compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.16.20'
testImplementation 'junit:junit:4.13.2'
}

tasks.build.dependsOn shadowJar
shadowJar {
classifier = ""
archiveClassifier.set('')
}

jar {
manifest {
attributes(
'Class-Path': configurations.compile.collect { it.getName() }.join(' '),
'Main-Class': 'atm.bloodworkxgaming.serverstarter.ServerStarterKt'
)
}
}


tasks.build.dependsOn shadowJar


task copyJar(type: Copy) {
dependsOn build

from file("$buildDir/libs/serverstarter-${version}.jar")
into file("$buildDir/dist/serverstarter-$version/")
}

task packageDist(type: Copy) {
group = "build"
dependsOn copyJar

from file("src/main/resources/startserver.bat")
from file("src/main/resources/startserver.sh")
from file("server-setup-config.yaml")
into file("$buildDir/dist/serverstarter-$version/")

filter { it.replaceAll("@@serverstarter-libVersion@@", version as String) }
}

task zipDist (type: Zip) {
dependsOn packageDist
group = "build"

from file("$buildDir/dist/serverstarter-$version/")
include '*'
include '*/**'
archiveName = "serverstarter-${version}.zip"
destinationDir = file("$buildDir/release/")
}


githubRelease {
token = getGithubKey()
owner = "Yoosk"
repo = "ServerStarter"

releaseAssets file("$buildDir/release/serverstarter-${version}.zip")
}

tasks.githubRelease.dependsOn zipDist

static String getGithubKey(){
if (new File('secrets.properties').exists()) {

Properties props = new Properties()
props.load(new FileInputStream(new File('secrets.properties')))
return props['GITHUB_TOKEN']
}

return ""
}

task depsize {
group = "help"
doLast {
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
group=atm.bloodworkxgaming
version=2.0.2
5 changes: 2 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Sat Feb 08 22:19:47 CET 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit b2a086e

Please sign in to comment.