Skip to content

Commit

Permalink
Added android-maven plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jitpack-io committed May 2, 2015
1 parent f50bcaf commit 2b93216
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -6,7 +6,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'

classpath 'com.github.dcendents:android-maven-plugin:1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
19 changes: 19 additions & 0 deletions library/build.gradle
@@ -1,4 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'android-maven'

android {
compileSdkVersion 20
Expand All @@ -24,3 +25,21 @@ dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.nineoldandroids:library:2.4.0'
}

// build a jar with source files
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
artifacts {
archives sourcesJar
}

// to build a jar file in addition to the default aar file
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);
}

0 comments on commit 2b93216

Please sign in to comment.