From c8c0b648fda7659a07002acdc0e21f9f2a9fc514 Mon Sep 17 00:00:00 2001 From: "ivan.navas" Date: Sat, 10 Jan 2015 22:48:33 +0100 Subject: [PATCH] Add the gradle dependency information --- MaterialDesign/build.gradle | 78 +++++++++++++++++++++++++++++++++++++ README.md | 14 ++++++- build.gradle | 8 ++-- gradle.properties | 3 +- 4 files changed, 95 insertions(+), 8 deletions(-) diff --git a/MaterialDesign/build.gradle b/MaterialDesign/build.gradle index 985fc4e..2c02db9 100644 --- a/MaterialDesign/build.gradle +++ b/MaterialDesign/build.gradle @@ -1,4 +1,6 @@ apply plugin: 'com.android.library' +apply plugin: 'com.github.dcendents.android-maven' +apply plugin: 'com.jfrog.bintray' android { compileSdkVersion 19 @@ -28,8 +30,84 @@ android { } } +ext.siteUrl = 'https://github.com/navasmdc/MaterialDesignLibrary' +ext.issueUrl = 'https://github.com/navasmdc/MaterialDesignLibrary/issues' +ext.gitUrl = 'https://github.com/navasmdc/MaterialDesignLibrary.git' + +bintray { + user = hasProperty('BINTRAY_USER') ? BINTRAY_USER : "_" + key = hasProperty('BINTRAY_KEY') ? BINTRAY_PASSWORD : "_" + + configurations = ["archives"] + pkg { + repo = 'maven' + name = 'MaterialDesignLibrary' + desc = 'This is a library with components of Android L to you use in android 2.2' + websiteUrl = siteUrl + issueTrackerUrl = issueUrl + vcsUrl = gitUrl + licenses = ['Apache-2.0'] + labels = [] + publicDownloadNumbers = true + } +} + dependencies { compile 'com.nineoldandroids:library:2.4.+' compile 'com.android.support:support-v4:21.+' } +install { + repositories.mavenInstaller { + pom { + project { + packaging 'aar' + name 'MaterialDesignLibrary' + url siteUrl + licenses { + license { + name 'The Apache Software License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + } + } + developers { + developer { + id 'navasmdc' + name 'Iván Navas' + email 'i.navas.mdc@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 +} + +task findConventions << { + println project.getConvention() +} + diff --git a/README.md b/README.md index d148482..d5c6c99 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,18 @@ If you want use this library, you only have to download MaterialDesign project, import it into your workspace and add the project as a library in your android project settings. +If you prefer it, you can use the grade dependency, you have to add these lines in your buil.gradle file: + +```xml +repositories { + jcenter() +} + +dependencies { + compile(group: 'com.github.navasmdc', name: 'MaterialDesign', version: '1.0', ext: 'aar') +} +``` + Some components have custom attributes, if you want use them, you must add this line in your xml file in the first component: ```xml @@ -195,7 +207,7 @@ Some components have custom attributes, if you want use them, you must add this ```xml -