Add stuff
This commit is contained in:
parent
f159efbc05
commit
5af42284ad
|
@ -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
|
32
build.gradle
32
build.gradle
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue