使用Jenkins进行android项目的自动构建(6)
2015-03-11 16:33
573 查看
之前已经介绍过使用Maven做构建,在来介绍一下Gralde的自动化构建。
什么是Gralde?官方的解释是
环境搭建步骤跟Maven的大致相同,只需要将Maven的用Gralde替换。
下载Gralde,解压,并将Gralde的bin目录加入到环境变量PATH,然后配置Jenkins,选择“管理 Jenkins”->“設定系統”,将刚才Gralde的目录路径填入相应设定中。最后在Jenkins的外挂程式中安装Gradle plugin。
Gralde的具体例子
Jenkins中专案的组态设定也需要做一下改动
什么是Gralde?官方的解释是
Gradle is an open source build automation system. Gradle can automate the building, testing, publishing, deployment and more of software packages or other types of projects such as generated static websites, generated documentation or indeed anything else. Gradle combines the power and flexibility of Ant with the dependency management and conventions of Maven into a more effective way to build. Powered by Build Programming Language, Gradle is concise yet expressive.
环境搭建步骤跟Maven的大致相同,只需要将Maven的用Gralde替换。
下载Gralde,解压,并将Gralde的bin目录加入到环境变量PATH,然后配置Jenkins,选择“管理 Jenkins”->“設定系統”,将刚才Gralde的目录路径填入相应设定中。最后在Jenkins的外挂程式中安装Gradle plugin。
Gralde的具体例子
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:1.0.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { mavenLocal() maven { url "http://localhost/repo" } } }
apply plugin: 'com.android.application' //apply plugin: 'com.android.library' android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { applicationId "com.example.demo" minSdkVersion 15 targetSdkVersion 21 versionCode 1 versionName "2.1.1" } signingConfigs { releaseConfig { storeFile file(System.getenv("KEYSTORE")) storePassword System.getenv("KEYSTORE_PASSWORD") keyAlias System.getenv("KEY_ALIAS") keyPassword System.getenv("KEY_PASSWORD") } } buildTypes { release { signingConfig signingConfigs.releaseConfig } } packagingOptions { exclude 'META-INF/LICENSE.txt' } lintOptions { abortOnError false } sourceSets { main { manifest { srcFile 'src/main/AndroidManifest.xml' } java { srcDir 'src/main/java' } res { srcDir 'src/main/res' } assets { srcDir 'assets' } } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile project(':framework') compile 'com.example:libxxx:1.0' }
Jenkins中专案的组态设定也需要做一下改动
相关文章推荐
- 使用Jenkins进行android项目的自动构建(4)
- 使用Jenkins进行android项目的自动构建(2)
- 使用Jenkins进行android项目的自动构建(1)
- 使用Jenkins进行android项目的自动构建(5)
- 使用Jenkins进行android项目的自动构建(3)
- 使用jenkins进行项目的自动构建部署
- Jenkins构建Android项目持续集成之findbugs的使用
- Jenkins构建Android项目持续集成之findbugs的使用
- 使用Jenkins进行Android自动打包
- 使用ant及IDE配置文件进行Android项目初步的标准化,规范化构建
- 使用crontab进行Android代码的自动更新和构建
- Jenkins构建Android项目持续集成之findbugs的使用
- Jenkins构建Android项目持续集成之findbugs的使用
- 使用Jenkins进行Android自动打包
- Jenkins使用Gradle构建Android项目时Error: Some file crunching failed, see logs for details
- 使用cmake进行Android项目的构建
- 使用Bitbucket Pipeline进行.Net Core项目的自动构建、测试和部署
- 使用阿里云服务器搭建Android自动构建平台Jenkins
- 将一个Android项目修改为能够使用Maven进行构建
- 使用maven对android项目进行构建