./ad2mf.sh aosp.dependencies
Last active
December 11, 2020 21:48
-
-
Save koumaza/6e1d10d89be967fa05ae4b3a31ddcefb to your computer and use it in GitHub Desktop.
Android_Dependencies to Manifest.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
set -gx srcdepend (echo $argv|awk '{print $1}') | |
set -gx spdoutput (echo $argv|awk '{print $2}') | |
if cat $srcdepend|jq . > /dev/null | |
if test -e "$spdoutput" | |
while true | |
echo -e "$spdoutput"' is exiting!'\n'Overwriting?' | |
read ugoto -p "echo -e 'Y/N > '" | |
if test $ugoto = N -o $ugoto = n | |
read spdoutput -p "echo -e 'Enter FileName > '" | |
echo -n > $spdoutput | |
set -gx outputfile $spdoutput | |
break | |
end | |
if test $ugoto = Y -o $ugoto = y | |
echo -n > $spdoutput | |
break | |
end | |
end | |
else | |
if test -z "$spdoutput" | |
set -gx spdoutput output.xml | |
echo -n > $spdoutput | |
end | |
end | |
for n in (seq 0 (math (cat $srcdepend|jq '.|length') - 1)) | |
set imrepo (cat $srcdepend|jq -r .[$n].repository) | |
set impath (cat $srcdepend|jq -r .[$n].target_path) | |
set imbrnc (cat $srcdepend|jq -r .[$n].branch) | |
set imrmte (cat $srcdepend|jq -r .[$n].remote) | |
echo "<project path=\"$impath\" name=\"$imrepo\" remote=\"$imrmte\" revision=\"$imbrnc\" />" >> $spdoutput | |
end | |
echo -e Output Completed!\nSee \"$spdoutput\" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment