Skip to content

Instantly share code, notes, and snippets.

@Nikhil-z
Forked from up1/build.gradle
Created November 4, 2021 09:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nikhil-z/a9821591f35277d9e29cff8bb6de9aec to your computer and use it in GitHub Desktop.
Save Nikhil-z/a9821591f35277d9e29cff8bb6de9aec 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
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment