summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rw-r--r--build.sh24
1 files changed, 15 insertions, 9 deletions
diff --git a/build.sh b/build.sh
index 60e33b6..8f7df32 100644
--- a/build.sh
+++ b/build.sh
@@ -10,8 +10,6 @@ mkdir -p release/"$release_name"
jobs=$(nproc)
-repo init -u https://github.com/LineageOS/android.git -b lineage-15.1
-
function clone_or_checkout() {
local dir="$1"
local repo="$2"
@@ -29,16 +27,24 @@ function clone_or_checkout() {
fi
}
-clone_or_checkout .repo/local_manifests "$thisdir" master
-clone_or_checkout dakkar-patches "$thisdir" master
-clone_or_checkout patches https://github.com/phhusson/treble_patches android-8.1
+function setup_code() {
+ repo init -u https://github.com/LineageOS/android.git -b lineage-15.1
+
+ clone_or_checkout .repo/local_manifests "$thisdir" master
+ clone_or_checkout dakkar-patches "$thisdir" master
+ clone_or_checkout patches https://github.com/phhusson/treble_patches android-8.1
-repo sync -c -j$jobs --force-sync
+ repo sync -c -j$jobs --force-sync
-rm -f device/*/sepolicy/common/private/genfs_contexts
+ rm -f device/*/sepolicy/common/private/genfs_contexts
+
+ bash "$thidir/apply-patches.sh" patches
+ bash "$thidir/apply-patches.sh" dakkar-patches
+}
-bash "$thidir/apply-patches.sh" patches
-bash "$thidir/apply-patches.sh" dakkar-patches
+if [[ "$1" == "setup" ]]; then
+ setup_code
+fi
. build/envsetup.sh