Customizing the build path in project.properties

I have an android project that is created using ant (ant debug / release) to generate an executable. The dependent project path was set from project.properties as follows:

android.library.reference.1=../../../backup/cocos2d-x-2.2.1/cocos2dx/platform/android/java

android.library.reference.2=../../../backup/adt-bundle-mac-x86_64-20130522/sdk/extras/google/google_play_services/libproject/google-play-services_lib

But the path is relative to my system. I wanted to change the path using some environment variables, for example:

android.library.reference.1=$COCOS_HOME/cocos2dx/platform/android/java

But that does not work. Should I define it somewhere in the ant build file? Any help would be appreciated.

+3
source share
2 answers

Mads, , <property environment="env"/> build.xml local.properties project.properties. project.properties :

android.library.reference.1=${env.COCOS_HOME}/cocos2dx/platform/android/java

, COCOS_HOME .

, , , Windows ( * nixes?), COCOS2DX_ROOT='D:\softwares\ANDROID\cocos2d-x-2.2' .

, , , local.properties.

local.properties( ) project.properties . , local.properties project.properties:

local.properties

COCOS2DX_ROOT_RELATIVE=../../../cocos2d-x-2.2
ANDROID_ROOT_RELATIVE=../../../adt-bundle-windows-x86-20131030/sdk
# location of the SDK. This is only used by Ant
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=D:\\softwares\\ANDROID\\adt-bundle-windows-x86-20131030\\sdk

project.properties

android.library.reference.1=${COCOS2DX_ROOT_RELATIVE}/cocos2dx/platform/android/java
android.library.reference.2=${ANDROID_ROOT_RELATIVE}/extras/google/google_play_services/libproject/google-play-services_lib

local.properties build.xml, , , project.properties ${...}.

+2

COCOS_HOME, , .

environment .           , , .

, , .

:

<property environment="env"/>
<echo message="COCOS_HOME is set to = ${env.COCOS_HOME}"/>
<property file="android.properties"/>
<echo message="android.library.reference.1 is set to = ${android.library.reference.1}" />
0

All Articles