From e8ebde5bf00256bcd102d0d8ead9cbd8ba46bf92 Mon Sep 17 00:00:00 2001 From: Alexander Martinz Date: Tue, 3 May 2016 16:36:22 +0200 Subject: [PATCH] gradle: add jitpack.io support Change-Id: I81697c42e1bf98405a7b71ff07eda439033581b1 Signed-off-by: Alexander Martinz --- README.md | 13 ++++++++++++- build.gradle | 2 ++ library/build.gradle | 24 ++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cb74fc9..aa22b2a 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,18 @@ public class DemoActivity extends IntroActivity { ``` ### Gradle dependency -Coming soon! +Add the following to your top level build.gradle + + allprojects { + repositories { + ... + maven { url "https://jitpack.io" } + } + } + +Add the following dependency + + compile 'com.github.MizzleDK:IntroActivity:-SNAPSHOT' ## Custom styling The library allows you to perform various custom styling using the following methods: diff --git a/build.gradle b/build.gradle index e0b366a..08fe29e 100644 --- a/build.gradle +++ b/build.gradle @@ -9,6 +9,8 @@ buildscript { // 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.3' } } diff --git a/library/build.gradle b/library/build.gradle index 85872a7..e1ff899 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -28,3 +28,27 @@ dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:23.2.1' } + +apply plugin: 'android-maven' + +// build a jar with source files +task sourcesJar(type: Jar) { + classifier = 'sources' + from android.sourceSets.main.java.srcDirs +} +task javadoc(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + classpath += configurations.compile + failOnError false +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + +artifacts { + archives sourcesJar + archives javadocJar +}