Home | History | Annotate | Download | only in scripts
      1 #! /bin/bash
      2 # Copyright (c) 2016, the R8 project authors. Please see the AUTHORS file
      3 # for details. All rights reserved. Use of this source code is governed by a
      4 # BSD-style license that can be found in the LICENSE file.
      5 
      6 # This script will update the host dx and dexmerger tools in tools/linux/dx.
      7 
      8 # Before running this script make sure the dx and dexmerger versions required are built
      9 # in ~/android/master (There are probably simpler ways to just build dx and dexmerger):
     10 #
     11 #  m -j24 build-art
     12 #
     13 # Maybe also run the Art host tests:
     14 #
     15 #  mm -j24 art-test-host
     16 #
     17 
     18 ANDROID_CHECKOUT=~/android/master
     19 ANDROID_HOST_BUILD=$ANDROID_CHECKOUT/out/host/linux-x86
     20 LINUX_TOOLS=tools/linux
     21 DX_DIR=dx
     22 DEST=$LINUX_TOOLS/$DX_DIR
     23 
     24 # Clean out the previous version of Art
     25 rm -rf $DEST
     26 
     27 # Required binaries and scripts.
     28 mkdir -p $DEST/bin
     29 cp $ANDROID_HOST_BUILD/bin/dx $DEST/bin
     30 cp $ANDROID_HOST_BUILD/bin/dexmerger $DEST/bin
     31 
     32 # Required framework files.
     33 mkdir -p $DEST/framework
     34 cp $ANDROID_HOST_BUILD/framework/dx.jar $DEST/framework
     35 
     36 # Build the tar to upload to Google Cloud Storage.
     37 DX_ARCHIVE=$DX_DIR.tar.gz
     38 pushd $LINUX_TOOLS > /dev/null
     39 rm -f $DX_ARCHIVE
     40 rm -f $DX_ARCHIVE.sha1
     41 tar caf $DX_ARCHIVE $DX_DIR
     42 popd  > /dev/null
     43 
     44 echo "New $LINUX_TOOLS/$DX_ARCHIVE archive created."
     45 echo ""
     46 echo "Now run:"
     47 echo ""
     48 echo "  cd $LINUX_TOOLS"
     49 echo "  upload_to_google_storage.py --bucket r8-deps $DX_DIR.tar.gz"
     50 echo ""
     51 echo "to upload to Google Cloud Storage"
     52