Skip to content

Commit

Permalink
Add a build phase that automatically calls populate-project for the u…
Browse files Browse the repository at this point in the history
…ser.
  • Loading branch information
Joseph Hager committed Apr 18, 2012
1 parent 18687fb commit f32d0c9
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 6 deletions.
18 changes: 14 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@ Kivy for IOS
(This is a work in progress.)

#. Build the whole toolchain with `tools/build_all.sh`
#. Create an xcode project for your application with `tools/create-xcode-project.sh test`
#. Populate the project with your application source code `tools/populate-project.sh test /path/to/app`
#. Open your newly xcode project created
#. Ensure the code signing is ok
#. Create an Xcode project for your application with
`tools/create-xcode-project.sh test /path/to/app`
#. Open your newly created Xcode project
#. Ensure code signing is setup correctly
#. 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.
10 changes: 9 additions & 1 deletion tools/create-xcode-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,21 @@ try () {
. $(dirname $0)/environment.sh

APPNAME=$1
SRCDIR=$2
APPID=$(echo $APPNAME | tr '[A-Z]' '[a-z]')
TEMPLATESDIR=$(dirname $0)/templates/
APPDIR=$KIVYIOSROOT/app-$APPID
if [ "X$APPNAME" == "X" ]; then
echo $(basename $0) "<appname>"
echo $(basename $0) "<appname> <source directory>"
exit 1
fi

if [ "X$SRCDIR" == "X" ]; then
echo $(basename $0) "<appname> <source directory>"
exit 1
fi


echo "-> Create $APPDIR directory"
try mkdir $APPDIR

Expand All @@ -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/##APPNAME##/$APPNAME/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 !"

Expand Down
19 changes: 18 additions & 1 deletion tools/templates/template.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,11 @@
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
1D6058900D05DD3D006BFB54 /* ##APPID## */ = {
1D6058900D05DD3D006BFB54 /* ##APPNAME## */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "##APPID##" */;
buildPhases = (
113D17E2153E3DB5001310A5 /* ShellScript */,
1D60588D0D05DD3D006BFB54 /* Resources */,
1D60588E0D05DD3D006BFB54 /* Sources */,
1D60588F0D05DD3D006BFB54 /* Frameworks */,
Expand Down Expand Up @@ -226,6 +227,22 @@
};
/* 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 */
1D60588E0D05DD3D006BFB54 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down

0 comments on commit f32d0c9

Please sign in to comment.