Add a build phase that automatically calls populate-project for the user.

This commit is contained in:
Joseph Hager 2012-04-17 20:58:40 -04:00
parent 18687fb762
commit f32d0c99a4
3 changed files with 41 additions and 6 deletions

View file

@ -4,8 +4,18 @@ Kivy for IOS
(This is a work in progress.) (This is a work in progress.)
#. Build the whole toolchain with `tools/build_all.sh` #. Build the whole toolchain with `tools/build_all.sh`
#. Create an xcode project for your application with `tools/create-xcode-project.sh test` #. Create an Xcode project for your application with
#. Populate the project with your application source code `tools/populate-project.sh test /path/to/app` `tools/create-xcode-project.sh test /path/to/app`
#. Open your newly xcode project created #. Open your newly created Xcode project
#. Ensure the code signing is ok #. Ensure code signing is setup correctly
#. Click on play #. Click on play
Notes
-----
#. A build phase is added to the project that processes and moves your
app's files to the Xcode project before every build. If you would
like to handle this process manually, remove the "Run Script" build
phase from your target and use `tools/populate-project.sh
/path/to/app` after every change. You can also change the path to
your app by modifying this build phase.

View file

@ -7,14 +7,21 @@ try () {
. $(dirname $0)/environment.sh . $(dirname $0)/environment.sh
APPNAME=$1 APPNAME=$1
SRCDIR=$2
APPID=$(echo $APPNAME | tr '[A-Z]' '[a-z]') APPID=$(echo $APPNAME | tr '[A-Z]' '[a-z]')
TEMPLATESDIR=$(dirname $0)/templates/ TEMPLATESDIR=$(dirname $0)/templates/
APPDIR=$KIVYIOSROOT/app-$APPID APPDIR=$KIVYIOSROOT/app-$APPID
if [ "X$APPNAME" == "X" ]; then if [ "X$APPNAME" == "X" ]; then
echo $(basename $0) "<appname>" echo $(basename $0) "<appname> <source directory>"
exit 1 exit 1
fi fi
if [ "X$SRCDIR" == "X" ]; then
echo $(basename $0) "<appname> <source directory>"
exit 1
fi
echo "-> Create $APPDIR directory" echo "-> Create $APPDIR directory"
try mkdir $APPDIR try mkdir $APPDIR
@ -28,6 +35,7 @@ echo "-> Customize templates"
try find $APPDIR -type f -exec sed -i '' "s/##APPID##/$APPID/g" {} \; try find $APPDIR -type f -exec sed -i '' "s/##APPID##/$APPID/g" {} \;
try find $APPDIR -type f -exec sed -i '' "s/##APPNAME##/$APPNAME/g" {} \; try find $APPDIR -type f -exec sed -i '' "s/##APPNAME##/$APPNAME/g" {} \;
try find $APPDIR -type f -exec sed -i '' "s/##SDKVER##/$SDKVER/g" {} \; try find $APPDIR -type f -exec sed -i '' "s/##SDKVER##/$SDKVER/g" {} \;
try find $APPDIR -type f -exec sed -i '' "s^##SRCDIR##^$SRCDIR^g" {} \;
echo "-> Done !" echo "-> Done !"

View file

@ -168,10 +168,11 @@
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
1D6058900D05DD3D006BFB54 /* ##APPID## */ = { 1D6058900D05DD3D006BFB54 /* ##APPNAME## */ = {
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "##APPID##" */; buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "##APPID##" */;
buildPhases = ( buildPhases = (
113D17E2153E3DB5001310A5 /* ShellScript */,
1D60588D0D05DD3D006BFB54 /* Resources */, 1D60588D0D05DD3D006BFB54 /* Resources */,
1D60588E0D05DD3D006BFB54 /* Sources */, 1D60588E0D05DD3D006BFB54 /* Sources */,
1D60588F0D05DD3D006BFB54 /* Frameworks */, 1D60588F0D05DD3D006BFB54 /* Frameworks */,
@ -226,6 +227,22 @@
}; };
/* End PBXResourcesBuildPhase section */ /* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
113D17E2153E3DB5001310A5 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 12;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
shellScript = "../tools/populate-project.sh ##APPNAME## ##SRCDIR## ";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */
1D60588E0D05DD3D006BFB54 /* Sources */ = { 1D60588E0D05DD3D006BFB54 /* Sources */ = {
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;