Sfoglia il codice sorgente

Download the JDK binaries but don't process them in anyway

Toni Helenius 2 settimane fa
parent
commit
3acbb06bee

+ 2 - 5
.gitignore

@@ -24,9 +24,6 @@ build/*
 netbeans/*
 */nbproject/private/*
 ant-jme/dist
-jdks/local/*
-jdks/*.bin
-jdks/*.exe
-jdks/*.zip
 dist/
-/.nb-gradle/
+/.nb-gradle/
+jdks/downloads/

+ 0 - 8
jdks/build-osx-zip.sh

@@ -1,8 +0,0 @@
-#!/bin/sh
-#(c) jmonkeyengine.org
-#Author Normen Hansen
-set -e
-rm -rf jdk-macosx.zip
-cp -r local/jdk7u11-macosx ./jdk
-zip -9 -r -y ./jdk-macosx.zip ./jdk
-rm -rf jdk

+ 0 - 48
jdks/build-package.sh

@@ -1,48 +0,0 @@
-#!/bin/bash
-set -e
-#(c) jmonkeyengine.org
-#This script creates SFX binaries of the JDK for the specified platform
-#Author Normen Hansen
-
-#gather options
-os="$1"
-source="$2"
-if [ -z "$1" ]; then
-    echo "No platform supplied"
-    echo "Specify a platform like macosx, windows-x86, linux-x64 and a source like /path/to/jdk/home"
-    echo "If no source is specified, local/jdk-(platform) will be used"
-    exit 1
-fi
-if [ -z "$2" ]; then
-	source="local/jdk-$os"
-fi
-if [ ! -d "$source" ]; then
-    echo "Source JDK directory $source was not found, specify another source folder as second parameter or copy the needed JDK to $source"
-    exit 1
-fi
-unzipsfxname="unzipsfx/unzipsfx-$os"
-if [ ! -f "$unzipsfxname" ]; then
-	echo "No unzipsfx for platform $os found at $unzipsfxname, cannot continue"
-    exit 1
-fi
-suffix="bin"
-if [[ "$os" == *"windows"* ]]; then
-	suffix="exe"
-fi
-name="jdk-$os.$suffix"
-
-echo "Creating SFX JDK package $name for $os with source $source."
-
-#code logic
-rm -rf $name
-cp -r $source ./jdk_tmp
-cd jdk_tmp/jre
-pack200 -J-Xmx1024m lib/rt.jar.pack.gz lib/rt.jar
-rm -rf lib/rt.jar
-cd ..
-zip -9 -r -y -q ../jdk_tmp_sfx.zip .
-cd ..
-cat $unzipsfxname jdk_tmp_sfx.zip > $name
-chmod +x $name
-rm -rf jdk_tmp
-rm -rf jdk_tmp_sfx.zip

+ 13 - 121
jdks/download-jdks.sh

@@ -2,12 +2,6 @@
 #(c) jmonkeyengine.org
 #Author MeFisto94
 
-# This script is build up like a gradle build script. It contains many functions, each for it's distinctive task and every function is calling it's dependency functions.
-# This means in order for "unpack" to work, it will first launch "download" etc. While each task is self-explanatory, here's the process in short:
-# 1. Download JDK, 2. Unpack JDK (this used to be more work, with SFX Installers from Oracle etc), 3. Compile (this zips the unpacked and processed jdk and
-# creates a SFX Installer again from the zip), 4. Build (Build is the more general code to call compile (which calls unpack which calls download) and links the currently
-# most up to date JDK version into the main directory (because several old jdk versions are stored as well).
-
 set -e # Quit on Error
 
 jdk_major_version="21"
@@ -26,11 +20,9 @@ function download_jdk {
     fi
 }
 
-function unpack_mac_jdk {
-    echo ">> Extracting the Mac JDK..."
-    #cd local/$jdk_version-$jdk_build_version/
-
-    if [ -f "compiled/jdk-macosx.zip" ];
+function build_mac_jdk {
+    echo "> Getting the Mac JDK"
+    if [ -f "downloads/jdk-x64_mac.tar.gz" ];
     then
         echo "< Already existing, SKIPPING."
         #cd ../../
@@ -38,43 +30,16 @@ function unpack_mac_jdk {
     fi
 
     download_jdk x64 mac .tar.gz
-    tar xf downloads/jdk-x64_mac.tar.gz
-    cd jdk-$jdk_major_version*/Contents/
-
-    # FROM HERE: build-osx-zip.sh by normen (with changes)
-    mv Home jdk # rename folder
-    rm -rf jdk/man jdk/legal # ANT got stuck at the symlinks (https://bz.apache.org/bugzilla/show_bug.cgi?id=64053)
-    zip -9 -r -y -q ../../compiled/jdk-macosx.zip jdk
-    cd ../../
-    
-    rm -rf jdk-$jdk_major_version*
-
-    if [ "$TRAVIS" == "true" ]; then
-        rm -rf downloads/jdk-x64_mac.tar.gz
-    fi
-    #cd ../../
-
-    echo "<< OK!"
-}
 
-function build_mac_jdk {
-    echo "> Building the Mac JDK"
-    if ! [ -f "compiled/jdk-macosx.zip" ];
-    then
-        unpack_mac_jdk # Depends on "unpack" which depends on "download" (Unpack includes what compile is to other archs)
-    fi
-
-    rm -rf ../../jdk-macosx.zip
-    ln -rs compiled/jdk-macosx.zip ../../
     echo "< OK!"
 }
 
 # PARAMS arch
 function unpack_windows {
-    echo ">> Extracting the JDK for windows-$1"
+    echo ">> Getting the JDK for windows-$1"
     #cd local/$jdk_version-$jdk_build_version/
 
-    if [ -d windows-$1 ];
+    if [ -f downloads/jdk-$1_windows.zip ];
     then
         echo "<< Already existing, SKIPPING."
         # cd ../../
@@ -82,40 +47,15 @@ function unpack_windows {
     fi
 
     download_jdk "$1" windows .zip
-
-    mkdir -p windows-$1
-    unzip -qq downloads/jdk-$1_windows.zip -d windows-$1
-    cd windows-$1/
-    
-    mv jdk-$jdk_major_version*/* .
-    rm -rf jdk-$jdk_major_version*   
-
-    # This seems to be replaced by lib/tools.jar in openJDK
-    #unzip -qq tools.zip -d .
-    #rm tools.zip
-
-    find . -exec chmod u+w {} \; # Make all file writable to allow uninstaller's cleaner to remove file    
-    
-    find . -type f \( -name "*.exe" -o -name "*.dll" \) -exec chmod u+rwx {} \; # Make them executable
-    
-    # Insert fake unpack200.exe
-    # See https://github.com/jMonkeyEngine/sdk/issues/491
-    touch bin/unpack200.exe
-    
-    cd ../
-
-    if [ "$TRAVIS" == "true" ]; then
-        rm -rf downloads/jdk-$1_windows.zip
-    fi
     
     echo "<< OK!"
 }
 
 function unpack_linux {
-    echo ">> Extracting the JDK for linux-$1"
+    echo ">> Getting the JDK for linux-$1"
     #cd local/$jdk_version-$jdk_build_version/
 
-    if [ -d linux-$1 ];
+    if [ -f downloads/jdk-$1.tar.gz ];
     then
         echo "<< Already existing, SKIPPING."
         #cd ../../
@@ -124,39 +64,19 @@ function unpack_linux {
 
     download_jdk "$1" linux .tar.gz
 
-    mkdir -p linux-$1
-    cd linux-$1
-    tar -xf "../downloads/jdk-$1_linux.tar.gz"
-    mv jdk-$jdk_major_version*/* .
-    rm -rf jdk-$jdk_major_version*
-    
-    cd ../
-
-    if [ "$TRAVIS" == "true" ]; then
-        rm -rf downloads/jdk-$1.tar.gz
-    fi
-
     echo "<< OK!"
 }
 
+
 # PARAMS: os arch arch_unzipsfx
 function compile_other {
-    echo "> Compiling JDK for $1-$2"
+    echo "> Getting JDK for $1-$2"
 
-    if [ $1 == "windows" ]; then
-        name="jdk-$1-$3.exe"
-    elif [ $1 == "linux" ]; then
-        name="jdk-$1-$3.bin"
-    else
+    if [[ $1 != "windows" && $1 != "linux" ]]; then
         echo "Unknown Platform $1. ERROR!!!"
         exit 1
     fi
 
-    if [ -f "compiled/$name" ]; then
-        echo "< Already existing, SKIPPING."
-        return 0
-    fi
-
     # Depends on UNPACK and thus DOWNLOAD
     if [ $1 == "windows" ]; then
         unpack_windows $2
@@ -164,48 +84,20 @@ function compile_other {
         unpack_linux $2
     fi
 
-    unzipsfxname="../../unzipsfx/unzipsfx-$1-$3"
-    if [ ! -f "$unzipsfxname" ]; then
-        echo "No unzipsfx for platform $1-$3 found at $unzipsfxname, cannot continue"
-        exit 1
-    fi
-
-    echo "> Zipping JDK"
-    cd $1-$2 # zip behaves differently between 7zip and Info-Zip, so simply change wd
-    zip -9 -qry ../jdk_tmp_sfx.zip *
-    cd ../
-    echo "> Building SFX"
-    cat $unzipsfxname jdk_tmp_sfx.zip > compiled/$name
-    chmod +x compiled/$name
-    rm -rf jdk_tmp_sfx.zip
-
-    if [ "$TRAVIS" == "true" ]; then
-        rm -rf $1-$2
-    fi
-
     echo "< OK!"
 }
 
+
 # PARAMS: os arch arch_unzipsfx
 function build_other_jdk {
-    echo "> Building Package for $1-$2"
+    echo "> Getting Package for $1-$2"
     compile_other $1 $2 $3 # Depend on Compile
 
-    if [ $1 == "windows" ]; then
-        name="jdk-$1-$3.exe"
-    elif [ $1 == "linux" ]; then
-        name="jdk-$1-$3.bin"
-    fi
-
-    rm -rf ../../$name
-    ln -rs compiled/$name ../../
     echo "< OK!"
 }
 
-mkdir -p local/$jdk_major_version/downloads
-mkdir -p local/$jdk_major_version/compiled
 
-cd local/$jdk_major_version
+mkdir -p downloads
 
 if [ "x$TRAVIS" != "x" ]; then
     if [ "x$BUILD_X64" != "x" ]; then

BIN
jdks/unzipsfx/unzipsfx-linux-x64


BIN
jdks/unzipsfx/unzipsfx-linux-x86


BIN
jdks/unzipsfx/unzipsfx-macosx


BIN
jdks/unzipsfx/unzipsfx-windows-x64


BIN
jdks/unzipsfx/unzipsfx-windows-x86


+ 0 - 5
jdks/versions

@@ -1,5 +0,0 @@
-MacOSX: 1.7u51
-Win32: 1.7u51
-Win64: 1.7u51
-Linux32: 1.7u51
-Linux64: 1.7u51