Skip to content

Commit

Permalink
Fix win32 cpp-template, speedup appveyor, add cocos new CI configurat…
Browse files Browse the repository at this point in the history
…ion (cocos2d#18663)

* Fix win32 cpp-template, speedup appveyor, add cocos new CI configuration

* fix cocos new for win32
  • Loading branch information
crazyhappygame authored and minggo committed Jan 30, 2018
1 parent b3285ed commit 8c1c347
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 15 deletions.
12 changes: 8 additions & 4 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ environment:
PYTHON_VERSION: "2.7.13"
PYTHON_ARCH: "32"
matrix:
# - build_type: android_cpp_empty_test
- build_type: windows32_cocos_new_test
- build_type: windows32
- build_type: android_cpp_tests
# - build_type: android_cocos_new_test
- build_type: android_cocos_new_test
# - build_type: android_cpp_empty_test
# - build_type: android_gen_libs
- build_type: windows32


platform:
- x86
Expand All @@ -35,4 +37,6 @@ branches:
- v3.11_backup
- v35-for-tizen

clone_depth: 50
clone_depth: 1

test: off
4 changes: 3 additions & 1 deletion templates/cocos2dx_files.json
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,9 @@
"cocos/base/utlist.h",
"cocos/cc_dummy.c",
"cocos/cocos2d.cpp",
"cocos/cocos2d.h",
"cocos/cocos2d.h",
"cocos/precheader.cpp",
"cocos/precheader.h",
"cocos/deprecated/CCArray.cpp",
"cocos/deprecated/CCArray.h",
"cocos/deprecated/CCBool.h",
Expand Down
6 changes: 0 additions & 6 deletions templates/cpp-template-default/proj.win32/HelloCpp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp", "HelloCpp.vcxpro
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos2d\cocos\2d\libcocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d", "..\cocos2d\external\Box2D\proj.win32\libbox2d.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\cocos2d\cocos\editor-support\spine\proj.win32\libSpine.vcxproj", "{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "librecast", "..\cocos2d\external\recast\proj.win32\librecast.vcxproj", "{41E34993-647E-4282-8384-4AB1AE31A452}"
Expand All @@ -30,10 +28,6 @@ Global
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.Build.0 = Debug|Win32
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.ActiveCfg = Release|Win32
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.Build.0 = Release|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.ActiveCfg = Debug|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.Build.0 = Debug|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.ActiveCfg = Release|Win32
{929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.Build.0 = Release|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.ActiveCfg = Debug|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.Build.0 = Debug|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.ActiveCfg = Release|Win32
Expand Down
8 changes: 5 additions & 3 deletions tools/appveyor-scripts/before-build.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Set-PSDebug -Trace 1
$python = "C:\\Python27\\python.exe"

function Download-Deps
Expand Down Expand Up @@ -47,7 +48,7 @@ function Update-SubModule
{
Push-Location $env:APPVEYOR_BUILD_FOLDER
& git submodule init
& git submodule update --recursive
& git submodule update --recursive --depth=1
Pop-Location
}

Expand All @@ -59,8 +60,9 @@ If ($env:build_type -eq "windows32") {
Download-Deps
Download-NDK
Generate-Binding-Codes
}
Else {
} elseif ($env:build_type -like "android*") {
& $python -u .\tools\appveyor-scripts\setup_android.py
if ($lastexitcode -ne 0) {throw}
} else {
Download-Deps
}
20 changes: 19 additions & 1 deletion tools/appveyor-scripts/build.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Set-PSDebug -Trace 1
$python = "C:\\Python27\\python.exe"

Write-Host "Set environment"
Expand Down Expand Up @@ -48,8 +49,25 @@ If ($env:build_type -eq "android_cpp_tests") {
# & $python -u tools\cocos2d-console\bin\cocos.py gen-libs -p android -m release --ap android-15 --app-abi armeabi-v7a --agreement n
# if ($lastexitcode -ne 0) {throw}

} elseif ($env:build_type -eq "windows32_cocos_new_test") {
Write-Host "Create new project windows32_cocos_new_test"
& $python -u tools\cocos2d-console\bin\cocos.py --agreement n new -l cpp -p my.pack.qqqq cocos_new_test
if ($lastexitcode -ne 0) {throw}

& msbuild $env:APPVEYOR_BUILD_FOLDER\cocos_new_test\proj.win32\cocos_new_test.sln /t:Build /p:Platform="Win32" /p:Configuration="Release" /m /consoleloggerparameters:"PerformanceSummary;NoSummary"
if ($lastexitcode -ne 0) {throw}

& 7z a release_win32.7z $env:APPVEYOR_BUILD_FOLDER\cocos_new_test\proj.win32\Release.win32\
if ($lastexitcode -ne 0) {throw}

Push-AppveyorArtifact release_win32.7z
}
Else {
& msbuild $env:APPVEYOR_BUILD_FOLDER\build\cocos2d-win32.sln /t:Build /p:Platform="Win32" /p:Configuration="Release" /m
& msbuild $env:APPVEYOR_BUILD_FOLDER\build\cocos2d-win32.sln /t:Build /p:Platform="Win32" /p:Configuration="Release" /m /consoleloggerparameters:"PerformanceSummary;NoSummary"

if ($lastexitcode -ne 0) {throw}
& 7z a release_win32.7z $env:APPVEYOR_BUILD_FOLDER\build\Release.win32\
if ($lastexitcode -ne 0) {throw}

Push-AppveyorArtifact release_win32.7z
}

0 comments on commit 8c1c347

Please sign in to comment.