Skip to content

Commit

Permalink
Setup publishing artifacts via bintray
Browse files Browse the repository at this point in the history
  • Loading branch information
Mantas Palaima committed Jan 5, 2018
1 parent 7a3792d commit 6856e2d
Show file tree
Hide file tree
Showing 24 changed files with 331 additions and 323 deletions.
169 changes: 56 additions & 113 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.novoda:bintray-release:0.8.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down Expand Up @@ -39,119 +40,61 @@ allprojects {
}
}

ext {
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 27
buildToolsVersion = '27.0.1'

supportVersion = '27.0.2'
butterknifeVersion = '8.4.0'
glideVersion = '3.7.0'
picassoVersion = '2.5.2'
picasso2Okhttp3Downloader = '1.0.2'
playServiceVersion = '11.8.0'
timberVersion = '4.6.0'
okhttpVersion = '3.4.1'
okhttp2Version = '2.7.0'
scalpelVersion = '1.1.2'
taktVersion = '1.0.2'
leakCanaryVersion = '1.5.4'
lynxVersion = '1.1.0'
chukVersion = '1.1.0'

VERSION_NAME = '0.7.5'
VERSION_CODE = 21

SITE_URL = 'https://github.com/palaima/DebugDrawer'
GIT_URL = '[email protected]\\:palaima/DebugDrawer.git'
GROUP_NAME = 'io.palaima.debugdrawer'
COMPILE_SDK = compileSdkVersion
BUILD_TOOLS = buildToolsVersion

MODULES_NAMES = [
'debugdrawer',
'debugdrawer-actions',
'debugdrawer-base',
'debugdrawer-commons',
'debugdrawer-fps',
'debugdrawer-glide',
'debugdrawer-location',
'debugdrawer-logs',
'debugdrawer-network-quality',
'debugdrawer-no-op',
'debugdrawer-okhttp',
'debugdrawer-okhttp3',
'debugdrawer-picasso',
'debugdrawer-scalpel',
'debugdrawer-timber',
'debugdrawer-view',
'debugdrawer-view-no-op'
]

LICENSE = 'The Apache Software License, Version 2.0'

DEVELOPER_ID = 'palaima'
DEVELOPER_NAME = 'Mantas Palaima'
DEVELOPER_EMAIL = '[email protected]'

IS_UPLOADING = project.getGradle().startParameter.taskNames.any { it.contains('bintrayUpload') }

}

subprojects {
group = GROUP_NAME
version = VERSION_NAME

if (IS_UPLOADING && project.name in MODULES_NAMES) {
println project.name
apply plugin: 'maven'

gradle.taskGraph.whenReady { taskGraph ->
def pomTask = taskGraph.getAllTasks().find {
it.path == ":$project.name:generatePomFileForReleasePublication"
}

if (pomTask == null)
return

pomTask.doLast {
file("build/publications/maven/pom-default.xml").delete()
println 'Overriding pom-file to make sure we can sync to maven central!'
pom {
//noinspection GroovyAssignabilityCheck
project {
name "$project.name"
artifactId ARTIFACT_ID
packaging 'aar'
description DESCRIPTION
url SITE_URL
version VERSION_NAME

scm {
url GIT_URL
connection GIT_URL
developerConnection GIT_URL
}

licenses {
license {
name LICENSE
}
}

developers {
developer {
id DEVELOPER_ID
name DEVELOPER_NAME
email DEVELOPER_EMAIL
}
}
}
}.writeTo("build/publications/maven/pom-default.xml")
}
}
}
allprojects {
def properties = new Properties()
properties.load(new FileInputStream(new File(rootDir, "version.properties")))
def major = properties['version.major'] as int
def minor = properties['version.minor'] as int
def patch = properties['version.patch'] as int
def suffix = properties['version.suffix']?.toString()?.trim() ?: ""
def snapshot = properties['version.snapshot'].toBoolean()

ext.libraryVersion = "$major.$minor.$patch" + (suffix.isAllWhitespace() ? '' : "-$suffix") + (snapshot ? '-RC' : '')
ext.group = 'io.palaima.debugdrawer'
ext.override = snapshot

ext.dryRun = properties['version.dryRun'].toBoolean()
ext.publish = properties['version.publish'].toBoolean()

ext.minSdkVersion = 16
ext.compileSdkVersion = 27
ext.targetSdkVersion = 27
ext.buildToolsVersion = '27.0.1'

ext.supportVersion = '27.0.2'
ext.butterknifeVersion = '8.4.0'
ext.glideVersion = '3.7.0'
ext.picassoVersion = '2.5.2'
ext.picasso2Okhttp3Downloader = '1.0.2'
ext.playServiceVersion = '11.8.0'
ext.timberVersion = '4.6.0'
ext.okhttpVersion = '3.4.1'
ext.okhttp2Version = '2.7.0'
ext.scalpelVersion = '1.1.2'
ext.taktVersion = '1.0.2'
ext.leakCanaryVersion = '1.5.4'
ext.lynxVersion = '1.1.0'
ext.chukVersion = '1.1.0'

ext.bintrayRepo = snapshot ? 'snapshots' : 'maven'
ext.orgName = 'palaima'

ext.publishedGroupId = 'io.palaima.debugdrawer'

ext.siteUrl = 'https://github.com/palaima/DebugDrawer'
ext.gitUrl = 'https://github.com/palaima/DebugDrawer.git'

ext.developerId = 'palaima'
ext.developerName = 'Mantas Palaima'
ext.developerEmail = '[email protected]'

ext.licenseName = 'The Apache Software License, Version 2.0'
ext.licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
ext.allLicenses = ["Apache-2.0"]

ext.githubRepo = 'palaima/DebugDrawer'
ext.githubReleaseNotesFile = 'README.md'
}

if (JavaVersion.current().isJava8Compatible()) {
Expand Down
16 changes: 5 additions & 11 deletions debugdrawer-actions/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,10 @@ dependencies {
}

ext {
ARTIFACT_ID = 'debugdrawer-actions'
DESCRIPTION = 'Debug Drawer Actions Module'
libraryName = 'Debug Drawer Actions Module'
artifact = 'debugdrawer-actions'
libraryDescription = 'Android Debug Drawer Actions Module'
}

apply plugin: 'com.novoda.bintray-release'
publish {
artifactId = ARTIFACT_ID
desc = DESCRIPTION
userOrg = "$rootProject.ext.DEVELOPER_ID"
groupId = "$rootProject.ext.GROUP_NAME"
publishVersion = "$rootProject.ext.VERSION_NAME"
website = "$rootProject.ext.SITE_URL"
}
apply from: rootProject.file('gradle/install-v1.gradle')
apply from: rootProject.file('gradle/bintray-android-v1.gradle')
16 changes: 5 additions & 11 deletions debugdrawer-base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,10 @@ dependencies {
}

ext {
ARTIFACT_ID = 'debugdrawer-base'
DESCRIPTION = 'Debug Drawer Base Module'
libraryName = 'Debug Drawer Base Module'
artifact = 'debugdrawer-base'
libraryDescription = 'Android Debug Drawer Base Module'
}

apply plugin: 'com.novoda.bintray-release'
publish {
artifactId = ARTIFACT_ID
desc = DESCRIPTION
userOrg = "$rootProject.ext.DEVELOPER_ID"
groupId = "$rootProject.ext.GROUP_NAME"
publishVersion = "$rootProject.ext.VERSION_NAME"
website = "$rootProject.ext.SITE_URL"
}
apply from: rootProject.file('gradle/install-v1.gradle')
apply from: rootProject.file('gradle/bintray-android-v1.gradle')
16 changes: 5 additions & 11 deletions debugdrawer-commons/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,10 @@ dependencies {
}

ext {
ARTIFACT_ID = 'debugdrawer-commons'
DESCRIPTION = 'Debug Drawer Commons Module'
libraryName = 'Debug Drawer Commons Module'
artifact = 'debugdrawer-commons'
libraryDescription = 'Android Debug Drawer Commons Module'
}

apply plugin: 'com.novoda.bintray-release'
publish {
artifactId = ARTIFACT_ID
desc = DESCRIPTION
userOrg = "$rootProject.ext.DEVELOPER_ID"
groupId = "$rootProject.ext.GROUP_NAME"
publishVersion = "$rootProject.ext.VERSION_NAME"
website = "$rootProject.ext.SITE_URL"
}
apply from: rootProject.file('gradle/install-v1.gradle')
apply from: rootProject.file('gradle/bintray-android-v1.gradle')
16 changes: 5 additions & 11 deletions debugdrawer-fps/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,10 @@ dependencies {
}

ext {
ARTIFACT_ID = 'debugdrawer-fps'
DESCRIPTION = 'Debug Drawer FPS Module'
libraryName = 'Debug Drawer FPS Module'
artifact = 'debugdrawer-fps'
libraryDescription = 'Android Debug Drawer FPS Module'
}

apply plugin: 'com.novoda.bintray-release'
publish {
artifactId = ARTIFACT_ID
desc = DESCRIPTION
userOrg = "$rootProject.ext.DEVELOPER_ID"
groupId = "$rootProject.ext.GROUP_NAME"
publishVersion = "$rootProject.ext.VERSION_NAME"
website = "$rootProject.ext.SITE_URL"
}
apply from: rootProject.file('gradle/install-v1.gradle')
apply from: rootProject.file('gradle/bintray-android-v1.gradle')
16 changes: 5 additions & 11 deletions debugdrawer-glide/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,10 @@ dependencies {
}

ext {
ARTIFACT_ID = 'debugdrawer-glide'
DESCRIPTION = 'Debug Drawer Glide Module'
libraryName = 'Debug Drawer Glide Module'
artifact = 'debugdrawer-glide'
libraryDescription = 'Android Debug Drawer Glide Module'
}

apply plugin: 'com.novoda.bintray-release'
publish {
artifactId = ARTIFACT_ID
desc = DESCRIPTION
userOrg = "$rootProject.ext.DEVELOPER_ID"
groupId = "$rootProject.ext.GROUP_NAME"
publishVersion = "$rootProject.ext.VERSION_NAME"
website = "$rootProject.ext.SITE_URL"
}
apply from: rootProject.file('gradle/install-v1.gradle')
apply from: rootProject.file('gradle/bintray-android-v1.gradle')
16 changes: 5 additions & 11 deletions debugdrawer-location/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,10 @@ dependencies {
}

ext {
ARTIFACT_ID = 'debugdrawer-location'
DESCRIPTION = 'Debug Drawer Location Module'
libraryName = 'Debug Drawer Location Module'
artifact = 'debugdrawer-location'
libraryDescription = 'Android Debug Drawer Location Module'
}

apply plugin: 'com.novoda.bintray-release'
publish {
artifactId = ARTIFACT_ID
desc = DESCRIPTION
userOrg = "$rootProject.ext.DEVELOPER_ID"
groupId = "$rootProject.ext.GROUP_NAME"
publishVersion = "$rootProject.ext.VERSION_NAME"
website = "$rootProject.ext.SITE_URL"
}
apply from: rootProject.file('gradle/install-v1.gradle')
apply from: rootProject.file('gradle/bintray-android-v1.gradle')
16 changes: 5 additions & 11 deletions debugdrawer-logs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,10 @@ dependencies {
}

ext {
ARTIFACT_ID = 'debugdrawer-logs'
DESCRIPTION = 'Debug Drawer Logs Module'
libraryName = 'Debug Drawer Logs Module'
artifact = 'debugdrawer-logs'
libraryDescription = 'Android Debug Drawer Logs Module'
}

apply plugin: 'com.novoda.bintray-release'
publish {
artifactId = ARTIFACT_ID
desc = DESCRIPTION
userOrg = "$rootProject.ext.DEVELOPER_ID"
groupId = "$rootProject.ext.GROUP_NAME"
publishVersion = "$rootProject.ext.VERSION_NAME"
website = "$rootProject.ext.SITE_URL"
}
apply from: rootProject.file('gradle/install-v1.gradle')
apply from: rootProject.file('gradle/bintray-android-v1.gradle')
16 changes: 5 additions & 11 deletions debugdrawer-network-quality/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,10 @@ dependencies {
}

ext {
ARTIFACT_ID = 'debugdrawer-network-quality'
DESCRIPTION = 'Debug Drawer Network Quality Module'
libraryName = 'Debug Drawer Network Quality Module'
artifact = 'debugdrawer-network-quality'
libraryDescription = 'Android Debug Drawer Network Quality Module'
}

apply plugin: 'com.novoda.bintray-release'
publish {
artifactId = ARTIFACT_ID
desc = DESCRIPTION
userOrg = "$rootProject.ext.DEVELOPER_ID"
groupId = "$rootProject.ext.GROUP_NAME"
publishVersion = "$rootProject.ext.VERSION_NAME"
website = "$rootProject.ext.SITE_URL"
}
apply from: rootProject.file('gradle/install-v1.gradle')
apply from: rootProject.file('gradle/bintray-android-v1.gradle')
16 changes: 5 additions & 11 deletions debugdrawer-no-op/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,10 @@ dependencies {
}

ext {
ARTIFACT_ID = 'debugdrawer-no-op'
DESCRIPTION = 'Debug Drawer no-op'
libraryName = 'Debug Drawer No-Op'
artifact = 'debugdrawer-no-op'
libraryDescription = 'Android Debug Drawer No-Op'
}

apply plugin: 'com.novoda.bintray-release'
publish {
artifactId = ARTIFACT_ID
desc = DESCRIPTION
userOrg = "$rootProject.ext.DEVELOPER_ID"
groupId = "$rootProject.ext.GROUP_NAME"
publishVersion = "$rootProject.ext.VERSION_NAME"
website = "$rootProject.ext.SITE_URL"
}
apply from: rootProject.file('gradle/install-v1.gradle')
apply from: rootProject.file('gradle/bintray-android-v1.gradle')
Loading

0 comments on commit 6856e2d

Please sign in to comment.