Hi so I'm following the github site of Gradle Bintray Plugin https://github.com/bintray/gradle-bintray-plugin#readme tutorial however I don't quite understand the publications part. Can anyone help me with this? I'am currently working on bintray version 1.7.3.
Update:
I was able to upload successfully in bintray. However my current problem now is when downloading it in other projects. I have errors when syncing gradle :
-Could not find android-dbpatcher.jar(sirqo:android-dbpatcher:0.0.1).
-Error: Searched in the following locations:
http://sirqo.bintray.com/Android-DBPatcher/sirqo/android-dbpatcher/0.0.1/android-dbpatcher-0.0.1.jar
Update2:
For reference this is my gradle.build in my module
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
minSdkVersion 9
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso- core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.1'
testCompile 'junit:junit:4.12'
compile 'com.android.volley:volley:1.0.0'
}
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
}
group = 'xxxx'
version = '0.0.1'
install {
repositories.mavenInstaller {
pom.project {
name 'android-dbpatcher'
description 'A library for updating SQLite database in android.'
url 'https://sirqo.bintray.com/Android-DBPatcher'
inceptionYear '2016'
packaging 'aar'
groupId 'xxxx'
artifactId 'android-dbpatcher'
version '0.0.1'
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 'xxxx'
name 'xxxxx'
email 'xxxxxx#gmail.com'
}
}
}
}
}
Properties bintrayProperties = new Properties()
bintrayProperties.load(project.rootProject.file('bintray.properties').newDa taInputStream())
bintray {
user = bintrayProperties.getProperty('user')
key = bintrayProperties.get('key')
configurations = ['archives']
pkg {
repo = 'Android-DBPatcher'
name = 'android-dbpatcher'
userOrg = 'xxxx'
vcsUrl = 'https://github.com/sirqo/android-dbpatcher'
publish = true
version {
name = '0.0.1'
desc = 'Android SQLite Database Patcher'
released = new Date()
vcsTag = 'v0.0.1'
}
}
}
So I figured it out. For reference I'll share my code.
For my Project gradle.build
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id "com.jfrog.bintray" version "1.7.3"
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And for my module gradle.build
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
minSdkVersion 9
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.1'
testCompile 'junit:junit:4.12'
compile 'com.android.volley:volley:1.0.0'
}
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
}
group = 'xxxx' //bintray org/group name
version = '0.0.1' //version
install {
repositories.mavenInstaller {
pom.project {
name 'xxxxx' //package name
description 'A library for updating SQLite database in android.'
url 'xxxxx'
inceptionYear '2016'
packaging 'aar'
groupId 'xxxx' //group/org id
artifactId 'xxxx' //your android module name
version '0.0.1'
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 'xxxxx' //developer username
name 'xxxxxx' //developer name
email 'xxxxxx#gmail.com' //developer email
}
}
scm {
connection 'xxxxxx' // YOUR GIT REPO
developerConnection 'xxxxxx' // YOUR GIT REPO
url 'xxxxxxx' // YOUR SITE
}
}
}
}
Properties bintrayProperties = new Properties()
bintrayProperties.load(project.rootProject.file('bintray.properties').newDataInputStream())
bintray {
user = bintrayProperties.getProperty('user')
key = bintrayProperties.get('key')
configurations = ['archives']
pkg {
repo = 'xxxxxx' //Bintray repository
name = 'xxxxxx' //Bintray Package name
userOrg = 'xxxxx'
licenses = ['Apache-2.0']
vcsUrl = 'xxxxxxxx'
publish = true
version {
name = '0.0.1' //version
desc = 'xxxxxx' //Description
released = new Date()
vcsTag = 'v0.0.1'
}
}
}
After this open the android terminal below in your android studio and enter this command
./gradlew install
if there is some errors you can append the command with --debug and re-enter the command to trace the error
//if nothing else fail issue this command
./gradlew bintrayUpload
*again if there is an error you can use the command and append with --debug to trace it.
after all these you will recieve an email or something and then you can proceed to downloading your library in other projects. Happy coding!
Related
i had an android project in an old version of Android Studio. I re-installed my windows, and then i installed latest version of Android Studio.
Now, when i Open or Import my project i face this error:
No service of type Factory<LoggingManagerInternal> available in ProjectScopeServices.
Open File
and when i click on Open File link under the error, it directs me to
apply plugin: 'com.github.dcendents.android-maven'
this is my project build.gradle:
apply plugin: 'com.android.library'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'
version = '0.0.6'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile files('libs/chunk-templates-3.0.1.jar')
compile 'com.android.support:appcompat-v7:23.1.1'
}
def siteUrl = 'https://github.com/kexanie/MathView'
def gitUrl = 'https://github.com/kexanie/MathView.git'
group = 'io.github.kexanie.library'
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
// Add your description here
name 'A library for displaying math formula in Android apps.'
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 'kexanie'
name 'Brian Lee'
email 'kexanie#gmail.com'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}
dependencies {
}
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 = "MathView"
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
}
}
and this is build.gradle app Module:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "mathtools.user.com.mathtools"
minSdkVersion 17
targetSdkVersion 23
versionCode 9
versionName "2.4"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile project(':MathView')
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.android.gms:play-services-appindexing:8.1.0'
compile 'com.androidplot:androidplot-core:0.9.8'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
}
What do i do?
Change maven gradle plugin version to 1.4.1 in project build.gradle file
> dependencies {
> classpath 'com.android.tools.build:gradle:2.2.2'
> classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' }
Using the recommendations from here I'm not able to upload my android aar to my Bintray account. I got 'Build successfull' using gradlew bintrayUpload, but only jar file and a pom file are visible in bintray.
Here is my top level gradle file
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
plugins {
id "com.jfrog.bintray" version "1.7.3"
}
allprojects {
repositories {
jcenter()
}
}
apply plugin: 'maven-publish'
apply plugin: 'java'
apply plugin: 'maven'
publishing {
publications {
MyPublication(MavenPublication) {
from components.java
groupId 'com.android.me.mylibrary'
artifactId 'demo-lib'
version '1.0.1'
}
}
}
and here is my gradle file
apply plugin: 'com.android.library'
bintray {
user = user
key = key
publications = ['MyPublication'] //When uploading Maven-based publication files
//configurations = ['archives']
pkg {
repo = repo
name = 'demo-lib'
userOrg = userorg
labels = ['aar', 'android', 'example']
version {
name = '1.0.1'
}
}
}
android {
compileSdkVersion 26
buildToolsVersion "27.0.2"
defaultConfig {
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
testCompile 'junit:junit:4.12'
}
Is there something missing?
I've also try to use the example script here but the result is the same.
Best regards...
yes there is actually something missing. You do not upload the artifact. You upload artifactId but not artifact.
Because there are a lot of outdated tutorials I have actually made a post in here about this. What you need to do also is follow maven specifications for pom.xml and I see that you do not.
In version 4 they require as well those:
pom.withXml {
def root = asNode()
root.appendNode('description', "libraryDescription")
root.appendNode('name', "libraryName")
root.appendNode('url', "siteUrl")
root.children().last() + pomConfig
}
also in the pomConfig you should use it like this:
def pomConfig = {
licenses {
license {
name "licenseName"
url "licenseUrl"
distribution "repo"
}
}
developers {
developer {
id "developerId"
name "developerName"
email "developerEmail"
}
}
scm {
url "gitUrl"
}
}
Hope it helps!!!
I get following error while running gradlew install.
Failed to capture snapshot of input files for task 'javadoc' during up-to-date check. See stacktrace for details.
Could not normalize path for file 'C:\android\sdk\platforms\android-23\android.jar;C:\android\sdk\platforms\android-23\optional\org.apache.http.legacy.jar'
The project's build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
The library module's build.gradle:
apply plugin: 'com.android.library'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'
ext {
bintrayRepo = 'maven'
bintrayName = 'befrest'
publishedGroupId = 'com.oddrun.libraries'
libraryName = 'Befrest'
artifact = 'befrest'
libraryDescription = 'Simple Push Notification Library For Android'
siteUrl = 'https://github.com/hojjat-imani/PushNotif'
gitUrl = 'https://github.com/hojjat-imani/PushNotif.git'
libraryVersion = '0.0.1'
developerId = 'hojjat-imani'
developerName = 'Hojjat Imani'
developerEmail = 'imani.hojjat95#gmail.com'
licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
minSdkVersion 10
targetSdkVersion 23
versionCode 0
versionName "0.0.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
}
version = libraryVersion
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
}
// Bintray
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 = bintrayRepo
name = bintrayName
desc = libraryDescription
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = allLicenses
publish = true
publicDownloadNumbers = true
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'
}
}
}
}
group = publishedGroupId // Maven Group ID for the artifact
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
groupId publishedGroupId
artifactId artifact
// Add your description here
name libraryName
description libraryDescription
url siteUrl
// Set your license
licenses {
license {
name licenseName
url licenseUrl
}
}
developers {
developer {
id developerId
name developerName
email developerEmail
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}
You can add org.apache.http.legacy.jar in your libs folder.
You can find this jar in Android/Sdk/platforms/android-23/optional
I also added this line to my app.gradle file
compile files('libs/org.apache.http.legacy.jar')
But if you're using more libraries, you can use this way
compile fileTree(dir: 'libs', include: ['*.jar'])
This resolved all my errors that were caused because google removed support of Apache HTTP client. Do not changed compileSdkVersion 23 to 22, I think this solution is better.
There seems to be a problem with apache http in android 23.
Just changing compileSdkVersion 23 to 22 and removing useLibrary 'org.apache.http.legacy' solved the problem.
I'm trying to create a maven library using Android Studio and bintray but I can't get it working. When I try to upload the lib using gradle bintrayUpload I allways get the following error:
Could not upload to 'https://api.bintray.com/content/company/maven/company-simplename-lib/simplename/company-simplename-lib/lib/0.0.1/lib-0.0.1.pom': HTTP/1.1 400 Bad Request [message:Unable to upload files: Maven group, artifact or version defined in the pom file do not match the file path 'company-simplename-lib/lib/0.0.1/lib-0.0.1.pom']
This happens when I try to follow the example bintray has in their github repo.
I have changed my library build.gradle (not the root) to the following:
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
}
}
plugins {
id "com.jfrog.bintray" version "1.4"
}
version = '0.0.1'
allprojects {
repositories {
jcenter()
}
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName '0.0.1'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:cardview-v7:23.1.0'
compile 'com.android.support:recyclerview-v7:23.1.0'
}
install {
repositories.mavenInstaller {
pom.project {
name 'EasyGoogle'
description 'A wrapper library for basic functions of Google Play Services APIs'
url 'https://github.com/googlesamples/easygoogle'
inceptionYear '2015'
packaging 'aar'
groupId 'pub.devrel'
artifactId 'android-maven-example'
version '0.1'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
connection 'https://github.com/googlesamples/easygoogle.git'
url 'https://github.com/googlesamples/easygoogle'
}
developers {
developer {
name 'Google'
}
}
}
}
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
configurations = ['archives']
pkg {
repo = 'maven'
name = 'company-simplename-lib'
userOrg = user
licenses = ['Apache-2.0']
vcsUrl = 'http://example.com/android/company-simplename-lib.git'
version {
name = 'simplename'
desc = 'test build'
vcsTag = '0.0.1'
attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin']
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.4'
}
Is someone able to see what I'm doing wrong? Becasue I can't and I can't find any good documentation about this either.
Please go through below blog , it clearly explain everything.
http://inthecheesefactory.com/blog/how-to-upload-library-to-jcenter-maven-central-as-dependency/en
If you still face issue of uploading pom file then make sure
libraryName , artifact and module name should be same.
I got it working by removing the install part from the gradle file so it looks like this:
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
}
}
plugins {
id "com.jfrog.bintray" version "1.4"
}
version = '0.0.4'
allprojects {
repositories {
jcenter()
}
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName '0.0.4'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:cardview-v7:23.1.0'
compile 'com.android.support:recyclerview-v7:23.1.0'
}
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
configurations = ['archives']
pkg {
repo = 'maven'
name = 'company-simplename-lib'
userOrg = user
licenses = ['Apache-2.0']
vcsUrl = 'http://gitlab.company-servic.es/android/company-simplename-lib.git'
version {
name = 'simplename'
desc = 'test build'
vcsTag = '0.0.4'
attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin']
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.4'
}
In my android application i had imported Module from GitHub https://github.com/IsseiAoki/SimpleCropView#download .But after sync my gradle i get error :
Error:(21, 0) Plugin with id 'com.github.dcendents.android-maven' not found.
in added modules built.gradle file which is as follows.
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 9
targetSdkVersion 22
versionCode 9
versionName "1.0.8"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
group = 'com.isseiaoki'
version = '1.0.8'
def siteUrl = 'https://github.com/IsseiAoki/SimpleCropView'
def gitUrl = 'https://github.com/IsseiAoki/SimpleCropView.git'
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'] //When uploading configuration files
pkg {
repo = 'maven'
name = 'SimpleCropView'
desc = 'A simple image cropping library for Android.'
websiteUrl = siteUrl
issueTrackerUrl = 'https://github.com/IsseiAoki/SimpleCropView/issues'
vcsUrl = gitUrl
licenses = ['MIT']
labels = ['android']
publicDownloadNumbers = true
}
}
install {
repositories.mavenInstaller {
pom {
project {
packaging 'aar'
name 'SimpleCropView'
url siteUrl
licenses {
license {
name 'The MIT License (MIT)'
url 'http://opensource.org/licenses/MIT'
}
}
developers {
developer {
id 'isseiaoki'
name 'Issei Aoki'
email 'i.greenwood.dev#gmail.com'
}
}
scm {
connection 'https://github.com/IsseiAoki/SimpleCropView.git'
developerConnection 'https://github.com/IsseiAoki/SimpleCropView.git'
url siteUrl
}
}
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
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
}
task findConventions << {
println project.getConvention()
}
This package is already available on jcenter repo, so instead of include by source code, add compile package name in dependencies block of your app's build.gradle
dependencies {
compile 'com.isseiaoki:simplecropview:1.0.8'
}
UPDATE:
Your dependencies should look like
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:design:22.2.0'
compile 'com.isseiaoki:simplecropview:1.0.8'
}