💩 Shitty code to build different various variant, to be Refactored

This commit is contained in:
Nikhil Badyal
2022-11-05 13:13:13 +05:30
parent 2d15e76ed8
commit 6a3625df3a
3 changed files with 19 additions and 4 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ jobs:
build-apk:
name: APK Build
runs-on: ubuntu-latest
timeout-minutes: 15
timeout-minutes: 20
steps:
- name: Check out Git repository
+15 -2
View File
@@ -30,9 +30,9 @@ def main() -> None:
parser.patch_app(app=app, version=version, is_experimental=is_experimental)
except Exception as e:
logger.exception(f"Failed to build {app} because of {e}")
if config.build_alternative_youtube:
if len(config.alternative_youtube_patches):
for alternative_patch in config.alternative_youtube_patches:
logger.info(f"Rebuilding youtube with ${alternative_patch}")
logger.info(f"Rebuilding youtube with inverted ${alternative_patch} patch.")
_, version, is_experimental = patcher.get_app_configs("youtube")
parser.invert_patch(alternative_patch)
parser.patch_app(
@@ -41,6 +41,19 @@ def main() -> None:
is_experimental=is_experimental,
output_prefix="-" + alternative_patch + "-",
)
if len(config.alternative_youtube_music_patches):
for alternative_patch in config.alternative_youtube_music_patches:
logger.info(
f"Rebuilding youtube music with inverted ${alternative_patch} patch."
)
_, version, is_experimental = patcher.get_app_configs("youtube_music")
parser.invert_patch(alternative_patch)
parser.patch_app(
app="youtube_music",
version=version,
is_experimental=is_experimental,
output_prefix="-" + alternative_patch + "-",
)
if __name__ == "__main__":
+3 -1
View File
@@ -58,5 +58,7 @@ class RevancedConfig:
"youtube_music": f"{self.apk_mirror_urls.get('youtube_music')}youtube-music",
}
self.archs_to_build = env.list("ARCHS_TO_BUILD", [])
self.build_alternative_youtube = env.bool("BUILD_ALTERNATIVE_YOUTUBE", False)
self.alternative_youtube_patches = env.list("ALTERNATIVE_YOUTUBE_PATCHES", [])
self.alternative_youtube_music_patches = env.list(
"ALTERNATIVE_YOUTUBE_MUSIC_PATCHES", []
)