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
8SOURCE="git://github.com/mockito/mockito.git"
9INCLUDE="
10    LICENSE
11    cglib-and-asm
12    src
13    "
14
15EXCLUDE="
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
23working_dir="$(mktemp -d)"
24trap "echo \"Removing temporary directory\"; rm -rf $working_dir" EXIT
25
26echo "Fetching Mockito source into $working_dir"
27git clone $SOURCE $working_dir/source
28
29for include in ${INCLUDE}; do
30  echo "Updating $include"
31  rm -rf $include
32  cp -R $working_dir/source/$include .
33done;
34
35for exclude in ${EXCLUDE}; do
36  echo "Excluding $exclude"
37  rm -r $exclude
38done;
39
40echo "Done"
41
42