Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'
def packageName = 'bluesquare-core'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 21
targetSdkVersion 28
versionCode getDate()
versionName "$bluesquareVersion"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude "META-INF/*kotlin*"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
/* test */
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
/*
kotlin
*/
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
api "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
/*
support
*/
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:paperview-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
/*
bluesquare
*/
implementation project(':processor')
implementation project(':camera')
implementation project(':utils')
implementation project(':color')
implementation project(':shapes')
implementation project(':processor_preview')
implementation project(':tilt')
/*
OS
*/
api 'org.kodein.di:kodein-di-generic-jvm:5.2.0'
}
task sourceJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
archiveClassifier.set('sources')
}
publishing {
publications {
aar(MavenPublication) {
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
/* APPEND ALL API DEPENDENCIES */
configurations.api.allDependencies.each {
if (!it.group.startsWith("bluesquare")) {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
/* APPEND processor AS DEPENDENCY */
def processorNode = dependenciesNode.appendNode('dependency')
processorNode.appendNode('groupId', "com.quickbirdstudios")
processorNode.appendNode('artifactId', "bluesquare-processor")
processorNode.appendNode('version', bluesquareVersion)
/* APPEND CAMERA AS DEPENDENCY */
def cameraNode = dependenciesNode.appendNode('dependency')
cameraNode.appendNode('groupId', "com.quickbirdstudios")
cameraNode.appendNode('artifactId', "bluesquare-camera")
cameraNode.appendNode('version', bluesquareVersion)
/* APPEND UTILS AS DEPENDENCY */
def utilsNode = dependenciesNode.appendNode('dependency')
utilsNode.appendNode('groupId', "com.quickbirdstudios")
utilsNode.appendNode('artifactId', "bluesquare-utils")
utilsNode.appendNode('version', bluesquareVersion)
/* APPEND COLOR AS DEPENDENCY */
def colorNode = dependenciesNode.appendNode('dependency')
colorNode.appendNode('groupId', "com.quickbirdstudios")
colorNode.appendNode('artifactId', "bluesquare-color")
colorNode.appendNode('version', bluesquareVersion)
/* APPEND PAPER AS DEPENDENCY */
def paperNode = dependenciesNode.appendNode('dependency')
paperNode.appendNode('groupId', "com.quickbirdstudios")
paperNode.appendNode('artifactId', "bluesquare-paper")
paperNode.appendNode('version', bluesquareVersion)
/* APPEND SHAPES AS DEPENDENCY */
def shapesNode = dependenciesNode.appendNode('dependency')
shapesNode.appendNode('groupId', "com.quickbirdstudios")
shapesNode.appendNode('artifactId', "bluesquare-shapes")
shapesNode.appendNode('version', bluesquareVersion)
/* APPEND processor PREVIEW AS DEPENDENCY */
def processorPreviewNode = dependenciesNode.appendNode('dependency')
processorPreviewNode.appendNode('groupId', "com.quickbirdstudios")
processorPreviewNode.appendNode('artifactId', "bluesquare-processor-preview")
processorPreviewNode.appendNode('version', bluesquareVersion)
/* APPEND ORIENTATION AS DEPENDENCY */
def orientationNode = dependenciesNode.appendNode('dependency')
orientationNode.appendNode('groupId', "com.quickbirdstudios")
orientationNode.appendNode('artifactId', "bluesquare-tilt")
orientationNode.appendNode('version', bluesquareVersion)
}
// ##############################################################
groupId "com.quickbirdstudios"
version = "$bluesquareVersion"
artifactId packageName
artifact("$buildDir/outputs/aar/core-release.aar")
artifact sourceJar
}
}
}
if (!project.hasProperty("artifactory_username")) {
ext.artifactory_username = ""
}
if (!project.hasProperty("artifactory_password")) {
ext.artifactory_password = ""
}
artifactory {
contextUrl = '***'
publish {
repository {
repoKey = 'quickbirdstudios'
username = artifactory_username
password = artifactory_password
}
defaults {
publications('aar')
publishArtifacts = true
// Properties to be attached to the published artifacts.
properties = ['qa.level': 'basic', 'dev.team': 'core']
publishPom = true
}
}
}
repositories {
mavenCentral()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.