Skip to content
This repository has been archived by the owner on Oct 24, 2019. It is now read-only.

Commit

Permalink
README.md updates for DEVELOPER_DIR, plus some install.sh updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnezang committed Jun 22, 2011
1 parent 9a58109 commit 9f81507
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
26 changes: 13 additions & 13 deletions README.md
Expand Up @@ -37,7 +37,7 @@ Warning: Consider running this script as 'sudo "./install.sh"' instead.

Installing in to the Xcode Developer Tools at '/Developer', which was determined automatically by the command 'xcode-select'.

Note: You can override this location by setting the environment variable DEVTOOLS_PATH if you have multiple versions of the Xcode Developer Tools installed.
Note: You can override this location by setting the environment variable DEVELOPER_DIR if you have multiple versions of the Xcode Developer Tools installed.

Do you want to install in to this directory? (y/n)? <b>y &crarr;</b>

Expand All @@ -56,7 +56,7 @@ shell% <b>sudo "./install.sh" &crarr;</b>
Password: &nbsp;<i><b>Enter your password, it will not be displayed.</b></i>
Installing in to the Xcode Developer Tools at '/Developer', which was determined automatically by the command 'xcode-select'.

Note: You can override this location by setting the environment variable DEVTOOLS_PATH if you have multiple versions of the Xcode Developer Tools installed.
Note: You can override this location by setting the environment variable DEVELOPER_DIR if you have multiple versions of the Xcode Developer Tools installed.

Do you want to install in to this directory? (y/n)? <b>y &crarr;</b>

Expand All @@ -73,33 +73,33 @@ If `Xcode.app` is not running at the time that `install.sh` is executed, the las

### Installing in a different version of the Xcode Development Tools

If you have multiple versions of the Xcode Development Tools installed on your system, you can install the Xcode iPhone PNG Optimizer Enhacement in the different Xcode versions using the environment variable `DEVTOOLS_PATH`.
If you have multiple versions of the Xcode Development Tools installed on your system, you can install the Xcode iPhone PNG Optimizer Enhacement in the different Xcode versions using the environment variable `DEVELOPER_DIR`.

**Important:** When you set the `DEVTOOLS_PATH` environment variable, the `install.sh` script will not ask if the directory that `DEVTOOLS_PATH` is set to is really the directory you want to install in to.
**Important:** When you set the `DEVELOPER_DIR` environment variable, the `install.sh` script will not ask if the directory that `DEVELOPER_DIR` is set to is really the directory you want to install in to.

<pre>
shell% <b>setenv DEVTOOLS_PATH "/Developer4" &crarr;</b>
shell% <b>setenv DEVELOPER_DIR "/Developer4" &crarr;</b>
shell% <b>./install.sh &crarr;</b>
Warning: In general, this script must be executed as the super user in order to modify the Xcode Plug-In files.
Warning: Consider running this script as 'sudo DEVTOOLS_PATH="$DEVTOOLS_PATH" "./install.sh"' instead.
Warning: Consider running this script as 'sudo DEVELOPER_DIR="$DEVELOPER_DIR" "./install.sh"' instead.

Installing in to the Xcode Developer Tools at '/Developer4', which was determined by the environment variable DEVTOOLS_PATH.
Installing in to the Xcode Developer Tools at '/Developer4', which was determined by the environment variable DEVELOPER_DIR.

A backup of '/Developer4/Platforms/iPhoneOS.platform/Developer/Library/Xcode/PrivatePlugIns/iPhoneOS Build System Support.xcplugin'
was created at: '/Developer4/Platforms/iPhoneOS.platform/Developer/Library/Xcode/PrivatePlugIns/iPhoneOS_xcplugin_backup_20110621193634_41339.tar.gz'
./install.sh:90: error: Unable to copy '/Users/johne/projects/scribd/xcode/Xcode-OptimizePNG/plugin-src/copypng' to '/Developer4/Platforms/iPhoneOS.platform/Developer/Library/Xcode/PrivatePlugIns/iPhoneOS Build System Support.xcplugin/Contents/Resources/copypng'. Aborting.
shell% &#9612;
</pre>

Like the example without `DEVTOOLS_PATH`, this installation failed because the `install.sh` script requires super-user privliges in order to update certain Xcode files. When re-run using `sudo DEVTOOLS_PATH="$DEVTOOLS_PATH"`:
Like the example without `DEVELOPER_DIR`, this installation failed because the `install.sh` script requires super-user privliges in order to update certain Xcode files. When re-run using `sudo DEVELOPER_DIR="$DEVELOPER_DIR"`:

**Important:** `sudo` will execute the `install.sh` script with super-user (i.e., `root`) privileges.

<pre>
shell% <b>setenv DEVTOOLS_PATH "/Developer4" &crarr;</b>
shell% <b>sudo DEVTOOLS_PATH="$DEVTOOLS_PATH" "./install.sh" &crarr;</b>
shell% <b>setenv DEVELOPER_DIR "/Developer4" &crarr;</b>
shell% <b>sudo DEVELOPER_DIR="$DEVELOPER_DIR" "./install.sh" &crarr;</b>
Password: &nbsp;<i><b>Enter your password, it will not be displayed.</b></i>
Installing in to the Xcode Developer Tools at '/Developer4', which was determined by the environment variable DEVTOOLS_PATH.
Installing in to the Xcode Developer Tools at '/Developer4', which was determined by the environment variable DEVELOPER_DIR.

A backup of '/Developer4/Platforms/iPhoneOS.platform/Developer/Library/Xcode/PrivatePlugIns/iPhoneOS Build System Support.xcplugin'
was created at: '/Developer4/Platforms/iPhoneOS.platform/Developer/Library/Xcode/PrivatePlugIns/iPhoneOS_xcplugin_backup_20110621193734_41355.tar.gz'
Expand Down Expand Up @@ -133,15 +133,15 @@ To fix this, you will need to build the Scribd fork of the [AdvanceCOMP utilitie

## Uninstalling

The `install.sh` script makes a back up of the `iPhoneOS Build System Support.xcplugin` directory using `tar` and stores it in <code><i>DEVTOOLS_PATH</i>/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/</code>.
The `install.sh` script makes a back up of the `iPhoneOS Build System Support.xcplugin` directory using `tar` and stores it in <code><i>DEVELOPER_DIR</i>/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/</code>.

The name of the `.tar` backup is <code>iPhoneOS\_xcplugin\_backup\_<i>YearMonthDayHourMinuteSecond</i>\_<i>Random</i>.tar.gz</code>.

The `install.sh` script makes a back up of the `iPhoneOS Build System Support.xcplugin` directory as follows:

What | Directory or File
---------------------------------|------------
Directory containing `.tar` file | <code><i>DEVTOOLS_PATH</i>/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/</code>
Directory containing `.tar` file | <code><i>DEVELOPER_DIR</i>/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/</code>
`.tar` file naming scheme | <code>iPhoneOS\_xcplugin\_backup\_<i>YearMonthDayHourMinuteSecond</i>\_<i>Random</i>.tar.gz</code>

The `install.sh` script also prints this information:
Expand Down
10 changes: 6 additions & 4 deletions install.sh
Expand Up @@ -53,12 +53,14 @@ PLUGIN_XCODE_ENGLISH_LPROJ_NATIVE_BUILD_SYSTEM_STRINGS="${IPHONEOS_BUILD_PLUGIN_

if [ ${DIFF_COPYPNG} == 0 ] && [ ${DIFF_COPYPNGFILE_XCSPEC} == 0 ] && [ ${DIFF_NATIVE_BUILD_SYSTEM_XCSPEC} == 0 ] && [ ${DIFF_ENGLISH_LPROJ_NATIVE_BUILD_SYSTEM_STRINGS} == 0 ]; then echo "The enhanced 'Compress PNG Files' Xcode iPhoneOS Build System Support Plug-In in '${DEVELOPER_DIR}' is up to date."; exit 0; fi;

if [ "$1" == "-check" ]; then echo "The enhanced 'Compress PNG Files' Xcode iPhoneOS Build System Support Plug-In in '${DEVELOPER_DIR}' requires updating."; exit 1; fi;

if [ "${UID}" != 0 ]; then
if [ "${DEVELOPER_DIR_SET}" == "Yes" ]; then SUDO_DEVTOOLS="DEVELOPER_DIR=\"\$DEVELOPER_DIR\" "; else SUDO_DEVTOOLS=""; fi;
echo "Warning: In general, this script must be executed as the super user in order to modify the Xcode Plug-In files.\nWarning: Consider running this script as 'sudo ${SUDO_DEVTOOLS}\"$0\"' instead.\n";
fi;

echo "Installing in to the Xcode Developer Tools at '${DEVELOPER_DIR}', which was ${DEVELOPER_DIR_SET_BY}.\n"
echo "Note: Installing in to the Xcode Developer Tools at '${DEVELOPER_DIR}', which was ${DEVELOPER_DIR_SET_BY}.\n"
if [ "${DEVELOPER_DIR_SET}" != "Yes" ]; then
echo "Note: You can override this location by setting the environment variable DEVELOPER_DIR if you have multiple versions of the Xcode Developer Tools installed.\n";
read -p "Do you want to install in to this directory? (y/n)? "
Expand All @@ -78,8 +80,8 @@ cd "${XCODE_PLUGIN_PATH}"
/usr/bin/tar -czf "${IPHONEOS_BUILD_PLUGIN_TAR_BACKUP}" "${IPHONEOS_BUILD_PLUGIN}"
if [ $? != 0 ]; then echo "$0:$LINENO: error: Unable create a backup of '${IPHONEOS_BUILD_PLUGIN_PATH}'. Aborting."; exit 1; fi;

echo "A backup of '${IPHONEOS_BUILD_PLUGIN_PATH}'"
echo "was created at: '${XCODE_PLUGIN_PATH}/${IPHONEOS_BUILD_PLUGIN_TAR_BACKUP}'"
echo "Note: A backup of '${IPHONEOS_BUILD_PLUGIN_PATH}'"
echo "Note: was created at: '${XCODE_PLUGIN_PATH}/${IPHONEOS_BUILD_PLUGIN_TAR_BACKUP}'"


if [ ! -d "${IPHONEOS_BUILD_PLUGIN_RESOURCES_PATH}" ]; then echo "$0:$LINENO: error: The Xcode iPhoneOS Build System Support Plug-In Resources directory, '${IPHONEOS_BUILD_PLUGIN_RESOURCES_PATH}', does not exist. Aborting."; exit 1; fi;
Expand All @@ -99,7 +101,7 @@ if [ $? != 0 ]; then echo "$0:$LINENO: error: Unable to copy '${PLUGIN_SOURCE_NA
cp -p "${PLUGIN_SOURCE_ENGLISH_LPROJ_NATIVE_BUILD_SYSTEM_STRINGS}" "${PLUGIN_XCODE_ENGLISH_LPROJ_NATIVE_BUILD_SYSTEM_STRINGS}" >/dev/null 2>&1
if [ $? != 0 ]; then echo "$0:$LINENO: error: Unable to copy '${PLUGIN_SOURCE_ENGLISH_LPROJ_NATIVE_BUILD_SYSTEM_STRINGS}' to '${PLUGIN_XCODE_ENGLISH_LPROJ_NATIVE_BUILD_SYSTEM_STRINGS}'. Aborting"; exit 1; fi;

echo "\nInstallation was successful!"
echo "\nNote: Installation was successful!"

XCODE_RUNNING=$(/usr/bin/osascript -e 'if application "Xcode" is running then return "Yes"')
if [ "${XCODE_RUNNING}" == "Yes" ]; then echo "\nWarning: You must exit and restart Xcode before the new 'Compress PNG Files' Build Setting options are available."; fi;

0 comments on commit 9f81507

Please sign in to comment.