1 #!/bin/bash 2 # 3 # Copyright 2013 The Android Open Source Project. 4 # 5 # Retrieves the current Mockito source code into the current directory, excluding portions related 6 # to mockito's internal build system and javadoc. 7 8 SOURCE="git://github.com/mockito/mockito.git" 9 INCLUDE=" 10 LICENSE 11 cglib-and-asm 12 src 13 " 14 15 EXCLUDE=" 16 cglib-and-asm/lib 17 cglib-and-asm/.project 18 cglib-and-asm/.classpath 19 cglib-and-asm/build.gradle 20 cglib-and-asm/mockito-repackaged.iml 21 " 22 23 working_dir="$(mktemp -d)" 24 trap "echo \"Removing temporary directory\"; rm -rf $working_dir" EXIT 25 26 echo "Fetching Mockito source into $working_dir" 27 git clone $SOURCE $working_dir/source 28 29 for include in ${INCLUDE}; do 30 echo "Updating $include" 31 rm -rf $include 32 cp -R $working_dir/source/$include . 33 done; 34 35 for exclude in ${EXCLUDE}; do 36 echo "Excluding $exclude" 37 rm -r $exclude 38 done; 39 40 echo "Done" 41 42