add JSB to jenkins

This commit is contained in:
andyque 2015-05-25 16:37:08 +08:00
parent a6a5318e13
commit c7d698362f
8 changed files with 56 additions and 16 deletions

View File

@ -58,8 +58,8 @@ endif()
set(BUILD_CPP_TESTS_DEFAULT ON)
set(BUILD_LUA_LIBS_DEFAULT ON)
set(BUILD_LUA_TESTS_DEFAULT ON)
set(BUILD_JS_LIBS_DEFAULT OFF)
set(BUILD_JS_TESTS_DEFAULT OFF)
set(BUILD_JS_LIBS_DEFAULT ON)
set(BUILD_JS_TESTS_DEFAULT ON)
# TODO: fix test samples for MSVC
if(MSVC)
set(BUILD_CPP_TESTS_DEFAULT OFF)

View File

@ -4,12 +4,12 @@
import sys
import os, os.path
import shutil
from optparse import OptionParser
CPP_SAMPLES = ['cpp-empty-test', 'cpp-tests', 'game-controller-test']
LUA_SAMPLES = ['lua-empty-test', 'lua-tests', 'lua-game-controller-test']
ALL_SAMPLES = CPP_SAMPLES + LUA_SAMPLES
JS_SAMPLES = ['js-tests']
ALL_SAMPLES = CPP_SAMPLES + LUA_SAMPLES + JS_SAMPLES
def caculate_built_samples(args):
''' Compute the sampels to be built
@ -27,6 +27,9 @@ def caculate_built_samples(args):
if 'lua' in args:
targets += LUA_SAMPLES
args.remove('lua')
if 'js' in args:
targets += JS_SAMPLES
args.remove('js')
targets += args
@ -36,8 +39,8 @@ def caculate_built_samples(args):
return list(targets)
def do_build(app_android_root, build_mode):
command = 'cocos compile -p android -s %s --ndk-mode %s' % (app_android_root, build_mode)
command = 'cocos compile -p android -s %s --ndk-mode %s' % (app_android_root, build_mode)
print command
if os.system(command) != 0:
@ -49,7 +52,7 @@ def build_samples(target, build_mode):
build_mode = 'debug'
elif build_mode != 'release':
build_mode = 'debug'
build_targets = caculate_built_samples(target)
app_android_root = ''
@ -60,7 +63,8 @@ def build_samples(target, build_mode):
"cpp-tests": "tests/cpp-tests",
"lua-empty-test": "tests/lua-empty-test",
"lua-tests": "tests/lua-tests",
"lua-game-controller-test": "tests/lua-game-controller-test"
"lua-game-controller-test": "tests/lua-game-controller-test",
"js-tests": "tests/js-tests"
}
cocos_root = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..")
@ -81,7 +85,7 @@ if __name__ == '__main__':
usage = """
This script is mainy used for building tests built-in with cocos2d-x.
Usage: %prog [options] [cpp-empty-test|cpp-tests|lua-empty-test|lua-tests|cpp|lua|all]
Usage: %prog [options] [cpp-empty-test|cpp-tests|lua-empty-test|lua-tests|js-tests|cpp|lua|all]
If you are new to cocos2d-x, I recommend you start with cpp-empty-test, lua-empty-test.
@ -93,13 +97,15 @@ if __name__ == '__main__':
parser = OptionParser(usage=usage)
parser.add_option("-n", "--ndk", dest="ndk_build_param",
help='It is not used anymore, because cocos console does not support it.')
help='It is not used anymore, because cocos console does not support it.')
parser.add_option("-p", "--platform", dest="android_platform",
help='This parameter is not used any more, just keep compatible.')
help='This parameter is not used any more, just keep compatible.')
parser.add_option("-b", "--build", dest="build_mode",
help='The build mode for java project,debug[default] or release. Get more information,please refer to http://developer.android.com/tools/building/building-cmdline.html')
help='The build mode for java project,debug[default] or release. \
Get more information, \
please refer to http://developer.android.com/tools/building/building-cmdline.html')
(opts, args) = parser.parse_args()
if len(args) == 0:
parser.print_help()
sys.exit(1)

View File

@ -48,10 +48,13 @@ def do_build_slaves():
js_tests_build_scripts = jenkins_script_path + "win32-js-build.bat"
elif(node_name == 'windows-universal' or node_name == 'windows-universal_bak'):
slave_build_scripts = jenkins_script_path + "windows-universal.bat"
js_tests_build_scripts = jenkins_script_path + "windows-js-universal.bat"
elif(node_name == 'ios_mac' or node_name == 'ios' or node_name == 'ios_bak'):
slave_build_scripts = jenkins_script_path + "ios-build.sh"
js_tests_build_scripts = jenkins_script_path + "ios-js-build.sh"
elif(node_name == 'mac' or node_name == 'mac_bak'):
slave_build_scripts = jenkins_script_path + "mac-build.sh"
js_tests_build_scripts = jenkins_script_path + "mac-js-build.sh"
elif(node_name == 'linux_centos' or node_name == 'linux' or node_name == 'linux_bak'):
slave_build_scripts = jenkins_script_path + "linux-build.sh"
elif(node_name == 'wp8'):

View File

@ -2,4 +2,4 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
COCOS2DX_ROOT="$DIR"/../../..
cd ${COCOS2DX_ROOT}
python build/android-build.py -p 10 cpp-tests lua-tests
python build/android-build.py -p 10 cpp-tests lua-tests js-tests

View File

@ -4,7 +4,7 @@ import os
import sys
ret = 0
genbindings_dirs = ['tolua']
genbindings_dirs = ['tolua', 'tojs']
for item in genbindings_dirs:
os.chdir("tools/" + item)
ret = os.system('python genbindings.py')
@ -12,5 +12,5 @@ for item in genbindings_dirs:
if(ret != 0):
ret = 1
break
sys.exit(ret)

View File

@ -0,0 +1,7 @@
#put xctool.sh into your PATH
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
COCOS2DX_ROOT="$DIR"/../../..
xcodebuild -project "$COCOS2DX_ROOT"/build/cocos2d_js_tests.xcodeproj -scheme "js-tests iOS" -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" clean | xcpretty
xcodebuild -project "$COCOS2DX_ROOT"/build/cocos2d_js_tests.xcodeproj -scheme "js-tests iOS" -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" build | xcpretty
#the following commands must not be removed
xcodebuild -project "$COCOS2DX_ROOT"/build/cocos2d_js_tests.xcodeproj -scheme "js-tests iOS" -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" build

View File

@ -0,0 +1,22 @@
#put xctool.sh into your PATH
#######
# Cmake build
#######
# DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# COCOS2DX_ROOT="$DIR"/../../..
# cd ${COCOS2DX_ROOT}
# mkdir mac-build
# cd mac-build
# cmake ..
# make -j4
#######
# xcode build
#######
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
COCOS2DX_ROOT="$DIR"/../../..
xcodebuild -project "$COCOS2DX_ROOT"/build/cocos2d_js_tests.xcodeproj -scheme "js-tests Mac" clean | xcpretty
xcodebuild -project "$COCOS2DX_ROOT"/build/cocos2d_js_tests.xcodeproj -scheme "js-tests Mac" build | xcpretty
#xcpretty has a bug, some xcodebuid fails return value would be treated as 0.
xcodebuild -project "$COCOS2DX_ROOT"/build/cocos2d_js_tests.xcodeproj -scheme "js-tests Mac" build

View File

@ -0,0 +1,2 @@
call "%VS120COMNTOOLS%vsvars32.bat"
msbuild build\cocos2d-js-win8.1-universal.sln /t:Build /p:Platform="Win32" /p:Configuration="Release" /m