Skip to content
This repository has been archived by the owner on Jan 27, 2025. It is now read-only.

Commit

Permalink
fix(publish): Attempting to fix publish for auth-api (datahub-project…
Browse files Browse the repository at this point in the history
  • Loading branch information
jjoyce0510 authored and cccs-Dustin committed Feb 1, 2023
1 parent 160a352 commit f1823c5
Showing 1 changed file with 0 additions and 48 deletions.
48 changes: 0 additions & 48 deletions metadata-auth/auth-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@ apply plugin: 'io.codearte.nexus-staging'
apply from: '../../metadata-integration/java/versioning.gradle'


import org.apache.tools.ant.filters.ReplaceTokens

test {
useJUnit()
}

shadowJar {
zip64 true
determineAndSetVersion()
classifier = null
archiveName = "$project.name-${version}.jar"
exclude "META-INF/*.RSA", "META-INF/*.SF","META-INF/*.DSA"
Expand All @@ -37,51 +34,6 @@ dependencies() {
testCompile externalDependency.testng
}

def determineAndSetVersion() {
def detailedVersionString = "0.0.0-unknown-SNAPSHOT"
def snapshotVersion = false
if (project.hasProperty("releaseVersion")) {
version = releaseVersion
detailedVersionString = releaseVersion
} else {
try {
// apply this plugin in a try-catch block so that we can handle cases without .git directory
apply plugin: "com.palantir.git-version"
def details = versionDetails()
detailedVersionString = gitVersion()
version = details.lastTag
version = version.startsWith("v")? version.substring(1): version
def suffix = details.isCleanTag? "": "-SNAPSHOT"
snapshotVersion = ! details.isCleanTag
}
catch (Exception e) {
e.printStackTrace()
// last fall back
version = detailedVersionString
}
}
// trim version if it is of size 4 to size 3
def versionParts = version.tokenize(".")
if (versionParts.size() > 3) {
// at-least 4 part version
// we check if the 4th part is a .0 in which case we want to create a release
if (versionParts[3] != '0') {
snapshotVersion = true
}
versionParts = versionParts[0..2]
version = versionParts[0..2].join('.')
}

if (snapshotVersion) {
if (versionParts[versionParts.size()-1].isInteger()) {
version = versionParts[0..versionParts.size()-2].join('.') + '.' + (versionParts[versionParts.size()-1].toInteger()+1).toString() + "-SNAPSHOT"
} else {
// we are unable to part the last token as an integer, so we just append SNAPSHOT to this version
version = versionParts[0..versionParts.size()-1].join('.') + '-SNAPSHOT'
}
}
}

task sourcesJar(type: Jar) {
classifier 'sources'
from sourceSets.main.allJava
Expand Down

0 comments on commit f1823c5

Please sign in to comment.