我的应用程序设置为构建包含在各个客户应用程序中的通用主要内容。
以前,aar会出现在
/{library_name}/build/outputs/aar/core-release.aar
这是整个项目的gradle文件
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
}
}
allprojects {
repositories {
jcenter()
maven {
credentials {
username ''
password ''
}
url 'https://artifactory.*.com/artifactory/*-libs/'
}
google()
}
}
这是应该生成aar
的库的gradleapply plugin: 'com.android.library'
dependencies {
implementation project(':AndroidAsync')
implementation project(':simplezxing')
implementation('org.apache.httpcomponents:httpmime:4.5.1') {
exclude module: "httpclient"
}
implementation 'net.danlew:android.joda:2.9.+'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.android.gms:play-services-location:9.0.2'
implementation 'com.google.android.gms:play-services-gcm:9.0.2'
implementation 'com.google.android.gms:play-services-maps:9.0.2'
implementation 'com.android.support:support-v13:25.3.0'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
android {
compileSdkVersion 21
buildToolsVersion '26.0.2'
defaultConfig {
multiDexEnabled false
minSdkVersion 18
targetSdkVersion 21
versionCode 1604020110 //Last two digits are build type 0 = Developer, 1 = Development, and 5 rc and 10 for release
versionName "4.2.1"
}
signingConfigs {
debug {
storeFile file("keystores/debug.keystore")
}
release {
storeFile file("keystores/*-android.keystore")
storePassword ""
keyAlias ""
keyPassword ""
}
}
lintOptions {
abortOnError false
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
}
dexOptions {
jumboMode true
javaMaxHeapSize "4g"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
我确实删除了一些公司特定信息。
我的其他版本在jenkins上工作得很好,但aar并没有像预期的那样存在。
修改
当我使用
的分支构建我的jenkins时,这正确地构建了aar./ gradlew clean build
如果我按照产品风味构建它并不构建aar,则使用
./ gradlew clean assemble {flavor}