Browse Source

feat: jcenter 发布

hexleo 5 years ago
parent
commit
5a8e93bd9a

+ 4 - 0
Android/PlayerProj/animplayer/build.gradle

@@ -26,3 +26,7 @@ dependencies {
         exclude module: 'annotations'
         exclude module: 'annotations'
     }
     }
 }
 }
+
+// jcenter 上传(这个要在底部)
+// 上传需要执行此任务 IDE -> gradle-> Tasks/publishing/bintrayUpload
+apply from: file("publish.gradle")

+ 33 - 0
Android/PlayerProj/animplayer/publish.gradle

@@ -0,0 +1,33 @@
+ext {
+    // 此处填写刚才建立的maven仓库的仓库名称
+    bintrayRepo = 'maven'
+    // library的group id
+    publishedGroupId = 'com.egame.vap'
+    // library网站地址
+    siteUrl = 'https://github.com/Tencent/vap'
+    // library仓库地址
+    gitUrl = 'https://github.com/Tencent/vap'
+
+    // 注册时候的bintray username
+    developerId = 'hexleo'
+    // 开发者名称
+    developerName = 'hexleo'
+    // 开发者邮箱
+    developerEmail = 'wanghailiang333@gmail.com'
+
+    // 开源许可证
+    licenseName = 'MIT'
+    licenseUrl = 'http://opensource.org/licenses/MIT'
+    allLicenses = ["MIT"]
+
+    // library artifact(单个module一般就填写library name)
+    artifact = 'animplayer'
+    libraryName = 'animplayer'
+    libraryVersion = '2.0.9'
+    libraryDescription = ''
+    // bintrayName 是你在网页Repository页面能看到的名称
+    bintrayName = 'vap'
+}
+
+apply from: '../installv1.gradle'
+apply from: '../bintrayv1.gradle'

+ 59 - 0
Android/PlayerProj/bintrayv1.gradle

@@ -0,0 +1,59 @@
+apply plugin: 'com.jfrog.bintray'
+
+version = libraryVersion
+
+if (project.hasProperty("android")) { // Android libraries
+    task sourcesJar(type: Jar) {
+        classifier = 'sources'
+        from android.sourceSets.main.java.srcDirs
+    }
+
+    task javadoc(type: Javadoc) {
+        source = android.sourceSets.main.java.srcDirs
+        classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
+    }
+} else { // Java libraries
+    task sourcesJar(type: Jar, dependsOn: classes) {
+        classifier = 'sources'
+        from sourceSets.main.allSource
+    }
+}
+
+task javadocJar(type: Jar, dependsOn: javadoc) {
+    classifier = 'javadoc'
+    from javadoc.destinationDir
+}
+
+artifacts {
+    archives javadocJar
+    archives sourcesJar
+}
+
+// Bintray
+Properties properties = new Properties()
+properties.load(project.rootProject.file('local.properties').newDataInputStream())
+
+bintray {
+    user = properties.getProperty("bintray.user")
+    key = properties.getProperty("bintray.apikey")
+
+    configurations = ['archives']
+    pkg {
+        repo = bintrayRepo
+        name = bintrayName
+        desc = libraryDescription
+        websiteUrl = siteUrl
+        vcsUrl = gitUrl
+        licenses = allLicenses
+        publish = true
+        publicDownloadNumbers = true
+        version {
+            desc = libraryDescription
+            gpg {
+                sign = true //Determines whether to GPG sign the files. The default is false
+                passphrase = properties.getProperty("bintray.gpg.password")
+                //Optional. The passphrase for GPG signing'
+            }
+        }
+    }
+}

+ 42 - 0
Android/PlayerProj/installv1.gradle

@@ -0,0 +1,42 @@
+apply plugin: 'com.github.dcendents.android-maven'
+
+group = publishedGroupId                               // Maven Group ID for the artifact
+
+install {
+    repositories.mavenInstaller {
+        // This generates POM.xml with proper parameters
+        pom {
+            project {
+                packaging 'aar'
+                groupId publishedGroupId
+                artifactId artifact
+
+                // Add your description here
+                name libraryName
+                description libraryDescription
+                url siteUrl
+
+                // Set your license
+                licenses {
+                    license {
+                        name licenseName
+                        url licenseUrl
+                    }
+                }
+                developers {
+                    developer {
+                        id developerId
+                        name developerName
+                        email developerEmail
+                    }
+                }
+                scm {
+                    connection gitUrl
+                    developerConnection gitUrl
+                    url siteUrl
+
+                }
+            }
+        }
+    }
+}