123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- if (versions == null || versions.publish_version == null) {
- throw new IllegalStateException("Unable to reference publish_version!")
- } else if (module_group == null || module_name == null) {
- throw new IllegalStateException("Must provide module_group and module_name!")
- }
- apply plugin: 'maven-publish'
- apply plugin: 'signing'
- task androidSourcesJar(type: Jar) {
- archiveClassifier.set('sources')
- if
-
- from
- from
- } else
-
- from
- from
- }
- }
- artifacts
- archives
- }
- group
- version
- ext["signing.keyId"] = ''
- ext["signing.password"] = ''
- ext["signing.secretKeyRingFile"] = ''
- ext["ossrhUsername"] = ''
- ext["ossrhPassword"] = ''
- ext["sonatypeStagingProfileId"] = ''
- File
- if
- Properties
- new
- p.each
- } else
- ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID')
- ext["signing.password"] = System.getenv('SIGNING_PASSWORD')
- ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_SECRET_KEY_RING_FILE')
- ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME')
- ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD')
- ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID')
- }
- publishing
- publications
- release(MavenPublication)
-
-
- groupId
- artifactId
- version
-
- if
- artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
- } else
- artifact("$buildDir/libs/${project.getName()}-${version}.jar")
- }
- artifact
-
- pom
- packaging
- name
- description
- url
- licenses
- license
- name
- url
- }
- }
- developers
- developer
- id
- name
- email
- }
-
- }
-
- scm
- connection
- developerConnection
- url
- }
-
-
- withXml
- def
- project.configurations.implementation.allDependencies.each
- def
- dependencyNode.appendNode('groupId', it.group)
- dependencyNode.appendNode('artifactId', it.name)
- dependencyNode.appendNode('version', it.version)
- }
- }
- }
- }
- }
-
- repositories
- maven
-
-
- name
- url
- credentials
- username
- password
- }
- }
- }
- }
- signing
- sign
- }
- afterEvaluate
- publishReleasePublicationToSonatypeRepository.dependsOn
- }
|