mirror of
https://github.com/PaperMC/Velocity.git
synced 2024-12-09 07:01:19 +08:00
This should do it
This commit is contained in:
parent
13215f132e
commit
f6f48e9b2d
@ -58,19 +58,13 @@ publishing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
println "maven deployment: ${System.getenv("MAVEN_DEPLOYMENT")}"
|
repositories {
|
||||||
println "on branch ${project.ext.getCurrentBranchName()}"
|
maven {
|
||||||
|
name = 'myRepo'
|
||||||
if (System.getenv("MAVEN_DEPLOYMENT") != null && project.ext.getCurrentBranchName() == "master") {
|
def base = project.ext.getCurrentBranchName() == "master" ? File.createTempDir().toURI().toURL().toString() : 'file:///maven-repo'
|
||||||
repositories {
|
def releasesRepoUrl = "$base/releases"
|
||||||
maven {
|
def snapshotsRepoUrl = "$base/snapshots"
|
||||||
name = 'myRepo'
|
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
|
||||||
if (project.version.toString().endsWith("-SNAPSHOT")) {
|
|
||||||
url = "file:///maven-repo/snapshots"
|
|
||||||
} else {
|
|
||||||
url = "file:///maven-repo/releases"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user