zoukankan      html  css  js  c++  java
  • Jenkins 搭建U3D自动发布 Android

    工具 【u3d相关的PostProcessBuildPlayer,PerformBuild.cs】

    1.Jenkins 开源包  Java -jar jenkins.war,参考链接 http://www.cnblogs.com/itech/archive/2011/11/02/2233343.html

    2.JDK 

    3.ANT 

    4.Eclipse

    5.Jenkins 插件管理  

    This plugin adds Apache Ant support to Jenkins.
    1.2      
    This plugin allows you to store credentials in Jenkins.
    1.18      
    Integrates Jenkins with CVS version control system using a modified version of the Netbeans cvsclient.
    2.11      
    Adds the ability to monitor the result of externally executed jobs.
    1.4      
    This plugin adds Javadoc support to Jenkins.
    1.1      
    Allows JUnit-format test results to be published.
    1.2-beta-4      
    Security realm based on LDAP authentication.
    1.6      
    This plugin allows you to configure email notifications. This is a break-out of the original core based email component.
    1.11      
    Offers matrix-based security authorization strategies (global and per-project).
    1.1      
    Multi-configuration (matrix) project type.
    1.3      
    Jenkins plugin for building Maven 2/3 jobs via a special project type.
    2.7.1      
    Uses the OWASP Java HTML Sanitizer to allow safe-seeming HTML markup to be entered in project descriptions and the like.
    1.1      
    Adds Unix Pluggable Authentication Module (PAM) support to Jenkins.
    1.1      
    This plugin allows you to store SSH credentials in Jenkins.
    1.10      
    This plugin allows you to manage slaves running on *nix machines over SSH.
    1.9      
    This plugin adds the Subversion support (via SVNKit) to Jenkins.
    1.54      
    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      
    Allows you to connect to Windows machines and start slave agents on them.

    6.因为考虑在MAC上执行,安装Cygwin

    7.新建项目开始配置步骤:

    1>.源码管理 :SVN更新代码工程与资源 。

    2>.构建触发器,可以不要 指定时间自己构建  Poll SCM  H 22 * * *  【每天22.00点自动构建一次】

    3>.添加Windows的batch command: 先到Android Project再打包APK

    COPY %WORKSPACE%ToolsPerformBuild.cs %WORKSPACE%codeAssetsEditor
    COPY %WORKSPACE%ToolsPostProcessBuildPlayer %WORKSPACE%codeAssetsEditor

    RD /S /Q %WORKSPACE%uild-android
    MKDIR %WORKSPACE%uild-android

    echo Start building Unity project to Android project..........
    "C:Program Files (x86)UnityEditorUnity" -projectPath %WORKSPACE%code -executeMethod PerformBuild.CommandLineBuildAndroid -batchmode -quit -logFile %WORKSPACE%uild-androidlog.txt

    把U3D的工程使用命令行导出Eclipse工程。中间需要手动设置一次AndroidSDK。 

    SET LANG="en_US.UTF-8"
    SET ANT_ROOT="E:helptoolseclipsepluginsorg.apache.ant_1.9.2.v201404171502in"
    SET ANDROID_SDK_ROOT="E:helptoolsandroid-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 dragonassetsClientRes
    copy /y %WORKSPACE%ClientResConfig dragonassetsClientRes
    copy /y %WORKSPACE%ClientResAssetbundles_Android dragonassetsClientRes
    del dragonassetsClientResConfig.svn
    del dragonassetsClientResAssetbundles_Android.svn

    copy %WORKSPACE%Toolsstrings.xml %WORKSPACE%uild-androiddragon esvalues


    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%ClientResConfig codeAssetsPluginsAndroidassetsClientResConfig
    copy /y %WORKSPACE%ClientResAssetbundles_Android codeAssetsPluginsAndroidassetsClientResAssetbundles_Android
    rd /s/q codeAssetsPluginsAndroidassetsClientResConfig.svn
    rd /s/q codeAssetsPluginsAndroidassetsClientResAssetbundles_Android.svn

    MKDIR %WORKSPACE%uild-android

    echo Start building Unity project to Android APK..........
    "C:Program Files (x86)UnityEditorUnity" -projectPath %WORKSPACE%code -executeMethod PerformBuild.CommandLineBuildAndroid -batchmode -quit -logFile %WORKSPACE%uild-androidlog.txt

    PerformBuild.cs 有变动

  • 相关阅读:
    Fast Search:爬网测试 金大昊(jindahao)
    FAST Search :deployment.xml
    TFS:强制签入已签出的文件 金大昊(jindahao)
    采用权限控制的工作流权限设计 金大昊(jindahao)
    FAST Search :创建自定义属性 金大昊(jindahao)
    SharePoint:替换搜索结果连接URL 金大昊(jindahao)
    SharePoint:迁移
    SharePoint:关于word模板内容类型(template.dotx) 金大昊(jindahao)
    SharePoint:备份和还原
    BCS 爬网报错 金大昊(jindahao)
  • 原文地址:https://www.cnblogs.com/j349900963/p/4401987.html
Copyright © 2011-2022 走看看