Don't set version when building on constructicon

This commit is contained in:
probablycorey
2013-06-18 17:03:08 -07:00
parent 7163d8dc71
commit 4449758135
3 changed files with 34 additions and 3 deletions

View File

@@ -150,11 +150,16 @@ module.exports = (grunt) ->
unless /.+\.plist/.test(sourcePath)
grunt.file.copy(sourcePath, path.resolve(APP_DIR, '..', subDirectory, filename))
grunt.task.run('compile', 'update-info-plist', 'codesign')
grunt.task.run('compile', 'copy-info-plist', 'codesign')
grunt.registerTask 'update-info-plist', 'Copy plist and set version to current sha', ->
grunt.registerTask 'copy-info-plist', 'Copy plist', ->
done = @async()
grunt.util.spawn cmd: 'script/update-info-plist', args: [BUILD_DIR], (error, result, code) ->
grunt.util.spawn cmd: 'script/copy-info-plist', args: [BUILD_DIR], (error, result, code) ->
done(error)
grunt.registerTask 'set-development-version', "Sets version to current sha", ->
done = @async()
grunt.util.spawn cmd: 'script/set-version', args: [BUILD_DIR], (error, result, code) ->
done(error)
grunt.registerTask 'codesign', 'Codesign the app', ->

11
script/copy-info-plist Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/sh
set -e
BUILT_PRODUCTS_DIR=$1
PLIST_PATH="$BUILT_PRODUCTS_DIR/Atom.app/Contents/Info.plist"
HELPER_PLIST_PATH="$BUILT_PRODUCTS_DIR/Atom.app/Contents/Frameworks/Atom Helper.app/Contents/Info.plist"
# Copy custom plist files
cp resources/mac/atom-Info.plist "$PLIST_PATH"
cp resources/mac/helper-Info.plist "$HELPER_PLIST_PATH"

15
script/set-version Normal file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
set -e
BUILT_PRODUCTS_DIR=$1
PLIST_PATH="$BUILT_PRODUCTS_DIR/Atom.app/Contents/Info.plist"
HELPER_PLIST_PATH="$BUILT_PRODUCTS_DIR/Atom.app/Contents/Frameworks/Atom Helper.app/Contents/Info.plist"
# Update version
VERSION=$(git rev-parse --short HEAD | tr -d "\n")
echo $VERSION > "$BUILT_PRODUCTS_DIR/Atom.app/Contents/Resources/version"
/usr/libexec/PlistBuddy -c "Set CFBundleShortVersionString $VERSION" "$PLIST_PATH"
/usr/libexec/PlistBuddy -c "Set CFBundleVersion $VERSION" "$PLIST_PATH"
/usr/libexec/PlistBuddy -c "Set CFBundleShortVersionString $VERSION" "$HELPER_PLIST_PATH"
/usr/libexec/PlistBuddy -c "Set CFBundleVersion $VERSION" "$HELPER_PLIST_PATH"