Skip to content

Commit

Permalink
rename a property to better reflect reality
Browse files Browse the repository at this point in the history
  • Loading branch information
paulk-asert committed Jan 10, 2017
1 parent f9a3c0e commit 86065a7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -61,7 +61,7 @@ buildScan {

apply from: 'gradle/filter.gradle'
apply from: 'gradle/indy.gradle'
apply from: 'gradle/bintray.gradle'
apply from: 'gradle/publish.gradle'
apply plugin: 'javadocHotfix'
apply plugin: "com.github.jk1.dependency-license-report"

Expand Down
2 changes: 1 addition & 1 deletion gradle/assemble.gradle
Expand Up @@ -41,7 +41,7 @@ ext.srcSpec = copySpec {
'cobertura.ser',
'junitvmwatcher*.properties',
'out',
'bintray.properties', // generated by the CI server
'artifactory.properties', // generated by the CI server
'gradle.properties.gz', // generated by the CI server
'**/*.iml', // used by Intellij IDEA
'**/*.ipr', // used by Intellij IDEA
Expand Down
24 changes: 12 additions & 12 deletions gradle/bintray.gradle → gradle/publish.gradle
Expand Up @@ -18,17 +18,17 @@
*/
import org.gradle.api.internal.artifacts.publish.DefaultPublishArtifact

ext.bintrayUser = project.hasProperty('bintrayUser') ? project.bintrayUser : System.getenv('BINTRAY_USER')
ext.bintrayPassword = project.hasProperty('bintrayPassword') ? project.bintrayPassword : System.getenv('BINTRAY_PASSWORD')
ext.artifactoryUser = project.hasProperty('artifactoryUser') ? project.artifactoryUser : System.getenv('ARTIFACTORY_USER')
ext.artifactoryPassword = project.hasProperty('artifactoryPassword') ? project.artifactoryPassword : System.getenv('ARTIFACTORY_PASSWORD')

if (!bintrayUser) {
if (!artifactoryUser) {
// try to read from properties
def bintrayFile = file('bintray.properties')
if (bintrayFile.exists()) {
def artifactoryFile = file('artifactory.properties')
if (artifactoryFile.exists()) {
def props = new Properties()
props.load(bintrayFile.newReader())
ext.bintrayUser = props.getProperty('bintrayUser','')
ext.bintrayPassword = props.getProperty('bintrayPassword','')
props.load(artifactoryFile.newReader())
ext.artifactoryUser = props.getProperty('artifactoryUser','')
ext.artifactoryPassword = props.getProperty('artifactoryPassword','')
}
}

Expand All @@ -38,7 +38,7 @@ allprojects {
apply plugin: 'com.jfrog.artifactory-upload'

artifactory {
contextUrl = project.hasProperty('bintrayContext') ? project.bintrayContext : 'https://oss.jfrog.org'
contextUrl = project.hasProperty('artifactoryContext') ? project.artifactoryContext : 'https://oss.jfrog.org'
resolve {
repository {
repoKey = 'libs-release'
Expand All @@ -47,11 +47,11 @@ allprojects {
publish {
excludePatterns = "org/codehaus/groovy/groovy/*/groovy-all-*,org/codehaus/groovy/groovy/*/groovy-backports-*,org/codehaus/groovy/groovy/*/groovy-binary-*"
repository {
repoKey = project.hasProperty('bintrayRepoKey') ? project.bintrayRepoKey : 'oss-snapshot-local' //The Artifactory repository key to publish to
repoKey = project.hasProperty('artifactoryRepoKey') ? project.artifactoryRepoKey : 'oss-snapshot-local' //The Artifactory repository key to publish to
//when using oss.jfrog.org the credentials are from Bintray. For local build we expect them to be found in
//~/.gradle/gradle.properties, otherwise to be set in the build server
username = rootProject.bintrayUser
password = rootProject.bintrayPassword
username = rootProject.artifactoryUser
password = rootProject.artifactoryPassword
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions gradle/upload.gradle
Expand Up @@ -17,11 +17,11 @@
* under the License.
*/

boolean isUsingBintray = rootProject.hasProperty('bintrayUser') && rootProject.bintrayUser &&
rootProject.hasProperty('bintrayPassword') && rootProject.bintrayPassword
boolean isUsingArtifactory = rootProject.hasProperty('artifactoryUser') && rootProject.artifactoryUser &&
rootProject.hasProperty('artifactoryPassword') && rootProject.artifactoryPassword

if (isUsingBintray) {
logger.lifecycle 'Deployment environment set to Bintray'
if (isUsingArtifactory) {
logger.lifecycle 'Deployment environment set to Artifactory'
}

def embedded = ['asm', 'asm-util', 'asm-analysis', 'asm-tree', 'asm-commons', 'antlr', 'commons-cli', 'openbeans']
Expand Down

0 comments on commit 86065a7

Please sign in to comment.