Created
April 15, 2012 06:05
-
-
Save chkn/2390344 to your computer and use it in GitHub Desktop.
Enable IL instrumentation in MonoTouch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# This mtouch wrapper adds an argument for a "postcompile" command to be run | |
# after the managed code is compiled to IL but before it is compiled to native code. | |
# | |
# It may be passed as "Additional mtouch arguments" in MD like so: | |
# | |
# -postcompile "mono ${SolutionDir}/postcompiler.exe ${TargetPath}" | |
# | |
# To use, rename mtouch to mtouch_real and put this script in its place. | |
# Cheers! | |
declare -a ARGS | |
LAST="" | |
POSTCOMPILE="" | |
j=0 | |
for i in "$@"; do | |
if [ "x$LAST" = "x-postcompile" ]; then | |
POSTCOMPILE="$i" | |
elif [ "x$i" != "x-postcompile" ]; then | |
ARGS[$j]="$i" | |
let j+=1 | |
fi | |
LAST="$i" | |
done | |
echo $POSTCOMPILE | |
$POSTCOMPILE | |
exec $(dirname $0)/mtouch_real "${ARGS[@]}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment