
Have defined better the dependencies for 'library', using new gradle options: 'api' and 'implementation'
83 lines
1.9 KiB
Groovy
83 lines
1.9 KiB
Groovy
apply plugin: 'com.android.library'
|
|
apply plugin: 'kotlin-android'
|
|
|
|
apply plugin: 'com.jfrog.artifactory'
|
|
apply plugin: 'digital.wup.android-maven-publish'
|
|
|
|
android {
|
|
|
|
compileSdkVersion TARGET_SDK
|
|
buildToolsVersion BUILD_TOOLS
|
|
|
|
defaultConfig {
|
|
minSdkVersion MIN_SDK
|
|
targetSdkVersion TARGET_SDK
|
|
versionCode 1
|
|
versionName version
|
|
|
|
consumerProguardFiles 'lib-proguard-rules.pro'
|
|
}
|
|
|
|
libraryVariants.all { variant ->
|
|
variant.outputs.all {
|
|
outputFileName = "${POM_ARTIFACT_ID}-release.aar"
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
api SUPPORT_ANNOTATIONS
|
|
implementation COMMON_MARK
|
|
implementation COMMON_MARK_STRIKETHROUGHT
|
|
implementation COMMON_MARK_TABLE
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
aar(MavenPublication) {
|
|
groupId "${GROUP}.auto1"
|
|
version VERSION_NAME
|
|
artifactId POM_ARTIFACT_ID
|
|
|
|
from components.android
|
|
}
|
|
}
|
|
}
|
|
|
|
artifactory {
|
|
contextUrl = artifactory_repository
|
|
publish {
|
|
repository {
|
|
repoKey = 'libs-android-local'
|
|
|
|
username = artifactory_username
|
|
password = artifactory_password
|
|
}
|
|
defaults {
|
|
publications('aar')
|
|
publishArtifacts = true
|
|
|
|
properties = ['qa.level': 'basic', 'q.os': 'android', 'dev.team': 'mobile-android']
|
|
publishPom = true
|
|
}
|
|
}
|
|
}
|
|
|
|
afterEvaluate {
|
|
|
|
task cleanBuildPublish {
|
|
dependsOn 'clean'
|
|
dependsOn 'assembleRelease'
|
|
dependsOn 'artifactoryPublish'
|
|
tasks.findByName('assembleRelease').mustRunAfter 'clean'
|
|
tasks.findByName('artifactoryPublish').dependsOn 'generatePomFileForAarPublication'
|
|
tasks.findByName('artifactoryPublish').mustRunAfter 'assembleRelease'
|
|
}
|
|
|
|
cleanBuildPublish
|
|
} |