From 2b5f64dc1eecd82b821684100959b203520049ad Mon Sep 17 00:00:00 2001 From: Aaron Veil <70171475+anddea@users.noreply.github.com> Date: Tue, 19 Mar 2024 11:49:50 +0300 Subject: [PATCH] Update build --- .gitignore | 1 + build.gradle.kts | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/.gitignore b/.gitignore index 8448060e5..49c9cf74f 100644 --- a/.gitignore +++ b/.gitignore @@ -125,3 +125,4 @@ node_modules/ # gradle properties, due to Github token ./gradle.properties .DS_Store +local.properties diff --git a/build.gradle.kts b/build.gradle.kts index 1ce7d9c0a..502e76bac 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -53,6 +53,18 @@ tasks { } } + register("updatePrefsXml") { + description = "Update revanced_prefs.xml with the new version" + + doLast { + val prefsFile = file("src/main/resources/youtube/settings/xml/revanced_prefs.xml") + val old = Regex("""Patches" (.*)summary="[^"]*"""") + val new = """Patches" $1summary="$version"""" + + prefsFile.writeText(prefsFile.readText().replace(old, new)) + } + } + register("buildDexJar") { description = "Build and add a DEX to the JAR file" group = "build" @@ -144,3 +156,7 @@ signing { sign(publishing.publications["revanced-patches-publication"]) } + +tasks.named("processResources") { + dependsOn("updatePrefsXml") +}