diff options
author | Tomasz Kramkowski <tomasz@kramkow.ski> | 2023-04-21 23:50:38 +0100 |
---|---|---|
committer | Tomasz Kramkowski <tomasz@kramkow.ski> | 2023-04-21 23:50:38 +0100 |
commit | 16a36c812fabda812ecf3aaa7f12fa6f44c66b2e (patch) | |
tree | ccae60abf8301ae451cfa1f21c33b8a62d5306cf /R.jar.do | |
parent | db091bfd1db36ab66340ccad2eb7b6393a0aa3da (diff) | |
download | android-jetpack-compose-redo-master.tar.gz android-jetpack-compose-redo-master.tar.xz android-jetpack-compose-redo-master.zip |
Diffstat (limited to 'R.jar.do')
-rwxr-xr-x | R.jar.do | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/R.jar.do b/R.jar.do new file mode 100755 index 0000000..ea07012 --- /dev/null +++ b/R.jar.do @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +set -e +redo-ifchange R.zip .vars.rc packages.rc +. ./.vars.rc +. ./packages.rc +javas=() +for package in "${!packages[@]}"; do + if [[ $(package_ext "$package") != "aar" ]]; then continue; fi + javas+=("pkg/$package.java") +done +android=$PLATFORM/android.jar +redo-ifchange "$JAVAC" "$android" "${javas[@]}" +tmp=$(mktemp -d) +trap 'rm -rf "$tmp"' EXIT +7z e -so R.zip R.java >"$tmp/R.java" +sources=("$tmp/R.java") +for f in "${javas[@]}"; do + if [[ ! -r $f ]]; then continue; fi + dir="$tmp/${#sources[@]}" + mkdir "$dir" + cp "$f" "$dir/R.java" + sources+=("$dir/R.java") +done +mkdir "$tmp/compiled" +"$JAVAC" -source 8 -target 8 -bootclasspath "$android" -d "$tmp/compiled" "${sources[@]}" +jar --create --no-compress --date=2000-01-01T00:00:00Z --file "$3" -C "$tmp/compiled" . +# vim:ft=bash |