From bdb628b12fdbe02fc6ed96d897cbc6af95f72d44 Mon Sep 17 00:00:00 2001 From: shuyu <359369982@qq.com> Date: Mon, 14 Nov 2016 10:24:03 +0800 Subject: [PATCH] add id to jcenter --- .gitignore | 1 + bintray.gradle | 104 ++++++++++++++++++++++++++++++++++++ build.gradle | 6 ++- gradle.properties | 18 +++++++ gsyVideoPlayer/build.gradle | 5 +- 5 files changed, 131 insertions(+), 3 deletions(-) create mode 100644 bintray.gradle diff --git a/.gitignore b/.gitignore index b3a3ece..d74e75c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /captures .externalNativeBuild *.apk +keyid \ No newline at end of file diff --git a/bintray.gradle b/bintray.gradle new file mode 100644 index 0000000..560b6e4 --- /dev/null +++ b/bintray.gradle @@ -0,0 +1,104 @@ +group = PROJ_GROUP +version = PROJ_VERSION +project.archivesBaseName = PROJ_ARTIFACTID + +apply plugin: 'com.jfrog.bintray' +apply plugin: 'com.github.dcendents.android-maven' + +task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' +} + +task javadoc(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + classpath += configurations.compile + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + +javadoc { + options{ + encoding "UTF-8" + charSet 'UTF-8' + author true + version true + links "http://docs.oracle.com/javase/7/docs/api" + title "$PROJ_NAME $PROJ_VERSION" + } +} + +artifacts { + archives sourcesJar + archives javadocJar +} + +install { + repositories.mavenInstaller { + pom.project { + name PROJ_NAME + description PROJ_DESCRIPTION + url PROJ_WEBSITEURL + inceptionYear '2016' + + packaging 'aar' + groupId PROJ_GROUP + artifactId PROJ_ARTIFACTID + version PROJ_VERSION + + licenses { + license { + name 'The Apache Software License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + distribution 'repo' + } + } + scm { + connection PROJ_VCSURL + url PROJ_WEBSITEURL + + } + developers { + developer { + id DEVELOPER_ID + name DEVELOPER_NAME + email DEVELOPER_EMAIL + } + } + } + } +} + +bintray { + user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : project.property('BINTRAY_USER') + key = project.hasProperty('bintrayKey') ? project.property('bintrayKey') : project.property('BINTRAY_KEY') + + configurations = ['archives'] + + dryRun = false + publish = true + + pkg { + userOrg = PROJ_USER_ORG //这个是你创建时的organization,必须要有,不然没办法找到指定路径 + repo = PROJ_USER_MAVEN + name = PROJ_NAME + licenses = ['Apache-2.0'] + vcsUrl = PROJ_VCSURL + websiteUrl = PROJ_WEBSITEURL + issueTrackerUrl = PROJ_ISSUETRACKERURL + publicDownloadNumbers = true + version { + name = PROJ_VERSION + desc = PROJ_DESCRIPTION + vcsTag = PROJ_VERSION + + gpg { + sign = true + } + } + } +} diff --git a/build.gradle b/build.gradle index 1374dc9..e0a21e4 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. apply from: 'dependencies.gradle' + buildscript { repositories { jcenter() @@ -8,8 +9,9 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.2.2' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files + + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6' } } diff --git a/gradle.properties b/gradle.properties index aac7c9b..34d345c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,3 +15,21 @@ org.gradle.jvmargs=-Xmx1536m # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true +BINTRAY_USER= +BINTRAY_KEY= +PROJ_GROUP=com.shuyu +PROJ_VERSION=1.1.0 +PROJ_NAME=gsyVideo +PROJ_WEBSITEURL=hhttps://github.com/CarGuo/GSYVideoPlayer +PROJ_ISSUETRACKERURL= +PROJ_VCSURL=git@github.com:CarGuo/GSYVideoPlayer.git +PROJ_DESCRIPTION=android video player +PROJ_ARTIFACTID=gsyVideoPlayer +PROJ_USER_ORG=guoshuyu +PROJ_USER_MAVEN=gsyVideo + + +DEVELOPER_ID=guo +DEVELOPER_NAME=guoshuyu +DEVELOPER_EMAIL=359369982@qq.com + diff --git a/gsyVideoPlayer/build.gradle b/gsyVideoPlayer/build.gradle index 4a2d791..4736c0e 100644 --- a/gsyVideoPlayer/build.gradle +++ b/gsyVideoPlayer/build.gradle @@ -1,5 +1,6 @@ apply plugin: 'com.android.library' apply plugin: 'com.neenbedankt.android-apt' + android { def globalConfiguration = rootProject.extensions.getByName("ext") @@ -8,7 +9,7 @@ android { defaultConfig { - minSdkVersion globalConfiguration.androidMinSdkVersion + minSdkVersion globalConfiguration.androidMinSdkVersion targetSdkVersion globalConfiguration.androidTargetSdkVersion versionCode 1 @@ -40,3 +41,5 @@ dependencies { compile androidDependencies.cardview_v7 compile androidDependencies.design } + +apply from: '../bintray.gradle' -- GitLab