Skip to content

Instantly share code, notes, and snippets.

@Krylez-zz
Last active December 24, 2015 16:49
Show Gist options
  • Save Krylez-zz/6830846 to your computer and use it in GitHub Desktop.
Save Krylez-zz/6830846 to your computer and use it in GitHub Desktop.
// This is the main build configuration
// It lives in: compiled-libraries/
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'maven'
repositories {
mavenCentral()
}
sourceCompatibility = "1.6"
targetCompatibility = "1.6"
configurations {
archives {
extendsFrom configurations.default
}
}
// This is the library build configuration. It lives in: compiled-libraries/MyLib
// Note: it should be called 'build-gradle', not 'library-build.gradle', this is only for Github
apply plugin: 'android-library'
apply plugin: 'maven'
group = 'com.rileybrewer.mylib'
version = '1.0.0'
uploadArchives {
configuration = configurations.archives
repositories {
mavenDeployer {
// I chose to put my repo in the project's root
repository(url: uri("../../localrepo"))
pom.project {
artifactId 'mylib'
name 'My Library'
packaging 'aar'
}
}
}
}
// Keep your library's original build configuration
// i.e. this isn't necessarily going to apply to you
dependencies {
compile 'com.android.support:support-v4:18.0.+'
}
android {
compileSdkVersion 18
buildToolsVersion "18.0.1"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment