Skip to content

Instantly share code, notes, and snippets.

@up1
Created January 7, 2016 03:40
Show Gist options
  • Save up1/955829e7c67fb89ae004 to your computer and use it in GitHub Desktop.
Save up1/955829e7c67fb89ae004 to your computer and use it in GitHub Desktop.
Android Library with Artifactory
apply plugin: 'com.android.library'
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'maven-publish'
def packageName = 'codeinputlib'
def libraryVersion = '1.0.0'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.0.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
android {
compileSdkVersion 22
buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 11
targetSdkVersion 22
versionCode 11
versionName "1.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
publishing {
publications {
aar(MavenPublication) {
groupId packageName
version = libraryVersion
artifactId packageName
artifact("$buildDir/outputs/aar/${packageName}-release.aar")
}
}
}
artifactory {
contextUrl = 'http://localhost:8081/artifactory'
publish {
repository {
repoKey = 'demo-shared-library'
username = "admin"
password = "password"
}
defaults {
publications('aar')
publishArtifacts = true
// Properties to be attached to the published artifacts.
properties = ['qa.level': 'basic', 'dev.team': 'core']
// Publish generated POM files to Artifactory (true by default)
publishPom = true
}
}
}
@up1
Copy link
Author

up1 commented Jan 7, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment