Skip to content

Commit

Permalink
Fix artifact publishing.
Browse files Browse the repository at this point in the history
I keep ammending this commit so it doesn't look like I've been working on
this for the past three hours.
  • Loading branch information
wizjany committed Aug 6, 2016
1 parent 9aba6a2 commit 471a1c8
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,23 @@ buildscript {

dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.4.0'
classpath 'org.ajoberstar:gradle-git:1.4.2'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.3.0'
classpath 'org.ajoberstar:gradle-git:1.5.1'
}
}

allprojects {
group = 'com.sk89q.worldedit'
version = '6.1.4-SNAPSHOT'
}

if (!project.hasProperty("artifactory_contextUrl")) ext.artifactory_contextUrl = "http://localhost"
if (!project.hasProperty("artifactory_user")) ext.artifactory_user = "guest"
if (!project.hasProperty("artifactory_password")) ext.artifactory_password = ""

if (!project.hasProperty("gitCommitHash") && !JavaVersion.current().isJava6()) {
try {
def Grgit = Class.forName("org.ajoberstar.grgit.Grgit");
def Grgit_open = Grgit.getDeclaredMethod("open", File.class)
def repo = Grgit_open.invoke(null, project.file('.'))
def repo = Grgit.open(dir: '.')
ext.gitCommitHash = repo.head().abbreviatedId
} catch (Exception e) {
println "Error getting commit hash: " + e.getMessage()
Expand All @@ -59,6 +62,7 @@ artifactory {
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
ivy = false
}
}

Expand All @@ -71,6 +75,7 @@ artifactory {
}
}
}
artifactoryPublish.skip = true

subprojects {
apply plugin: 'java'
Expand All @@ -79,8 +84,6 @@ subprojects {
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.jfrog.artifactory'

group = 'com.sk89q.worldedit'
version = '6.1.4-SNAPSHOT'
ext.internalVersion = version + ";" + gitCommitHash

sourceCompatibility = 1.7
Expand Down Expand Up @@ -139,4 +142,8 @@ subprojects {
exclude '.cache'
exclude 'LICENSE*'
}

artifactoryPublish {
publishConfigs('archives')
}
}

0 comments on commit 471a1c8

Please sign in to comment.