Jenkins 搭建U3D自动发布 Android
2015-04-08 11:49
531 查看
工具 【u3d相关的PostProcessBuildPlayer,PerformBuild.cs】
1.Jenkins 开源包 Java -jar jenkins.war,参考链接 /article/4664614.html。
2.JDK
3.ANT
4.Eclipse
5.Jenkins 插件管理
6.因为考虑在MAC上执行,安装Cygwin
7.新建项目开始配置步骤:
1>.源码管理 :SVN更新代码工程与资源 。
2>.构建触发器,可以不要 指定时间自己构建 Poll SCM H 22 * * * 【每天22.00点自动构建一次】
3>.添加Windows的batch command: 先到Android Project再打包APK
COPY %WORKSPACE%\Tools\PerformBuild.cs %WORKSPACE%\code\Assets\Editor\
COPY %WORKSPACE%\Tools\PostProcessBuildPlayer %WORKSPACE%\code\Assets\Editor\
RD /S /Q %WORKSPACE%\build-android
MKDIR %WORKSPACE%\build-android
echo Start building Unity project to Android project..........
"C:\Program Files (x86)\Unity\Editor\Unity" -projectPath %WORKSPACE%\code -executeMethod PerformBuild.CommandLineBuildAndroid -batchmode -quit -logFile %WORKSPACE%\build-android\log.txt
把U3D的工程使用命令行导出Eclipse工程。中间需要手动设置一次AndroidSDK。
SET LANG="en_US.UTF-8"
SET ANT_ROOT="E:\helptools\eclipse\plugins\org.apache.ant_1.9.2.v201404171502\bin"
SET ANDROID_SDK_ROOT="E:\helptools\android-sdk"
SET PATH=%PATH%;%ANT_ROOT%;%ANDROID_SDK_ROOT%;%ANDROID_SDK_ROOT%/tools;
cd %WORKSPACE%/build-android
ren dragonandroid dragon
echo Copy resource to build directory.....
mkdir dragon\assets\ClientRes
copy /y %WORKSPACE%\ClientRes\Config dragon\assets\ClientRes
copy /y %WORKSPACE%\ClientRes\Assetbundles_Android \dragon\assets\ClientRes
del \dragon\assets\ClientRes\Config\.svn
del \dragon\assets\ClientRes\Assetbundles_Android\.svn
copy %WORKSPACE%\Tools\strings.xml %WORKSPACE%\build-android\dragon\res\values
cd dragon
echo unzip android -d ./dragon
android update project -p ./ --name Dragon
ant debug
zipalign -v 4 bin/Dragon-debug.apk "bin/dragon 0.8.${BUILD_NUMBER}.apk"
如果上面相关命令不对需要在系统环境变量中添加。
4>.batch command: 直接 APK
echo Copy resource to build directory.....
cd %WORKSPACE%
copy /y %WORKSPACE%\ClientRes\Config code\Assets\Plugins\Android\assets\ClientRes\Config
copy /y %WORKSPACE%\ClientRes\Assetbundles_Android\ code\Assets\Plugins\Android\assets\ClientRes\Assetbundles_Android
rd /s/q code\Assets\Plugins\Android\assets\ClientRes\Config\.svn
rd /s/q code\Assets\Plugins\Android\assets\ClientRes\Assetbundles_Android\.svn
MKDIR %WORKSPACE%\build-android
echo Start building Unity project to Android APK..........
"C:\Program Files (x86)\Unity\Editor\Unity" -projectPath %WORKSPACE%\code -executeMethod PerformBuild.CommandLineBuildAndroid -batchmode -quit -logFile %WORKSPACE%\build-android\log.txt
PerformBuild.cs 有变动
1.Jenkins 开源包 Java -jar jenkins.war,参考链接 /article/4664614.html。
2.JDK
3.ANT
4.Eclipse
5.Jenkins 插件管理
Ant Plugin This plugin adds Apache Ant support to Jenkins. | 1.2 | ||||
Credentials Plugin This plugin allows you to store credentials in Jenkins. | 1.18 | ||||
CVS Plugin Integrates Jenkins with CVS version control system using a modified version of the Netbeans cvsclient. | 2.11 | ||||
External Monitor Job Type Plugin Adds the ability to monitor the result of externally executed jobs. | 1.4 | ||||
Javadoc Plugin This plugin adds Javadoc support to Jenkins. | 1.1 | ||||
JUnit Plugin Allows JUnit-format test results to be published. | 1.2-beta-4 | ||||
LDAP Plugin Security realm based on LDAP authentication. | 1.6 | ||||
Mailer This plugin allows you to configure email notifications. This is a break-out of the original core based email component. | 1.11 | ||||
Matrix Authorization Strategy Plugin Offers matrix-based security authorization strategies (global and per-project). | 1.1 | ||||
Matrix Project Plugin Multi-configuration (matrix) project type. | 1.3 | ||||
Maven Project Plugin Jenkins plugin for building Maven 2/3 jobs via a special project type. | 2.7.1 | ||||
OWASP Markup Formatter Plugin Uses the OWASP Java HTML Sanitizer to allow safe-seeming HTML markup to be entered in project descriptions and the like. | 1.1 | ||||
PAM Authentication Plugin Adds Unix Pluggable Authentication Module (PAM) support to Jenkins. | 1.1 | ||||
SSH Credentials Plugin This plugin allows you to store SSH credentials in Jenkins. | 1.10 | ||||
SSH Slaves plugin This plugin allows you to manage slaves running on \*nix machines over SSH. | 1.9 | ||||
Subversion Plugin This plugin adds the Subversion support (via SVNKit) to Jenkins. | 1.54 | ||||
Translation Assistance Plugin This plugin adds an additional dialog box in every page, which enables people to contribute localizations for the messages they are seeing in the current page. | 1.10 | ||||
Windows Slaves Plugin Allows you to connect to Windows machines and start slave agents on them. |
7.新建项目开始配置步骤:
1>.源码管理 :SVN更新代码工程与资源 。
2>.构建触发器,可以不要 指定时间自己构建 Poll SCM H 22 * * * 【每天22.00点自动构建一次】
3>.添加Windows的batch command: 先到Android Project再打包APK
COPY %WORKSPACE%\Tools\PerformBuild.cs %WORKSPACE%\code\Assets\Editor\
COPY %WORKSPACE%\Tools\PostProcessBuildPlayer %WORKSPACE%\code\Assets\Editor\
RD /S /Q %WORKSPACE%\build-android
MKDIR %WORKSPACE%\build-android
echo Start building Unity project to Android project..........
"C:\Program Files (x86)\Unity\Editor\Unity" -projectPath %WORKSPACE%\code -executeMethod PerformBuild.CommandLineBuildAndroid -batchmode -quit -logFile %WORKSPACE%\build-android\log.txt
把U3D的工程使用命令行导出Eclipse工程。中间需要手动设置一次AndroidSDK。
SET LANG="en_US.UTF-8"
SET ANT_ROOT="E:\helptools\eclipse\plugins\org.apache.ant_1.9.2.v201404171502\bin"
SET ANDROID_SDK_ROOT="E:\helptools\android-sdk"
SET PATH=%PATH%;%ANT_ROOT%;%ANDROID_SDK_ROOT%;%ANDROID_SDK_ROOT%/tools;
cd %WORKSPACE%/build-android
ren dragonandroid dragon
echo Copy resource to build directory.....
mkdir dragon\assets\ClientRes
copy /y %WORKSPACE%\ClientRes\Config dragon\assets\ClientRes
copy /y %WORKSPACE%\ClientRes\Assetbundles_Android \dragon\assets\ClientRes
del \dragon\assets\ClientRes\Config\.svn
del \dragon\assets\ClientRes\Assetbundles_Android\.svn
copy %WORKSPACE%\Tools\strings.xml %WORKSPACE%\build-android\dragon\res\values
cd dragon
echo unzip android -d ./dragon
android update project -p ./ --name Dragon
ant debug
zipalign -v 4 bin/Dragon-debug.apk "bin/dragon 0.8.${BUILD_NUMBER}.apk"
如果上面相关命令不对需要在系统环境变量中添加。
4>.batch command: 直接 APK
echo Copy resource to build directory.....
cd %WORKSPACE%
copy /y %WORKSPACE%\ClientRes\Config code\Assets\Plugins\Android\assets\ClientRes\Config
copy /y %WORKSPACE%\ClientRes\Assetbundles_Android\ code\Assets\Plugins\Android\assets\ClientRes\Assetbundles_Android
rd /s/q code\Assets\Plugins\Android\assets\ClientRes\Config\.svn
rd /s/q code\Assets\Plugins\Android\assets\ClientRes\Assetbundles_Android\.svn
MKDIR %WORKSPACE%\build-android
echo Start building Unity project to Android APK..........
"C:\Program Files (x86)\Unity\Editor\Unity" -projectPath %WORKSPACE%\code -executeMethod PerformBuild.CommandLineBuildAndroid -batchmode -quit -logFile %WORKSPACE%\build-android\log.txt
PerformBuild.cs 有变动
相关文章推荐
- Jenkins 搭建U3D自动发布 IOS
- 用jenkins搭建android自动打包环境
- Jenkins下Android自动化打包(图文讲解)(自动发布内测平台)
- Jenkins+Gradle+Git+Pyger+二维码搭建Android自动打包平台
- git+maven+jenkins 自动发布环境搭建
- Mac Jenkins搭建 Android/IOS自动打包环境
- mac上搭建Jenkins+Android+IOS自动开发部署环境
- MAC上搭建Jenkins实现Android自动打包
- 使用阿里云服务器搭建Android自动构建平台Jenkins
- Jenkins搭建.NET自动编译测试与发布环境
- windows下利用jenkins搭建Android自动打包环境
- 【mac+Android Studio】【持续集成优化】搭建Jenkins+svn+Android Studio+发布到蒲公英+发邮件
- 用jenkins搭建android自动打包环境
- Jenkins搭建.NET自动编译测试与发布环境
- Jenkins搭建Android自动打包二之设置渠道打包
- Jenkins + aapt + JForg Artifatory 搭建快速版本发布(Android, IOS)
- Jenkins+Gradle+Git+Pyger+二维码搭建Android自动打包平台
- 【mac+Android Studio】搭建Jenkins+svn+Android Studio+发布到蒲公英+发邮件+findbugs
- centos下搭建jenkins自动打包功能--Android