From d2751210cb6733c60e549d9342a2698ff8b73f54 Mon Sep 17 00:00:00 2001 From: SteWers <42718143+SteWers@users.noreply.github.com> Date: Tue, 31 Dec 2024 17:02:11 +0100 Subject: [PATCH] Add build time to self-compiled builds (#846) Add build time to self-compiled builds --- app/build.gradle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 1e6056881..bebe8ceb3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -30,6 +30,8 @@ def GITHUB_BRANCH = System.env.GITHUB_REF?.replaceFirst("^refs/.*/", "") def runProguardInDebug = false def isRunningOnCI = System.getenv("CI") == "true" +final BUILD_DATE = new Date().toZonedDateTime().toEpochSecond() + android { namespace 'me.hufman.androidautoidrive' @@ -54,7 +56,7 @@ android { // testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner 'me.hufman.androidautoidrive.DexOpenerAndroidJUnitRunner' archivesBaseName = "androidautoidrive-${androidGitVersion.name()}" - buildConfigField "long", "COMMIT_TIME", ((grgit != null && !androidGitVersion.name().contains("-dirty")) ? grgit.head().dateTime.toEpochSecond() : 0L) + "L" + buildConfigField "long", "COMMIT_TIME", ((grgit != null && !androidGitVersion.name().contains("-dirty")) ? grgit.head().dateTime.toEpochSecond() : BUILD_DATE) + "L" manifestPlaceholders = [ spotify_api_key: System.env.AndroidAutoIdrive_SpotifyApiKey ? System.env.AndroidAutoIdrive_SpotifyApiKey : AndroidAutoIdrive_SpotifyApiKey, appAuthRedirectScheme: applicationId