├── .gitattributes ├── .gitignore ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── allen │ │ └── uploadplugin │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── allen │ │ │ └── uploadplugin │ │ │ └── MainActivity.java │ └── res │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── allen │ └── uploadplugin │ └── ExampleUnitTest.java ├── build.gradle ├── buildSrc └── build │ ├── libs │ └── buildSrc.jar │ └── tmp │ └── jar │ └── MANIFEST.MF ├── gif ├── 15950793-0108-457E-9FB3-96B2F9148A92.png ├── 17F52141-981D-4055-B82C-3F61BF31C01F.png └── B0A414C5-1E7B-4BA1-AC58-70616F5BAEE4.png ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── preuploader ├── build.gradle └── src │ └── main │ ├── groovy │ └── com │ │ └── pre │ │ └── im │ │ ├── Constants.groovy │ │ ├── HttpURLConnectionUtil.groovy │ │ ├── PreExtension.groovy │ │ ├── PrePlugin.groovy │ │ └── UploadInfo.java │ └── resources │ └── META-INF │ └── gradle-plugins │ └── com.pre.im.properties ├── repo └── com │ └── pre │ └── im │ └── preuploader │ ├── 1.0.1 │ ├── preuploader-1.0.1-javadoc.jar │ ├── preuploader-1.0.1-javadoc.jar.md5 │ ├── preuploader-1.0.1-javadoc.jar.sha1 │ ├── preuploader-1.0.1-sources.jar │ ├── preuploader-1.0.1-sources.jar.md5 │ ├── preuploader-1.0.1-sources.jar.sha1 │ ├── preuploader-1.0.1.jar │ ├── preuploader-1.0.1.jar.md5 │ ├── preuploader-1.0.1.jar.sha1 │ ├── preuploader-1.0.1.pom │ ├── preuploader-1.0.1.pom.md5 │ └── preuploader-1.0.1.pom.sha1 │ ├── 1.0.2 │ └── preuploader-1.0.2.jar │ ├── maven-metadata.xml │ ├── maven-metadata.xml.md5 │ └── maven-metadata.xml.sha1 └── uploader.gradle /.gitattributes: -------------------------------------------------------------------------------- 1 | *.js linguist-language=Groovy *.css linguist-language=Groovy *.html linguist-language=Groovy 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | /settings.gradle 11 | /.idea/ 12 | /preuploader/build/ 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Pre.im 插件使用说明 2 | 3 | 4 | [官网链接,一款内测分发平台](http://pre.im/) 5 | 6 | 7 | 在根目录下的build.gralde文件的depandencies(buildscript部分)中添加: 8 | 9 | 10 | ```groovy 11 | dependencies { 12 | classpath 'com.pre.im:preuploader:1.0.2' 13 | } 14 | ``` 15 | 16 | 17 | 在module的build.gradle文件的顶部添加: 18 | 19 | ``` 20 | apply plugin: 'com.pre.im' 21 | 22 | pre { 23 | user_key='' 24 | password='<下载密码 (传空字符串或不传则不设置密码)>' 25 | update_notify="<向内测成员发布新版通知 (1:开启)>" 26 | } 27 | 28 | ``` 29 | 30 | 31 | `/build.gradle`文件如下: 32 | 33 | ``` 34 | buildscript { 35 | repositories { 36 | jcenter() 37 | } 38 | dependencies { 39 | ... 40 | classpath 'com.pre.im:preuploader:1.0.2' 41 | } 42 | }} 43 | ``` 44 | 45 | `//build.gradle`文件如下: 46 | ``` 47 | apply plugin: 'com.pre.im' 48 | pre { 49 | user_key='a33333333333rrrr4ddeeeeeeedd' 50 | password='1222222' 51 | update_notify="1" 52 | } 53 | ``` 54 | 55 | 项目应用了Pre插件之后,插件默认是开启的,会在工程Gradle projects生成以下两个task: 56 | ![task | center](./gif/17F52141-981D-4055-B82C-3F61BF31C01F.png) 57 | 58 | 59 | 60 | 可以直接点击执行或者在命令行输入以下命令: 61 | 62 | ``` 63 | gradle uploadReleasePreApkFile 64 | ``` 65 | 66 | 上传成功之后就可以在内测平台看到版本信息: 67 | ![Alt text](./gif/B0A414C5-1E7B-4BA1-AC58-70616F5BAEE4.png) 68 | 69 | Thanks [Bugly](https://bugly.qq.com/betaGradle), 70 | [BuglyDevTeam](https://github.com/BuglyDevTeam/BuglyBetaUploader), 71 | [IT_xiao小巫 ](http://www.jianshu.com/p/7e8ae21b093a) 72 | 73 | ## License 74 | ``` 75 | Copyright 2016 AllenCoder 76 | 77 | Licensed under the Apache License, Version 2.0 (the "License"); 78 | you may not use this file except in compliance with the License. 79 | You may obtain a copy of the License at 80 | 81 | http://www.apache.org/licenses/LICENSE-2.0 82 | 83 | Unless required by applicable law or agreed to in writing, software 84 | distributed under the License is distributed on an "AS IS" BASIS, 85 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 86 | See the License for the specific language governing permissions and 87 | limitations under the License. 88 | ``` 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'com.pre.im' 3 | pre { 4 | user_key='cccccccddddeddddddddddddddd' 5 | password='1222222' 6 | update_notify="1" 7 | } 8 | android { 9 | compileSdkVersion 24 10 | buildToolsVersion "23.0.2" 11 | defaultConfig { 12 | applicationId "com.allen.uploadplugin" 13 | minSdkVersion 14 14 | targetSdkVersion 24 15 | versionCode 1 16 | versionName "1.0" 17 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 18 | } 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | } 26 | 27 | dependencies { 28 | compile fileTree(dir: 'libs', include: ['*.jar']) 29 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 30 | exclude group: 'com.android.support', module: 'support-annotations' 31 | }) 32 | compile 'com.android.support:appcompat-v7:24.2.0' 33 | testCompile 'junit:junit:4.12' 34 | } 35 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Applications/Android-SDK/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/allen/uploadplugin/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.allen.uploadplugin; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.allen.uploadplugin", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/allen/uploadplugin/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.allen.uploadplugin; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | 6 | public class MainActivity extends AppCompatActivity { 7 | @Override 8 | protected void onCreate(Bundle savedInstanceState) { 9 | super.onCreate(savedInstanceState); 10 | setContentView(R.layout.activity_main); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/UploaderPlugin/34a070a9c6d63649b45cac34773e9f21c116c56a/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/UploaderPlugin/34a070a9c6d63649b45cac34773e9f21c116c56a/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/UploaderPlugin/34a070a9c6d63649b45cac34773e9f21c116c56a/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/UploaderPlugin/34a070a9c6d63649b45cac34773e9f21c116c56a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/UploaderPlugin/34a070a9c6d63649b45cac34773e9f21c116c56a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | UploadPlugin 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/test/java/com/allen/uploadplugin/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.allen.uploadplugin; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.2.0-rc1' 9 | classpath 'com.github.dcendents:android-maven-gradle-plugin:latest.release' 10 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.1' 11 | classpath 'com.pre.im:preuploader:1.0.2' 12 | // NOTE: Do not place your application dependencies here; they belong 13 | // in the individual module build.gradle files 14 | // compile 'com.bugly.plugin:betauploader:1.0.4' 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | jcenter() 21 | } 22 | } 23 | 24 | task clean(type: Delete) { 25 | delete rootProject.buildDir 26 | } 27 | -------------------------------------------------------------------------------- /buildSrc/build/libs/buildSrc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/UploaderPlugin/34a070a9c6d63649b45cac34773e9f21c116c56a/buildSrc/build/libs/buildSrc.jar -------------------------------------------------------------------------------- /buildSrc/build/tmp/jar/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | 3 | -------------------------------------------------------------------------------- /gif/15950793-0108-457E-9FB3-96B2F9148A92.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/UploaderPlugin/34a070a9c6d63649b45cac34773e9f21c116c56a/gif/15950793-0108-457E-9FB3-96B2F9148A92.png -------------------------------------------------------------------------------- /gif/17F52141-981D-4055-B82C-3F61BF31C01F.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/UploaderPlugin/34a070a9c6d63649b45cac34773e9f21c116c56a/gif/17F52141-981D-4055-B82C-3F61BF31C01F.png -------------------------------------------------------------------------------- /gif/B0A414C5-1E7B-4BA1-AC58-70616F5BAEE4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/UploaderPlugin/34a070a9c6d63649b45cac34773e9f21c116c56a/gif/B0A414C5-1E7B-4BA1-AC58-70616F5BAEE4.png -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/UploaderPlugin/34a070a9c6d63649b45cac34773e9f21c116c56a/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /preuploader/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'groovy' 2 | apply plugin: 'maven' 3 | apply from: '../uploader.gradle' 4 | //apply from: '../bintray.gradle' 5 | dependencies { 6 | compile gradleApi() 7 | compile localGroovy() 8 | } 9 | 10 | repositories { 11 | mavenCentral() 12 | } 13 | 14 | 15 | uploadArchives { 16 | repositories { 17 | mavenDeployer { 18 | repository(url: uri('../repo')) 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /preuploader/src/main/groovy/com/pre/im/Constants.groovy: -------------------------------------------------------------------------------- 1 | package com.pre.im 2 | 3 | class Constants { 4 | public static final String HTTPMETHOD_GET = "GET" 5 | public static final String HTTPMETHOD_POST = "POST" 6 | public static final String HTTPMETHOD_PUT = "PUT" 7 | 8 | public static final String USER_KEY = "user_key" 9 | public static final String FILE = "file" 10 | public static final String PASSWORD = "password" 11 | public static final String UPDATE_NOTIFY = "update_notify" 12 | public Boolean enable = true // 插件开关 13 | public Boolean autoUpload = false // 是否自动上传 14 | public Boolean debugOn = false // debug模式是否上传 15 | 16 | 17 | } 18 | -------------------------------------------------------------------------------- /preuploader/src/main/groovy/com/pre/im/HttpURLConnectionUtil.groovy: -------------------------------------------------------------------------------- 1 | package com.pre.im 2 | 3 | 4 | public class HttpURLConnectionUtil { 5 | public static final String HTTPMETHOD_GET = "GET" 6 | public static final String HTTPMETHOD_POST = "POST" 7 | public static final String HTTPMETHOD_PUT = "PUT" 8 | 9 | private URL url; 10 | private String httpMethod; 11 | private HttpURLConnection conn; 12 | private final String BOUNDARY = "---------betaUploader"; // 定义数据分隔线 13 | private Map textParams = new HashMap(); 14 | private Map fileParams = new HashMap(); 15 | private DataOutputStream ds; 16 | 17 | public HttpURLConnectionUtil(String url, String httpMethod) throws Exception { 18 | this.url = new URL(url); 19 | this.httpMethod = httpMethod; 20 | } 21 | 22 | /** 23 | * 增加一个普通字符串数据到form表单数据中 24 | * @param name 25 | * @param value 26 | */ 27 | public void addTextParameter(String name, String value) { 28 | textParams.put(name, value); 29 | } 30 | 31 | /** 32 | * 增加一个文件到form表单数据中 33 | * @param name 34 | * @param value 35 | */ 36 | public void addFileParameter(String name, File value) { 37 | fileParams.put(name, value); 38 | } 39 | 40 | /** 41 | * 清空所有已添加的form表单数据 42 | */ 43 | public void clearAllParameters() { 44 | textParams.clear(); 45 | fileParams.clear(); 46 | } 47 | 48 | /** 49 | * 初始化连接 50 | * @throws Exception 51 | */ 52 | private void initConnection() throws Exception{ 53 | conn = (HttpURLConnection) this.url.openConnection(); 54 | // 发送POST请求必须设置如下两行 55 | conn.setDoOutput(true); 56 | conn.setDoInput(true); 57 | conn.setUseCaches(false); 58 | conn.setConnectTimeout(10000); //连接超时为10秒 59 | conn.setRequestMethod(httpMethod); 60 | conn.setRequestProperty("connection", "Keep-Alive"); 61 | conn.setRequestProperty("Content-Type", 62 | "multipart/form-data; boundary=" + BOUNDARY); 63 | 64 | } 65 | 66 | public byte[] post() throws Exception { 67 | initConnection(); 68 | try { 69 | conn.connect(); 70 | } catch (SocketTimeoutException e) { 71 | throw new RuntimeException(); 72 | } 73 | 74 | ds = new DataOutputStream(conn.getOutputStream()); 75 | writeStringParams() 76 | writeFileParams(); 77 | paramsEnd(); 78 | ds.flush(); 79 | ds.close(); 80 | InputStream inputStream = conn.getInputStream(); 81 | ByteArrayOutputStream out = new ByteArrayOutputStream(); 82 | int b; 83 | while ((b = inputStream.read()) != -1) { 84 | out.write(b); 85 | } 86 | conn.disconnect(); 87 | return out.toByteArray(); 88 | } 89 | 90 | private void writeStringParams() throws Exception { 91 | Set keySet = textParams.keySet(); 92 | for (Iterator it = keySet.iterator(); it.hasNext();) { 93 | String name = it.next(); 94 | String value = textParams.get(name); 95 | if (ds != null && value != null ) { 96 | ds.writeBytes("--" + BOUNDARY + "\r\n"); 97 | ds.writeBytes("Content-Disposition: form-data; name=\"" + name 98 | + "\"\r\n"); 99 | ds.writeBytes("\r\n"); 100 | ds.write(value.getBytes("UTF-8")); 101 | ds.writeBytes("\r\n"); 102 | } 103 | } 104 | } 105 | 106 | 107 | /** 108 | * 文件数据 109 | * @throws Exception 110 | */ 111 | private void writeFileParams() throws Exception { 112 | Set keySet = fileParams.keySet(); 113 | for (Iterator it = keySet.iterator(); it.hasNext();) { 114 | String name = it.next(); 115 | File value = fileParams.get(name); 116 | ds.writeBytes("--" + BOUNDARY + "\r\n"); 117 | ds.writeBytes("Content-Disposition: form-data; name=\"" + name 118 | + "\"; filename=\"" + value.getName() + "\"\r\n"); 119 | ds.writeBytes("Content-Type:application/octet-stream" + "\r\n"); 120 | ds.writeBytes("\r\n"); 121 | ds.write(getBytes(value)); 122 | ds.writeBytes("\r\n"); 123 | } 124 | } 125 | 126 | /** 127 | * 把文件转换成字节数组 128 | * @param file 129 | * @return 130 | * @throws Exception 131 | */ 132 | private byte[] getBytes(File file) throws Exception { 133 | DataInputStream inputStream = new DataInputStream(new FileInputStream(file)) 134 | ByteArrayOutputStream out = new ByteArrayOutputStream(); 135 | byte[] bufferOut = new byte[1024]; 136 | int bytes = 0; 137 | while ((bytes = inputStream.read(bufferOut)) != -1) { 138 | out.write(bufferOut, 0, bytes); 139 | } 140 | inputStream.close() 141 | return out.toByteArray(); 142 | } 143 | 144 | /** 145 | * 添加结尾数据 146 | * @throws Exception 147 | */ 148 | private void paramsEnd() throws Exception { 149 | ds.writeBytes("--" + BOUNDARY + "--" + "\r\n"); 150 | ds.writeBytes("\r\n"); 151 | } 152 | 153 | /** 154 | * 对包含中文的字符串进行转码,此为UTF-8。服务器那边要进行一次解码 155 | * @param value 156 | * @return 157 | * @throws Exception 158 | */ 159 | private String encode(String value) throws Exception{ 160 | return URLEncoder.encode(value, "UTF-8"); 161 | } 162 | 163 | 164 | /** 165 | * read buffer from inputstream 166 | * @param input 167 | * @return 168 | */ 169 | public String readBufferFromStream(InputStream input) { 170 | if (input == null) 171 | return null; 172 | String charSet = "UTF-8"; 173 | BufferedInputStream buffer = new BufferedInputStream(input); 174 | ByteArrayOutputStream baos = null; 175 | String str = null; 176 | try { 177 | baos = new ByteArrayOutputStream(); 178 | 179 | byte[] byteChunk = new byte[1024 * 16]; 180 | int len = -1; 181 | while ((len = buffer.read(byteChunk)) > -1) { 182 | baos.write(byteChunk, 0, len); 183 | } 184 | baos.flush(); 185 | byte[] bytes = baos.toByteArray(); 186 | str = new String(bytes, charSet); 187 | if (baos != null) { 188 | baos.close(); 189 | baos = null; 190 | } 191 | } catch (IOException e) { 192 | println("readBufferFromStream error", e); 193 | } finally { 194 | try { 195 | if (baos != null) { 196 | baos.close(); 197 | baos = null; 198 | } 199 | } catch (Exception e) { 200 | println("readBufferFromStream error!", e); 201 | } 202 | } 203 | return str; 204 | } 205 | 206 | public void setHttpMethod(String httpMethod) { 207 | this.httpMethod = httpMethod; 208 | } 209 | } 210 | -------------------------------------------------------------------------------- /preuploader/src/main/groovy/com/pre/im/PreExtension.groovy: -------------------------------------------------------------------------------- 1 | package com.pre.im; 2 | 3 | public class PreExtension { 4 | public String user_key = null 5 | public String file = null 6 | 7 | public String password = null // 标题 8 | public String update_notify = null // 版本描述 9 | 10 | // // 【插件配置】 11 | public Boolean enable = true // 插件开关 12 | public Boolean autoUpload = false // 是否自动上传 13 | public Boolean debugOn = false // debug模式是否上传 14 | } 15 | -------------------------------------------------------------------------------- /preuploader/src/main/groovy/com/pre/im/PrePlugin.groovy: -------------------------------------------------------------------------------- 1 | package com.pre.im; 2 | 3 | import groovy.json.JsonSlurper 4 | import org.gradle.api.Plugin 5 | import org.gradle.api.Project 6 | import org.gradle.api.Task 7 | 8 | /** 9 | * 10 | */ 11 | public class PrePlugin implements Plugin { 12 | private Project project = null; 13 | 14 | // URL for uploading apk file 15 | private static final String APK_UPLOAD_URL = "http://api.pre.im/api/v1/app/upload"; 16 | 17 | 18 | @Override 19 | void apply(Project project) { 20 | this.project = project 21 | // 接收外部参数 22 | project.extensions.create("pre", PreExtension) 23 | 24 | // 取得外部参数 25 | if (project.android.hasProperty("applicationVariants")) { // For android application. 26 | project.android.applicationVariants.all { variant -> 27 | String variantName = variant.name.capitalize() 28 | 29 | // Check for execution 30 | if (false == project.pre.enable) { 31 | project.logger.error("Pre.im gradle enable is false, if you want to auto upload apk file, you should set the execute = true") 32 | return 33 | } 34 | 35 | // Create task. 36 | Task preTask = createUploadTask(variant) 37 | 38 | project.tasks["assemble${variantName}"].doLast { 39 | // if debug model and debugOn = false no execute upload 40 | if (variantName.contains("Debug") && !project.pre.debugOn) { 41 | println("Pre: the option debugOn is closed, if you want to upload apk file on debug model, you can set debugOn = true to open it") 42 | return 43 | } 44 | 45 | if (variantName.contains("Release")) { 46 | println("Pre.in: the option autoUpload is opened, it will auto upload the release to the pre platform") 47 | } 48 | uploadApk(generateUploadInfo(variant)) 49 | 50 | } 51 | } 52 | } 53 | } 54 | 55 | /** 56 | * generate upload info 57 | * @param variant 58 | * @return 59 | */ 60 | public UploadInfo generateUploadInfo(Object variant) { 61 | def manifestFile = variant.outputs.processManifest.manifestOutputFile[0] 62 | println("-> Manifest: " + manifestFile) 63 | println("VersionCode: " + variant.getVersionCode() + " VersionName: " + variant.getVersionName()) 64 | 65 | UploadInfo uploadInfo = new UploadInfo() 66 | uploadInfo.user_key = project.pre.user_key; 67 | 68 | uploadInfo.password = project.pre.password; 69 | uploadInfo.update_notify =project.pre.update_notify; 70 | // if you not set apkFile, default get the assemble output file 71 | if (project.pre.file != null) { 72 | uploadInfo.file = project.pre.file 73 | println("pre: you has set the custom file") 74 | println("pre: your apk absolutepath :" + project.pre.file) 75 | }else { 76 | File apkFile = variant.outputs[0].outputFile 77 | uploadInfo.file = apkFile.getAbsolutePath() 78 | println("pre: the apkFile is default set to build file") 79 | println("pre: your apk absolutepath :" + apkFile.getAbsolutePath()) 80 | } 81 | 82 | 83 | return uploadInfo 84 | } 85 | 86 | /** 87 | * 创建上传任务 88 | * 89 | * @param variant 编译参数 90 | * @return 91 | */ 92 | private Task createUploadTask(Object variant) { 93 | String variantName = variant.name.capitalize() 94 | Task uploadTask = project.tasks.create("upload${variantName}PreApkFile") << { 95 | // if debug model and debugOn = false no execute upload 96 | if (variantName.contains("Debug") && !project.pre.debugOn) { 97 | println("Pre: the option debugOn is closed, if you want to upload apk file on debug model, you can set debugOn = true to open it") 98 | return 99 | } 100 | uploadApk(generateUploadInfo(variant)) 101 | } 102 | println("Pre:create upload${variantName}PreApkFile task") 103 | return uploadTask 104 | } 105 | 106 | /** 107 | * 上传apk 108 | * @param uploadInfo 109 | * @return 110 | */ 111 | public boolean uploadApk(UploadInfo uploadInfo) { 112 | // 拼接url如:curl -F "file=@abc.apk" -F "user_key={user_key}" -F "update_notify=1" http://api.pre.im/api/v1/app/upload 113 | String url = APK_UPLOAD_URL 114 | println("Pre.im: Apk start uploading....") 115 | // // 116 | if (uploadInfo.user_key == null) { 117 | project.logger.error("Please set the user_key = \"xxxxx900037672xxx\"") 118 | return false 119 | } 120 | println("Pre:" + uploadInfo.toString()) 121 | 122 | if (!post(url, uploadInfo.file, uploadInfo)) { 123 | project.logger.error("Pre: Failed to upload!") 124 | return false 125 | } else { 126 | println("Pre: upload apk success !!!") 127 | return true 128 | } 129 | } 130 | 131 | /** 132 | * 上传apk 133 | * @param url 地址 134 | * @param filePath 文件路径 135 | * @param uploadInfo 更新信息 136 | * @return 137 | */ 138 | public boolean post(String url, String filePath, UploadInfo uploadInfo) { 139 | HttpURLConnectionUtil connectionUtil = new HttpURLConnectionUtil(url, Constants.HTTPMETHOD_POST); 140 | connectionUtil.addTextParameter(Constants.USER_KEY,uploadInfo.user_key); 141 | connectionUtil.addTextParameter(Constants.PASSWORD,uploadInfo.password); 142 | connectionUtil.addTextParameter(Constants.UPDATE_NOTIFY,uploadInfo.update_notify); 143 | 144 | connectionUtil.addFileParameter(Constants.FILE, new File(filePath)); 145 | String result = new String(connectionUtil.post(), "UTF-8"); 146 | println("Pre ---result: " + result) 147 | def data = new JsonSlurper().parseText(result) 148 | if (data.code=="0") { 149 | println("Pre --->update success: " + data.msg) 150 | return true 151 | } 152 | return false; 153 | } 154 | 155 | 156 | 157 | } 158 | -------------------------------------------------------------------------------- /preuploader/src/main/groovy/com/pre/im/UploadInfo.java: -------------------------------------------------------------------------------- 1 | package com.pre.im; 2 | 3 | /** 4 | * 作者: allen on 16/9/9. 5 | */ 6 | 7 | public class UploadInfo { 8 | /** 9 | * 10 | */ 11 | public String user_key = null ; 12 | /** 13 | * 需要上传的ipa或者apk文件 14 | */ 15 | public String file = null ; 16 | /** 17 | * 下载密码 (传空字符串或不传则不设置密码) 18 | */ 19 | public String password = null ; 20 | /** 21 | * 向内测成员发布新版通知 (1:开启) 22 | */ 23 | public String update_notify = null ; 24 | 25 | @Override 26 | public String toString() { 27 | return "UploadInfo{" + 28 | "user_key='" + user_key + '\'' + 29 | ", file='" + file + '\'' + 30 | ", password='" + password + '\'' + 31 | ", update_notify='" + update_notify + '\'' + 32 | '}'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /preuploader/src/main/resources/META-INF/gradle-plugins/com.pre.im.properties: -------------------------------------------------------------------------------- 1 | implementation-class=com.pre.im.PrePlugin 2 | -------------------------------------------------------------------------------- /repo/com/pre/im/preuploader/1.0.1/preuploader-1.0.1-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/UploaderPlugin/34a070a9c6d63649b45cac34773e9f21c116c56a/repo/com/pre/im/preuploader/1.0.1/preuploader-1.0.1-javadoc.jar -------------------------------------------------------------------------------- /repo/com/pre/im/preuploader/1.0.1/preuploader-1.0.1-javadoc.jar.md5: -------------------------------------------------------------------------------- 1 | 6d2cec413f71a2f595e727736903328f -------------------------------------------------------------------------------- /repo/com/pre/im/preuploader/1.0.1/preuploader-1.0.1-javadoc.jar.sha1: -------------------------------------------------------------------------------- 1 | 8c92667557e9674ad178107fd5ecaaf9c9cab191 -------------------------------------------------------------------------------- /repo/com/pre/im/preuploader/1.0.1/preuploader-1.0.1-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/UploaderPlugin/34a070a9c6d63649b45cac34773e9f21c116c56a/repo/com/pre/im/preuploader/1.0.1/preuploader-1.0.1-sources.jar -------------------------------------------------------------------------------- /repo/com/pre/im/preuploader/1.0.1/preuploader-1.0.1-sources.jar.md5: -------------------------------------------------------------------------------- 1 | c721b7242ad798a2fa3caea111f53020 -------------------------------------------------------------------------------- /repo/com/pre/im/preuploader/1.0.1/preuploader-1.0.1-sources.jar.sha1: -------------------------------------------------------------------------------- 1 | 2344aea195a38f28a235d9395319fb78891c3b92 -------------------------------------------------------------------------------- /repo/com/pre/im/preuploader/1.0.1/preuploader-1.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/UploaderPlugin/34a070a9c6d63649b45cac34773e9f21c116c56a/repo/com/pre/im/preuploader/1.0.1/preuploader-1.0.1.jar -------------------------------------------------------------------------------- /repo/com/pre/im/preuploader/1.0.1/preuploader-1.0.1.jar.md5: -------------------------------------------------------------------------------- 1 | 31914093d333379f3629e734d0724376 -------------------------------------------------------------------------------- /repo/com/pre/im/preuploader/1.0.1/preuploader-1.0.1.jar.sha1: -------------------------------------------------------------------------------- 1 | 2105a1f330c167ba1d86595b50d74cf6ed93ae23 -------------------------------------------------------------------------------- /repo/com/pre/im/preuploader/1.0.1/preuploader-1.0.1.pom: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | com.pre.im 6 | preuploader 7 | 1.0.1 8 | 9 | -------------------------------------------------------------------------------- /repo/com/pre/im/preuploader/1.0.1/preuploader-1.0.1.pom.md5: -------------------------------------------------------------------------------- 1 | 262aa8834dd3031d0f0660e2b27de272 -------------------------------------------------------------------------------- /repo/com/pre/im/preuploader/1.0.1/preuploader-1.0.1.pom.sha1: -------------------------------------------------------------------------------- 1 | c1ddf7ab631852075778279b14976b6518235354 -------------------------------------------------------------------------------- /repo/com/pre/im/preuploader/1.0.2/preuploader-1.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/UploaderPlugin/34a070a9c6d63649b45cac34773e9f21c116c56a/repo/com/pre/im/preuploader/1.0.2/preuploader-1.0.2.jar -------------------------------------------------------------------------------- /repo/com/pre/im/preuploader/maven-metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.pre.im 4 | preuploader 5 | 6 | 1.0.1 7 | 8 | 1.0.1 9 | 10 | 20160910123622 11 | 12 | 13 | -------------------------------------------------------------------------------- /repo/com/pre/im/preuploader/maven-metadata.xml.md5: -------------------------------------------------------------------------------- 1 | f20d0d81668e86c1d9453675525ded96 -------------------------------------------------------------------------------- /repo/com/pre/im/preuploader/maven-metadata.xml.sha1: -------------------------------------------------------------------------------- 1 | 69a35655da9f31decf130e87b45a99407062d703 -------------------------------------------------------------------------------- /uploader.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.jfrog.bintray' 2 | apply plugin: 'maven-publish' 3 | group = 'com.pre.im' 4 | version = '1.0.2' 5 | def baseUrl = 'https://github.com/AllenCoder' 6 | def siteUrl = baseUrl 7 | def gitUrl = "${baseUrl}/UploaderPlugin.git" 8 | def issueUrl = "${baseUrl}/UploaderPlugin/issues" 9 | 10 | def projectName = "uploaderplugin" 11 | def mavenDesc = 'A simple plugin provider for android studio to help apk upload fir.im and pre.im' 12 | def licenseIds = ['Apache-2.0'] 13 | 14 | install { 15 | repositories.mavenInstaller { 16 | // This generates POM.xml with proper parameters 17 | pom.project { 18 | // packaging 'jar' 19 | // Add your description here 20 | name = 'A simple plugin provider for android studio to help apk upload fir.im and pre.im' 21 | url siteUrl 22 | // Set your license 23 | licenses { 24 | license { 25 | name = 'The Apache Software License, Version 2.0' 26 | url 'http://www.apache.org/licenses/LICENSE-2.0.txt' 27 | } 28 | } 29 | developers { 30 | developer { 31 | id 'Allen' 32 | name 'AllenCoder' 33 | email 'AllenCoder@126.com' 34 | } 35 | } 36 | scm { 37 | connection gitUrl 38 | developerConnection gitUrl 39 | url siteUrl 40 | } 41 | } 42 | } 43 | } 44 | 45 | task sourcesJar(type: Jar) { 46 | from 'src/main/groovy' 47 | exclude 'META-INF' 48 | classifier = 'sources' 49 | } 50 | 51 | groovydoc { 52 | includePrivate = true 53 | source = 'src/main/groovy' 54 | } 55 | 56 | task groovydocJar(type: Jar, dependsOn: groovydoc) { 57 | classifier = 'javadoc' 58 | from groovydoc.destinationDir 59 | } 60 | 61 | artifacts { 62 | archives groovydocJar 63 | archives sourcesJar 64 | } 65 | 66 | Properties properties = new Properties() 67 | properties.load(project.rootProject.file('local.properties').newDataInputStream()) 68 | 69 | bintray { 70 | user = properties.getProperty("bintray.user") 71 | key = properties.getProperty("bintray.apikey") 72 | 73 | configurations = ['archives'] 74 | 75 | pkg { 76 | repo = 'maven' 77 | name = projectName 78 | desc = mavenDesc 79 | websiteUrl = siteUrl 80 | issueTrackerUrl = issueUrl 81 | vcsUrl = gitUrl 82 | labels = ['gradle', 'com.pre.im.plugin', 'preuploader'] 83 | licenses = licenseIds 84 | publish = true 85 | publicDownloadNumbers = true 86 | } 87 | } 88 | //apply from: 'https://raw.githubusercontent.com/attwellBrian/JCenter/master/installv1.gradle' 89 | //apply from: 'https://raw.githubusercontent.com/attwellBrian/JCenter/master/bintrayv1.gradle' 90 | 91 | --------------------------------------------------------------------------------