浏览代码

添加引用信息

郑梓斌 8 年之前
父节点
当前提交
1c2a0bbb17
共有 4 个文件被更改,包括 110 次插入1 次删除
  1. 1 1
      .idea/misc.xml
  2. 1 0
      library/.gitignore
  3. 97 0
      library/bintray.gradle
  4. 11 0
      library/build.gradle

+ 1 - 1
.idea/misc.xml

@@ -37,7 +37,7 @@
     <ConfirmationsSetting value="0" id="Add" />
     <ConfirmationsSetting value="0" id="Add" />
     <ConfirmationsSetting value="0" id="Remove" />
     <ConfirmationsSetting value="0" id="Remove" />
   </component>
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/build/classes" />
     <output url="file://$PROJECT_DIR$/build/classes" />
   </component>
   </component>
   <component name="ProjectType">
   <component name="ProjectType">

+ 1 - 0
library/.gitignore

@@ -1 +1,2 @@
 /build
 /build
+/gradle.properties

+ 97 - 0
library/bintray.gradle

@@ -0,0 +1,97 @@
+group = PROJ_GROUP
+version = PROJ_VERSION
+
+apply plugin: 'com.jfrog.bintray'
+apply plugin: 'maven-publish'
+
+task androidJavadocs(type: Javadoc) {
+    source = android.sourceSets.main.java
+}
+
+task androidJavadocsJar(type: Jar) {
+    classifier = 'javadoc'
+    from androidJavadocs.destinationDir
+}
+
+task androidLibJar(type: Jar) {
+    from fileTree(dir: './build/intermediates/classes/release')
+}
+
+task androidSourcesJar(type: Jar) {
+    classifier = 'sources'
+    from android.sourceSets.main.java.srcDirs
+}
+
+artifacts {
+    archives androidSourcesJar
+}
+
+def pomConfig = {
+    licenses {
+        license {
+            name "The Apache Software License, Version 2.0"
+            url "http://www.apache.org/licenses/LICENSE-2.0.txt"
+            distribution "repo"
+        }
+    }
+    developers {
+        developer {
+            id DEVELOPER_ID
+            name DEVELOPER_NAME
+            email DEVELOPER_EMAIL
+        }
+    }
+}
+
+publishing {
+    publications {
+        mavenJava(MavenPublication) {
+            artifactId PROJ_ARTIFACTID
+
+            artifact androidSourcesJar
+            artifact androidJavadocsJar
+            artifact bundleRelease
+
+            pom.withXml {
+                def root = asNode()
+                root.appendNode('description', PROJ_DESCRIPTION)
+                root.children().last() + pomConfig
+            }
+        }
+    }
+}
+
+bintray {
+    //Do not share your username and key.
+    // Config it in ~/.gradle/gradle.properties or local.properties
+    user = BINTRAY_USER
+    key = BINTRAY_KEY
+
+    publications = ['mavenJava'] //When uploading Maven-based publication files
+    // - AND/OR -
+    filesSpec { //When uploading any arbitrary files ('filesSpec' is a standard Gradle CopySpec)
+        from 'arbitrary-files'
+        into 'standalone_files/level1'
+        rename '(.+)\\.(.+)', '$1-suffix.$2'
+    }
+    dryRun = false //Whether to run this as dry-run, without deploying
+    publish = true //If version should be auto published after an upload
+    pkg {
+        repo = 'maven'
+        //     userOrg = 'myorg' //An optional organization name when the repo belongs to one of the user's orgs
+        name = PROJ_NAME
+        desc = 'what a fantastic package indeed!'
+        websiteUrl = PROJ_WEBSITEURL
+        issueTrackerUrl = PROJ_ISSUETRACKERURL
+        vcsUrl = PROJ_VCSURL
+        licenses = ['Apache-2.0']
+        //   labels = ['gear', 'gore', 'gorilla']
+        publicDownloadNumbers = true
+        //attributes= ['a': ['ay1', 'ay2'], 'b': ['bee'], c: 'cee'] //Optional package-level attributes
+        //Optional version descriptor
+        version {
+            name = PROJ_VERSION //Bintray logical version name
+            vcsTag = PROJ_VERSION
+        }
+    }
+}

+ 11 - 0
library/build.gradle

@@ -1,5 +1,14 @@
 apply plugin: 'com.android.library'
 apply plugin: 'com.android.library'
 
 
+buildscript {
+    repositories {
+        jcenter()
+    }
+    dependencies {
+        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
+    }
+}
+
 android {
 android {
     compileSdkVersion 24
     compileSdkVersion 24
     buildToolsVersion "23.0.3"
     buildToolsVersion "23.0.3"
@@ -23,3 +32,5 @@ dependencies {
     testCompile 'junit:junit:4.12'
     testCompile 'junit:junit:4.12'
     compile 'com.android.support:appcompat-v7:24.1.1'
     compile 'com.android.support:appcompat-v7:24.1.1'
 }
 }
+
+apply from: 'bintray.gradle'