Skip to content
This repository has been archived by the owner on Aug 27, 2021. It is now read-only.

Commit

Permalink
Add manifest generation
Browse files Browse the repository at this point in the history
this will dynamically generate the removes files and setup the local_manifest folder for the user. 

     . build/envsetup.sh
     anbox-generate-manifest
  • Loading branch information
electrikjesus committed Jul 31, 2021
1 parent 5d910fb commit 0f8699a
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
anbox-halium/
tmp/
95 changes: 95 additions & 0 deletions manifest_scripts/generate-remove-project.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#
# Copyright (C) 2021 The BlissLabs
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

rompath="$PWD"
vendor_path="anbox"
temp_path="$rompath/vendor/$vendor_path/tmp/"
config_type="$1"

#setup colors
red=`tput setaf 1`
green=`tput setaf 2`
yellow=`tput setaf 3`
blue=`tput setaf 4`
purple=`tput setaf 5`
teal=`tput setaf 6`
light=`tput setaf 7`
dark=`tput setaf 8`
ltred=`tput setaf 9`
ltgreen=`tput setaf 10`
ltyellow=`tput setaf 11`
ltblue=`tput setaf 12`
ltpurple=`tput setaf 13`
CL_CYN=`tput setaf 12`
CL_RST=`tput sgr0`
reset=`tput sgr0`

addRemove() {
#~ echo "Adding $1"
echo -e "\t$1" >> "$temp_path/01-remove.xml"
}

readFile() {
echo -e ${reset}""${reset}
echo -e ${green}"00-remove.xml generation starting..."${reset}
echo -e ${reset}""${reset}

while IFS= read -r rpitem; do
if grep -RlZ "$rpitem" $rompath/.repo/manifests/; then
echo -e ${yellow}" ROM already includes: $rpitem"${reset}
else
prefix="<remove-project name="
suffix=" />"
item=${rpitem#"$prefix"}
item=${item%"$suffix"}
if grep -RlZ "$item" $rompath/.repo/manifests/; then
addRemove "$rpitem"
fi
fi
done < $rompath/vendor/$vendor_path/manifest_scripts/remove.lst
}


if [ -d $temp_path ]; then
echo -e ${reset}""${reset}
echo -e ${teal}"Temp Path Already Created, cleaning up"${reset}
echo -e ${reset}""${reset}
rm -rf "$temp_path/01-remove.xml"
else
mkdir -p "$temp_path"
fi

if [ -d $rompath/.repo/local_manifests/ ]; then
echo -e ${reset}""${reset}
echo -e ${teal}"local_manifests Path Already Created"${reset}
else
mkdir -p "$rompath/.repo/local_manifests/"
fi

echo -e '<?xml version="1.0" encoding="UTF-8"?>' > "$temp_path/01-remove.xml"
echo -e '<manifest>' >> "$temp_path/01-remove.xml"

readFile

echo -e '</manifest>' >> "$temp_path/01-remove.xml"

cp -r "$temp_path/01-remove.xml" $rompath/.repo/local_manifests/

cp -r $rompath/vendor/$vendor_path/manifest_scripts/manifests/*.xml $rompath/.repo/local_manifests

echo -e ${reset}""${reset}
echo -e ${green}"manifest generation complete. Files have been copied to $rompath/.repo/local_manifests"${reset}
echo -e ${reset}""${reset}
7 changes: 7 additions & 0 deletions manifest_scripts/manifests/00-remotes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<manifest>

<!-- Remotes -->
<remote name="ghub" fetch="https://github.com/" />

</manifest>
29 changes: 29 additions & 0 deletions manifest_scripts/manifests/02-waydroid.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<manifest>

<project path="system/libhidl" name="Anbox-halium/android_system_libhidl" remote="github" revision="refs/heads/lineage-17.1" />
<project path="system/libhwbinder" name="Anbox-halium/android_system_libhwbinder" remote="github" revision="refs/heads/lineage-17.1" />
<project path="external/libdrm" name="Anbox-halium/android_external_libdrm" remote="github" revision="refs/heads/lineage-17.1" />
<project path="external/mesa3d" name="Anbox-halium/android_external_mesa3d" remote="github" revision="refs/heads/lineage-17.1" />
<project path="hardware/intel/common/libva" name="Anbox-halium/android_hardware_intel_common_libva" remote="github" revision="refs/heads/lineage-17.1" />

<!-- Anbox Projects -->
<project path="vendor/anbox" name="Anbox-halium/anbox-patches" remote="github" revision="refs/heads/lineage-17.1" />
<project path="vendor/anbox/anbox-halium" name="Anbox-halium/anbox-halium" remote="github" revision="refs/heads/lineage-17.1" />
<project path="device/halium/anbox" name="Anbox-halium/android_device_halium_anbox" remote="github" revision="refs/heads/lineage-17.1" />
<project path="hardware/anbox/interfaces" name="Anbox-halium/android_hardware_anbox_interfaces" remote="github" revision="refs/heads/lineage-17.1" />

<!-- Audio -->
<project path="external/alsa-lib" name="Anbox-halium/android_external_alsa-lib" remote="github" revision="refs/heads/lineage-17.1" />
<project path="external/alsa-plugins" name="Anbox-halium/android_external_alsa-plugins" remote="github" revision="refs/heads/lineage-17.1" />
<project path="external/libsndfile" name="Anbox-halium/android_external_libsndfile" remote="github" revision="refs/heads/lineage-17.1" />
<project path="external/pulseaudio" name="Anbox-halium/android_external_pulseaudio" remote="github" revision="refs/heads/lineage-17.1" />

<!-- Display -->
<project path="external/llvm90" name="Anbox-halium/android_external_llvm90" remote="github" revision="refs/heads/lineage-17.1" />

<!-- Media -->
<project path="external/ffmpeg" name="Anbox-halium/android_external_ffmpeg" remote="github" revision="refs/heads/lineage-17.1" />
<project path="external/stagefright-plugins" name="Anbox-halium/android_external_stagefright-plugins" remote="github" revision="refs/heads/lineage-17.1" />

</manifest>
5 changes: 5 additions & 0 deletions manifest_scripts/remove.lst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<remove-project name="platform/system/libhidl" />
<remove-project name="platform/system/libhwbinder" />
<remove-project name="platform/external/libdrm" />
<remove-project name="platform/external/mesa3d" />
<remove-project name="platform/hardware/intel/common/libva" />
7 changes: 7 additions & 0 deletions vendorsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,10 @@ function anbox-generate-props
${vendor_path}/anbox-halium/scripts/generate-props.sh

}

function anbox-generate-manifest
{

${vendor_path}/manifest_scripts/generate-remove-project.sh

}

0 comments on commit 0f8699a

Please sign in to comment.