Extract gradle code to assemble and publish library to external gradle file
Adapted library and library-image-loader gradle files
This commit is contained in:
parent
c3e4b6ad50
commit
d7630631b6
44
artifactory-mvn-push.gradle
Normal file
44
artifactory-mvn-push.gradle
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
apply plugin: 'com.jfrog.artifactory'
|
||||||
|
apply plugin: 'digital.wup.android-maven-publish'
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
aar(MavenPublication) {
|
||||||
|
groupId "${GROUP}.auto1"
|
||||||
|
version VERSION_NAME
|
||||||
|
artifactId POM_ARTIFACT_ID
|
||||||
|
|
||||||
|
from components.android
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
artifactory {
|
||||||
|
contextUrl = artifactory_repository_url
|
||||||
|
publish {
|
||||||
|
repository {
|
||||||
|
repoKey = artifactory_repository_name
|
||||||
|
|
||||||
|
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'
|
||||||
|
}
|
||||||
|
}
|
@ -25,6 +25,4 @@ dependencies {
|
|||||||
implementation OK_HTTP
|
implementation OK_HTTP
|
||||||
}
|
}
|
||||||
|
|
||||||
if (project.hasProperty('release')) {
|
apply from: '../artifactory-mvn-push.gradle'
|
||||||
apply from: 'https://raw.githubusercontent.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'
|
|
||||||
}
|
|
@ -1,9 +1,6 @@
|
|||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
|
|
||||||
apply plugin: 'com.jfrog.artifactory'
|
|
||||||
apply plugin: 'digital.wup.android-maven-publish'
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
compileSdkVersion TARGET_SDK
|
compileSdkVersion TARGET_SDK
|
||||||
@ -37,47 +34,4 @@ repositories {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
apply from: '../artifactory-mvn-push.gradle'
|
||||||
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
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user