I’ve been automating my iOS build systems using various tools such as Xcodebuilder, Ant, Applescript and several plugins. I want to use a common format for settings across the various scripts so I picked JSON because I could easily parse it in each instance.
To get you started, here’s an quick Ant build example that will parse a simple JSON object in
properties.json and set those properties in the Ant project.
properties.json (in a Gist):
build.xml file (in a Gist):
And the result (in a Gist):
Jeffreys-MacBook-Air$ ant example Buildfile: /Users/jsambells/Documents/example/build.xml [echo] Parsing properties [echo] greeting=Hello [echo] audience=world example: [echo] Hello world
project.getProperty('name') to retrieve existing properties from Ant in the
<script> if you need. Now you can use JSON directly from a url or file to set the environment in your Ant build.