This repository has been archived by the owner on Jul 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This generally improves building experience. Some code piece is directly copied from 5ec1cff's zygisk-module-template.
- Loading branch information
Showing
3 changed files
with
99 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
buildscript { | ||
val agp_version by extra("8.5.1") | ||
} | ||
import java.io.ByteArrayOutputStream | ||
|
||
plugins { | ||
id("com.android.application") version "8.5.1" apply false | ||
} | ||
} | ||
|
||
fun String.execute(currentWorkingDir: File = file("./")): String { | ||
val byteOut = ByteArrayOutputStream() | ||
project.exec { | ||
workingDir = currentWorkingDir | ||
commandLine = split("\\s".toRegex()) | ||
standardOutput = byteOut | ||
} | ||
return String(byteOut.toByteArray()).trim() | ||
} | ||
|
||
val gitCommitCount = "git rev-list HEAD --count".execute().toInt() | ||
val gitCommitHash = "git rev-parse --verify --short HEAD".execute() | ||
|
||
val verName by extra("v0.1.0") | ||
val verCode by extra(gitCommitCount) | ||
val commitHash by extra(gitCommitHash) |