1 #!/bin/bash 2 # 3 # Copyright 2013 The Android Open Source Project. 4 # 5 # Retrieves the current Mockito source code into the current direcory, exlcuding portions related 6 # to constructing Mock objects in the JVM. 7 8 SOURCE="git://github.com/mockito/mockito.git" 9 INCLUDE=" 10 LICENSE 11 src 12 " 13 14 EXCLUDE=" 15 src/org/mockito/internal/creation/cglib 16 src/org/mockito/internal/creation/jmock 17 src/org/mockito/internal/creation/AbstractMockitoMethodProxy.java 18 src/org/mockito/internal/creation/AcrossJVMSerializationFeature.java 19 src/org/mockito/internal/creation/CglibMockMaker.java 20 src/org/mockito/internal/creation/DelegatingMockitoMethodProxy.java 21 src/org/mockito/internal/creation/MethodInterceptorFilter.java 22 src/org/mockito/internal/creation/MockitoMethodProxy.java 23 src/org/mockito/internal/creation/SerializableMockitoMethodProxy.java 24 src/org/mockito/internal/invocation/realmethod/FilteredCGLIBProxyRealMethod.java 25 src/org/mockito/internal/invocation/realmethod/CGLIBProxyRealMethod.java 26 src/org/mockito/internal/invocation/realmethod/HasCGLIBMethodProxy.java 27 " 28 29 working_dir="$(mktemp -d)" 30 trap "echo \"Removing temporary directory\"; rm -rf $working_dir" EXIT 31 32 echo "Fetching Mockito source into $working_dir" 33 git clone $SOURCE $working_dir/source 34 35 for include in ${INCLUDE}; do 36 echo "Updating $include" 37 rm -rf $include 38 cp -R $working_dir/source/$include . 39 done; 40 41 for exclude in ${EXCLUDE}; do 42 echo "Excluding $exclude" 43 rm -r $exclude 44 done; 45 46 echo "Done" 47 48