Add stuff

This commit is contained in:
JFronny 2021-10-28 23:32:57 +02:00
parent f159efbc05
commit 5af42284ad
No known key found for this signature in database
GPG Key ID: BEC5ACBBD4EE17E5
2 changed files with 50 additions and 3 deletions

21
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,21 @@
image: gradle:jdk16
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
build_test:
stage: deploy
script:
- gradle --build-cache build
- cp build/libs/*-all.jar ./latest.jar
- cp build/libs/*.exe ./latest.exe
artifacts:
paths:
- build/libs
- latest.jar
- latest.exe
only:
- master

View File

@ -2,6 +2,7 @@ plugins {
id 'java'
id 'application'
id 'com.github.johnrengelman.shadow' version '7.0.0'
id "de.undercouch.download" version "4.1.1"
}
group 'io.gitlab.jfronny'
@ -44,6 +45,31 @@ dependencies {
implementation "io.github.spair:imgui-java-natives-macos:$imguiVersion"
}
test {
useJUnitPlatform()
}
class FileOutput extends DefaultTask {
@OutputFile
File output
}
def bootstrapVersion = "0.1.6"
def bootstrapArch = "i686"
task downloadBootstrap(type: Download) {
src "https://maven.fabricmc.net/net/fabricmc/fabric-installer-native-bootstrap/windows-${bootstrapArch}/${bootstrapVersion}/windows-${bootstrapArch}-${bootstrapVersion}.exe"
dest project.buildDir
}
task nativeExe(dependsOn: [downloadBootstrap], type: FileOutput) {
output = file("${projectDir}/build/libs/${archivesBaseName}-${project.version}.exe")
outputs.upToDateWhen { false }
doFirst {
output.delete()
}
doLast {
output.createNewFile()
output.setBytes downloadBootstrap.outputFiles.first().readBytes()
output.append shadowJar.archiveFile.get().getAsFile().readBytes()
}
}
build.dependsOn nativeExe