My entire use of Packr has been a lie - it needs a JDK corresponding to the destination platform

This commit is contained in:
Yair Morgenstern 2019-11-26 23:11:00 +02:00
parent 405536beba
commit f27611710d
2 changed files with 17 additions and 3 deletions

View file

@ -1,6 +1,7 @@
language: android
dist: trusty # For oracleJDK fail errors, as per advice from https://travis-ci.community/t/error-installing-oraclejdk8-expected-feature-release-number-in-range-of-9-to-14-but-got-8/3766/6
jdk:
- oraclejdk8
@ -24,7 +25,13 @@ cache:
script:
- "./gradlew test"
- if [ -n "$TRAVIS_TAG" ]; then ./gradlew desktop:packr; fi
- if [ -n "$TRAVIS_TAG" ]; then
curl https://github.com/ojdkbuild/ojdkbuild/releases/download/java-1.8.0-openjdk-1.8.0.232-1.b09/java-1.8.0-openjdk-1.8.0.232-1.b09.ojdkbuild.windows.x86_64.zip -o jdk-windows.zip
./gradlew desktop:packrLinux32;
./gradlew desktop:packrLinux64;
./gradlew desktop:packrWindows32;
./gradlew desktop:packrWindows64;
fi
deploy:
provider: releases
@ -38,7 +45,6 @@ deploy:
- deploy/Unciv-Linux64.zip
- deploy/Unciv-Windows32.zip
- deploy/Unciv-Windows64.zip
- deploy/Unciv-MacOS.zip
on:
repo: yairm210/Unciv
tags: true

View file

@ -49,7 +49,15 @@ for(platform in PackrConfig.Platform.values()) {
def jarFile = "desktop/build/libs/${appName}.jar".toString()
PackrConfig config = new PackrConfig()
config.platform = platform
config.jdk = System.env.'JAVA_HOME' // For Travis
// For Travis
if(platform == PackrConfig.Platform.Linux32 || platform == PackrConfig.Platform.Linux64)
config.jdk = System.env.'JAVA_HOME' // take the jdk straight from the building linux computer
if(platform == PackrConfig.Platform.Windows32 || platform == PackrConfig.Platform.Windows64)
config.jdk = "jdk-windows.zip" // see how we download and name this in travis yml
// for my computer
// config.jdk = "C:/Users/LENOVO/Downloads/java-1.8.0-openjdk-1.8.0.232-1.b09.ojdkbuild.windows.x86_64.zip"
config.executable = "Unciv"
config.classpath = Arrays.asList(jarFile)