mirror of
https://github.com/architectury/architectury-api.git
synced 2026-03-28 03:56:59 -05:00
Fix buildscript
This commit is contained in:
62
build.gradle
62
build.gradle
@@ -37,6 +37,35 @@ allprojects {
|
||||
|
||||
ignoreFailures = true
|
||||
}
|
||||
|
||||
ext {
|
||||
releaseChangelog = {
|
||||
def dateFormat = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm")
|
||||
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"))
|
||||
def branch
|
||||
if (System.env.BRANCH_NAME) {
|
||||
branch = System.env.BRANCH_NAME
|
||||
branch = branch.substring(branch.lastIndexOf("/") + 1)
|
||||
} else {
|
||||
branch = "git rev-parse --abbrev-ref HEAD".execute().in.text.trim()
|
||||
}
|
||||
if (branch == "HEAD") {
|
||||
branch = "git rev-parse --short HEAD".execute().in.text.trim()
|
||||
}
|
||||
def time = dateFormat.format(new Date())
|
||||
def changes = new StringBuilder()
|
||||
changes << "<h2>Architectury v$project.version for $project.supported_version</h2>Updated at <b>$time</b>.<br><a href=\"https://www.github.com/architectury/architectury/commits/$branch\">Click here for changelog</a>"
|
||||
def proc = "git log --max-count=200 --pretty=format:%s".execute()
|
||||
proc.in.eachLine { line ->
|
||||
def processedLine = line.toString()
|
||||
if (!processedLine.contains("New translations") && !processedLine.contains("Merge") && !processedLine.contains("branch")) {
|
||||
changes << "<br>- ${processedLine.capitalize()}"
|
||||
}
|
||||
}
|
||||
proc.waitFor()
|
||||
return changes.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task licenseFormatAll
|
||||
@@ -58,35 +87,4 @@ bintray {
|
||||
}
|
||||
}
|
||||
|
||||
def releaseChangelog = "No changelog"
|
||||
task curseforgePublish {
|
||||
def dateFormat = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm")
|
||||
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"))
|
||||
def branch
|
||||
if (System.env.BRANCH_NAME) {
|
||||
branch = System.env.BRANCH_NAME
|
||||
branch = branch.substring(branch.lastIndexOf("/") + 1)
|
||||
} else {
|
||||
branch = "git rev-parse --abbrev-ref HEAD".execute().in.text.trim()
|
||||
}
|
||||
if (branch == "HEAD") {
|
||||
branch = "git rev-parse --short HEAD".execute().in.text.trim()
|
||||
}
|
||||
def time = dateFormat.format(new Date())
|
||||
def changes = new StringBuilder()
|
||||
changes << "<h2>Architectury v$project.version for $project.supported_version</h2>Updated at <b>$time</b>.<br><a href=\"https://www.github.com/architectury/architectury/commits/$branch\">Click here for changelog</a>"
|
||||
def proc = "git log --max-count=200 --pretty=format:%s".execute()
|
||||
proc.in.eachLine { line ->
|
||||
def processedLine = line.toString()
|
||||
if (!processedLine.contains("New translations") && !processedLine.contains("Merge") && !processedLine.contains("branch")) {
|
||||
changes << "<br>- ${processedLine.capitalize()}"
|
||||
}
|
||||
}
|
||||
proc.waitFor()
|
||||
releaseChangelog = changes.toString()
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
// curseforgePublish.dependsOn project("fabric").tasks.getByName("curseforge")
|
||||
// curseforgePublish.dependsOn project("forge").tasks.getByName("curseforge")
|
||||
}
|
||||
task curseforgePublish
|
||||
@@ -69,7 +69,7 @@ curseforge {
|
||||
id = "419697"
|
||||
releaseType = "release"
|
||||
changelogType = "html"
|
||||
changelog = rootProject.releaseChangelog
|
||||
changelog = releaseChangelog()
|
||||
addGameVersion "1.16-Snapshot"
|
||||
addGameVersion "1.16.4"
|
||||
addGameVersion "Java 8"
|
||||
@@ -89,4 +89,6 @@ curseforge {
|
||||
forgeGradleIntegration = false
|
||||
javaVersionAutoDetect = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.tasks.getByName("curseforgePublish").dependsOn curseforge
|
||||
@@ -89,7 +89,7 @@ curseforge {
|
||||
id = "419699"
|
||||
releaseType = "release"
|
||||
changelogType = "html"
|
||||
changelog = rootProject.releaseChangelog
|
||||
changelog = releaseChangelog()
|
||||
addGameVersion "1.16.4"
|
||||
addGameVersion "Java 8"
|
||||
addGameVersion "Forge"
|
||||
@@ -108,4 +108,6 @@ curseforge {
|
||||
forgeGradleIntegration = false
|
||||
javaVersionAutoDetect = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.tasks.getByName("curseforgePublish").dependsOn curseforge
|
||||
Reference in New Issue
Block a user