From 2fbce0bf09445eca1d886acafa4cec06c7430d60 Mon Sep 17 00:00:00 2001 From: Brian Hoffmann Date: Sat, 7 Mar 2015 23:38:37 +0100 Subject: [PATCH] try jitpack --- README.md | 13 ++++++++++++- build.gradle | 7 +++++++ library/build.gradle | 29 +++++++++++++++++++++++++---- 3 files changed, 44 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index eff026e..96064d9 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,17 @@ Contents - [RotatedDrawable](de/slowpoke/androidtank/graphics/drawable/RotatedDrawable.java): a `Drawable` that can be programmatically rotated +Usage +====== + + repositories { + maven { url "https://jitpack.io" } + } + + dependencies { + compile 'com.github.panzerfahrer:android-tank:1.0.0' + } + License ======= @@ -38,7 +49,7 @@ License you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/build.gradle b/build.gradle index 9eb52ac..46c00d4 100644 --- a/build.gradle +++ b/build.gradle @@ -5,5 +5,12 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:1.0.0' + classpath 'com.github.dcendents:android-maven-plugin:1.2' + } +} + +allprojects { + repositories { + jcenter() } } \ No newline at end of file diff --git a/library/build.gradle b/library/build.gradle index 041b0c6..935f575 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,10 +1,31 @@ apply plugin: 'com.android.library' - -repositories { - jcenter() -} +apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion 21 buildToolsVersion '21.1.2' + + defaultConfig { + minSdkVersion 14 + targetSdkVersion 21 + versionCode 100000 + versionName "1.0.0" + } +} + +// build a jar with source files +task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' +} +artifacts { + archives sourcesJar +} + +android.libraryVariants.all { variant -> + def name = variant.buildType.name + def task = project.tasks.create "jar${name.capitalize()}", Jar + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + artifacts.add('archives', task); } \ No newline at end of file