Simplify gyp

Gyp is only used for construction now.
This commit is contained in:
probablycorey
2013-06-18 11:43:39 -07:00
parent 65c02328b3
commit fcaa952973
4 changed files with 25 additions and 107 deletions

108
atom.gyp
View File

@@ -1,116 +1,12 @@
{
'variables': {
'version%': "<!(git rev-parse --short HEAD)",
},
'includes': [
'sources.gypi',
],
'target_defaults': {
'default_configuration': 'Release',
'configurations': {
'Release': {
},
},
},
'targets': [
{
'target_name': 'Atom',
'type': 'none',
'sources': [
'<@(coffee_sources)',
'<@(cson_sources)',
'<@(less_sources)'
],
'rules': [
{
'rule_name': 'coffee',
'extension': 'coffee',
'inputs': [
'script/compile-coffee',
],
'outputs': [
'<(compiled_sources_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).js',
],
'action': [
'sh',
'script/compile-coffee',
'<(RULE_INPUT_PATH)',
'<(compiled_sources_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).js',
],
},
{
'rule_name': 'cson2json',
'extension': 'cson',
'inputs': [
'script/compile-cson',
],
'outputs': [
'<(compiled_sources_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).json',
],
'action': [
'sh',
'script/compile-cson',
'<(RULE_INPUT_PATH)',
'<(compiled_sources_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).json',
],
},
{
'rule_name': 'less',
'extension': 'less',
'inputs': [
'script/compile-less',
],
'outputs': [
'<(compiled_sources_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).css',
],
'action': [
'sh',
'script/compile-less',
'<(RULE_INPUT_PATH)',
'<(compiled_sources_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).css',
],
},
],
'copies': [
{
'destination': '<(PRODUCT_DIR)',
'files': [
'atom-shell/Atom.app'
],
},
],
'postbuilds': [
{
'postbuild_name': 'Copy Static Files',
'action': [
'script/copy-files-to-bundle',
'<(compiled_sources_dir_xcode)',
],
},
{
'postbuild_name': 'Generate Version',
'action': [
'script/generate-version',
'<(version)',
],
},
{
'postbuild_name': 'Generate Info.plist for App',
'action': [
'script/generate-info-plist',
'<(version)',
'resources/mac/app-Info.plist',
'Atom.app/Contents/Info.plist',
],
},
{
'postbuild_name': 'Generate Info.plist for Helper',
'action': [
'script/generate-info-plist',
'<(version)',
'resources/mac/helper-Info.plist',
'Atom.app/Contents/Frameworks/Atom Helper.app/Contents/Info.plist',
],
'postbuild_name': 'Create Atom, basically do everything',
'action': ['script/create-atom'],
},
],
},

6
script/create-atom Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
set -e
cd "$(dirname "$0")/.."
./node_modules/.bin/grunt --build-dir="$BUILT_PRODUCTS_DIR"

14
script/lib/polite-curl Executable file
View File

@@ -0,0 +1,14 @@
if [ -t 0 ] ; then # If stdout is a terminal
INTERACTIVE=1
fi
polite_curl()
{
if [ $INTERACTIVE ] ; then
CURL_ARGS="--progress-bar"
else
CURL_ARGS="-fsS"
fi
curl $CURL_ARGS $*
}

View File

@@ -1,5 +1,7 @@
#!/bin/bash
. $(dirname $0)/lib/polite-curl
cd "$(dirname "${BASH_SOURCE[0]}" )/.."
TARGET=${1:-atom-shell}
@@ -20,7 +22,7 @@ if [[ ${LATEST_VERSION} != ${CURRENT_VERSION} ]]; then
else
echo "Downloading/extracting atom-shell ${LATEST_VERSION}..."
mkdir -p $TEMP_DIR
curl "${DISTURL}/${LATEST_VERSION}/atom-shell.zip" > "${TEMP_DIR}/atom-shell.zip"
polite_curl "${DISTURL}/${LATEST_VERSION}/atom-shell.zip" > "${TEMP_DIR}/atom-shell.zip"
unzip -q "${TEMP_DIR}/atom-shell.zip" -d "${TEMP_DIR}"
rm "${TEMP_DIR}/atom-shell.zip"
fi