From 3fce97e62edcd134c980558c9a6e0de756a43769 Mon Sep 17 00:00:00 2001 From: Caidongyang Date: Mon, 6 Aug 2012 11:55:05 +0800 Subject: [PATCH 1/2] issue #1404:Modify directory structure --- tools/JenkinsScript/androidtest-debug3.bat | 125 ---------------- tools/JenkinsScript/androidtest-debug3.sh | 104 ------------- tools/JenkinsScript/androidtest-debug4.bat | 100 ------------- tools/JenkinsScript/androidtest-debug4.sh | 80 ---------- tools/JenkinsScript/androidtest-release3.bat | 149 ------------------- tools/JenkinsScript/androidtest-release3.sh | 108 -------------- tools/JenkinsScript/androidtest-release4.bat | 115 -------------- tools/JenkinsScript/androidtest-release4.sh | 84 ----------- tools/JenkinsScript/androidtestcommon.bat | 89 ----------- tools/JenkinsScript/debug.keystore | Bin 1268 -> 0 bytes tools/JenkinsScript/iostest-debug.sh | 72 --------- tools/JenkinsScript/iostest-release.sh | 72 --------- tools/JenkinsScript/mactest-debug.sh | 56 ------- tools/JenkinsScript/mactest-release.sh | 56 ------- tools/JenkinsScript/rootconfig-Mac.sh | 31 ---- tools/JenkinsScript/rootconfig.sh | 35 ----- 16 files changed, 1276 deletions(-) delete mode 100644 tools/JenkinsScript/androidtest-debug3.bat delete mode 100644 tools/JenkinsScript/androidtest-debug3.sh delete mode 100644 tools/JenkinsScript/androidtest-debug4.bat delete mode 100644 tools/JenkinsScript/androidtest-debug4.sh delete mode 100644 tools/JenkinsScript/androidtest-release3.bat delete mode 100644 tools/JenkinsScript/androidtest-release3.sh delete mode 100644 tools/JenkinsScript/androidtest-release4.bat delete mode 100644 tools/JenkinsScript/androidtest-release4.sh delete mode 100644 tools/JenkinsScript/androidtestcommon.bat delete mode 100644 tools/JenkinsScript/debug.keystore delete mode 100644 tools/JenkinsScript/iostest-debug.sh delete mode 100644 tools/JenkinsScript/iostest-release.sh delete mode 100644 tools/JenkinsScript/mactest-debug.sh delete mode 100644 tools/JenkinsScript/mactest-release.sh delete mode 100644 tools/JenkinsScript/rootconfig-Mac.sh delete mode 100644 tools/JenkinsScript/rootconfig.sh diff --git a/tools/JenkinsScript/androidtest-debug3.bat b/tools/JenkinsScript/androidtest-debug3.bat deleted file mode 100644 index 33b0085a7c..0000000000 --- a/tools/JenkinsScript/androidtest-debug3.bat +++ /dev/null @@ -1,125 +0,0 @@ -::This script is used to finish a android automated compiler. -::You should make sure have finished the environment setting. -::Here are the environment variables you should set. -::%ANT_HOME% %ANDROID_HOME% %JAVA_HOME% %CYGWIN% %GITBIN% %ANDROID_NDK% -:: Don't change it until you know what you do. - -if not exist "%CYGWIN%" echo Couldn't find Cygwin at "%CYGWIN%" and you should set like this "C:\cygwin"& pause & exit 1 -if not exist "%GITBIN%" echo Couldn't find Gitbin at "%GITBIN%" and you should set like this "F:\Git\bin"& pause & exit 2 -if not exist "%ANDROID_HOME%" echo Couldn't find ANDROID_HOME at "%ANDROID_HOME%" and you should set like this "D:\Windows7\android-sdk-windows"& pause & exit 3 -if not exist "%ANDROID_NDK%" echo Couldn't find Cygwin at "%ANDROID_NDK%" and you should set like this "D:\Windows7\android-ndk-r8"& pause & exit 4 -if not exist "%JAVA_HOME%" echo Couldn't find Cygwin at "%JAVA_HOME%" and you should set like this "C:\Program Files\Java\jdk1.7.0_05"& pause & exit 5 - -set _PROJECTNAME=TestCpp -cd ..\.. - -:project -::Copy build Configuration files to target directory -copy %cd%\tools\JenkinsScript\ant.properties %cd%\samples\%_PROJECTNAME%\proj.android -copy %cd%\tools\JenkinsScript\build.xml %cd%\samples\%_PROJECTNAME%\proj.android -copy %cd%\tools\JenkinsScript\rootconfig.sh %cd%\samples\%_PROJECTNAME%\proj.android - -::Modify the configuration files -cd samples\%_PROJECTNAME%\proj.android -rootconfig.sh %_PROJECTNAME% -cd .. -set _PROJECTLOCATION=%cd% - -::A command line that make the current user get the ownrship of project. -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F - -::Use cygwin compile the source code. -cygpath "%_PROJECTLOCATION%\proj.android\build_native.sh"|call %CYGWIN%\Cygwin.bat - -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F -::echo "%_PROJECTION%/proj.android/build_native.sh"|call %CYGWIN%\Cygwin.bat - -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F -call android update project -p proj.android -cd proj.android - -::Make sure the original android build target is android-8 -for /f "delims=" %%a in ('findstr /i "target=android-" ant.properties') do set xx=%%a -echo %xx% -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="%xx%" (echo/target=android-8)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Android ant build(debug,API level:8). -call ant debug -set result8=%ERROELEVEL% - -::Change API level.(API level:10) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-8" (echo/target=android-10)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Android ant build(debug,API level:10). -call ant debug -set result10=%ERRORLEVEL% - -::Change API level.(API level:11) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-10" (echo/target=android-11)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Android ant build(debug,API level:11). -call ant debug -set result11=%ERRORlEVEL% - -::Change API level.(API level:12) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-11" (echo/target=android-12)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Android ant build(debug,API level:12). -call ant debug -set result12=%ERRORLEVEL% - -::Change API level.(API level:13) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-12" (echo/target=android-13)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Android ant build(debug,API level:13). -call ant debug -set result13=%ERRORLEVEL% - -::After all test versions completed,changed current API level to the original.(API level:8) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-13" (echo/target=android-8)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Calculate the errorlevel and change build target. -cd ..\..\.. -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 _PROJECTNAME=HelloLua&& goto project -IF "%_PROJECTNAME%"=="HelloLua" set /a testresult3=(result8+result10+result11+result12+result13) -set /a testresult=(testresult1+testresult2+testresult3) -IF %testresult% NEQ 0 goto error - -goto success - -:error -echo Error. -git checkout -f -git clean -df -x -pause -exit 1 -goto end - -:success -echo Success. -git checkout -f -git clean -df -x -pause -exit 0 -goto end - -::End. \ No newline at end of file diff --git a/tools/JenkinsScript/androidtest-debug3.sh b/tools/JenkinsScript/androidtest-debug3.sh deleted file mode 100644 index b6f4f647a8..0000000000 --- a/tools/JenkinsScript/androidtest-debug3.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/bash -#This script is used to finish a android automated compiler. -#You should make sure have finished the environment setting. -#Here are the environment variables you should set. -#$COCOS2DX_ROOT $ANDROID_SDK_ROOT $ANDROID_NDK_ROOT $NDK_ROOT - -antcompile() -{ - #Make sure the original target is android-8 - sed '/target=/s/=.*$/=android-8/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - - #Android ant build(debug ,API level:8) - ant debug - #If build failed,make sure the Jenkins could get the errorlevel. - compileresult=$[$compileresult+$?] - - #Change API level.(API level:10) - sed '/target=/s/=.*$/=android-10/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant debug - compileresult=$[$compileresult+$?] - - #Change API level.(API level:11) - sed '/target=/s/=.*$/=android-11/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant debug - compileresult=$[$compileresult+$?] - - #Change API level.(API level:12) - sed '/target=/s/=.*$/=android-12/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant debug - compileresult=$[$compileresult+$?] - - #Change API level.(API level:13) - sed '/target=/s/=.*$/=android-13/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant debug - compileresult=$[$compileresult+$?] - - #After all test versions completed,changed current API level to the original.(API level:8) - sed '/target=/s/=.*$/=android-8/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties -} - -#record the relevant catalog -compileresult=0 -CUR=$(pwd) -cd ../.. -ROOT=$(pwd) - -#copy configuration files to target. -cp $CUR/ant.properties $ROOT/samples/TestCpp/proj.android -cp $CUR/build.xml $ROOT/samples/TestCpp/proj.android -cp $CUR/rootconfig-Mac.sh $ROOT/samples/TestCpp/proj.android -cd samples/TestCpp/proj.android -sh rootconfig-Mac.sh TestCpp -sh build_native.sh - -#update android project configuration files -cd .. -android update project -p proj.android -cd proj.android -antcompile - -cp $CUR/ant.properties $ROOT/samples/HelloCpp/proj.android -cp $CUR/build.xml $ROOT/samples/HelloCpp/proj.android -cp $CUR/rootconfig-Mac.sh $ROOT/samples/HelloCpp/proj.android -cd ../../HelloCpp/proj.android -sh rootconfig-Mac.sh HelloCpp -sh build_native.sh -cd .. -android update project -p proj.android -cd proj.android -antcompile - -cp $CUR/ant.properties $ROOT/samples/HelloLua/proj.android -cp $CUR/build.xml $ROOT/samples/HelloLua/proj.android -cp $CUR/rootconfig-Mac.sh $ROOT/samples/HelloLua/proj.android -cd ../../HelloLua/proj.android -sh rootconfig-Mac.sh HelloLua -sh build_native.sh -cd .. -android update project -p proj.android -cd proj.android -antcompile - -#return the compileresult. -cd ../../.. -if [ $compileresult != 0 ]; then - git checkout -f - git clean -df -x - exit 1 -else - git checkout -f - git clean -df -x -fi \ No newline at end of file diff --git a/tools/JenkinsScript/androidtest-debug4.bat b/tools/JenkinsScript/androidtest-debug4.bat deleted file mode 100644 index 97dbc5a118..0000000000 --- a/tools/JenkinsScript/androidtest-debug4.bat +++ /dev/null @@ -1,100 +0,0 @@ -::This script is used to finish a android automated compiler. -::You should make sure have finished the environment setting. -::Here are the environment variables you should set. -::%ANT_HOME% %ANDROID_HOME% %JAVA_HOME% %CYGWIN% %GITBIN% %ANDROID_NDK% -:: Don't change it until you know what you do. - -if not exist "%CYGWIN%" echo Couldn't find Cygwin at "%CYGWIN%" and you should set like this "C:\cygwin"& pause & exit 1 -if not exist "%GITBIN%" echo Couldn't find Gitbin at "%GITBIN%" and you should set like this "F:\Git\bin"& pause & exit 2 -if not exist "%ANDROID_HOME%" echo Couldn't find ANDROID_HOME at "%ANDROID_HOME%" and you should set like this "D:\Windows7\android-sdk-windows"& pause & exit 3 -if not exist "%ANDROID_NDK%" echo Couldn't find Cygwin at "%ANDROID_NDK%" and you should set like this "D:\Windows7\android-ndk-r8"& pause & exit 4 -if not exist "%JAVA_HOME%" echo Couldn't find Cygwin at "%JAVA_HOME%" and you should set like this "C:\Program Files\Java\jdk1.7.0_05"& pause & exit 5 - -set _PROJECTNAME=TestCpp -cd ..\.. - -:project -::Copy build Configuration files to target directory -copy %cd%\tools\JenkinsScript\ant.properties %cd%\samples\%_PROJECTNAME%\proj.android -copy %cd%\tools\JenkinsScript\build.xml %cd%\samples\%_PROJECTNAME%\proj.android -copy %cd%\tools\JenkinsScript\rootconfig.sh %cd%\samples\%_PROJECTNAME%\proj.android - -::Modify the configuration files -cd samples\%_PROJECTNAME%\proj.android -rootconfig.sh %_PROJECTNAME% -cd .. -set _PROJECTLOCATION=%cd% - -::A command line that make the current user get the ownrship of project. -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F - -::Use cygwin compile the source code. -cygpath "%_PROJECTLOCATION%\proj.android\build_native.sh"|call %CYGWIN%\Cygwin.bat - -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F -::echo "%_PROJECTION%/proj.android/build_native.sh"|call %CYGWIN%\Cygwin.bat - -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F -call android update project -p proj.android -cd proj.android - -for /f "delims=" %%a in ('findstr /i "target=android-" ant.properties') do set xx=%%a -echo %xx% -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="%xx%" (echo/target=android-8)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Change API level.(API level:14) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-8" (echo/target=android-14)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Android ant build(debug,API level:14). -call ant debug -set result14=%ERRORLEVEL% - -::Change API level.(API level:15) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-14" (echo/target=android-15)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Android ant build(debug,API level:15). -call ant debug -set result15=%ERRORLEVEL% - -::After all test versions completed,changed current API level to the original.(API level:8) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-15" (echo/target=android-8)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Calculate the errorlevel and change build target. -cd ../../.. -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 _PROJECTNAME=HelloLua&& goto project -IF "%_PROJECTNAME%"=="HelloLua" set /a testresult3=(result8+result10+result11+result12+result13) -set /a testresult=(testresult1+testresult2+testresult3) -IF %testresult% NEQ 0 goto error - -goto success - -:error -echo Error. -git checkout -f -git clean -df -x -pause -exit 1 -goto end - -:success -echo Success. -git checkout -f -git clean -df -x -pause -exit 0 -goto end - -::End. \ No newline at end of file diff --git a/tools/JenkinsScript/androidtest-debug4.sh b/tools/JenkinsScript/androidtest-debug4.sh deleted file mode 100644 index 7b4c8b09ba..0000000000 --- a/tools/JenkinsScript/androidtest-debug4.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash -#This script is used to finish a android automated compiler. -#You should make sure have finished the environment setting. -#Here are the environment variables you should set. -#$COCOS2DX_ROOT $ANDROID_SDK_ROOT $ANDROID_NDK_ROOT $NDK_ROOT - -antcompile() -{ - #Change API level.(API level:14) - sed '/target=/s/=.*$/=android-14/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant release - compileresult=$[$compileresult+$?] - - #Change API level.(API level:15) - sed '/target=/s/=.*$/=android-15/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant release - compileresult=$[$compileresult+$?] - - #After all test versions completed,changed current API level to the original.(API level:8) - sed '/target=/s/=.*$/=android-8/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties -} - -#record the relevant catalog -compileresult=0 -CUR=$(pwd) -cd ../.. -ROOT=$(pwd) - -#copy configuration files to target. -cp $CUR/ant.properties $ROOT/samples/TestCpp/proj.android -cp $CUR/build.xml $ROOT/samples/TestCpp/proj.android -cp $CUR/rootconfig-Mac.sh $ROOT/samples/TestCpp/proj.android -cd samples/TestCpp/proj.android -sh rootconfig-Mac.sh TestCpp -sh build_native.sh - -#update android project configuration files -cd .. -android update project -p proj.android -cd proj.android -antcompile - -cp $CUR/ant.properties $ROOT/samples/HelloCpp/proj.android -cp $CUR/build.xml $ROOT/samples/HelloCpp/proj.android -cp $CUR/rootconfig-Mac.sh $ROOT/samples/HelloCpp/proj.android -cd ../../HelloCpp/proj.android -sh rootconfig-Mac.sh HelloCpp -sh build_native.sh -cd .. -android update project -p proj.android -cd proj.android -antcompile - -cp $CUR/ant.properties $ROOT/samples/HelloLua/proj.android -cp $CUR/build.xml $ROOT/samples/HelloLua/proj.android -cp $CUR/rootconfig-Mac.sh $ROOT/samples/HelloLua/proj.android -cd ../../HelloLua/proj.android -sh rootconfig-Mac.sh HelloLua -sh build_native.sh -cd .. -android update project -p proj.android -cd proj.android -antcompile - -#return the compileresult. -cd ../../.. -if [ $compileresult != 0 ]; then - git checkout -f - git clean -df -x - exit 1 -else - git checkout -f - git clean -df -x -fi \ No newline at end of file diff --git a/tools/JenkinsScript/androidtest-release3.bat b/tools/JenkinsScript/androidtest-release3.bat deleted file mode 100644 index ff5bf939b2..0000000000 --- a/tools/JenkinsScript/androidtest-release3.bat +++ /dev/null @@ -1,149 +0,0 @@ -::This script is used to finish a android automated compiler. -::You should make sure have finished the environment setting. -::Here are the environment variables you should set. -::%ANT_HOME% %ANDROID_HOME% %JAVA_HOME% %CYGWIN% %GITBIN% %ANDROID_NDK% -:: Don't change it until you know what you do. - -if not exist "%CYGWIN%" echo Couldn't find Cygwin at "%CYGWIN%" and you should set like this "C:\cygwin"& pause & exit 1 -if not exist "%GITBIN%" echo Couldn't find Gitbin at "%GITBIN%" and you should set like this "F:\Git\bin"& pause & exit 2 -if not exist "%ANDROID_HOME%" echo Couldn't find ANDROID_HOME at "%ANDROID_HOME%" and you should set like this "D:\Windows7\android-sdk-windows"& pause & exit 3 -if not exist "%ANDROID_NDK%" echo Couldn't find Cygwin at "%ANDROID_NDK%" and you should set like this "D:\Windows7\android-ndk-r8"& pause & exit 4 -if not exist "%JAVA_HOME%" echo Couldn't find Cygwin at "%JAVA_HOME%" and you should set like this "C:\Program Files\Java\jdk1.7.0_05"& pause & exit 5 - -set _PROJECTNAME=TestCpp -cd ..\.. - -:project -::Copy build Configuration files to target directory -copy %cd%\tools\JenkinsScript\ant.properties %cd%\samples\%_PROJECTNAME%\proj.android -copy %cd%\tools\JenkinsScript\build.xml %cd%\samples\%_PROJECTNAME%\proj.android -copy %cd%\tools\JenkinsScript\rootconfig.sh %cd%\samples\%_PROJECTNAME%\proj.android - -::Modify the configuration files -cd samples\%_PROJECTNAME%\proj.android -rootconfig.sh %_PROJECTNAME% -cd .. -set _PROJECTLOCATION=%cd% - -::A command line that make the current user get the ownrship of project. -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F - -::Use cygwin compile the source code. -cygpath "%_PROJECTLOCATION%\proj.android\build_native.sh"|call %CYGWIN%\Cygwin.bat - -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F -::echo "%_PROJECTION%/proj.android/build_native.sh"|call %CYGWIN%\Cygwin.bat - -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F -call android update project -p proj.android -cd proj.android - -::Make sure the original android build target is android-8 -for /f "delims=" %%a in ('findstr /i "target=android-" ant.properties') do set xx=%%a -echo %xx% -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="%xx%" (echo/target=android-8)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis -move ant1.properties ant.properties - -::Android ant build(release,API level:8). -call ant release -set result8=%ERRORLEVEL% - -::Change API level.(API level:10) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-8" (echo/target=android-10)else echo/%%a -)>>"ant1.properties" -move ant1.properties ant.properties - -for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis -move ant1.properties ant.properties - -::Android ant build(release,API level:10). -call ant release -set result10=%ERRORLEVEL% - -::Change API level.(API level:11) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-10" (echo/target=android-11)else echo/%%a -)>>"ant1.properties" -move ant1.properties ant.properties - -for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis -move ant1.properties ant.properties - -::Android ant build(release,API level:11). -call ant release -set result11=%ERRORLEVEL% - -::Change API level.(API level:12) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-11" (echo/target=android-12)else echo/%%a -)>>"ant1.properties" -move ant1.properties ant.properties - -for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis -move ant1.properties ant.properties - -::Android ant build(release,API level:12). -call ant release -set result12=%ERRORLEVEL% - -::Change API level.(API level:13) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-12" (echo/target=android-13)else echo/%%a -)>>"ant1.properties" -move ant1.properties ant.properties - -for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis -move ant1.properties ant.properties - -::Android ant build(release,API level:13). -call ant release -set result13=%ERRORLEVEL% - -::After all test versions completed,changed current API level to the original.(API level:8) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-13" (echo/target=android-8)else echo/%%a -)>>"ant1.properties" -move ant1.properties ant.properties - -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 ..\..\.. -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 _PROJECTNAME=HelloLua&& goto project -IF "%_PROJECTNAME%"=="HelloLua" set /a testresult3=(result8+result10+result11+result12+result13) -set /a testresult=(testresult1+testresult2+testresult3) -IF %testresult% NEQ 0 goto error - -goto success - -:lis -if "%num%"=="" goto :eof -if "%num:~-1%"==" " set num=%num:~0,-1%&goto lis -echo %num%>>ant1.properties -goto :eof - -:error -echo Error. -git checkout -f -git clean -df -x -pause -exit 1 -goto end - -:success -echo Success. -git checkout -f -git clean -df -x -pause -exit 0 -goto end - -::End. \ No newline at end of file diff --git a/tools/JenkinsScript/androidtest-release3.sh b/tools/JenkinsScript/androidtest-release3.sh deleted file mode 100644 index 0a7f662e42..0000000000 --- a/tools/JenkinsScript/androidtest-release3.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/bash -#This script is used to finish a android automated compiler. -#You should make sure have finished the environment setting. -#Here are the environment variables you should set. -#$COCOS2DX_ROOT $ANDROID_SDK_ROOT $ANDROID_NDK_ROOT $NDK_ROOT - -antcompile() -{ - #Make sure the original target is android-8 - sed '/target=/s/=.*$/=android-8/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - - #Android ant build(debug ,API level:8) - ant release - #If build failed,make sure the Jenkins could get the errorlevel. - compileresult=$[$compileresult+$?] - - #Change API level.(API level:10) - sed '/target=/s/=.*$/=android-10/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant release - compileresult=$[$compileresult+$?] - - #Change API level.(API level:11) - sed '/target=/s/=.*$/=android-11/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant release - compileresult=$[$compileresult+$?] - - #Change API level.(API level:12) - sed '/target=/s/=.*$/=android-12/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant release - compileresult=$[$compileresult+$?] - - #Change API level.(API level:13) - sed '/target=/s/=.*$/=android-13/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant release - compileresult=$[$compileresult+$?] - - #After all test versions completed,changed current API level to the original.(API level:8) - sed '/target=/s/=.*$/=android-8/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties -} - -#record the relevant catalog -compileresult=0 -CUR=$(pwd) -cd ../.. -ROOT=$(pwd) - -#copy configuration files to target. -sed -i '' '14d' $CUR/ant.properties -gsed -i "14 i\\key.store=$ANDROID_HOME/debug.keystore" $CUR/ant.properties -cp $CUR/debug.keystore $ANDROID_HOME - -cp $CUR/ant.properties $ROOT/samples/TestCpp/proj.android -cp $CUR/build.xml $ROOT/samples/TestCpp/proj.android -cp $CUR/rootconfig-Mac.sh $ROOT/samples/TestCpp/proj.android -cd samples/TestCpp/proj.android -sh rootconfig-Mac.sh TestCpp -sh build_native.sh - -#update android project configuration files -cd .. -android update project -p proj.android -cd proj.android -antcompile - -cp $CUR/ant.properties $ROOT/samples/HelloCpp/proj.android -cp $CUR/build.xml $ROOT/samples/HelloCpp/proj.android -cp $CUR/rootconfig-Mac.sh $ROOT/samples/HelloCpp/proj.android -cd ../../HelloCpp/proj.android -sh rootconfig-Mac.sh HelloCpp -sh build_native.sh -cd .. -android update project -p proj.android -cd proj.android -antcompile - -cp $CUR/ant.properties $ROOT/samples/HelloLua/proj.android -cp $CUR/build.xml $ROOT/samples/HelloLua/proj.android -cp $CUR/rootconfig-Mac.sh $ROOT/samples/HelloLua/proj.android -cd ../../HelloLua/proj.android -sh rootconfig-Mac.sh HelloLua -sh build_native.sh -cd .. -android update project -p proj.android -cd proj.android -antcompile - -#return the compileresult. -cd ../../.. -if [ $compileresult != 0 ]; then - git checkout -f - git clean -df -x - exit 1 -else - git checkout -f - git clean -df -x -fi \ No newline at end of file diff --git a/tools/JenkinsScript/androidtest-release4.bat b/tools/JenkinsScript/androidtest-release4.bat deleted file mode 100644 index 322c1d6262..0000000000 --- a/tools/JenkinsScript/androidtest-release4.bat +++ /dev/null @@ -1,115 +0,0 @@ -::This script is used to finish a android automated compiler. -::You should make sure have finished the environment setting. -::Here are the environment variables you should set. -::%ANT_HOME% %ANDROID_HOME% %JAVA_HOME% %CYGWIN% %GITBIN% %ANDROID_NDK% -:: Don't change it until you know what you do. - -if not exist "%CYGWIN%" echo Couldn't find Cygwin at "%CYGWIN%" and you should set like this "C:\cygwin"& pause & exit 1 -if not exist "%GITBIN%" echo Couldn't find Gitbin at "%GITBIN%" and you should set like this "F:\Git\bin"& pause & exit 2 -if not exist "%ANDROID_HOME%" echo Couldn't find ANDROID_HOME at "%ANDROID_HOME%" and you should set like this "D:\Windows7\android-sdk-windows"& pause & exit 3 -if not exist "%ANDROID_NDK%" echo Couldn't find Cygwin at "%ANDROID_NDK%" and you should set like this "D:\Windows7\android-ndk-r8"& pause & exit 4 -if not exist "%JAVA_HOME%" echo Couldn't find Cygwin at "%JAVA_HOME%" and you should set like this "C:\Program Files\Java\jdk1.7.0_05"& pause & exit 5 - -set _PROJECTNAME=TestCpp -cd ..\.. - -:project -::Copy build Configuration files to target directory -copy %cd%\tools\JenkinsScript\ant.properties %cd%\samples\%_PROJECTNAME%\proj.android -copy %cd%\tools\JenkinsScript\build.xml %cd%\samples\%_PROJECTNAME%\proj.android -copy %cd%\tools\JenkinsScript\rootconfig.sh %cd%\samples\%_PROJECTNAME%\proj.android - -::Modify the configuration files -cd samples\%_PROJECTNAME%\proj.android -rootconfig.sh %_PROJECTNAME% -cd .. -set _PROJECTLOCATION=%cd% - -::A command line that make the current user get the ownrship of project. -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F - -::Use cygwin compile the source code. -cygpath "%_PROJECTLOCATION%\proj.android\build_native.sh"|call %CYGWIN%\Cygwin.bat - -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F -::echo "%_PROJECTION%/proj.android/build_native.sh"|call %CYGWIN%\Cygwin.bat - -::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F -call android update project -p proj.android -cd proj.android - -for /f "delims=" %%a in ('findstr /i "target=android-" ant.properties') do set xx=%%a -echo %xx% -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="%xx%" (echo/target=android-8)else echo/%%a -)>>"anttmp.properties" -move anttmp.properties ant.properties - -::Change API level.(API level:14) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-8" (echo/target=android-14)else echo/%%a -)>>"ant1.properties" -move ant1.properties ant.properties - -for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis -move ant1.properties ant.properties - -::Android ant build(release,API level:14). -call ant release -set result14=%ERRORLEVEL% - -::Change API level.(API level:15) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-14" (echo/target=android-15)else echo/%%a -)>>"ant1.properties" -move ant1.properties ant.properties - -for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis -move ant1.properties ant.properties - -::Android ant build(release,API level:15). -call ant release -set result15=%ERRORLEVEL% - -::After all test versions completed,changed current API level to the original.(API level:8) -for /f "delims=" %%a in (ant.properties) do ( -if "%%a"=="target=android-15" (echo/target=android-8)else echo/%%a -)>>"ant1.properties" -move ant1.properties ant.properties - -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 ..\..\.. -IF "%_PROJECTNAME%"=="TestCpp" set /a testresult1=(result14+result15) && set _PROJECTNAME=HelloCpp&& goto project -IF "%_PROJECTNAME%"=="HelloCpp" set /a testresult2=(result14+result15) && set _PROJECTNAME=HelloLua&& goto project -IF "%_PROJECTNAME%"=="HelloLua" set /a testresult3=(result14+result15) -set /a testresult=(testresult1+testresult2+testresult3) -IF %testresult% NEQ 0 goto error - -goto success - -:lis -if "%num%"=="" goto :eof -if "%num:~-1%"==" " set num=%num:~0,-1%&goto lis -echo %num%>>ant1.properties -goto :eof - -:error -echo Error. -git checkout -f -git clean -df -x -pause -exit 1 -goto end - -:success -echo Success. -git checkout -f -git clean -df -x -pause -exit 0 -goto end - -::End. \ No newline at end of file diff --git a/tools/JenkinsScript/androidtest-release4.sh b/tools/JenkinsScript/androidtest-release4.sh deleted file mode 100644 index f95a01eef0..0000000000 --- a/tools/JenkinsScript/androidtest-release4.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash -#This script is used to finish a android automated compiler. -#You should make sure have finished the environment setting. -#Here are the environment variables you should set. -#$COCOS2DX_ROOT $ANDROID_SDK_ROOT $ANDROID_NDK_ROOT $NDK_ROOT - -antcompile() -{ - #Change API level.(API level:14) - sed '/target=/s/=.*$/=android-14/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant release - compileresult=$[$compileresult+$?] - - #Change API level.(API level:15) - sed '/target=/s/=.*$/=android-15/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties - ant release - compileresult=$[$compileresult+$?] - - #After all test versions completed,changed current API level to the original.(API level:8) - sed '/target=/s/=.*$/=android-8/' ant.properties > anttmp.properties - cp anttmp.properties ant.properties - rm anttmp.properties -} - -#record the relevant catalog -compileresult=0 -CUR=$(pwd) -cd ../.. -ROOT=$(pwd) - -#copy configuration files to target. -sed -i '' '14d' $CUR/ant.properties -gsed -i "14 i\\key.store=$ANDROID_HOME/debug.keystore" $CUR/ant.properties -cp $CUR/debug.keystore $ANDROID_HOME - -cp $CUR/ant.properties $ROOT/samples/TestCpp/proj.android -cp $CUR/build.xml $ROOT/samples/TestCpp/proj.android -cp $CUR/rootconfig-Mac.sh $ROOT/samples/TestCpp/proj.android -cd samples/TestCpp/proj.android -sh rootconfig-Mac.sh TestCpp -sh build_native.sh - -#update android project configuration files -cd .. -android update project -p proj.android -cd proj.android -antcompile - -cp $CUR/ant.properties $ROOT/samples/HelloCpp/proj.android -cp $CUR/build.xml $ROOT/samples/HelloCpp/proj.android -cp $CUR/rootconfig-Mac.sh $ROOT/samples/HelloCpp/proj.android -cd ../../HelloCpp/proj.android -sh rootconfig-Mac.sh HelloCpp -sh build_native.sh -cd .. -android update project -p proj.android -cd proj.android -antcompile - -cp $CUR/ant.properties $ROOT/samples/HelloLua/proj.android -cp $CUR/build.xml $ROOT/samples/HelloLua/proj.android -cp $CUR/rootconfig-Mac.sh $ROOT/samples/HelloLua/proj.android -cd ../../HelloLua/proj.android -sh rootconfig-Mac.sh HelloLua -sh build_native.sh -cd .. -android update project -p proj.android -cd proj.android -antcompile - -#return the compileresult. -cd ../../.. -if [ $compileresult != 0 ]; then - git checkout -f - git clean -df -x - exit 1 -else - git checkout -f - git clean -df -x -fi \ No newline at end of file diff --git a/tools/JenkinsScript/androidtestcommon.bat b/tools/JenkinsScript/androidtestcommon.bat deleted file mode 100644 index fab374d236..0000000000 --- a/tools/JenkinsScript/androidtestcommon.bat +++ /dev/null @@ -1,89 +0,0 @@ -echo off -rem =========Basic parameters============ -rem jdk path -set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_31 -rem jdk version -set JDK_Version=1.6 -rem sdk path -set AndroidHome=D:\Windows7\android-sdk-windows -rem android version path -set AndroidVersion=\platforms\android-8 -rem android project path -set AndroidProject=D:\cocos2d-x\tests\proj.android -rem unsigned apk name -set unsign_apk=Tests.apk -rem signed apk name -set sign_apk=Tests-sign.apk -rem sign keystore -set apk_key=cdykeystore -set apk_keypass=123456 -set apk_keystore=D:\cdykeystore - -for %%x in ("%AndroidProject%") do set AndroidProject=%%~sx -for %%x in ("%JAVA_HOME%") do set JAVA_HOME=%%~sx -for %%x in ("%AndroidHome%") do set AndroidHome=%%~sx - -rem jdk kit -set EXE_JAVA=%JAVA_HOME%\bin\java -set JAVAC=%JAVA_HOME%\bin\javac -set JAR=%JAVA_HOME%\bin\jar -set KeyTool=%JAVA_HOME%\bin\keytool -set Jarsigner=%JAVA_HOME%\bin\jarsigner - -rem sdk kit -set AndroidAAPT=%AndroidHome%\platform-tools\aapt.exe -set AndroidDx=%AndroidHome%\platform-tools\dx.bat -set AndroidApkBuilder=%AndroidHome%\tools\apkbuilder.bat -set AndroidJar=%AndroidHome%%AndroidVersion%\android.jar - -rem android project directory -set AndroidProjectDrive=D: -set AndroidProjectRes=%AndroidProject%\res -set AndroidProjectGen=%AndroidProject%\gen -set AndroidProjectBin=%AndroidProject%\bin -set AndroidProjectAsset=%AndroidProject%\assets -set AndroidProjectLibs=%AndroidProject%\libs -set AndroidProjectAndroidMainfest=%AndroidProject%\AndroidManifest.xml -set AndroidProjectSrc=%AndroidProject%\src\org\cocos2dx\tests\*.java -set AndroidProjectSrc=%AndroidProjectSrc% %AndroidProject%\src\org\cocos2dx\lib\*.java -set AndroidProjectSrc=%AndroidProjectSrc% %AndroidProject%\gen\org\cocos2dx\tests\*.java - -rem output file -set AndroidProjectClassDex=%AndroidProject%\bin\classes.dex -set AndroidProjectResources=%AndroidProject%\bin\resources.ap_ -set AndroidProjectApk="%AndroidProject%\bin\%unsign_apk%" -set AndroidProjectSignApk="%AndroidProject%\bin\%sign_apk%" - -mkdir %AndroidProject%\gen -mkdir %AndroidProject%\src\org\cocos2dx\lib -mkdir %AndroidProject%\bin -::mkdir %AndroidProject%\bin\classes -xcopy D:\cocos2d-x\cocos2dx\platform\android\java\src_common\org\cocos2dx\lib %AndroidProject%\src\org\cocos2dx\lib /s - -echo generate R.java file -%AndroidAAPT% package -f -m -J %AndroidProjectGen% -S %AndroidProjectRes% -I %AndroidJar% -M %AndroidProjectAndroidMainfest% - -echo generate class file -%JAVAC% -encoding UTF-8 -target %JDK_Version% -bootclasspath %AndroidJar% -d %AndroidProjectBin% %AndroidProjectSrc% %AndroidProjectGen%\org\cocos2dx\tests\R.java - -echo generate dex file -echo on -%AndroidProjectDrive% -cd %AndroidProjectBin% -rem packaging the *.class file into *.jar file -%JAR% cvf %AndroidProjectBin%\classes.jar *.* -cd %AndroidProject% -rem generate *.dex file -call %AndroidDx% --dex --output=%AndroidProjectClassDex% %AndroidProjectBin%\classes.jar - -echo package resources files -%AndroidAAPT% package -f -M %AndroidProjectAndroidMainfest% -S %AndroidProjectRes% -A %AndroidProjectAsset% -I %AndroidJar% -F %AndroidProjectResources% - -echo generate unsigned apk file -call %AndroidApkBuilder% %AndroidProjectApk% -v -u -z %AndroidProjectResources% -f %AndroidProjectClassDex% -rf %AndroidProject%\src -nf %AndroidProjectLibs% -rj %AndroidProjectLibs% - -echo generate signed apk file -%Jarsigner% -verbose -keystore %apk_keystore% -keypass %apk_keypass% -storepass %apk_keypass% -signedjar %AndroidProjectSignApk% %AndroidProjectApk% cdykeystore - -echo sign success! -pause \ No newline at end of file diff --git a/tools/JenkinsScript/debug.keystore b/tools/JenkinsScript/debug.keystore deleted file mode 100644 index cfc159027afc50d89440029b94c79fa1735e08f2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1268 zcmezO_TO6u1_mY|W&~sY#JrTE{LGY;)TGk%?9@u2xW%TuLT`X-b{jM?Z8zX!GBpVCd8d{S|1p z@JQlYzFOloOeH@flsYtSdVMZfEV_4YD+|Bns-kTY?;E1mIjb=yZdoE6& zUIc%dnS4NLebepF8?J;{De>R6(@mbmq37r9-l;nKzA)itX!q~@doGBP4~-c-uzj=`fT|`p(wTol3J08KF`yu1EfNvm#a&$w5M9z z)#w~&NC~_Zm{hHuRJ}-}r}Ef6l{Hs{v+C#Se)Ruz)z5kFznfd*E4Sq(@vh#q%-?vU zfa%BJd#69kn7oqQ;%c1Mk^V?msYTHL#x=7qrF+t@a>#uCFCQLoMWrjL)G0qN$U1IA zPt-Fu<%ooWIZveb+%~+>7i5|^2AN^Lw>mbsg03cw9~SA?f%ITW{xU+dZ{;A zgSuY{tgQONQo;E^UH6~AO z<}RPTHO(!1?vwR?XT=l03kS+^DCm9mOc(0!I2a^2Z@q_p%PBMdoyPmyROL&T7)OS* z9(D^l`7ZVIc{{V|5Bw@(O=9Nh70V<{Yvq-C|7o?t&yv-Kwgs$$my}{pU)p|D?6#Fz zJ|VL2)G_(Er1aEkUj`}h;uUOc(Kn)RgVQ!^ zgr2E^B``(5G-zUc3dDX3n3))vm{=1>+k zVW!YvLjhpI2XeTC*&QJn#8AvY1SG;N%nKD!Z~^5R137VCLn8xoBV!=8Fg1)4=QROx z4b7lj@(pgBkL*TZ-eYd;WiV*$WNK_=*taWl{@tRxm#;06*sv(9ZlP+k>YEdePrnst z^C)+xg`B)(d(`5qnAV2#yN>NY>TpzazxDML&YGq-ya7=mO`P_*&Hmvl*36MS*|Z~b zK|CRB8V(vq$*mm3Mz2$itwb&{2kxz~G z{&inoGchwVFd{n-7=+9~cg=g+w!v$b@t*A~c6M=G+A_zpujlVv>CdH$X8f-?Hfy=g zGT$p}_*Nu7GRThZw4PVMAw6YXqs;6QU7LAo+oFG*|CT+q!*!?r$Lz3~=Y&Hm*D+oA zns2%5S7=&l;7&C|mD|@=wi&$LTzoBOCCh tmp.txt - -#Get sdk's numbers -sdk_num=`grep "Simulator - iOS" tmp.txt|wc -l` -grep "Simulator - iOS" tmp.txt > tmp1.txt -sed 's/Simulator - iOS [4-5].[0-9]//' tmp1.txt> tmp.txt - -#Use a for circulation to build each version of sdks -cp tmp.txt $(pwd)/TestCpp/proj.ios -cd TestCpp/proj.ios -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' tmp.txt) - echo $a - -#Build debug version - xcodebuild -configuration Debug $a - compileresult=$[$compileresult+$?] - sed -i '' '1d' tmp.txt -done - -cd ../.. -#Use a for circulation to build each version of sdks -cp tmp.txt $(pwd)/HelloCpp/proj.ios -cd HelloCpp/proj.ios -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' tmp.txt) - echo $a - - -#Build debug version - xcodebuild -configuration Debug $a - compileresult=$[$compileresult+$?] - sed -i '' '1d' tmp.txt -done - -cd ../.. -#Use a for circulation to build each version of sdks -cp tmp.txt $(pwd)/HelloLua/proj.ios -cd HelloLua/proj.ios -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' tmp.txt) - echo $a - -#Build debug version - xcodebuild -configuration Debug $a - compileresult=$[$compileresult+$?] - sed -i '' '1d' tmp.txt -done - -#return the compileresult. -cd ../../.. -if [ $compileresult != 0 ]; then - echo Error. - echo $compilesult - git checkout -f - git clean -df -x - exit 1 -else - echo Success. - echo $compileresult - git checkout -f - git clean -df -x -fi \ No newline at end of file diff --git a/tools/JenkinsScript/iostest-release.sh b/tools/JenkinsScript/iostest-release.sh deleted file mode 100644 index 18f42a9079..0000000000 --- a/tools/JenkinsScript/iostest-release.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash -#This script is used to finish a ios automated compiler. - -compileresult=0 -cd ../../samples -#List simulator sdks -xcodebuild -showsdks > tmp.txt - -#Get sdk's numbers -sdk_num=`grep "Simulator - iOS" tmp.txt|wc -l` -grep "Simulator - iOS" tmp.txt > tmp1.txt -sed 's/Simulator - iOS [4-5].[0-9]//' tmp1.txt> tmp.txt - -#Use a for circulation to build each version of sdks -cp tmp.txt $(pwd)/TestCpp/proj.ios -cd TestCpp/proj.ios -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' tmp.txt) - echo $a - -#Build release version - xcodebuild -configuration Release $a - compileresult=$[$compileresult+$?] - sed -i '' '1d' tmp.txt -done - -cd ../.. -#Use a for circulation to build each version of sdks -cp tmp.txt $(pwd)/HelloCpp/proj.ios -cd HelloCpp/proj.ios -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' tmp.txt) - echo $a - - -#Build release version - xcodebuild -configuration Release $a - compileresult=$[$compileresult+$?] - sed -i '' '1d' tmp.txt -done - -cd ../.. -#Use a for circulation to build each version of sdks -cp tmp.txt $(pwd)/HelloLua/proj.ios -cd HelloLua/proj.ios -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' tmp.txt) - echo $a - -#Build release version - xcodebuild -configuration Release $a - compileresult=$[$compileresult+$?] - sed -i '' '1d' tmp.txt -done - -#return the compileresult. -cd ../../.. -if [ $compileresult != 0 ]; then - echo Error. - echo $compilesult - git checkout -f - git clean -df -x - exit 1 -else - echo Success. - echo $compileresult - git checkout -f - git clean -df -x -fi \ No newline at end of file diff --git a/tools/JenkinsScript/mactest-debug.sh b/tools/JenkinsScript/mactest-debug.sh deleted file mode 100644 index c05a61c40f..0000000000 --- a/tools/JenkinsScript/mactest-debug.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -#This script is used to finish a mac automated compiler. - -compileresult=0 -cd ../../samples -#List simulator sdks -xcodebuild -showsdks > tmp.txt - -#Get sdk's numbers -sdk_num=`grep "Mac OS X 10" tmp.txt|wc -l` -grep "Mac OS X 10" tmp.txt > tmp1.txt -sed 's/Mac OS X 10.[0-9]//' tmp1.txt> tmp.txt - -#Use a for circulation to build each version of sdks -cp tmp.txt $(pwd)/TestCpp/proj.mac -cd TestCpp/proj.mac -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' tmp.txt) - echo $a - -#Build debug version - xcodebuild -configuration Debug $a - compileresult=$[$compileresult+$?] - sed -i '' '1d' tmp.txt -done - -cd ../.. -#Use a for circulation to build each version of sdks -cp tmp.txt $(pwd)/HelloCpp/proj.mac -cd HelloCpp/proj.mac -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' tmp.txt) - echo $a - -#Build debug version - xcodebuild -configuration Debug $a - compileresult=$[$compileresult+$?] - sed -i '' '1d' tmp.txt -done - -#return the compileresult. -cd ../../.. -if [ $compileresult != 0 ]; then - echo Error. - echo $compilesult - git checkout -f - git clean -df -x - exit 1 -else - echo Success. - echo $compileresult - git checkout -f - git clean -df -x -fi \ No newline at end of file diff --git a/tools/JenkinsScript/mactest-release.sh b/tools/JenkinsScript/mactest-release.sh deleted file mode 100644 index 9f571740af..0000000000 --- a/tools/JenkinsScript/mactest-release.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -#This script is used to finish a mac automated compiler. - -compileresult=0 -cd ../../samples -#List simulator sdks -xcodebuild -showsdks > tmp.txt - -#Get sdk's numbers -sdk_num=`grep "Mac OS X 10" tmp.txt|wc -l` -grep "Mac OS X 10" tmp.txt > tmp1.txt -sed 's/Mac OS X 10.[0-9]//' tmp1.txt> tmp.txt - -#Use a for circulation to build each version of sdks -cp tmp.txt $(pwd)/TestCpp/proj.mac -cd TestCpp/proj.mac -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' tmp.txt) - echo $a - -#Build release version - xcodebuild -configuration Release $a - compileresult=$[$compileresult+$?] - sed -i '' '1d' tmp.txt -done - -cd ../.. -#Use a for circulation to build each version of sdks -cp tmp.txt $(pwd)/HelloCpp/proj.mac -cd HelloCpp/proj.mac -for((i=1;i<=$sdk_num;i++)) -do - a=$(sed -n '1p' tmp.txt) - echo $a - -#Build release version - xcodebuild -configuration Release $a - compileresult=$[$compileresult+$?] - sed -i '' '1d' tmp.txt -done - -#return the compileresult. -cd ../../.. -if [ $compileresult != 0 ]; then - echo Error. - echo $compilesult - git checkout -f - git clean -df -x - exit 1 -else - echo Success. - echo $compileresult - git checkout -f - git clean -df -x -fi \ No newline at end of file diff --git a/tools/JenkinsScript/rootconfig-Mac.sh b/tools/JenkinsScript/rootconfig-Mac.sh deleted file mode 100644 index 1fc95bd4b4..0000000000 --- a/tools/JenkinsScript/rootconfig-Mac.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -#get params for build_native.sh -CUR=$(pwd) -cd ../../.. -#COCOS2DX=$(pwd) - -#var1=NDK_ROOT_LOCAL= -#_NDK_ROOT=${var1}${ANDROID_NDK} - -#var2=COCOS2DX_ROOT_LOCAL= -#_COCOS2DX_ROOT=${var2}${COCOS2DX} -#echo $_NDK_ROOT -#echo $_COCOS2DX_ROOT - -#Modify the configuration files -sed -i '' '3,4d' $CUR/build_native.sh -sed -i '' '13d' $CUR/project.properties -#gsed -i "3 i\\$_NDK_ROOT" $CUR/build_native.sh -#gsed -i "4 i\\$_COCOS2DX_ROOT" $CUR/build_native.sh - -#Modify the xml file -if [ $1 = TestCpp ]; then - gsed -i '2d' $CUR/build.xml - gsed -i '2 i\' $CUR/build.xml -elif [ $1 = HelloCpp ]; then - gsed -i '2d' $CUR/build.xml - gsed -i '2 i\' $CUR/build.xml -else - gsed -i '2d' $CUR/build.xml - gsed -i '2 i\' $CUR/build.xml -fi diff --git a/tools/JenkinsScript/rootconfig.sh b/tools/JenkinsScript/rootconfig.sh deleted file mode 100644 index 03d6922ae0..0000000000 --- a/tools/JenkinsScript/rootconfig.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -#Change the path expression of current path to cygwin path. -#NDK_ROOT=$($CYGWIN/bin/cygpath.exe $ANDROID_NDK) -#echo $NDK_ROOT -CUR=$(pwd) -cd ../../.. -#tmp=$(pwd) -#COCOS2DX=$($CYGWIN/bin/cygpath.exe $tmp) -#echo $COCOS2DX - -#var1=NDK_ROOT_LOCAL= -#_NDK_ROOT=${var1}${NDK_ROOT} - -#var2=COCOS2DX_ROOT_LOCAL= -#_COCOS2DX_ROOT=${var2}${COCOS2DX} -#echo $_NDK_ROOT -#echo $_COCOS2DX_ROOT - -#Modify the configuration files -sed -i '3,4d' $CUR/build_native.sh -sed -i '13d' $CUR/project.properties -#sed -i "3 i\\$_NDK_ROOT" $CUR/build_native.sh -#sed -i "4 i\\$_COCOS2DX_ROOT" $CUR/build_native.sh - -#Modify the project name -if [ $1 = TestCpp ]; then - sed -i '2d' $CUR/build.xml - sed -i '2 i\' $CUR/build.xml -elif [ $1 = HelloCpp ]; then - sed -i '2d' $CUR/build.xml - sed -i '2 i\' $CUR/build.xml -else - sed -i '2d' $CUR/build.xml - sed -i '2 i\' $CUR/build.xml -fi \ No newline at end of file From 37d84ba6bb1217e274f07fc34d480d47074b9b15 Mon Sep 17 00:00:00 2001 From: Caidongyang Date: Mon, 6 Aug 2012 11:59:37 +0800 Subject: [PATCH 2/2] issue #1404:Add new files --- .../Mac/android/androidtest-debug3.sh | 104 ++++++++++++ .../Mac/android/androidtest-debug4.sh | 80 ++++++++++ .../Mac/android/androidtest-release3.sh | 108 +++++++++++++ .../Mac/android/androidtest-release4.sh | 84 ++++++++++ tools/JenkinsScript/Mac/debug.keystore | Bin 0 -> 1268 bytes tools/JenkinsScript/Mac/ios/iostest-debug.sh | 72 +++++++++ .../JenkinsScript/Mac/ios/iostest-release.sh | 72 +++++++++ tools/JenkinsScript/Mac/mac/mactest-debug.sh | 56 +++++++ .../JenkinsScript/Mac/mac/mactest-release.sh | 56 +++++++ tools/JenkinsScript/Mac/rootconfig-Mac.sh | 31 ++++ .../Windows/android/androidtest-debug3.bat | 125 +++++++++++++++ .../Windows/android/androidtest-debug4.bat | 100 ++++++++++++ .../Windows/android/androidtest-release3.bat | 149 ++++++++++++++++++ .../Windows/android/androidtest-release4.bat | 115 ++++++++++++++ .../Windows/android/androidtestcommon.bat | 89 +++++++++++ .../Windows/android/rootconfig.sh | 35 ++++ 16 files changed, 1276 insertions(+) create mode 100644 tools/JenkinsScript/Mac/android/androidtest-debug3.sh create mode 100644 tools/JenkinsScript/Mac/android/androidtest-debug4.sh create mode 100644 tools/JenkinsScript/Mac/android/androidtest-release3.sh create mode 100644 tools/JenkinsScript/Mac/android/androidtest-release4.sh create mode 100644 tools/JenkinsScript/Mac/debug.keystore create mode 100644 tools/JenkinsScript/Mac/ios/iostest-debug.sh create mode 100644 tools/JenkinsScript/Mac/ios/iostest-release.sh create mode 100644 tools/JenkinsScript/Mac/mac/mactest-debug.sh create mode 100644 tools/JenkinsScript/Mac/mac/mactest-release.sh create mode 100644 tools/JenkinsScript/Mac/rootconfig-Mac.sh create mode 100644 tools/JenkinsScript/Windows/android/androidtest-debug3.bat create mode 100644 tools/JenkinsScript/Windows/android/androidtest-debug4.bat create mode 100644 tools/JenkinsScript/Windows/android/androidtest-release3.bat create mode 100644 tools/JenkinsScript/Windows/android/androidtest-release4.bat create mode 100644 tools/JenkinsScript/Windows/android/androidtestcommon.bat create mode 100644 tools/JenkinsScript/Windows/android/rootconfig.sh diff --git a/tools/JenkinsScript/Mac/android/androidtest-debug3.sh b/tools/JenkinsScript/Mac/android/androidtest-debug3.sh new file mode 100644 index 0000000000..53142c3d5d --- /dev/null +++ b/tools/JenkinsScript/Mac/android/androidtest-debug3.sh @@ -0,0 +1,104 @@ +#!/bin/bash +#This script is used to finish a android automated compiler. +#You should make sure have finished the environment setting. +#Here are the environment variables you should set. +#$COCOS2DX_ROOT $ANDROID_SDK_ROOT $ANDROID_NDK_ROOT $NDK_ROOT + +antcompile() +{ + #Make sure the original target is android-8 + sed '/target=/s/=.*$/=android-8/' ant.properties > anttmp.properties + cp anttmp.properties ant.properties + rm anttmp.properties + + #Android ant build(debug ,API level:8) + ant debug + #If build failed,make sure the Jenkins could get the errorlevel. + compileresult=$[$compileresult+$?] + + #Change API level.(API level:10) + sed '/target=/s/=.*$/=android-10/' ant.properties > anttmp.properties + cp anttmp.properties ant.properties + rm anttmp.properties + ant debug + compileresult=$[$compileresult+$?] + + #Change API level.(API level:11) + sed '/target=/s/=.*$/=android-11/' ant.properties > anttmp.properties + cp anttmp.properties ant.properties + rm anttmp.properties + ant debug + compileresult=$[$compileresult+$?] + + #Change API level.(API level:12) + sed '/target=/s/=.*$/=android-12/' ant.properties > anttmp.properties + cp anttmp.properties ant.properties + rm anttmp.properties + ant debug + compileresult=$[$compileresult+$?] + + #Change API level.(API level:13) + sed '/target=/s/=.*$/=android-13/' ant.properties > anttmp.properties + cp anttmp.properties ant.properties + rm anttmp.properties + ant debug + compileresult=$[$compileresult+$?] + + #After all test versions completed,changed current API level to the original.(API level:8) + sed '/target=/s/=.*$/=android-8/' ant.properties > anttmp.properties + cp anttmp.properties ant.properties + rm anttmp.properties +} + +#record the relevant catalog +compileresult=0 +CUR=$(pwd) +cd ../../../.. +ROOT=$(pwd) + +#copy configuration files to target. +cp $ROOT/tools/JenkinsScript/ant.properties $ROOT/samples/TestCpp/proj.android +cp $ROOT/tools/JenkinsScript/build.xml $ROOT/samples/TestCpp/proj.android +cp $$ROOT/tools/JenkinsScript/Mac/rootconfig-Mac.sh $ROOT/samples/TestCpp/proj.android +cd samples/TestCpp/proj.android +sh rootconfig-Mac.sh TestCpp +sh build_native.sh + +#update android project configuration files +cd .. +android update project -p proj.android +cd proj.android +antcompile + +cp $ROOT/tools/JenkinsScript/ant.properties $ROOT/samples/HelloCpp/proj.android +cp $ROOT/tools/JenkinsScript/build.xml $ROOT/samples/HelloCpp/proj.android +cp $$ROOT/tools/JenkinsScript/Mac/rootconfig-Mac.sh $ROOT/samples/HelloCpp/proj.android +cd ../../HelloCpp/proj.android +sh rootconfig-Mac.sh HelloCpp +sh build_native.sh +cd .. +android update project -p proj.android +cd proj.android +antcompile + +cp $ROOT/tools/JenkinsScript/ant.properties $ROOT/samples/HelloLua/proj.android +cp $ROOT/tools/JenkinsScript/build.xml $ROOT/samples/HelloLua/proj.android +cp $$ROOT/tools/JenkinsScript/Mac/rootconfig-Mac.sh $ROOT/samples/HelloLua/proj.android +cd ../../HelloLua/proj.android +sh rootconfig-Mac.sh HelloLua +sh build_native.sh +cd .. +android update project -p proj.android +cd proj.android +antcompile + +#return the compileresult. +cd ../../.. +if [ $compileresult != 0 ]; then + git checkout -f + git clean -df -x + exit 1 +else + git checkout -f + git clean -df -x +fi \ No newline at end of file diff --git a/tools/JenkinsScript/Mac/android/androidtest-debug4.sh b/tools/JenkinsScript/Mac/android/androidtest-debug4.sh new file mode 100644 index 0000000000..32454efd63 --- /dev/null +++ b/tools/JenkinsScript/Mac/android/androidtest-debug4.sh @@ -0,0 +1,80 @@ +#!/bin/bash +#This script is used to finish a android automated compiler. +#You should make sure have finished the environment setting. +#Here are the environment variables you should set. +#$COCOS2DX_ROOT $ANDROID_SDK_ROOT $ANDROID_NDK_ROOT $NDK_ROOT + +antcompile() +{ + #Change API level.(API level:14) + sed '/target=/s/=.*$/=android-14/' ant.properties > anttmp.properties + cp anttmp.properties ant.properties + rm anttmp.properties + ant release + compileresult=$[$compileresult+$?] + + #Change API level.(API level:15) + sed '/target=/s/=.*$/=android-15/' ant.properties > anttmp.properties + cp anttmp.properties ant.properties + rm anttmp.properties + ant release + compileresult=$[$compileresult+$?] + + #After all test versions completed,changed current API level to the original.(API level:8) + sed '/target=/s/=.*$/=android-8/' ant.properties > anttmp.properties + cp anttmp.properties ant.properties + rm anttmp.properties +} + +#record the relevant catalog +compileresult=0 +CUR=$(pwd) +cd ../../../.. +ROOT=$(pwd) + +#copy configuration files to target. +cp $ROOT/tools/JenkinsScript/ant.properties $ROOT/samples/TestCpp/proj.android +cp $ROOT/tools/JenkinsScript/build.xml $ROOT/samples/TestCpp/proj.android +cp $$ROOT/tools/JenkinsScript/Mac/rootconfig-Mac.sh $ROOT/samples/TestCpp/proj.android +cd samples/TestCpp/proj.android +sh rootconfig-Mac.sh TestCpp +sh build_native.sh + +#update android project configuration files +cd .. +android update project -p proj.android +cd proj.android +antcompile + +cp $ROOT/tools/JenkinsScript/ant.properties $ROOT/samples/HelloCpp/proj.android +cp $ROOT/tools/JenkinsScript/build.xml $ROOT/samples/HelloCpp/proj.android +cp $$ROOT/tools/JenkinsScript/Mac/rootconfig-Mac.sh $ROOT/samples/HelloCpp/proj.android +cd ../../HelloCpp/proj.android +sh rootconfig-Mac.sh HelloCpp +sh build_native.sh +cd .. +android update project -p proj.android +cd proj.android +antcompile + +cp $ROOT/tools/JenkinsScript/ant.properties $ROOT/samples/HelloLua/proj.android +cp $ROOT/tools/JenkinsScript/build.xml $ROOT/samples/HelloLua/proj.android +cp $$ROOT/tools/JenkinsScript/Mac/rootconfig-Mac.sh $ROOT/samples/HelloLua/proj.android +cd ../../HelloLua/proj.android +sh rootconfig-Mac.sh HelloLua +sh build_native.sh +cd .. +android update project -p proj.android +cd proj.android +antcompile + +#return the compileresult. +cd ../../.. +if [ $compileresult != 0 ]; then + git checkout -f + git clean -df -x + exit 1 +else + git checkout -f + git clean -df -x +fi \ No newline at end of file diff --git a/tools/JenkinsScript/Mac/android/androidtest-release3.sh b/tools/JenkinsScript/Mac/android/androidtest-release3.sh new file mode 100644 index 0000000000..eed1cc0e3e --- /dev/null +++ b/tools/JenkinsScript/Mac/android/androidtest-release3.sh @@ -0,0 +1,108 @@ +#!/bin/bash +#This script is used to finish a android automated compiler. +#You should make sure have finished the environment setting. +#Here are the environment variables you should set. +#$COCOS2DX_ROOT $ANDROID_SDK_ROOT $ANDROID_NDK_ROOT $NDK_ROOT + +antcompile() +{ + #Make sure the original target is android-8 + sed '/target=/s/=.*$/=android-8/' ant.properties > anttmp.properties + cp anttmp.properties ant.properties + rm anttmp.properties + + #Android ant build(debug ,API level:8) + ant release + #If build failed,make sure the Jenkins could get the errorlevel. + compileresult=$[$compileresult+$?] + + #Change API level.(API level:10) + sed '/target=/s/=.*$/=android-10/' ant.properties > anttmp.properties + cp anttmp.properties ant.properties + rm anttmp.properties + ant release + compileresult=$[$compileresult+$?] + + #Change API level.(API level:11) + sed '/target=/s/=.*$/=android-11/' ant.properties > anttmp.properties + cp anttmp.properties ant.properties + rm anttmp.properties + ant release + compileresult=$[$compileresult+$?] + + #Change API level.(API level:12) + sed '/target=/s/=.*$/=android-12/' ant.properties > anttmp.properties + cp anttmp.properties ant.properties + rm anttmp.properties + ant release + compileresult=$[$compileresult+$?] + + #Change API level.(API level:13) + sed '/target=/s/=.*$/=android-13/' ant.properties > anttmp.properties + cp anttmp.properties ant.properties + rm anttmp.properties + ant release + compileresult=$[$compileresult+$?] + + #After all test versions completed,changed current API level to the original.(API level:8) + sed '/target=/s/=.*$/=android-8/' ant.properties > anttmp.properties + cp anttmp.properties ant.properties + rm anttmp.properties +} + +#record the relevant catalog +compileresult=0 +CUR=$(pwd) +cd ../../../.. +ROOT=$(pwd) + +#copy configuration files to target. +sed -i '' '14d' $CUR/ant.properties +gsed -i "14 i\\key.store=$ANDROID_HOME/debug.keystore" $CUR/ant.properties +cp $CUR/../debug.keystore $ANDROID_HOME + +cp $ROOT/tools/JenkinsScript/ant.properties $ROOT/samples/TestCpp/proj.android +cp $ROOT/tools/JenkinsScript/build.xml $ROOT/samples/TestCpp/proj.android +cp $ROOT/tools/JenkinsScript/Mac/rootconfig-Mac.sh $ROOT/samples/TestCpp/proj.android +cd samples/TestCpp/proj.android +sh rootconfig-Mac.sh TestCpp +sh build_native.sh + +#update android project configuration files +cd .. +android update project -p proj.android +cd proj.android +antcompile + +cp $ROOT/tools/JenkinsScript/ant.properties $ROOT/samples/HelloCpp/proj.android +cp $ROOT/tools/JenkinsScript/build.xml $ROOT/samples/HelloCpp/proj.android +cp $ROOT/tools/JenkinsScript/Mac/rootconfig-Mac.sh $ROOT/samples/HelloCpp/proj.android +cd ../../HelloCpp/proj.android +sh rootconfig-Mac.sh HelloCpp +sh build_native.sh +cd .. +android update project -p proj.android +cd proj.android +antcompile + +cp $ROOT/tools/JenkinsScript/ant.properties $ROOT/samples/HelloLua/proj.android +cp $ROOT/tools/JenkinsScript/build.xml $ROOT/samples/HelloLua/proj.android +cp $ROOT/tools/JenkinsScript/Mac/rootconfig-Mac.sh $ROOT/samples/HelloLua/proj.android +cd ../../HelloLua/proj.android +sh rootconfig-Mac.sh HelloLua +sh build_native.sh +cd .. +android update project -p proj.android +cd proj.android +antcompile + +#return the compileresult. +cd ../../.. +if [ $compileresult != 0 ]; then + git checkout -f + git clean -df -x + exit 1 +else + git checkout -f + git clean -df -x +fi \ No newline at end of file diff --git a/tools/JenkinsScript/Mac/android/androidtest-release4.sh b/tools/JenkinsScript/Mac/android/androidtest-release4.sh new file mode 100644 index 0000000000..0092d4e136 --- /dev/null +++ b/tools/JenkinsScript/Mac/android/androidtest-release4.sh @@ -0,0 +1,84 @@ +#!/bin/bash +#This script is used to finish a android automated compiler. +#You should make sure have finished the environment setting. +#Here are the environment variables you should set. +#$COCOS2DX_ROOT $ANDROID_SDK_ROOT $ANDROID_NDK_ROOT $NDK_ROOT + +antcompile() +{ + #Change API level.(API level:14) + sed '/target=/s/=.*$/=android-14/' ant.properties > anttmp.properties + cp anttmp.properties ant.properties + rm anttmp.properties + ant release + compileresult=$[$compileresult+$?] + + #Change API level.(API level:15) + sed '/target=/s/=.*$/=android-15/' ant.properties > anttmp.properties + cp anttmp.properties ant.properties + rm anttmp.properties + ant release + compileresult=$[$compileresult+$?] + + #After all test versions completed,changed current API level to the original.(API level:8) + sed '/target=/s/=.*$/=android-8/' ant.properties > anttmp.properties + cp anttmp.properties ant.properties + rm anttmp.properties +} + +#record the relevant catalog +compileresult=0 +CUR=$(pwd) +cd ../../../.. +ROOT=$(pwd) + +#copy configuration files to target. +sed -i '' '14d' $CUR/ant.properties +gsed -i "14 i\\key.store=$ANDROID_HOME/debug.keystore" $CUR/ant.properties +cp $CUR/../debug.keystore $ANDROID_HOME + +cp $ROOT/tools/JenkinsScript/ant.properties $ROOT/samples/TestCpp/proj.android +cp $ROOT/tools/JenkinsScript/build.xml $ROOT/samples/TestCpp/proj.android +cp $ROOT/tools/JenkinsScript/Mac/rootconfig-Mac.sh $ROOT/samples/TestCpp/proj.android +cd samples/TestCpp/proj.android +sh rootconfig-Mac.sh TestCpp +sh build_native.sh + +#update android project configuration files +cd .. +android update project -p proj.android +cd proj.android +antcompile + +cp $ROOT/tools/JenkinsScript/ant.properties $ROOT/samples/HelloCpp/proj.android +cp $ROOT/tools/JenkinsScript/build.xml $ROOT/samples/HelloCpp/proj.android +cp $ROOT/tools/JenkinsScript/Mac/rootconfig-Mac.sh $ROOT/samples/HelloCpp/proj.android +cd ../../HelloCpp/proj.android +sh rootconfig-Mac.sh HelloCpp +sh build_native.sh +cd .. +android update project -p proj.android +cd proj.android +antcompile + +cp $ROOT/tools/JenkinsScript/ant.properties $ROOT/samples/HelloLua/proj.android +cp $ROOT/tools/JenkinsScript/build.xml $ROOT/samples/HelloLua/proj.android +cp $ROOT/tools/JenkinsScript/Mac/rootconfig-Mac.sh $ROOT/samples/HelloLua/proj.android +cd ../../HelloLua/proj.android +sh rootconfig-Mac.sh HelloLua +sh build_native.sh +cd .. +android update project -p proj.android +cd proj.android +antcompile + +#return the compileresult. +cd ../../.. +if [ $compileresult != 0 ]; then + git checkout -f + git clean -df -x + exit 1 +else + git checkout -f + git clean -df -x +fi \ No newline at end of file diff --git a/tools/JenkinsScript/Mac/debug.keystore b/tools/JenkinsScript/Mac/debug.keystore new file mode 100644 index 0000000000000000000000000000000000000000..cfc159027afc50d89440029b94c79fa1735e08f2 GIT binary patch literal 1268 zcmezO_TO6u1_mY|W&~sY#JrTE{LGY;)TGk%?9@u2xW%TuLT`X-b{jM?Z8zX!GBpVCd8d{S|1p z@JQlYzFOloOeH@flsYtSdVMZfEV_4YD+|Bns-kTY?;E1mIjb=yZdoE6& zUIc%dnS4NLebepF8?J;{De>R6(@mbmq37r9-l;nKzA)itX!q~@doGBP4~-c-uzj=`fT|`p(wTol3J08KF`yu1EfNvm#a&$w5M9z z)#w~&NC~_Zm{hHuRJ}-}r}Ef6l{Hs{v+C#Se)Ruz)z5kFznfd*E4Sq(@vh#q%-?vU zfa%BJd#69kn7oqQ;%c1Mk^V?msYTHL#x=7qrF+t@a>#uCFCQLoMWrjL)G0qN$U1IA zPt-Fu<%ooWIZveb+%~+>7i5|^2AN^Lw>mbsg03cw9~SA?f%ITW{xU+dZ{;A zgSuY{tgQONQo;E^UH6~AO z<}RPTHO(!1?vwR?XT=l03kS+^DCm9mOc(0!I2a^2Z@q_p%PBMdoyPmyROL&T7)OS* z9(D^l`7ZVIc{{V|5Bw@(O=9Nh70V<{Yvq-C|7o?t&yv-Kwgs$$my}{pU)p|D?6#Fz zJ|VL2)G_(Er1aEkUj`}h;uUOc(Kn)RgVQ!^ zgr2E^B``(5G-zUc3dDX3n3))vm{=1>+k zVW!YvLjhpI2XeTC*&QJn#8AvY1SG;N%nKD!Z~^5R137VCLn8xoBV!=8Fg1)4=QROx z4b7lj@(pgBkL*TZ-eYd;WiV*$WNK_=*taWl{@tRxm#;06*sv(9ZlP+k>YEdePrnst z^C)+xg`B)(d(`5qnAV2#yN>NY>TpzazxDML&YGq-ya7=mO`P_*&Hmvl*36MS*|Z~b zK|CRB8V(vq$*mm3Mz2$itwb&{2kxz~G z{&inoGchwVFd{n-7=+9~cg=g+w!v$b@t*A~c6M=G+A_zpujlVv>CdH$X8f-?Hfy=g zGT$p}_*Nu7GRThZw4PVMAw6YXqs;6QU7LAo+oFG*|CT+q!*!?r$Lz3~=Y&Hm*D+oA zns2%5S7=&l;7&C|mD|@=wi&$LTzoBOCCh tmp.txt + +#Get sdk's numbers +sdk_num=`grep "Simulator - iOS" tmp.txt|wc -l` +grep "Simulator - iOS" tmp.txt > tmp1.txt +sed 's/Simulator - iOS [4-5].[0-9]//' tmp1.txt> tmp.txt + +#Use a for circulation to build each version of sdks +cp tmp.txt $(pwd)/TestCpp/proj.ios +cd TestCpp/proj.ios +for((i=1;i<=$sdk_num;i++)) +do + a=$(sed -n '1p' tmp.txt) + echo $a + +#Build debug version + xcodebuild -configuration Debug $a + compileresult=$[$compileresult+$?] + sed -i '' '1d' tmp.txt +done + +cd ../.. +#Use a for circulation to build each version of sdks +cp tmp.txt $(pwd)/HelloCpp/proj.ios +cd HelloCpp/proj.ios +for((i=1;i<=$sdk_num;i++)) +do + a=$(sed -n '1p' tmp.txt) + echo $a + + +#Build debug version + xcodebuild -configuration Debug $a + compileresult=$[$compileresult+$?] + sed -i '' '1d' tmp.txt +done + +cd ../.. +#Use a for circulation to build each version of sdks +cp tmp.txt $(pwd)/HelloLua/proj.ios +cd HelloLua/proj.ios +for((i=1;i<=$sdk_num;i++)) +do + a=$(sed -n '1p' tmp.txt) + echo $a + +#Build debug version + xcodebuild -configuration Debug $a + compileresult=$[$compileresult+$?] + sed -i '' '1d' tmp.txt +done + +#return the compileresult. +cd ../../.. +if [ $compileresult != 0 ]; then + echo Error. + echo $compilesult + git checkout -f + git clean -df -x + exit 1 +else + echo Success. + echo $compileresult + git checkout -f + git clean -df -x +fi \ No newline at end of file diff --git a/tools/JenkinsScript/Mac/ios/iostest-release.sh b/tools/JenkinsScript/Mac/ios/iostest-release.sh new file mode 100644 index 0000000000..18f42a9079 --- /dev/null +++ b/tools/JenkinsScript/Mac/ios/iostest-release.sh @@ -0,0 +1,72 @@ +#!/bin/bash +#This script is used to finish a ios automated compiler. + +compileresult=0 +cd ../../samples +#List simulator sdks +xcodebuild -showsdks > tmp.txt + +#Get sdk's numbers +sdk_num=`grep "Simulator - iOS" tmp.txt|wc -l` +grep "Simulator - iOS" tmp.txt > tmp1.txt +sed 's/Simulator - iOS [4-5].[0-9]//' tmp1.txt> tmp.txt + +#Use a for circulation to build each version of sdks +cp tmp.txt $(pwd)/TestCpp/proj.ios +cd TestCpp/proj.ios +for((i=1;i<=$sdk_num;i++)) +do + a=$(sed -n '1p' tmp.txt) + echo $a + +#Build release version + xcodebuild -configuration Release $a + compileresult=$[$compileresult+$?] + sed -i '' '1d' tmp.txt +done + +cd ../.. +#Use a for circulation to build each version of sdks +cp tmp.txt $(pwd)/HelloCpp/proj.ios +cd HelloCpp/proj.ios +for((i=1;i<=$sdk_num;i++)) +do + a=$(sed -n '1p' tmp.txt) + echo $a + + +#Build release version + xcodebuild -configuration Release $a + compileresult=$[$compileresult+$?] + sed -i '' '1d' tmp.txt +done + +cd ../.. +#Use a for circulation to build each version of sdks +cp tmp.txt $(pwd)/HelloLua/proj.ios +cd HelloLua/proj.ios +for((i=1;i<=$sdk_num;i++)) +do + a=$(sed -n '1p' tmp.txt) + echo $a + +#Build release version + xcodebuild -configuration Release $a + compileresult=$[$compileresult+$?] + sed -i '' '1d' tmp.txt +done + +#return the compileresult. +cd ../../.. +if [ $compileresult != 0 ]; then + echo Error. + echo $compilesult + git checkout -f + git clean -df -x + exit 1 +else + echo Success. + echo $compileresult + git checkout -f + git clean -df -x +fi \ No newline at end of file diff --git a/tools/JenkinsScript/Mac/mac/mactest-debug.sh b/tools/JenkinsScript/Mac/mac/mactest-debug.sh new file mode 100644 index 0000000000..c05a61c40f --- /dev/null +++ b/tools/JenkinsScript/Mac/mac/mactest-debug.sh @@ -0,0 +1,56 @@ +#!/bin/bash +#This script is used to finish a mac automated compiler. + +compileresult=0 +cd ../../samples +#List simulator sdks +xcodebuild -showsdks > tmp.txt + +#Get sdk's numbers +sdk_num=`grep "Mac OS X 10" tmp.txt|wc -l` +grep "Mac OS X 10" tmp.txt > tmp1.txt +sed 's/Mac OS X 10.[0-9]//' tmp1.txt> tmp.txt + +#Use a for circulation to build each version of sdks +cp tmp.txt $(pwd)/TestCpp/proj.mac +cd TestCpp/proj.mac +for((i=1;i<=$sdk_num;i++)) +do + a=$(sed -n '1p' tmp.txt) + echo $a + +#Build debug version + xcodebuild -configuration Debug $a + compileresult=$[$compileresult+$?] + sed -i '' '1d' tmp.txt +done + +cd ../.. +#Use a for circulation to build each version of sdks +cp tmp.txt $(pwd)/HelloCpp/proj.mac +cd HelloCpp/proj.mac +for((i=1;i<=$sdk_num;i++)) +do + a=$(sed -n '1p' tmp.txt) + echo $a + +#Build debug version + xcodebuild -configuration Debug $a + compileresult=$[$compileresult+$?] + sed -i '' '1d' tmp.txt +done + +#return the compileresult. +cd ../../.. +if [ $compileresult != 0 ]; then + echo Error. + echo $compilesult + git checkout -f + git clean -df -x + exit 1 +else + echo Success. + echo $compileresult + git checkout -f + git clean -df -x +fi \ No newline at end of file diff --git a/tools/JenkinsScript/Mac/mac/mactest-release.sh b/tools/JenkinsScript/Mac/mac/mactest-release.sh new file mode 100644 index 0000000000..9f571740af --- /dev/null +++ b/tools/JenkinsScript/Mac/mac/mactest-release.sh @@ -0,0 +1,56 @@ +#!/bin/bash +#This script is used to finish a mac automated compiler. + +compileresult=0 +cd ../../samples +#List simulator sdks +xcodebuild -showsdks > tmp.txt + +#Get sdk's numbers +sdk_num=`grep "Mac OS X 10" tmp.txt|wc -l` +grep "Mac OS X 10" tmp.txt > tmp1.txt +sed 's/Mac OS X 10.[0-9]//' tmp1.txt> tmp.txt + +#Use a for circulation to build each version of sdks +cp tmp.txt $(pwd)/TestCpp/proj.mac +cd TestCpp/proj.mac +for((i=1;i<=$sdk_num;i++)) +do + a=$(sed -n '1p' tmp.txt) + echo $a + +#Build release version + xcodebuild -configuration Release $a + compileresult=$[$compileresult+$?] + sed -i '' '1d' tmp.txt +done + +cd ../.. +#Use a for circulation to build each version of sdks +cp tmp.txt $(pwd)/HelloCpp/proj.mac +cd HelloCpp/proj.mac +for((i=1;i<=$sdk_num;i++)) +do + a=$(sed -n '1p' tmp.txt) + echo $a + +#Build release version + xcodebuild -configuration Release $a + compileresult=$[$compileresult+$?] + sed -i '' '1d' tmp.txt +done + +#return the compileresult. +cd ../../.. +if [ $compileresult != 0 ]; then + echo Error. + echo $compilesult + git checkout -f + git clean -df -x + exit 1 +else + echo Success. + echo $compileresult + git checkout -f + git clean -df -x +fi \ No newline at end of file diff --git a/tools/JenkinsScript/Mac/rootconfig-Mac.sh b/tools/JenkinsScript/Mac/rootconfig-Mac.sh new file mode 100644 index 0000000000..f675a76fcd --- /dev/null +++ b/tools/JenkinsScript/Mac/rootconfig-Mac.sh @@ -0,0 +1,31 @@ +#!/bin/bash +#get params for build_native.sh +CUR=$(pwd) +cd ../../.. +#COCOS2DX=$(pwd) + +#var1=NDK_ROOT_LOCAL= +#_NDK_ROOT=${var1}${ANDROID_NDK} + +#var2=COCOS2DX_ROOT_LOCAL= +#_COCOS2DX_ROOT=${var2}${COCOS2DX} +#echo $_NDK_ROOT +#echo $_COCOS2DX_ROOT + +#Modify the configuration files +#sed -i '' '3,4d' $CUR/build_native.sh +sed -i '' '13d' $CUR/project.properties +#gsed -i "3 i\\$_NDK_ROOT" $CUR/build_native.sh +#gsed -i "4 i\\$_COCOS2DX_ROOT" $CUR/build_native.sh + +#Modify the xml file +if [ $1 = TestCpp ]; then + gsed -i '2d' $CUR/build.xml + gsed -i '2 i\' $CUR/build.xml +elif [ $1 = HelloCpp ]; then + gsed -i '2d' $CUR/build.xml + gsed -i '2 i\' $CUR/build.xml +else + gsed -i '2d' $CUR/build.xml + gsed -i '2 i\' $CUR/build.xml +fi diff --git a/tools/JenkinsScript/Windows/android/androidtest-debug3.bat b/tools/JenkinsScript/Windows/android/androidtest-debug3.bat new file mode 100644 index 0000000000..6c866cce16 --- /dev/null +++ b/tools/JenkinsScript/Windows/android/androidtest-debug3.bat @@ -0,0 +1,125 @@ +::This script is used to finish a android automated compiler. +::You should make sure have finished the environment setting. +::Here are the environment variables you should set. +::%ANT_HOME% %ANDROID_HOME% %JAVA_HOME% %CYGWIN% %GITBIN% %ANDROID_NDK% +:: Don't change it until you know what you do. + +if not exist "%CYGWIN%" echo Couldn't find Cygwin at "%CYGWIN%" and you should set like this "C:\cygwin"& pause & exit 1 +if not exist "%GITBIN%" echo Couldn't find Gitbin at "%GITBIN%" and you should set like this "F:\Git\bin"& pause & exit 2 +if not exist "%ANDROID_HOME%" echo Couldn't find ANDROID_HOME at "%ANDROID_HOME%" and you should set like this "D:\Windows7\android-sdk-windows"& pause & exit 3 +if not exist "%ANDROID_NDK%" echo Couldn't find Cygwin at "%ANDROID_NDK%" and you should set like this "D:\Windows7\android-ndk-r8"& pause & exit 4 +if not exist "%JAVA_HOME%" echo Couldn't find Cygwin at "%JAVA_HOME%" and you should set like this "C:\Program Files\Java\jdk1.7.0_05"& pause & exit 5 + +set _PROJECTNAME=TestCpp +cd ..\..\..\.. + +:project +::Copy build Configuration files to target directory +copy %cd%\tools\JenkinsScript\ant.properties %cd%\samples\%_PROJECTNAME%\proj.android +copy %cd%\tools\JenkinsScript\build.xml %cd%\samples\%_PROJECTNAME%\proj.android +copy %cd%\tools\JenkinsScript\Windows\android\rootconfig.sh %cd%\samples\%_PROJECTNAME%\proj.android + +::Modify the configuration files +cd samples\%_PROJECTNAME%\proj.android +rootconfig.sh %_PROJECTNAME% +cd .. +set _PROJECTLOCATION=%cd% + +::A command line that make the current user get the ownrship of project. +::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F + +::Use cygwin compile the source code. +cygpath "%_PROJECTLOCATION%\proj.android\build_native.sh"|call %CYGWIN%\Cygwin.bat + +::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F +::echo "%_PROJECTION%/proj.android/build_native.sh"|call %CYGWIN%\Cygwin.bat + +::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F +call android update project -p proj.android +cd proj.android + +::Make sure the original android build target is android-8 +for /f "delims=" %%a in ('findstr /i "target=android-" ant.properties') do set xx=%%a +echo %xx% +for /f "delims=" %%a in (ant.properties) do ( +if "%%a"=="%xx%" (echo/target=android-8)else echo/%%a +)>>"anttmp.properties" +move anttmp.properties ant.properties + +::Android ant build(debug,API level:8). +call ant debug +set result8=%ERROELEVEL% + +::Change API level.(API level:10) +for /f "delims=" %%a in (ant.properties) do ( +if "%%a"=="target=android-8" (echo/target=android-10)else echo/%%a +)>>"anttmp.properties" +move anttmp.properties ant.properties + +::Android ant build(debug,API level:10). +call ant debug +set result10=%ERRORLEVEL% + +::Change API level.(API level:11) +for /f "delims=" %%a in (ant.properties) do ( +if "%%a"=="target=android-10" (echo/target=android-11)else echo/%%a +)>>"anttmp.properties" +move anttmp.properties ant.properties + +::Android ant build(debug,API level:11). +call ant debug +set result11=%ERRORlEVEL% + +::Change API level.(API level:12) +for /f "delims=" %%a in (ant.properties) do ( +if "%%a"=="target=android-11" (echo/target=android-12)else echo/%%a +)>>"anttmp.properties" +move anttmp.properties ant.properties + +::Android ant build(debug,API level:12). +call ant debug +set result12=%ERRORLEVEL% + +::Change API level.(API level:13) +for /f "delims=" %%a in (ant.properties) do ( +if "%%a"=="target=android-12" (echo/target=android-13)else echo/%%a +)>>"anttmp.properties" +move anttmp.properties ant.properties + +::Android ant build(debug,API level:13). +call ant debug +set result13=%ERRORLEVEL% + +::After all test versions completed,changed current API level to the original.(API level:8) +for /f "delims=" %%a in (ant.properties) do ( +if "%%a"=="target=android-13" (echo/target=android-8)else echo/%%a +)>>"anttmp.properties" +move anttmp.properties ant.properties + +::Calculate the errorlevel and change build target. +cd ..\..\.. +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 _PROJECTNAME=HelloLua&& goto project +IF "%_PROJECTNAME%"=="HelloLua" set /a testresult3=(result8+result10+result11+result12+result13) +set /a testresult=(testresult1+testresult2+testresult3) +IF %testresult% NEQ 0 goto error + +goto success + +:error +echo Error. +git checkout -f +git clean -df -x +pause +exit 1 +goto end + +:success +echo Success. +git checkout -f +git clean -df -x +pause +exit 0 +goto end + +::End. \ No newline at end of file diff --git a/tools/JenkinsScript/Windows/android/androidtest-debug4.bat b/tools/JenkinsScript/Windows/android/androidtest-debug4.bat new file mode 100644 index 0000000000..deece9be34 --- /dev/null +++ b/tools/JenkinsScript/Windows/android/androidtest-debug4.bat @@ -0,0 +1,100 @@ +::This script is used to finish a android automated compiler. +::You should make sure have finished the environment setting. +::Here are the environment variables you should set. +::%ANT_HOME% %ANDROID_HOME% %JAVA_HOME% %CYGWIN% %GITBIN% %ANDROID_NDK% +:: Don't change it until you know what you do. + +if not exist "%CYGWIN%" echo Couldn't find Cygwin at "%CYGWIN%" and you should set like this "C:\cygwin"& pause & exit 1 +if not exist "%GITBIN%" echo Couldn't find Gitbin at "%GITBIN%" and you should set like this "F:\Git\bin"& pause & exit 2 +if not exist "%ANDROID_HOME%" echo Couldn't find ANDROID_HOME at "%ANDROID_HOME%" and you should set like this "D:\Windows7\android-sdk-windows"& pause & exit 3 +if not exist "%ANDROID_NDK%" echo Couldn't find Cygwin at "%ANDROID_NDK%" and you should set like this "D:\Windows7\android-ndk-r8"& pause & exit 4 +if not exist "%JAVA_HOME%" echo Couldn't find Cygwin at "%JAVA_HOME%" and you should set like this "C:\Program Files\Java\jdk1.7.0_05"& pause & exit 5 + +set _PROJECTNAME=TestCpp +cd ..\..\..\.. + +:project +::Copy build Configuration files to target directory +copy %cd%\tools\JenkinsScript\ant.properties %cd%\samples\%_PROJECTNAME%\proj.android +copy %cd%\tools\JenkinsScript\build.xml %cd%\samples\%_PROJECTNAME%\proj.android +copy %cd%\tools\JenkinsScript\Windows\android\rootconfig.sh %cd%\samples\%_PROJECTNAME%\proj.android + +::Modify the configuration files +cd samples\%_PROJECTNAME%\proj.android +rootconfig.sh %_PROJECTNAME% +cd .. +set _PROJECTLOCATION=%cd% + +::A command line that make the current user get the ownrship of project. +::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F + +::Use cygwin compile the source code. +cygpath "%_PROJECTLOCATION%\proj.android\build_native.sh"|call %CYGWIN%\Cygwin.bat + +::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F +::echo "%_PROJECTION%/proj.android/build_native.sh"|call %CYGWIN%\Cygwin.bat + +::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F +call android update project -p proj.android +cd proj.android + +for /f "delims=" %%a in ('findstr /i "target=android-" ant.properties') do set xx=%%a +echo %xx% +for /f "delims=" %%a in (ant.properties) do ( +if "%%a"=="%xx%" (echo/target=android-8)else echo/%%a +)>>"anttmp.properties" +move anttmp.properties ant.properties + +::Change API level.(API level:14) +for /f "delims=" %%a in (ant.properties) do ( +if "%%a"=="target=android-8" (echo/target=android-14)else echo/%%a +)>>"anttmp.properties" +move anttmp.properties ant.properties + +::Android ant build(debug,API level:14). +call ant debug +set result14=%ERRORLEVEL% + +::Change API level.(API level:15) +for /f "delims=" %%a in (ant.properties) do ( +if "%%a"=="target=android-14" (echo/target=android-15)else echo/%%a +)>>"anttmp.properties" +move anttmp.properties ant.properties + +::Android ant build(debug,API level:15). +call ant debug +set result15=%ERRORLEVEL% + +::After all test versions completed,changed current API level to the original.(API level:8) +for /f "delims=" %%a in (ant.properties) do ( +if "%%a"=="target=android-15" (echo/target=android-8)else echo/%%a +)>>"anttmp.properties" +move anttmp.properties ant.properties + +::Calculate the errorlevel and change build target. +cd ../../.. +IF "%_PROJECTNAME%"=="TestCpp" set /a testresult1=(result14+result15) && set _PROJECTNAME=HelloCpp&& goto project +IF "%_PROJECTNAME%"=="HelloCpp" set /a testresult2=(result14+result15) && set _PROJECTNAME=HelloLua&& goto project +IF "%_PROJECTNAME%"=="HelloLua" set /a testresult3=(result14+result15) +set /a testresult=(testresult1+testresult2+testresult3) +IF %testresult% NEQ 0 goto error + +goto success + +:error +echo Error. +git checkout -f +git clean -df -x +pause +exit 1 +goto end + +:success +echo Success. +git checkout -f +git clean -df -x +pause +exit 0 +goto end + +::End. \ No newline at end of file diff --git a/tools/JenkinsScript/Windows/android/androidtest-release3.bat b/tools/JenkinsScript/Windows/android/androidtest-release3.bat new file mode 100644 index 0000000000..b62a05b3e2 --- /dev/null +++ b/tools/JenkinsScript/Windows/android/androidtest-release3.bat @@ -0,0 +1,149 @@ +::This script is used to finish a android automated compiler. +::You should make sure have finished the environment setting. +::Here are the environment variables you should set. +::%ANT_HOME% %ANDROID_HOME% %JAVA_HOME% %CYGWIN% %GITBIN% %ANDROID_NDK% +:: Don't change it until you know what you do. + +if not exist "%CYGWIN%" echo Couldn't find Cygwin at "%CYGWIN%" and you should set like this "C:\cygwin"& pause & exit 1 +if not exist "%GITBIN%" echo Couldn't find Gitbin at "%GITBIN%" and you should set like this "F:\Git\bin"& pause & exit 2 +if not exist "%ANDROID_HOME%" echo Couldn't find ANDROID_HOME at "%ANDROID_HOME%" and you should set like this "D:\Windows7\android-sdk-windows"& pause & exit 3 +if not exist "%ANDROID_NDK%" echo Couldn't find Cygwin at "%ANDROID_NDK%" and you should set like this "D:\Windows7\android-ndk-r8"& pause & exit 4 +if not exist "%JAVA_HOME%" echo Couldn't find Cygwin at "%JAVA_HOME%" and you should set like this "C:\Program Files\Java\jdk1.7.0_05"& pause & exit 5 + +set _PROJECTNAME=TestCpp +cd ..\..\..\.. + +:project +::Copy build Configuration files to target directory +copy %cd%\tools\JenkinsScript\ant.properties %cd%\samples\%_PROJECTNAME%\proj.android +copy %cd%\tools\JenkinsScript\build.xml %cd%\samples\%_PROJECTNAME%\proj.android +copy %cd%\tools\JenkinsScript\Windows\android\rootconfig.sh %cd%\samples\%_PROJECTNAME%\proj.android + +::Modify the configuration files +cd samples\%_PROJECTNAME%\proj.android +rootconfig.sh %_PROJECTNAME% +cd .. +set _PROJECTLOCATION=%cd% + +::A command line that make the current user get the ownrship of project. +::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F + +::Use cygwin compile the source code. +cygpath "%_PROJECTLOCATION%\proj.android\build_native.sh"|call %CYGWIN%\Cygwin.bat + +::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F +::echo "%_PROJECTION%/proj.android/build_native.sh"|call %CYGWIN%\Cygwin.bat + +::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F +call android update project -p proj.android +cd proj.android + +::Make sure the original android build target is android-8 +for /f "delims=" %%a in ('findstr /i "target=android-" ant.properties') do set xx=%%a +echo %xx% +for /f "delims=" %%a in (ant.properties) do ( +if "%%a"=="%xx%" (echo/target=android-8)else echo/%%a +)>>"anttmp.properties" +move anttmp.properties ant.properties + +for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis +move ant1.properties ant.properties + +::Android ant build(release,API level:8). +call ant release +set result8=%ERRORLEVEL% + +::Change API level.(API level:10) +for /f "delims=" %%a in (ant.properties) do ( +if "%%a"=="target=android-8" (echo/target=android-10)else echo/%%a +)>>"ant1.properties" +move ant1.properties ant.properties + +for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis +move ant1.properties ant.properties + +::Android ant build(release,API level:10). +call ant release +set result10=%ERRORLEVEL% + +::Change API level.(API level:11) +for /f "delims=" %%a in (ant.properties) do ( +if "%%a"=="target=android-10" (echo/target=android-11)else echo/%%a +)>>"ant1.properties" +move ant1.properties ant.properties + +for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis +move ant1.properties ant.properties + +::Android ant build(release,API level:11). +call ant release +set result11=%ERRORLEVEL% + +::Change API level.(API level:12) +for /f "delims=" %%a in (ant.properties) do ( +if "%%a"=="target=android-11" (echo/target=android-12)else echo/%%a +)>>"ant1.properties" +move ant1.properties ant.properties + +for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis +move ant1.properties ant.properties + +::Android ant build(release,API level:12). +call ant release +set result12=%ERRORLEVEL% + +::Change API level.(API level:13) +for /f "delims=" %%a in (ant.properties) do ( +if "%%a"=="target=android-12" (echo/target=android-13)else echo/%%a +)>>"ant1.properties" +move ant1.properties ant.properties + +for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis +move ant1.properties ant.properties + +::Android ant build(release,API level:13). +call ant release +set result13=%ERRORLEVEL% + +::After all test versions completed,changed current API level to the original.(API level:8) +for /f "delims=" %%a in (ant.properties) do ( +if "%%a"=="target=android-13" (echo/target=android-8)else echo/%%a +)>>"ant1.properties" +move ant1.properties ant.properties + +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 ..\..\.. +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 _PROJECTNAME=HelloLua&& goto project +IF "%_PROJECTNAME%"=="HelloLua" set /a testresult3=(result8+result10+result11+result12+result13) +set /a testresult=(testresult1+testresult2+testresult3) +IF %testresult% NEQ 0 goto error + +goto success + +:lis +if "%num%"=="" goto :eof +if "%num:~-1%"==" " set num=%num:~0,-1%&goto lis +echo %num%>>ant1.properties +goto :eof + +:error +echo Error. +git checkout -f +git clean -df -x +pause +exit 1 +goto end + +:success +echo Success. +git checkout -f +git clean -df -x +pause +exit 0 +goto end + +::End. \ No newline at end of file diff --git a/tools/JenkinsScript/Windows/android/androidtest-release4.bat b/tools/JenkinsScript/Windows/android/androidtest-release4.bat new file mode 100644 index 0000000000..0fde559b23 --- /dev/null +++ b/tools/JenkinsScript/Windows/android/androidtest-release4.bat @@ -0,0 +1,115 @@ +::This script is used to finish a android automated compiler. +::You should make sure have finished the environment setting. +::Here are the environment variables you should set. +::%ANT_HOME% %ANDROID_HOME% %JAVA_HOME% %CYGWIN% %GITBIN% %ANDROID_NDK% +:: Don't change it until you know what you do. + +if not exist "%CYGWIN%" echo Couldn't find Cygwin at "%CYGWIN%" and you should set like this "C:\cygwin"& pause & exit 1 +if not exist "%GITBIN%" echo Couldn't find Gitbin at "%GITBIN%" and you should set like this "F:\Git\bin"& pause & exit 2 +if not exist "%ANDROID_HOME%" echo Couldn't find ANDROID_HOME at "%ANDROID_HOME%" and you should set like this "D:\Windows7\android-sdk-windows"& pause & exit 3 +if not exist "%ANDROID_NDK%" echo Couldn't find Cygwin at "%ANDROID_NDK%" and you should set like this "D:\Windows7\android-ndk-r8"& pause & exit 4 +if not exist "%JAVA_HOME%" echo Couldn't find Cygwin at "%JAVA_HOME%" and you should set like this "C:\Program Files\Java\jdk1.7.0_05"& pause & exit 5 + +set _PROJECTNAME=TestCpp +cd ..\..\..\.. + +:project +::Copy build Configuration files to target directory +copy %cd%\tools\JenkinsScript\ant.properties %cd%\samples\%_PROJECTNAME%\proj.android +copy %cd%\tools\JenkinsScript\build.xml %cd%\samples\%_PROJECTNAME%\proj.android +copy %cd%\tools\JenkinsScript\Windows\android\rootconfig.sh %cd%\samples\%_PROJECTNAME%\proj.android + +::Modify the configuration files +cd samples\%_PROJECTNAME%\proj.android +rootconfig.sh %_PROJECTNAME% +cd .. +set _PROJECTLOCATION=%cd% + +::A command line that make the current user get the ownrship of project. +::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F + +::Use cygwin compile the source code. +cygpath "%_PROJECTLOCATION%\proj.android\build_native.sh"|call %CYGWIN%\Cygwin.bat + +::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F +::echo "%_PROJECTION%/proj.android/build_native.sh"|call %CYGWIN%\Cygwin.bat + +::cacls proj.android\*.* /T /E /C /P %_USERNAME%:F +call android update project -p proj.android +cd proj.android + +for /f "delims=" %%a in ('findstr /i "target=android-" ant.properties') do set xx=%%a +echo %xx% +for /f "delims=" %%a in (ant.properties) do ( +if "%%a"=="%xx%" (echo/target=android-8)else echo/%%a +)>>"anttmp.properties" +move anttmp.properties ant.properties + +::Change API level.(API level:14) +for /f "delims=" %%a in (ant.properties) do ( +if "%%a"=="target=android-8" (echo/target=android-14)else echo/%%a +)>>"ant1.properties" +move ant1.properties ant.properties + +for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis +move ant1.properties ant.properties + +::Android ant build(release,API level:14). +call ant release +set result14=%ERRORLEVEL% + +::Change API level.(API level:15) +for /f "delims=" %%a in (ant.properties) do ( +if "%%a"=="target=android-14" (echo/target=android-15)else echo/%%a +)>>"ant1.properties" +move ant1.properties ant.properties + +for /f "delims=" %%a in (ant.properties) do set num=%%a&call :lis +move ant1.properties ant.properties + +::Android ant build(release,API level:15). +call ant release +set result15=%ERRORLEVEL% + +::After all test versions completed,changed current API level to the original.(API level:8) +for /f "delims=" %%a in (ant.properties) do ( +if "%%a"=="target=android-15" (echo/target=android-8)else echo/%%a +)>>"ant1.properties" +move ant1.properties ant.properties + +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 ..\..\.. +IF "%_PROJECTNAME%"=="TestCpp" set /a testresult1=(result14+result15) && set _PROJECTNAME=HelloCpp&& goto project +IF "%_PROJECTNAME%"=="HelloCpp" set /a testresult2=(result14+result15) && set _PROJECTNAME=HelloLua&& goto project +IF "%_PROJECTNAME%"=="HelloLua" set /a testresult3=(result14+result15) +set /a testresult=(testresult1+testresult2+testresult3) +IF %testresult% NEQ 0 goto error + +goto success + +:lis +if "%num%"=="" goto :eof +if "%num:~-1%"==" " set num=%num:~0,-1%&goto lis +echo %num%>>ant1.properties +goto :eof + +:error +echo Error. +git checkout -f +git clean -df -x +pause +exit 1 +goto end + +:success +echo Success. +git checkout -f +git clean -df -x +pause +exit 0 +goto end + +::End. \ No newline at end of file diff --git a/tools/JenkinsScript/Windows/android/androidtestcommon.bat b/tools/JenkinsScript/Windows/android/androidtestcommon.bat new file mode 100644 index 0000000000..fab374d236 --- /dev/null +++ b/tools/JenkinsScript/Windows/android/androidtestcommon.bat @@ -0,0 +1,89 @@ +echo off +rem =========Basic parameters============ +rem jdk path +set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_31 +rem jdk version +set JDK_Version=1.6 +rem sdk path +set AndroidHome=D:\Windows7\android-sdk-windows +rem android version path +set AndroidVersion=\platforms\android-8 +rem android project path +set AndroidProject=D:\cocos2d-x\tests\proj.android +rem unsigned apk name +set unsign_apk=Tests.apk +rem signed apk name +set sign_apk=Tests-sign.apk +rem sign keystore +set apk_key=cdykeystore +set apk_keypass=123456 +set apk_keystore=D:\cdykeystore + +for %%x in ("%AndroidProject%") do set AndroidProject=%%~sx +for %%x in ("%JAVA_HOME%") do set JAVA_HOME=%%~sx +for %%x in ("%AndroidHome%") do set AndroidHome=%%~sx + +rem jdk kit +set EXE_JAVA=%JAVA_HOME%\bin\java +set JAVAC=%JAVA_HOME%\bin\javac +set JAR=%JAVA_HOME%\bin\jar +set KeyTool=%JAVA_HOME%\bin\keytool +set Jarsigner=%JAVA_HOME%\bin\jarsigner + +rem sdk kit +set AndroidAAPT=%AndroidHome%\platform-tools\aapt.exe +set AndroidDx=%AndroidHome%\platform-tools\dx.bat +set AndroidApkBuilder=%AndroidHome%\tools\apkbuilder.bat +set AndroidJar=%AndroidHome%%AndroidVersion%\android.jar + +rem android project directory +set AndroidProjectDrive=D: +set AndroidProjectRes=%AndroidProject%\res +set AndroidProjectGen=%AndroidProject%\gen +set AndroidProjectBin=%AndroidProject%\bin +set AndroidProjectAsset=%AndroidProject%\assets +set AndroidProjectLibs=%AndroidProject%\libs +set AndroidProjectAndroidMainfest=%AndroidProject%\AndroidManifest.xml +set AndroidProjectSrc=%AndroidProject%\src\org\cocos2dx\tests\*.java +set AndroidProjectSrc=%AndroidProjectSrc% %AndroidProject%\src\org\cocos2dx\lib\*.java +set AndroidProjectSrc=%AndroidProjectSrc% %AndroidProject%\gen\org\cocos2dx\tests\*.java + +rem output file +set AndroidProjectClassDex=%AndroidProject%\bin\classes.dex +set AndroidProjectResources=%AndroidProject%\bin\resources.ap_ +set AndroidProjectApk="%AndroidProject%\bin\%unsign_apk%" +set AndroidProjectSignApk="%AndroidProject%\bin\%sign_apk%" + +mkdir %AndroidProject%\gen +mkdir %AndroidProject%\src\org\cocos2dx\lib +mkdir %AndroidProject%\bin +::mkdir %AndroidProject%\bin\classes +xcopy D:\cocos2d-x\cocos2dx\platform\android\java\src_common\org\cocos2dx\lib %AndroidProject%\src\org\cocos2dx\lib /s + +echo generate R.java file +%AndroidAAPT% package -f -m -J %AndroidProjectGen% -S %AndroidProjectRes% -I %AndroidJar% -M %AndroidProjectAndroidMainfest% + +echo generate class file +%JAVAC% -encoding UTF-8 -target %JDK_Version% -bootclasspath %AndroidJar% -d %AndroidProjectBin% %AndroidProjectSrc% %AndroidProjectGen%\org\cocos2dx\tests\R.java + +echo generate dex file +echo on +%AndroidProjectDrive% +cd %AndroidProjectBin% +rem packaging the *.class file into *.jar file +%JAR% cvf %AndroidProjectBin%\classes.jar *.* +cd %AndroidProject% +rem generate *.dex file +call %AndroidDx% --dex --output=%AndroidProjectClassDex% %AndroidProjectBin%\classes.jar + +echo package resources files +%AndroidAAPT% package -f -M %AndroidProjectAndroidMainfest% -S %AndroidProjectRes% -A %AndroidProjectAsset% -I %AndroidJar% -F %AndroidProjectResources% + +echo generate unsigned apk file +call %AndroidApkBuilder% %AndroidProjectApk% -v -u -z %AndroidProjectResources% -f %AndroidProjectClassDex% -rf %AndroidProject%\src -nf %AndroidProjectLibs% -rj %AndroidProjectLibs% + +echo generate signed apk file +%Jarsigner% -verbose -keystore %apk_keystore% -keypass %apk_keypass% -storepass %apk_keypass% -signedjar %AndroidProjectSignApk% %AndroidProjectApk% cdykeystore + +echo sign success! +pause \ No newline at end of file diff --git a/tools/JenkinsScript/Windows/android/rootconfig.sh b/tools/JenkinsScript/Windows/android/rootconfig.sh new file mode 100644 index 0000000000..b45a92a2a3 --- /dev/null +++ b/tools/JenkinsScript/Windows/android/rootconfig.sh @@ -0,0 +1,35 @@ +#!/bin/bash +#Change the path expression of current path to cygwin path. +#NDK_ROOT=$($CYGWIN/bin/cygpath.exe $ANDROID_NDK) +#echo $NDK_ROOT +CUR=$(pwd) +cd ../../.. +#tmp=$(pwd) +#COCOS2DX=$($CYGWIN/bin/cygpath.exe $tmp) +#echo $COCOS2DX + +#var1=NDK_ROOT_LOCAL= +#_NDK_ROOT=${var1}${NDK_ROOT} + +#var2=COCOS2DX_ROOT_LOCAL= +#_COCOS2DX_ROOT=${var2}${COCOS2DX} +#echo $_NDK_ROOT +#echo $_COCOS2DX_ROOT + +#Modify the configuration files +#sed -i '3,4d' $CUR/build_native.sh +sed -i '13d' $CUR/project.properties +#sed -i "3 i\\$_NDK_ROOT" $CUR/build_native.sh +#sed -i "4 i\\$_COCOS2DX_ROOT" $CUR/build_native.sh + +#Modify the project name +if [ $1 = TestCpp ]; then + sed -i '2d' $CUR/build.xml + sed -i '2 i\' $CUR/build.xml +elif [ $1 = HelloCpp ]; then + sed -i '2d' $CUR/build.xml + sed -i '2 i\' $CUR/build.xml +else + sed -i '2d' $CUR/build.xml + sed -i '2 i\' $CUR/build.xml +fi \ No newline at end of file