diff --git a/tools/jenkins_scripts/mac/android/build-android-2.2-3.2-debug.sh b/tools/jenkins_scripts/mac/android/build-android-2.2-3.2-debug.sh index 552c7d2fb1..ca5881893e 100755 --- a/tools/jenkins_scripts/mac/android/build-android-2.2-3.2-debug.sh +++ b/tools/jenkins_scripts/mac/android/build-android-2.2-3.2-debug.sh @@ -91,12 +91,12 @@ IsTestCpp=1 cp $ROOT/tools/jenkins_scripts/ant.properties $ROOT/samples/Cpp/TestCpp/proj.android cp $ROOT/tools/jenkins_scripts/build.xml $ROOT/samples/Cpp/TestCpp/proj.android cp $ROOT/tools/jenkins_scripts/mac/rootconfig-mac.sh $ROOT/samples/Cpp/TestCpp/proj.android -cd samples/Cpp/TestCpp/proj.android +cd $ROOT/samples/Cpp/TestCpp/proj.android sh rootconfig-mac.sh TestCpp sh build_native.sh #update android project configuration files -cd .. +cd $ROOT/samples/Cpp/TestCpp android update project -p proj.android cd proj.android antcompile @@ -106,10 +106,10 @@ IsTestCpp=0 cp $ROOT/tools/jenkins_scripts/ant.properties $ROOT/samples/Cpp/HelloCpp/proj.android cp $ROOT/tools/jenkins_scripts/build.xml $ROOT/samples/Cpp/HelloCpp/proj.android cp $ROOT/tools/jenkins_scripts/mac/rootconfig-mac.sh $ROOT/samples/Cpp/HelloCpp/proj.android -cd ../../Cpp/HelloCpp/proj.android +cd $ROOT/samples/Cpp/HelloCpp/proj.android sh rootconfig-mac.sh HelloCpp sh build_native.sh -cd .. +cd $ROOT/samples/Cpp/HelloCpp android update project -p proj.android cd proj.android antcompile @@ -117,16 +117,16 @@ antcompile cp $ROOT/tools/jenkins_scripts/ant.properties $ROOT/samples/Lua/HelloLua/proj.android cp $ROOT/tools/jenkins_scripts/build.xml $ROOT/samples/Lua/HelloLua/proj.android cp $ROOT/tools/jenkins_scripts/mac/rootconfig-mac.sh $ROOT/samples/Lua/CppHelloLua/proj.android -cd ../../Lua/HelloLua/proj.android +cd $ROOT/samples/Lua/HelloLua/proj.android sh rootconfig-mac.sh HelloLua sh build_native.sh -cd .. +cd $ROOT/samples/Lua/HelloLua android update project -p proj.android cd proj.android antcompile #return the compileresult. -cd ../../.. +cd $ROOT if [ $compileresult != 0 ]; then # git checkout -f # git clean -df -x diff --git a/tools/jenkins_scripts/mac/android/build-android-4.x-debug.sh b/tools/jenkins_scripts/mac/android/build-android-4.x-debug.sh index 90fbb34639..83e9769894 100755 --- a/tools/jenkins_scripts/mac/android/build-android-4.x-debug.sh +++ b/tools/jenkins_scripts/mac/android/build-android-4.x-debug.sh @@ -49,7 +49,7 @@ IsTestCpp=1 cp $ROOT/tools/jenkins_scripts/ant.properties $ROOT/samples/Cpp/TestCpp/proj.android cp $ROOT/tools/jenkins_scripts/build.xml $ROOT/samples/Cpp/TestCpp/proj.android cp $ROOT/tools/jenkins_scripts/mac/rootconfig-mac.sh $ROOT/samples/Cpp/TestCpp/proj.android -cd samples/TestCpp/proj.android +cd samples/Cpp/TestCpp/proj.android sh rootconfig-mac.sh TestCpp sh build_native.sh diff --git a/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-debug.bat b/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-debug.bat index 65c8fab412..034cf4308e 100755 --- a/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-debug.bat +++ b/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-debug.bat @@ -13,16 +13,17 @@ if not exist "%ANT_HOME%" echo Couldn't find Ant at "%ANT_HOME%" and you should set _PROJECTNAME=TestCpp set _LANGUAGE_=Cpp -cd ..\..\..\.. +set _ROOT_=%cd%\..\..\..\.. +cd %_ROOT_% :project ::Copy build Configuration files to target directory -copy %cd%\tools\jenkins_scripts\ant.properties %cd%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android /Y -copy %cd%\tools\jenkins_scripts\build.xml %cd%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android /Y -copy %cd%\tools\jenkins_scripts\windows\android\rootconfig.sh %cd%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android /Y +copy %_ROOT_%\tools\jenkins_scripts\ant.properties %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android /Y +copy %_ROOT_%\tools\jenkins_scripts\build.xml %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android /Y +copy %_ROOT_%\tools\jenkins_scripts\windows\android\rootconfig.sh %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android /Y ::Modify the configuration files -cd samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android +cd %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android rootconfig.sh %_PROJECTNAME% cd .. set _PROJECTLOCATION=%cd% @@ -129,7 +130,7 @@ if "%%a"=="target=android-13" (echo/target=android-8)else echo/%%a move anttmp.properties ant.properties ::Calculate the errorlevel and change build target. -cd ..\..\.. +cd %_ROOT_% if "%_PROJECTNAME%"=="TestCpp" set /a TestCpp_Result=(result8+result10+result11+result12+result13) && set _PROJECTNAME=HelloCpp&& goto project if "%_PROJECTNAME%"=="HelloCpp" set /a HelloCpp_Result=(result8+result10+result11+result12+result13) && set _LANGUAGE_=Lua && set _PROJECTNAME=HelloLua&& goto project if "%_PROJECTNAME%"=="HelloLua" set /a HelloLua_Result=(result8+result10+result11+result12+result13) diff --git a/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-release.bat b/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-release.bat index 60f7d89e05..c5e360c5ad 100755 --- a/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-release.bat +++ b/tools/jenkins_scripts/windows/android/build-android-2.2-3.2-release.bat @@ -12,16 +12,17 @@ if not exist "%ANT_HOME%" echo Couldn't find Ant at "%ANT_HOME%" and you should set _PROJECTNAME=TestCpp set _LANGUAGE_=Cpp -cd ..\..\..\.. +set _ROOT_=%cd%\..\..\..\.. +cd %_ROOT_% :project ::Copy build Configuration files to target directory -copy %cd%\tools\jenkins_scripts\ant.properties %cd%\samples\%_LANGUANE_%\%_PROJECTNAME%\proj.android -copy %cd%\tools\jenkins_scripts\build.xml %cd%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android -copy %cd%\tools\jenkins_scripts\windows\android\rootconfig.sh %cd%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android +copy %_ROOT_%\tools\jenkins_scripts\ant.properties %_ROOT_%\samples\%_LANGUANE_%\%_PROJECTNAME%\proj.android +copy %_ROOT_%\tools\jenkins_scripts\build.xml %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android +copy %_ROOT_%\tools\jenkins_scripts\windows\android\rootconfig.sh %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android ::Modify the configuration files -cd samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android +cd %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android rootconfig.sh %_PROJECTNAME% cd .. set _PROJECTLOCATION=%cd% @@ -146,7 +147,7 @@ for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis move ant1.properties ant.properties ::Calculate the errorlevel and change build target. -cd ..\..\.. +cd %_ROOT_% IF "%_PROJECTNAME%"=="TestCpp" set /a testresult1=(result8+result10+result11+result12+result13) && set _PROJECTNAME=HelloCpp&& goto project IF "%_PROJECTNAME%"=="HelloCpp" set /a testresult2=(result8+result10+result11+result12+result13) && set _LANGUAGE_=Lua && set _PROJECTNAME=HelloLua&& goto project IF "%_PROJECTNAME%"=="HelloLua" set /a testresult3=(result8+result10+result11+result12+result13) diff --git a/tools/jenkins_scripts/windows/android/build-android-4.x-debug.bat b/tools/jenkins_scripts/windows/android/build-android-4.x-debug.bat index 230e4b75ba..77e4fc9b5b 100755 --- a/tools/jenkins_scripts/windows/android/build-android-4.x-debug.bat +++ b/tools/jenkins_scripts/windows/android/build-android-4.x-debug.bat @@ -12,16 +12,17 @@ if not exist "%ANT_HOME%" echo Couldn't find Ant at "%ANT_HOME%" and you should set _PROJECTNAME=TestCpp set _LANGUAGE_=CPP -cd ..\..\..\.. +set _ROOT_=%cd%\..\..\..\.. +cd _ROOT_ :project ::Copy build Configuration files to target directory -copy %cd%\tools\jenkins_scripts\ant.properties %cd%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android -copy %cd%\tools\jenkins_scripts\build.xml %cd%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android -copy %cd%\tools\jenkins_scripts\windows\android\rootconfig.sh %cd%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android +copy %_ROOT_%\tools\jenkins_scripts\ant.properties %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android +copy %_ROOT_%\tools\jenkins_scripts\build.xml %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android +copy %_ROOT_%\tools\jenkins_scripts\windows\android\rootconfig.sh %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android ::Modify the configuration files -cd samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android +cd %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android rootconfig.sh %_PROJECTNAME% cd .. set _PROJECTLOCATION=%cd% @@ -85,7 +86,7 @@ if "%%a"=="target=android-15" (echo/target=android-8)else echo/%%a move anttmp.properties ant.properties ::Calculate the errorlevel and change build target. -cd ../../.. +cd %_ROOT_% IF "%_PROJECTNAME%"=="TestCpp" set /a testresult1=(result14+result15) && set _PROJECTNAME=HelloCpp&& goto project IF "%_PROJECTNAME%"=="HelloCpp" set /a testresult2=(result14+result15) && set _LANGUAGE_=Lua && set _PROJECTNAME=HelloLua&& goto project IF "%_PROJECTNAME%"=="HelloLua" set /a testresult3=(result14+result15) diff --git a/tools/jenkins_scripts/windows/android/build-android-4.x-release.bat b/tools/jenkins_scripts/windows/android/build-android-4.x-release.bat index b1c8e7e539..8164a5ae6a 100755 --- a/tools/jenkins_scripts/windows/android/build-android-4.x-release.bat +++ b/tools/jenkins_scripts/windows/android/build-android-4.x-release.bat @@ -12,16 +12,17 @@ if not exist "%ANT_HOME%" echo Couldn't find Ant at "%ANT_HOME%" and you should set _PROJECTNAME=TestCpp set _LANGUAGE=Cpp -cd ..\..\..\.. +set _ROOT_=%cd%\..\..\..\.. +cd %_ROOT_% :project ::Copy build Configuration files to target directory -copy %cd%\tools\jenkins_scripts\ant.properties %cd%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android -copy %cd%\tools\jenkins_scripts\build.xml %cd%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android -copy %cd%\tools\jenkins_scripts\windows\android\rootconfig.sh %cd%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android +copy %_ROOT_%\tools\jenkins_scripts\ant.properties %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android +copy %_ROOT_%\tools\jenkins_scripts\build.xml %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android +copy %_ROOT_%\tools\jenkins_scripts\windows\android\rootconfig.sh %_ROOT_%\samples\%_LANGUAGE_%\%_PROJECTNAME%\proj.android ::Modify the configuration files -cd samples\%_PROJECTNAME%\proj.android +cd %_ROOT_%\samples\%_PROJECTNAME%\proj.android rootconfig.sh %_PROJECTNAME% cd .. set _PROJECTLOCATION=%cd% @@ -94,7 +95,7 @@ for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis move ant1.properties ant.properties ::Calculate the errorlevel and change build target. -cd ..\..\.. +cd %_ROOT_% IF "%_PROJECTNAME%"=="TestCpp" set /a testresult1=(result14+result15) && set _PROJECTNAME=HelloCpp&& goto project IF "%_PROJECTNAME%"=="HelloCpp" set /a testresult2=(result14+result15) && set _LANGUAGE_=Lua && set _PROJECTNAME=HelloLua&& goto project IF "%_PROJECTNAME%"=="HelloLua" set /a testresult3=(result14+result15) diff --git a/tools/jenkins_scripts/windows/android/rootconfig.sh b/tools/jenkins_scripts/windows/android/rootconfig.sh index 1eae455170..cce166d359 100755 --- a/tools/jenkins_scripts/windows/android/rootconfig.sh +++ b/tools/jenkins_scripts/windows/android/rootconfig.sh @@ -5,7 +5,6 @@ #NDK_ROOT=$($CYGWIN/bin/cygpath.exe $ANDROID_NDK) #echo $NDK_ROOT CUR=$(pwd) -cd ../../.. #tmp=$(pwd) #COCOS2DX=$($CYGWIN/bin/cygpath.exe $tmp) #echo $COCOS2DX @@ -31,13 +30,13 @@ if [ $1 = TestCpp ]; then elif [ $1 = HelloCpp ]; then sed -i '2d' $CUR/build.xml sed -i '2 i\' $CUR/build.xml -else [ $1 = HelloLua ]; then +elif [ $1 = HelloLua ]; then sed -i '2d' $CUR/build.xml sed -i '2 i\' $CUR/build.xml -else [ $1 = TestLua ]; then +elif [ $1 = TestLua ]; then sed -i '2d' $CUR/build.xml sed -i '2 i\' $CUR/build.xml -else [ $1 = TestJavascript ]; then +elif [ $1 = TestJavascript ]; then sed -i '2d' $CUR/build.xml sed -i '2 i\' $CUR/build.xml else [ $1 = SimpleGame ]; then