Skip to content

Commit

Permalink
publish to bintray, so I can test compatibility with gradle6
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto committed Feb 26, 2020
1 parent 97e770b commit a3fa7ec
Showing 1 changed file with 49 additions and 44 deletions.
93 changes: 49 additions & 44 deletions plugin/core/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,62 +7,67 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.novoda:gradle-build-properties-plugin:0.4.1'
// classpath 'com.novoda:gradle-build-properties-plugin:0.4.1'
classpath 'com.novoda:bintray-release:+'
}
}

apply plugin: 'com.novoda.build-properties'
//apply plugin: 'com.novoda.build-properties'
apply plugin: 'com.novoda.bintray-release'

buildProperties {
cli {
using(project)
}

bintray {
using(bintrayCredentials()).or(cli)
description = '''This should contain the following properties:
- bintrayOrg: name of the Bintray organisation to deploy the artifacts to
- bintrayRepo: name of the repo of the organisation to deploy the artifacts to
- bintrayUser: name of the account used to deploy the artifacts
- bintrayKey: API key of the account used to deploy the artifacts
'''.stripIndent()
}

publish {
using(['version': "${generateVersion()}"]).or(project.buildProperties.bintray)
}
}
//buildProperties {
// cli {
// using(project)
// }
//
// bintray {
// using(bintrayCredentials()).or(cli)
// description = '''This should contain the following properties:
// - bintrayOrg: name of the Bintray organisation to deploy the artifacts to
// - bintrayRepo: name of the repo of the organisation to deploy the artifacts to
// - bintrayUser: name of the account used to deploy the artifacts
// - bintrayKey: API key of the account used to deploy the artifacts
// '''.stripIndent()
// }
//
// publish {
// using(['version': "${generateVersion()}"]).or(project.buildProperties.bintray)
// }
//}

// publish to https://dl.bintray.com/maranda/maven
publish {
groupId = 'com.novoda'
artifactId = rootProject.name
desc = 'Super duper easy way to release your Android and other artifacts to bintray'
website = "https://github.com/novoda/${rootProject.name}"
website = "https://github.com/marandaneto/${rootProject.name}"

version = project.buildProperties.publish['version'].string
publishVersion = project.buildProperties.publish['version'].string
bintrayUser = project.buildProperties.publish['bintrayUser'].string
bintrayKey = project.buildProperties.publish['bintrayKey'].string
repoName = project.buildProperties.publish['bintrayRepo'].string
userOrg = project.buildProperties.publish['bintrayOrg'].string
}

def bintrayCredentials() {
return isDryRun() ?
['bintrayOrg': 'n/a', 'bintrayRepo': 'n/a', 'bintrayUser': 'n/a', 'bintrayKey': 'n/a'] :
new File("${System.getenv('BINTRAY_PROPERTIES')}")
}
// version = project.buildProperties.publish['version'].string
// publishVersion = project.buildProperties.publish['version'].string
// bintrayUser = project.buildProperties.publish['bintrayUser'].string
// bintrayKey = project.buildProperties.publish['bintrayKey'].string
// repoName = project.buildProperties.publish['bintrayRepo'].string
// userOrg = project.buildProperties.publish['bintrayOrg'].string

def generateVersion() {
return isSnapshot() ? "develop-${System.getenv('BUILD_NUMBER') ?: 'LOCAL'}" : project.version
version = '1.0.0'
publishVersion = '1.0.0'
userOrg = 'maranda'
}

boolean isDryRun() {
project.buildProperties.cli['dryRun'].or(true).boolean
}

boolean isSnapshot() {
project.buildProperties.cli['bintraySnapshot'].or(false).boolean
}
//def bintrayCredentials() {
// return isDryRun() ?
// ['bintrayOrg': 'n/a', 'bintrayRepo': 'n/a', 'bintrayUser': 'n/a', 'bintrayKey': 'n/a'] :
// new File("${System.getenv('BINTRAY_PROPERTIES')}")
//}
//
//def generateVersion() {
// return isSnapshot() ? "develop-${System.getenv('BUILD_NUMBER') ?: 'LOCAL'}" : project.version
//}
//
//boolean isDryRun() {
// project.buildProperties.cli['dryRun'].or(true).boolean
//}
//
//boolean isSnapshot() {
// project.buildProperties.cli['bintraySnapshot'].or(false).boolean
//}

0 comments on commit a3fa7ec

Please sign in to comment.