-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcollect_classes.sh
More file actions
executable file
·40 lines (27 loc) · 884 Bytes
/
collect_classes.sh
File metadata and controls
executable file
·40 lines (27 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
BINDIR=bin
ZIPFILE=bin.zip
# clean up from previous collections
rm -rf $BINDIR
rm $ZIPFILE
# mkdir the directory for the bins
mkdir $BINDIR
# find all of the proper folders with classes built with gradle from the command line
FOLDERS=`find . -name 'classes' | grep build | egrep -v 'reports'`
# loop through the found folders with classes
for FOLDER in $FOLDERS; do
# create the output folder
OUT_FOLDER=$BINDIR/$FOLDER
echo "creating output folder: $OUT_FOLDER"
mkdir -p $OUT_FOLDER
#CLASSES=`find $FOLDER -name '*.class' -type f`
#echo $CLASSES
# copy all of the files within the class folders to the output
echo "copying all of the files from $FOLDER to $OUT_FOLDER"
cp -rf $FOLDER/* $OUT_FOLDER
done
# create the zip file
zip -r $ZIPFILE $BINDIR
# delete the collected bins
rm -rf $BINDIR
echo "All .class files collected into $ZIPFILE"