summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/Stone Island/Scripts
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/platforms/ios/Stone Island/Scripts')
-rwxr-xr-xStoneIsland/platforms/ios/Stone Island/Scripts/copy-www-build-step.sh63
1 files changed, 63 insertions, 0 deletions
diff --git a/StoneIsland/platforms/ios/Stone Island/Scripts/copy-www-build-step.sh b/StoneIsland/platforms/ios/Stone Island/Scripts/copy-www-build-step.sh
new file mode 100755
index 00000000..ba0a1b47
--- /dev/null
+++ b/StoneIsland/platforms/ios/Stone Island/Scripts/copy-www-build-step.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#
+# This script copies the www directory into the Xcode project.
+#
+# This script should not be called directly.
+# It is called as a build step from Xcode.
+
+SRC_DIR="www"
+DST_DIR="$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME"
+DST_DIR_WWW="$DST_DIR/www"
+COPY_HIDDEN=
+ORIG_IFS=$IFS
+IFS=$(echo -en "\n\b")
+
+if [[ -z "$BUILT_PRODUCTS_DIR" ]]; then
+ echo "The script is meant to be run as an Xcode build step and relies on env variables set by Xcode."
+ exit 1
+fi
+
+if [[ ! -e "$SRC_DIR" ]]; then
+ echo "error: Path does not exist: $SRC_DIR"
+ exit 2
+fi
+
+rm -rf "$DST_DIR_WWW"
+
+# Copy www dir recursively
+CODE=
+if [[ -n $COPY_HIDDEN ]]; then
+ rsync -Lra "$SRC_DIR" "$DST_DIR"
+ CODE=$?
+else
+ rsync -Lra --exclude="- .*" "$SRC_DIR" "$DST_DIR"
+ CODE=$?
+fi
+
+if [ $CODE -ne 0 ]; then
+ echo "error: Error occurred on copying www. Code $CODE"
+ exit 3
+fi
+
+# Copy the config.xml file.
+cp -f "${PROJECT_FILE_PATH%.xcodeproj}/config.xml" "$DST_DIR"
+
+IFS=$ORIG_IFS