File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
build-logic/src/main/kotlin Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,11 @@ import org.gradle.kotlin.dsl.extra
2424 * Container to memoize Git information retrieved via `git` command executions across all Gradle
2525 * projects.
2626 */
27- class GitInfo (val gitHead : String , val gitDescribe : String ) {
27+ class GitInfo (val gitHead : String , val gitDescribe : String , private val rawLinkRef : String ) {
28+
29+ fun rawGithubLink (file : String ): String =
30+ " https://raw.githubusercontent.com/apache/polaris/$rawLinkRef /$file "
31+
2832 companion object {
2933 private fun execGit (rootProject : Project , vararg args : Any ): String {
3034 val out =
@@ -56,7 +60,8 @@ class GitInfo(val gitHead: String, val gitDescribe: String) {
5660 execGit(rootProject, " describe" , " --always" , " --dirty" )
5761 }
5862 else " "
59- val gitInfo = GitInfo (gitHead, gitDescribe)
63+ val rawLinkRef = if (isRelease) gitDescribe else " HEAD"
64+ val gitInfo = GitInfo (gitHead, gitDescribe, rawLinkRef)
6065 rootProject.extra[" gitInfo" ] = gitInfo
6166 return gitInfo
6267 }
You can’t perform that action at this time.
0 commit comments