2012-09-18 02:35:55 +04:00
|
|
|
#!/bin/sh
|
2012-09-20 03:08:26 +04:00
|
|
|
# This can only be run by xcode or xcodebuild!
|
2012-09-18 02:35:55 +04:00
|
|
|
|
|
|
|
# Because of the way xcodebuild invokes external scripts we need to load
|
|
|
|
# The Setup's environment ourselves. If this isn't done, things like the
|
|
|
|
# node shim won't be able to find the stuff they need.
|
|
|
|
|
|
|
|
if [ -f /opt/github/env.sh ]; then
|
|
|
|
source /opt/github/env.sh
|
|
|
|
fi
|
|
|
|
|
2012-09-20 03:08:26 +04:00
|
|
|
RESOUCES_PATH="$BUILT_PRODUCTS_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH"
|
|
|
|
|
2012-10-27 02:27:40 +04:00
|
|
|
DIRS="src static vendor"
|
2012-10-15 22:19:27 +04:00
|
|
|
|
2013-01-18 01:08:27 +04:00
|
|
|
# Compile .coffee files into bundle
|
2012-10-15 22:19:27 +04:00
|
|
|
COFFEE_FILES=$(find $DIRS -type file -name '*.coffee')
|
2012-10-27 02:27:40 +04:00
|
|
|
for COFFEE_FILE in $COFFEE_FILES; do
|
2012-10-15 22:19:27 +04:00
|
|
|
JS_FILE=$(echo "$RESOUCES_PATH/$COFFEE_FILE" | sed 's/.coffee/.js/' )
|
|
|
|
OUTPUT_PATH="$RESOUCES_PATH/$(dirname "$COFFEE_FILE")"
|
|
|
|
|
|
|
|
if [ $COFFEE_FILE -nt "$JS_FILE" ]; then
|
|
|
|
mkdir -p "$OUTPUT_PATH"
|
|
|
|
node_modules/.bin/coffee -c -o "$OUTPUT_PATH" "$COFFEE_FILE" || exit 1
|
|
|
|
fi
|
2012-09-20 03:08:26 +04:00
|
|
|
done;
|
2012-10-15 22:19:27 +04:00
|
|
|
|
2013-01-18 01:08:27 +04:00
|
|
|
# Compile .cson files into bundle
|
|
|
|
CSON_FILES=$(find $DIRS -type file -name '*.cson')
|
|
|
|
for CSON_FILE in $CSON_FILES; do
|
|
|
|
JSON_FILE=$(echo "$RESOUCES_PATH/$CSON_FILE" | sed 's/.cson/.json/' )
|
|
|
|
OUTPUT_PATH="$RESOUCES_PATH/$(dirname "$CSON_FILE")"
|
|
|
|
|
|
|
|
if [ $CSON_FILE -nt "$JSON_FILE" ]; then
|
|
|
|
mkdir -p "$OUTPUT_PATH"
|
|
|
|
node_modules/.bin/cson2json "$CSON_FILE" > "$JSON_FILE"
|
|
|
|
fi
|
|
|
|
done;
|
|
|
|
|
2012-10-15 22:19:27 +04:00
|
|
|
# Copy non-coffee files into bundle
|
2013-02-23 08:49:37 +04:00
|
|
|
rsync --archive --recursive --exclude="src/**/*.coffee" --exclude="src/**/*.cson" src static vendor spec benchmark themes dot-atom atom.sh "$RESOUCES_PATH"
|