123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- apply plugin: 'maven-publish'
- apply plugin: 'signing'
- ext["PUBLISH_VERSION"] = ''
- ext["PUBLISH_GROUP_ID"] = ''
- ext["PUBLISH_ARTIFACT_ID"] = ''
- ext["signing.keyId"] = ''
- ext["signing.password"] = ''
- ext["signing.secretKeyRingFile"] = ''
- ext["ossrhUsername"] = ''
- ext["ossrhPassword"] = ''
- File secretPropsFile = project.rootProject.file('local.properties')
- if (secretPropsFile.exists()) {
- println "Found secret props file, loading props"
- Properties p = new Properties()
- p.load(new FileInputStream(secretPropsFile))
- p.each { name, value ->
- ext[name] = value
- }
- ext["PUBLISH_ARTIFACT_ID"] = "huawei-maven-release"
- ext["PUBLISH_VERSION"] = "1.0.2"
- } else {
- println "No props file, loading env vars"
- }
- afterEvaluate {
- publishing {
- repositories {
- maven {
-
-
- allowInsecureProtocol = false
- name = PUBLISH_ARTIFACT_ID
-
- def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
-
- def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
- url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
- credentials {
- username ossrhUsername
- password ossrhPassword
- }
- }
- maven {
-
- allowInsecureProtocol = false
- name = 'Local'
- url = uri('../ZrgkLocalRepo')
- }
- }
- publications {
- release(MavenPublication) {
- println("publish-maven Log-------> PUBLISH_GROUP_ID: $PUBLISH_GROUP_ID; PUBLISH_ARTIFACT_ID: $PUBLISH_ARTIFACT_ID; PUBLISH_VERSION: $PUBLISH_VERSION")
- groupId PUBLISH_GROUP_ID
- artifactId PUBLISH_ARTIFACT_ID
- version PUBLISH_VERSION
-
- artifact "F:\\Work_Space\\Wechat_workSpace\\duoduan_reader_test\\chajian\\android\\LocalRepo\\huawei\\huawei-maven-release.aar"
-
-
- pom {
- name = PUBLISH_ARTIFACT_ID
- description = 'efunboxMaven'
- url = 'https://github.com/FailedToRead/AndroidMaven'
- licenses {
- license {
-
- name = 'The Apache License, Version 2.0'
- url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
- }
- }
- developers {
- developer {
-
- id = 'FailedToRead'
- name = 'FailedToRead'
- email = 'zhangoq9@gmail.com'
- }
- }
-
- scm {
-
- connection = 'scm:https://github.com/FailedToRead/AndroidMaven.git'
- developerConnection = 'scm:https://github.com/FailedToRead/AndroidMaven.git'
-
- url = 'https://github.com/FailedToRead/AndroidMaven/tree/test'
- }
- }
- }
- }
- }
- signing {
- sign publishing.publications
- }
- }
- configurations.maybeCreate("default")
- artifacts.add("default", file('huawei-maven-release.aar'))
|