-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
44 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |