From f7abc03daca6e81747066f297b7a5f8f64abe9b0 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 17 Jul 2020 00:44:51 -0700 Subject: [PATCH] Move copy util_functions.sh from Python scripts to gradle --- app/build.gradle.kts | 7 +++++++ build.py | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 6380c98e5..bd57d1d8b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -69,6 +69,13 @@ androidExtensions { isExperimental = true } +val copyUtils = tasks.register("copyUtils", Copy::class) { + from(rootProject.file("scripts/util_functions.sh")) + into("src/main/res/raw") +} + +tasks["preBuild"]?.dependsOn(copyUtils) + dependencies { implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) implementation(project(":app:shared")) diff --git a/build.py b/build.py index f3d6760e8..2a19b78b7 100755 --- a/build.py +++ b/build.py @@ -350,10 +350,6 @@ def build_apk(args, module): def build_app(args): header('* Building Magisk Manager') - source = op.join('scripts', 'util_functions.sh') - target = op.join('app', 'src', 'main', - 'res', 'raw', 'util_functions.sh') - cp(source, target) build_apk(args, 'app')