From 393efce26cec83753cf369e31deea8aaa90f4d8d Mon Sep 17 00:00:00 2001 From: "Jason R. Clark" Date: Tue, 23 May 2017 21:20:07 -0700 Subject: [PATCH] Initial commit --- .gitignore | 3 +++ README.md | 18 ++++++++++++++++++ build.rb | 11 +++++++++++ linux-app-template/app | 26 ++++++++++++++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100755 build.rb create mode 100755 linux-app-template/app diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f910393 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.zip +*.tar.gz +.DS_Store diff --git a/README.md b/README.md new file mode 100644 index 0000000..9546cd8 --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# Shoes 4 Mac App Templates + +Source repo for Shoes 4 Mac apps. Non-binary stuff is kept here. Things like +the JDK downloads are only kept around as releases to keep the size down. + +## App Template Updates + +The general process for revising a package is: + +* Make updats as necessary in `mac-app-template` +* Run `./build.rb 0.0.1` with your desired version number +* Upload resulting zipfile to a new release +* Upload a compatible `jdk.zip` alongside (can reuse from prior releases if + not updating) + +## JDK Updates + +Document soon!!! diff --git a/build.rb b/build.rb new file mode 100755 index 0000000..4955e67 --- /dev/null +++ b/build.rb @@ -0,0 +1,11 @@ +#! /usr/bin/env ruby + +require 'fileutils' + +version = ARGV[0] +raise "Must include a version as argument" unless version + +root = File.expand_path(File.join(__FILE__, "..")) + +`find . -name ".DS_Store" -exec rm {} \\;` +`zip -r linux-app-template-#{version}.zip linux-app-template` diff --git a/linux-app-template/app b/linux-app-template/app new file mode 100755 index 0000000..3126091 --- /dev/null +++ b/linux-app-template/app @@ -0,0 +1,26 @@ +#! /usr/bin/env bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +COMMAND=java + +# See if Java's there to just use +$COMMAND -version &> /dev/null +if [ $? != 0 ]; then + + # See if we already have a downloaded JRE we can use + if [ ! -d ~/.shoes/jre ]; then + mkdir -p ~/.shoes + + # Download a JRE + pushd ~/.shoes + curl -L https://github.com/shoes/linux-app-templates/releases/download/jre1.8.0_131/jre1.8.0_131.tar.gz > jre.tar.gz + tar -zxvf jre.tar.gz + mv ~/.shoes/jre1.8.0_131.jre ~/.shoes/jre + popd + fi + + export JAVA_HOME=~/.shoes/jre/Contents/Home/ + COMMAND=$JAVA_HOME/bin/java +fi + +$COMMAND -jar $DIR/app.jar