mirror of https://github.com/axmolengine/axmol.git
ignore it.
This commit is contained in:
commit
e80b152045
|
@ -75,12 +75,24 @@ def MAC_BUILD():
|
||||||
return buildAndRun()
|
return buildAndRun()
|
||||||
#----------------autotest build and run end----------------#
|
#----------------autotest build and run end----------------#
|
||||||
|
|
||||||
|
PATH_ANDROID_SRC = 'tests/cpp-tests/proj.android/'
|
||||||
|
FILE_ANDROID_DELETE = ['libs','gen','assets','bin','obj']
|
||||||
#----------------autotest-android build and run----------------#
|
#----------------autotest-android build and run----------------#
|
||||||
def ANDROID_BUILD():
|
def ANDROID_BUILD():
|
||||||
|
def checkDevice():
|
||||||
|
cmd = 'adb devices'
|
||||||
|
infoDev = os.popen(cmd).readlines()
|
||||||
|
firstDev = infoDev[1]
|
||||||
|
if len(firstDev) < 5 or firstDev.find('device') < 0:
|
||||||
|
print 'no android device.'
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
print 'device info:', firstDev
|
||||||
|
return True
|
||||||
def cleanProj():
|
def cleanProj():
|
||||||
infoClean = os.system('rm -rf libs gen obj assets bin')
|
for strFile in FILE_ANDROID_DELETE:
|
||||||
print 'infoClean: ', infoClean
|
infoClean = os.system('rm -rf '+PATH_ANDROID_SRC+strFile)
|
||||||
infoClean = os.system('adb uninstall org.cocos2dx.testcpp');
|
infoClean = os.system('adb uninstall org.cocos2dx.cpp_tests');
|
||||||
print 'infoClean: ', infoClean
|
print 'infoClean: ', infoClean
|
||||||
if infoClean != 0:
|
if infoClean != 0:
|
||||||
print 'clean **CLEAN FAILED**'
|
print 'clean **CLEAN FAILED**'
|
||||||
|
@ -88,19 +100,19 @@ def ANDROID_BUILD():
|
||||||
def updateProperty():
|
def updateProperty():
|
||||||
infoUpdate = os.system('android update project -p ./cocos/2d/platform/android/java/ -t 12')
|
infoUpdate = os.system('android update project -p ./cocos/2d/platform/android/java/ -t 12')
|
||||||
print 'cocos update:', infoUpdate
|
print 'cocos update:', infoUpdate
|
||||||
infoUpdate = os.system('android update project -p ./tests/proj.android/ -t 12')
|
infoUpdate = os.system('android update project -p '+PATH_ANDROID_SRC+' -t 12')
|
||||||
print 'test update:', infoUpdate
|
print 'test update:', infoUpdate
|
||||||
def buildProj():
|
def buildProj():
|
||||||
infoBuild = os.system('./build/android-build.py testcpp')
|
infoBuild = os.system('./build/android-build.py -p 13 cpp-tests')
|
||||||
print 'infoBuild testcpp: ', infoBuild
|
print 'infoBuild cpp_tests: ', infoBuild
|
||||||
infoBuild = os.system('ant -buildfile ./tests/proj.android/ debug install')
|
infoBuild = os.system('ant -buildfile '+PATH_ANDROID_SRC+' debug install')
|
||||||
print 'infoBuild: ', infoBuild
|
print 'infoBuild: ', infoBuild
|
||||||
if infoBuild != 0:
|
if infoBuild != 0:
|
||||||
print 'build **BUILD FAILED**'
|
print 'build **BUILD FAILED**'
|
||||||
time.sleep(sleep_time)
|
time.sleep(sleep_time)
|
||||||
return infoBuild
|
return infoBuild
|
||||||
def openProj():
|
def openProj():
|
||||||
cmd = 'adb shell am start -n org.cocos2dx.testcpp/org.cocos2dx.testcpp.Cocos2dxActivity'
|
cmd = 'adb shell am start -n org.cocos2dx.cpp_tests/org.cocos2dx.cpp_tests.Cocos2dxActivity'
|
||||||
print 'cmd: ', cmd
|
print 'cmd: ', cmd
|
||||||
infoOpen = os.system(cmd)
|
infoOpen = os.system(cmd)
|
||||||
print 'infoOpen: ', infoOpen
|
print 'infoOpen: ', infoOpen
|
||||||
|
@ -109,23 +121,24 @@ def ANDROID_BUILD():
|
||||||
time.sleep(sleep_time)
|
time.sleep(sleep_time)
|
||||||
return True
|
return True
|
||||||
def buildAndRun():
|
def buildAndRun():
|
||||||
|
if not checkDevice():
|
||||||
|
return False
|
||||||
cleanProj()
|
cleanProj()
|
||||||
updateProperty()
|
updateProperty()
|
||||||
if buildProj() != 0:
|
buildProj()
|
||||||
cleanProj()
|
|
||||||
buildProj()
|
|
||||||
return openProj()
|
return openProj()
|
||||||
return buildAndRun()
|
return buildAndRun()
|
||||||
#----------------autotest-android build and run end----------------#
|
#----------------autotest-android build and run end----------------#
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
print 'will build mac project.'
|
print 'will build mac project.'
|
||||||
#suc_build_mac = MAC_BUILD()
|
suc_build_mac = MAC_BUILD()
|
||||||
print 'will build android project.'
|
print 'will build android project.'
|
||||||
suc_build_android = ANDROID_BUILD()
|
suc_build_android = ANDROID_BUILD()
|
||||||
if suc_build_mac:
|
if suc_build_mac:
|
||||||
autotest(TYPE_MAC)
|
autotest(TYPE_MAC)
|
||||||
if suc_build_android:
|
if suc_build_android:
|
||||||
|
print 'will run android autotest.'
|
||||||
autotest(TYPE_ANDROID)
|
autotest(TYPE_ANDROID)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue