diff --git a/app/build.gradle b/app/build.gradle index 2fb9a83..472f162 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,6 +19,9 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } + lintOptions { + abortOnError false + } } dependencies { diff --git a/build.gradle b/build.gradle index d0aa704..e4082ec 100644 --- a/build.gradle +++ b/build.gradle @@ -6,9 +6,8 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:2.3.2' - - // 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.4.1' + classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6' } } diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/smartcropperlib/build.gradle b/smartcropperlib/build.gradle index 365cb4e..40b43b5 100644 --- a/smartcropperlib/build.gradle +++ b/smartcropperlib/build.gradle @@ -8,7 +8,7 @@ android { minSdkVersion 14 targetSdkVersion 25 versionCode 1 - versionName "1.0" + versionName "1.0.0" externalNativeBuild { cmake { @@ -29,8 +29,89 @@ android { path "CMakeLists.txt" } } + lintOptions { + abortOnError false + } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) } + +apply plugin: 'com.github.dcendents.android-maven' +apply plugin: 'com.jfrog.bintray' +// This is the library version used when deploying the artifact +version = "1.0.0" + +def siteUrl = "https://github.com/pqpo/SmartCropper" +def gitUrl = "https://github.com/pqpo/SmartCropper.git" +group = "me.pqpo.smartcropper" // Maven Group ID for the artifact,一般填你唯一的包名 +install { + repositories.mavenInstaller { + // This generates POM.xml with proper parameters + pom { + project { + packaging 'aar' + // Add your description here + name 'A library for cropping image in a smart way that can identify the border and correct the cropped image' + url siteUrl + // Set your license + licenses { + license { + name 'The Apache Software License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + } + } + developers { + developer { + id 'pqpo' + name 'pqpo' + email 'pqponet@gmail.com' + } + } + scm { + connection gitUrl + developerConnection gitUrl + url siteUrl + } + } + } + } +} +task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' +} +task javadoc(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) +} +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} +artifacts { + archives javadocJar + archives sourcesJar +} +Properties properties = new Properties() +properties.load(project.rootProject.file('local.properties').newDataInputStream()) +bintray { + user = properties.getProperty("bintray.user") + key = properties.getProperty("bintray.apikey") + configurations = ['archives'] + pkg { + repo = "maven" + name = "SmartCropper" //发布到JCenter上的项目名字 + websiteUrl = siteUrl + vcsUrl = gitUrl + licenses = ["Apache-2.0"] + publish = true + } +} +javadoc { //jav doc采用utf-8编码否则会报“GBK的不可映射字符”错误 + options{ + encoding "UTF-8" + charSet 'UTF-8' + } +} diff --git a/smartcropperlib/src/main/java/me/pqpo/smartcropperlib/view/CropImageView.java b/smartcropperlib/src/main/java/me/pqpo/smartcropperlib/view/CropImageView.java index 20460a7..d5d96eb 100644 --- a/smartcropperlib/src/main/java/me/pqpo/smartcropperlib/view/CropImageView.java +++ b/smartcropperlib/src/main/java/me/pqpo/smartcropperlib/view/CropImageView.java @@ -151,7 +151,7 @@ public void setImageBitmap(Bitmap bm) { /** * 设置待裁剪图片并显示 - * @param bmp + * @param bmp 待裁剪图片 */ public void setImageToCrop(Bitmap bmp) { setImageBitmap(bmp);