mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 22:15:45 +00:00
Update indra to v4
This commit is contained in:
6 files changed
+10
-7
No files matched your search
@@ -1,7 +1,6 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import net.kyori.indra.git.IndraGitExtension
|
||||
import org.apache.tools.ant.filters.ReplaceTokens
|
||||
import org.eclipse.jgit.lib.Repository
|
||||
import org.gradle.accessors.dm.LibrariesForLibs
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.Task
|
||||
@@ -100,7 +99,7 @@ fun ShadowJar.configureShadowJar() {
|
||||
}
|
||||
|
||||
fun Project.lastCommitHash(): String =
|
||||
the<IndraGitExtension>().commit()?.name?.substring(0, 7)
|
||||
the<IndraGitExtension>().commit().orNull?.name?.substring(0, 7)
|
||||
?: error("Could not determine commit hash")
|
||||
|
||||
fun Project.decorateVersion() {
|
||||
@@ -120,10 +119,7 @@ fun Project.currentBranch(): String {
|
||||
|
||||
val indraGit = the<IndraGitExtension>().takeIf { it.isPresent }
|
||||
|
||||
val ref = indraGit?.git()?.repository?.exactRef("HEAD")?.target
|
||||
?: return "detached-head"
|
||||
|
||||
return Repository.shortenRefName(ref.name)
|
||||
return indraGit?.branchName()?.orNull ?: "detached-head"
|
||||
}
|
||||
|
||||
val Project.libs: LibrariesForLibs
|
||||
|
||||
Reference in new issue
Block a user