From 1c72643aaa8c6be312a0efdc5f46254fc38d6ecc Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Sun, 2 Nov 2014 10:27:02 -0500 Subject: [PATCH] Move mpw-js out of the homepage. --- .gitmodules | 4 +- Scripts/updatePlist | 62 +++++++++++++++++++ Site/2013-05/index.html | 2 +- Site/2013-05/mpw-js/js/mpw-js | 1 - Site/{2013-05 => }/mpw-js/css/main.css | 0 Site/{2013-05 => }/mpw-js/img/spinner.svg | 0 Site/{2013-05 => }/mpw-js/index.html | 0 Site/{2013-05 => }/mpw-js/js/dependencies.js | 0 .../mpw-js/js/encoding-polyfill.js | 0 Site/{2013-05 => }/mpw-js/js/main.js | 0 Site/mpw-js/js/mpw-js | 1 + .../mpw-js/js/promise-polyfill.js | 0 .../mpw-js/js/typedarray-polyfill.js | 0 .../mpw-js/js/vendor/jquery-2.1.1.js | 0 .../mpw-js/js/vendor/jquery-2.1.1.min.js | 0 .../mpw-js/js/vendor/jquery-2.1.1.min.map | 0 16 files changed, 66 insertions(+), 4 deletions(-) create mode 100755 Scripts/updatePlist delete mode 160000 Site/2013-05/mpw-js/js/mpw-js rename Site/{2013-05 => }/mpw-js/css/main.css (100%) rename Site/{2013-05 => }/mpw-js/img/spinner.svg (100%) rename Site/{2013-05 => }/mpw-js/index.html (100%) rename Site/{2013-05 => }/mpw-js/js/dependencies.js (100%) rename Site/{2013-05 => }/mpw-js/js/encoding-polyfill.js (100%) rename Site/{2013-05 => }/mpw-js/js/main.js (100%) create mode 160000 Site/mpw-js/js/mpw-js rename Site/{2013-05 => }/mpw-js/js/promise-polyfill.js (100%) rename Site/{2013-05 => }/mpw-js/js/typedarray-polyfill.js (100%) rename Site/{2013-05 => }/mpw-js/js/vendor/jquery-2.1.1.js (100%) rename Site/{2013-05 => }/mpw-js/js/vendor/jquery-2.1.1.min.js (100%) rename Site/{2013-05 => }/mpw-js/js/vendor/jquery-2.1.1.min.map (100%) diff --git a/.gitmodules b/.gitmodules index 0b9bf398..38e1a97e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,6 +16,6 @@ [submodule "External/jrswizzle"] path = External/jrswizzle url = git://github.com/jonmarimba/jrswizzle.git -[submodule "Site/2013-05/mpw-js/js/mpw-js"] - path = Site/2013-05/mpw-js/js/mpw-js +[submodule "Site/mpw-js/js/mpw-js"] + path = Site/mpw-js/js/mpw-js url = https://github.com/Lyndir/mpw-js.git diff --git a/Scripts/updatePlist b/Scripts/updatePlist new file mode 100755 index 00000000..a42f7e3d --- /dev/null +++ b/Scripts/updatePlist @@ -0,0 +1,62 @@ +#!/usr/bin/env bash +cd "${BASH_SOURCE%/*}" +source bashlib +set -e +cd .. +export PATH+=:/usr/libexec + +addPlistWithKey() { + local key=$1 type=$2 value=$3 plist=${4:-"$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH"} + + PlistBuddy -c "Delete :'$key'" "$plist" 2>/dev/null || true + PlistBuddy -c "Add :'$key' '$type' '$value'" "$plist" +} +setPlistWithKey() { + local key=$1 value=$2 plist=${3:-"$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH"} + + PlistBuddy -c "Set :'$key' '$value'" "$plist" +} +getPlistWithKey() { + local key=$1 plist=${2:-"$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH"} + + PlistBuddy -c "Print :'$key'" "$plist" +} +setSettingWithTitle() { + local i title=$1 value=$2 plist=${3:-"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Settings.bundle/Root.plist"} + + for (( i=0; 1; ++i )); do + PlistBuddy -c "Print :PreferenceSpecifiers:$i" "$plist" &>/dev/null || break + inf "Checking preference specifier $i" + + [[ $(PlistBuddy -c "Print :PreferenceSpecifiers:$i:Title" "$plist" 2>/dev/null) = $title ]] || continue + + inf "Correct title, setting value." + PlistBuddy -c "Set :PreferenceSpecifiers:$i:DefaultValue $value" "$plist" + break + done +} + +description=$(git describe --always --dirty --long --match '*-release') +version=${description%-g*} +major=${version%%-*} minor=${version##*-} +printf -v version '%s.%02d' "$major" "$minor" +printf -v commit '%09d' "$((16#${description##*-g}))" + +addPlistWithKey GITDescription string "$description" +setPlistWithKey CFBundleVersion "${version//.}$commit" # No separator between version and commit because I had already submitted a CFBundleVersion with a really high major. Cry. +setPlistWithKey CFBundleShortVersionString "$version" + +setSettingWithTitle "Build" "$commit" +setSettingWithTitle "Version" "$version" +setSettingWithTitle "Copyright" "$(getPlistWithKey NSHumanReadableCopyright)" + +if [[ $DEPLOYMENT_LOCATION = YES ]]; then + # This build is a release. Do some release checks. + passed=1 + [[ $description != *-dirty ]] || \ + { passed=0; err 'ERROR: Cannot release a dirty version, first commit any changes.'; } + [[ $(PlistBuddy -c "Print :'API Key'" "$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Crashlytics.plist") ]] || \ + { passed=0; err 'ERROR: Cannot release: Crashlytics API key is missing.'; } + (( passed )) || \ + { ftl "Failed to pass release checks. Fix the above errors and re-try. Aborting."; exit 1; } +fi diff --git a/Site/2013-05/index.html b/Site/2013-05/index.html index 8e8c3ad8..894f6fd5 100644 --- a/Site/2013-05/index.html +++ b/Site/2013-05/index.html @@ -84,7 +84,7 @@ Terminal (Java / Native C) | Android (Beta) | - Web (Beta) + Web (Beta) diff --git a/Site/2013-05/mpw-js/js/mpw-js b/Site/2013-05/mpw-js/js/mpw-js deleted file mode 160000 index 08ada42c..00000000 --- a/Site/2013-05/mpw-js/js/mpw-js +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 08ada42cbb033b2c094cef0c015a20d8c7467bc1 diff --git a/Site/2013-05/mpw-js/css/main.css b/Site/mpw-js/css/main.css similarity index 100% rename from Site/2013-05/mpw-js/css/main.css rename to Site/mpw-js/css/main.css diff --git a/Site/2013-05/mpw-js/img/spinner.svg b/Site/mpw-js/img/spinner.svg similarity index 100% rename from Site/2013-05/mpw-js/img/spinner.svg rename to Site/mpw-js/img/spinner.svg diff --git a/Site/2013-05/mpw-js/index.html b/Site/mpw-js/index.html similarity index 100% rename from Site/2013-05/mpw-js/index.html rename to Site/mpw-js/index.html diff --git a/Site/2013-05/mpw-js/js/dependencies.js b/Site/mpw-js/js/dependencies.js similarity index 100% rename from Site/2013-05/mpw-js/js/dependencies.js rename to Site/mpw-js/js/dependencies.js diff --git a/Site/2013-05/mpw-js/js/encoding-polyfill.js b/Site/mpw-js/js/encoding-polyfill.js similarity index 100% rename from Site/2013-05/mpw-js/js/encoding-polyfill.js rename to Site/mpw-js/js/encoding-polyfill.js diff --git a/Site/2013-05/mpw-js/js/main.js b/Site/mpw-js/js/main.js similarity index 100% rename from Site/2013-05/mpw-js/js/main.js rename to Site/mpw-js/js/main.js diff --git a/Site/mpw-js/js/mpw-js b/Site/mpw-js/js/mpw-js new file mode 160000 index 00000000..768cfad3 --- /dev/null +++ b/Site/mpw-js/js/mpw-js @@ -0,0 +1 @@ +Subproject commit 768cfad320668f480e2e44f7bf85c1f0de1b4059 diff --git a/Site/2013-05/mpw-js/js/promise-polyfill.js b/Site/mpw-js/js/promise-polyfill.js similarity index 100% rename from Site/2013-05/mpw-js/js/promise-polyfill.js rename to Site/mpw-js/js/promise-polyfill.js diff --git a/Site/2013-05/mpw-js/js/typedarray-polyfill.js b/Site/mpw-js/js/typedarray-polyfill.js similarity index 100% rename from Site/2013-05/mpw-js/js/typedarray-polyfill.js rename to Site/mpw-js/js/typedarray-polyfill.js diff --git a/Site/2013-05/mpw-js/js/vendor/jquery-2.1.1.js b/Site/mpw-js/js/vendor/jquery-2.1.1.js similarity index 100% rename from Site/2013-05/mpw-js/js/vendor/jquery-2.1.1.js rename to Site/mpw-js/js/vendor/jquery-2.1.1.js diff --git a/Site/2013-05/mpw-js/js/vendor/jquery-2.1.1.min.js b/Site/mpw-js/js/vendor/jquery-2.1.1.min.js similarity index 100% rename from Site/2013-05/mpw-js/js/vendor/jquery-2.1.1.min.js rename to Site/mpw-js/js/vendor/jquery-2.1.1.min.js diff --git a/Site/2013-05/mpw-js/js/vendor/jquery-2.1.1.min.map b/Site/mpw-js/js/vendor/jquery-2.1.1.min.map similarity index 100% rename from Site/2013-05/mpw-js/js/vendor/jquery-2.1.1.min.map rename to Site/mpw-js/js/vendor/jquery-2.1.1.min.map