diff --git a/build.gradle b/build.gradle index 5450420d..de50eb5d 100644 --- a/build.gradle +++ b/build.gradle @@ -5,10 +5,10 @@ buildscript { jcenter() } dependencies { -// classpath 'com.android.tools.build:gradle:2.1.0' - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:1.5.0' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6' classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1" +// 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 } diff --git a/downloadutil/build.gradle b/downloadutil/build.gradle index af305188..b6301421 100644 --- a/downloadutil/build.gradle +++ b/downloadutil/build.gradle @@ -1,26 +1,26 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 23 - buildToolsVersion "23.0.2" + compileSdkVersion 23 + buildToolsVersion "23.0.2" - defaultConfig { - minSdkVersion 9 - targetSdkVersion 23 - versionCode 13 - versionName "1.0.1" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + defaultConfig { + minSdkVersion 9 + targetSdkVersion 23 + versionCode 56 + versionName "2.0.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } } - } } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - testCompile 'junit:junit:4.12' - compile 'com.android.support:appcompat-v7:23.1.1' + compile fileTree(dir: 'libs', include: ['*.jar']) + testCompile 'junit:junit:4.12' + compile 'com.android.support:appcompat-v7:23.1.1' } -//apply from: 'jcenter.gradle' \ No newline at end of file +apply from: 'jcenter.gradle' \ No newline at end of file diff --git a/downloadutil/jcenter.gradle b/downloadutil/jcenter.gradle index 50c59b0f..2b186301 100644 --- a/downloadutil/jcenter.gradle +++ b/downloadutil/jcenter.gradle @@ -6,31 +6,30 @@ apply plugin: "com.jfrog.artifactory" apply plugin: 'maven-publish' task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' + from android.sourceSets.main.java.srcDirs + classifier = 'sources' } task javadoc(type: Javadoc) { - options.encoding = "utf-8" - source = android.sourceSets.main.java.srcDirs - classpath += configurations.compile - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + 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 + 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_ARTIFACTID - } + options { + encoding "UTF-8" + charSet 'UTF-8' + author true + version true + links "http://docs.oracle.com/javase/7/docs/api" + title PROJ_ARTIFACTID + } } //添加以下信息避免JAVADOC打包时引用其它类库而出现问题,比如出现以下错误 @@ -40,121 +39,128 @@ javadoc { // 符号: 类 JsonElement // 位置: 类 xxxx android.libraryVariants.all { variant -> - println variant.javaCompile.classpath.files - if (variant.name == 'release') { - //我们只需 release 的 javadoc - task("generate${variant.name.capitalize()}Javadoc", type: Javadoc) { - // title = '' - // description = '' - source = variant.javaCompile.source - classpath = files(variant.javaCompile.classpath.files, project.android.getBootClasspath()) - options { - encoding "utf-8" - links "http://docs.oracle.com/javase/7/docs/api/" - linksOffline "http://d.android.com/reference", "${android.sdkDirectory}/docs/reference" - } - exclude '**/BuildConfig.java' - exclude '**/R.java' - } - task("javadoc${variant.name.capitalize()}Jar", type: Jar, - dependsOn: "generate${variant.name.capitalize()}Javadoc") { - classifier = 'javadoc' - from tasks.getByName("generate${variant.name.capitalize()}Javadoc").destinationDir + println variant.javaCompile.classpath.files + if (variant.name == 'release') { //我们只需 release 的 javadoc + task("generate${variant.name.capitalize()}Javadoc", type: Javadoc) { + // title = '' + // description = '' + source = variant.javaCompile.source + classpath = files(variant.javaCompile.classpath.files, project.android.getBootClasspath()) + options { + encoding "utf-8" + links "http://docs.oracle.com/javase/7/docs/api/" + linksOffline "http://d.android.com/reference", "${android.sdkDirectory}/docs/reference" + } + exclude '**/BuildConfig.java' + exclude '**/R.java' + } + task("javadoc${variant.name.capitalize()}Jar", type: Jar, dependsOn: "generate${variant.name.capitalize()}Javadoc") { + classifier = 'javadoc' + from tasks.getByName("generate${variant.name.capitalize()}Javadoc").destinationDir + } + artifacts { + archives tasks.getByName("javadoc${variant.name.capitalize()}Jar") + } } - artifacts { - archives tasks.getByName("javadoc${variant.name.capitalize()}Jar") - } - } } artifacts { - archives javadocJar - archives sourcesJar + archives javadocJar + 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" + 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 + 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 + 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 - } + pom { + packaging 'aar' + } + pom.withXml { + def root = asNode() + root.appendNode('description', PROJ_DESCRIPTION) + root.children().last() + pomConfig + } + } } - } } afterEvaluate { - publishing.publications.mavenJava.artifact(bundleRelease) + publishing.publications.mavenJava.artifact(bundleRelease) } bintray { - user = hasProperty("bintrayUser") ? getProperty("bintrayUser") : getProperty("BINTRAY_USER") - key = hasProperty("bintrayKey") ? getProperty("bintrayKey") : getProperty("BINTRAY_KEY") + user = hasProperty("bintrayUser") ? getProperty("bintrayUser") : getProperty("BINTRAY_USER") + key = hasProperty("bintrayKey") ? getProperty("bintrayKey") : getProperty("BINTRAY_KEY") - configurations = ['archives'] - publications = ['mavenJava'] - publish = true + configurations = ['archives'] + publications = ['mavenJava'] + publish = true - pkg { - repo = 'maven' - name = PROJ_NAME - desc = PROJ_DESCRIPTION - websiteUrl = PROJ_WEBSITEURL - issueTrackerUrl = PROJ_ISSUETRACKERURL - vcsUrl = PROJ_VCSURL - licenses = ['Apache-2.0'] - publicDownloadNumbers = true - } + pkg { + repo = 'maven' + name = PROJ_NAME + desc = PROJ_DESCRIPTION + websiteUrl = PROJ_WEBSITEURL + issueTrackerUrl = PROJ_ISSUETRACKERURL + vcsUrl = PROJ_VCSURL + licenses = ['Apache-2.0'] + publicDownloadNumbers = true + } } 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 + contextUrl = 'http://oss.jfrog.org/artifactory' + resolve { + repository { + repoKey = 'libs-release' + } } - defaults { - publications('mavenJava') - publishArtifacts = true + 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 + } } - } } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 13372aef..00000000 Binary files a/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5b2de139..7b52afa3 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ 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 +distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip