diff --git a/build.gradle b/build.gradle index ecc23fde..29ec0227 100644 --- a/build.gradle +++ b/build.gradle @@ -3,11 +3,12 @@ buildscript { repositories { jcenter() + mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:2.2.2' + classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } @@ -16,6 +17,7 @@ buildscript { allprojects { repositories { jcenter() + mavenCentral() } } diff --git a/downloadutil/build.gradle b/downloadutil/build.gradle index 68eb9ad5..69b014c7 100644 --- a/downloadutil/build.gradle +++ b/downloadutil/build.gradle @@ -27,7 +27,7 @@ dependencies { testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' } -//apply from: 'jcenter.gradle' +apply from: 'jcenter.gradle' // build a jar with source files //task sourcesJar(type: Jar) { diff --git a/downloadutil/jcenter.gradle b/downloadutil/jcenter.gradle index 4963caec..7558784b 100644 --- a/downloadutil/jcenter.gradle +++ b/downloadutil/jcenter.gradle @@ -1,10 +1,9 @@ -group = PROJ_GROUP +group = PROJ_GROUP_ID version = PROJ_VERSION -project.archivesBaseName = PROJ_ARTIFACTID +project.archivesBaseName = PROJ_ARTIFACT_ID apply plugin: 'com.jfrog.bintray' apply plugin: 'com.github.dcendents.android-maven' -//apply plugin: "com.jfrog.artifactory" -//apply plugin: 'maven-publish' +//输入:gradlew bintrayupload 执行 task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs @@ -29,7 +28,7 @@ javadoc { author true version true links "http://docs.oracle.com/javase/7/docs/api" - title PROJ_ARTIFACTID + title PROJ_ARTIFACT_ID } } @@ -72,98 +71,68 @@ artifacts { archives sourcesJar } - -//def pomConfig = { -// scm { -// connection PROJ_VCSURL -// developerConnection PROJ_VCSURL -// url PROJ_WEBSITEURL -// } -// 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 -// } -// } -// "dependencies " { -// // dependency { -// // groupId "com.alibaba" -// // artifactId "fastjson" -// // "version " "1.2.6" -// // //同dependencies -// // } -// // } -// } -//} -// -//publishing { -// publications { -// mavenJava(MavenPublication) { -// artifactId PROJ_ARTIFACTID -// artifact javadocJar -// artifact sourcesJar -// -// pom { -// packaging 'aar' -// } -// pom.withXml { -// def root = asNode() -// root.appendNode('description', PROJ_DESCRIPTION) -// root.children().last() + pomConfig -// } -// } -// } -//} -// -//afterEvaluate { -// publishing.publications.mavenJava.artifact(bundleRelease) -//} - bintray { user = hasProperty("bintrayUser") ? getProperty("bintrayUser") : getProperty("BINTRAY_USER") key = hasProperty("bintrayKey") ? getProperty("bintrayKey") : getProperty("BINTRAY_KEY") configurations = ['archives'] publications = ['mavenJava'] - publish = true pkg { - repo = 'maven' + repo = PROJ_REPE name = PROJ_NAME desc = PROJ_DESCRIPTION - websiteUrl = PROJ_WEBSITEURL - issueTrackerUrl = PROJ_ISSUETRACKERURL - vcsUrl = PROJ_VCSURL - licenses = ['Apache-2.0'] + websiteUrl = PROJ_WEB_SITE_URL + issueTrackerUrl = PROJ_ISSUE_TRACKER_URL + vcsUrl = PROJ_VCS_URL + publish = true publicDownloadNumbers = true + licenses = LICENSES +// 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' +// } +// } } } -artifactory { - contextUrl = 'http://oss.jfrog.org/artifactory' - resolve { - repository { - repoKey = 'libs-release' - } - } - publish { - repository { - repoKey = 'oss-snapshot-local' //The Artifactory repository key to publish to - username = bintray.user - password = bintray.key - maven = true - } - defaults { - publications('mavenJava') - publishArtifacts = true +install { + repositories.mavenInstaller { + // This generates POM.xml with proper parameters + pom { + project { + packaging 'aar' + groupId PROJ_GROUP_ID + artifactId PROJ_ARTIFACT_ID + + // Add your description here + name PROJ_NAME + description PROJ_DESCRIPTION + url PROJ_WEB_SITE_URL + + // Set your license + licenses { + license { + name LICENSE_NAME + url LICENSE_URL + } + } + developers { + developer { + id DEVELOPER_ID + name DEVELOPER_NAME + email DEVELOPER_EMAIL + } + } + scm { + connection PROJ_WEB_SITE_URL + developerConnection PROJ_WEB_SITE_URL + url PROJ_VCS_URL + } + } } } } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..13372aef Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..ab4c9191 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Mon Oct 24 17:59:34 CST 2016 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip