Skip to content

Instantly share code, notes, and snippets.

@vincentbrison
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vincentbrison/1d1d13ab891a5b8ecf8e to your computer and use it in GitHub Desktop.
Save vincentbrison/1d1d13ab891a5b8ecf8e to your computer and use it in GitHub Desktop.
Ant boilerplate for Android
<?xml version="1.0" encoding="UTF-8"?>
<project name="AndroidAntBoilerPlateExample" >
<!-- Copy Config.java to our source tree, replacing custom tokens with values in build.properties. The configuration depends on "clean" because otherwise the build system will not detect changes in the configuration. -->
<target
name="dev"
description="Copy env filtered values" >
<!-- Copy the configuration file, replacing tokens in the file. -->
<copy
encoding="utf-8"
overwrite="true"
todir="res"
verbose="true" >
<fileset dir="config/filtered" />
<filterset refid="filterSetDev" />
</copy>
</target>
<filterset id="filterSetDev" >
<filtersfile file="config/filters/dev.properties" />
</filterset>
<target
name="test"
description="Copy env filtered values" >
<!-- Copy the configuration file, replacing tokens in the file. -->
<copy
encoding="utf-8"
overwrite="true"
todir="res"
verbose="true" >
<fileset dir="config/filtered" />
<filterset refid="filterSetTest" />
</copy>
</target>
<filterset id="filterSetTest" >
<filtersfile file="config/filters/test.properties" />
</filterset>
<target
name="prod"
description="Copy env filtered values" >
<!-- Copy the configuration file, replacing tokens in the file. -->
<copy
encoding="utf-8"
overwrite="true"
todir="res"
verbose="true" >
<fileset dir="config/filtered" />
<filterset refid="filterSetProd" />
</copy>
</target>
<filterset id="filterSetProd" >
<filtersfile file="config/filters/prod.properties" />
</filterset>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment