美文网首页
jenkins+ant+eclipse自动化构建多渠道打包

jenkins+ant+eclipse自动化构建多渠道打包

作者: __HAPPINESS_yh | 来源:发表于2017-03-10 11:45 被阅读177次

    ant配置

    在本机安装ant

    eclipse配置

    1.缺少ant的jar包时要导入jar包

    D:\adt-bundle-windows-x86_64-20140702\eclipse-64\plugins

    2.生成build.xml文件

    cmd 进入到工程根目录

    A:android.bat list target 查询现有版本的list

    B:android update project -n test -t 1 -p D:\space\test

    -n 对应项目的名称

    -t 查询SDK版本对应的ID

    -p 生成的路径

    右键buid.xml run as ant build 

    项目目录下创建ant.properties和custom_rules.xml文件。ant.properties文件定义一些变量例如keystore密码,apk存放目录等;而custom_rules.xml这个文件就是用户自定义的编译规则文件

    ant.properties

    custom_rules.xml和ant.properties可以收藏起来,任何项目中都可以用。

    3.打包

    cmd 工程目录下 ant deploytest  /  ant deployrel

    如果有引入第三方工程,则对每个工程都应该生成build.xml文件


    异常一:

    BUILD FAILED

    D:\Android\sdk\tools\ant\build.xml:601: The following error occurred while executing this line:

    D:\Android\sdk\tools\ant\build.xml:653: The following error occurred while executing this line:

    D:\Android\sdk\tools\ant\build.xml:698: null returned: 1

    解决办法:自己项目的build.xml文件中加入:

    异常二:

    BUILD FAILED

    D:\ProjectDemo\build.xml:83:

    Cannot find D:\ProjectDemo\android-sdk-windows\tools\ant\build.xml

    imported from D:\ProjectDemo\build.xml

    解决办法:修改local.projects,必须是双斜杠

    sdk.dir=D:\\android-sdk-windows

    jenkins配置

    下载jenkins ,安装jenkins

    cmd jenkins根目录

    java -jar jenkins.war

    浏览器访问 http://localhost:8080

    相关文章

      网友评论

          本文标题:jenkins+ant+eclipse自动化构建多渠道打包

          本文链接:https://www.haomeiwen.com/subject/qbstmttx.html