nice new tool to show version of feisty meow
[feisty_meow.git] / scripts / buildor / gffs_builders.sh
1 #!/bin/bash
2
3 source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
4
5 #hmmm: if this works well, we can use it in lots of places.
6 define_yeti_alias BAIL_ON_FAIL='if [ $? -ne 0 ]; then echo "A problem occurred.  $msg"; return 1; fi'
7
8 function zapem()
9 {
10   bash $GFFS_TOOLKIT_ROOT/library/zap_genesis_javas.sh 
11 }
12
13 # a macro for testing the configuration.
14 export GFFS_CHECK_VARS='
15   if [ -z "$GENII_INSTALL_DIR" -o -z "$GFFS_TOOLKIT_ROOT" ]; then
16     echo "GENII_INSTALL_DIR or GFFS_TOOLKIT_ROOT is not set.";
17     return 1;
18   fi '
19
20 function build_gffs()
21 {
22   eval $GFFS_CHECK_VARS
23   #zapem
24   pushd "$GENII_INSTALL_DIR"
25   if [ $? -ne 0 ]; then
26     popd
27     error_sound
28     return 1
29   fi
30   echo "Build starting at: $(date)"
31
32   # clean up some things.
33   \rm -rf unit-test-reports
34
35   # build the trunk.
36   ant -Dbuild.targetArch=64 build
37   if [ $? -ne 0 ]; then
38     popd
39     error_sound
40     return 1
41   fi
42   echo "Build done at: $(date)"
43   popd
44
45   success_sound  
46 }
47
48 function rebuild_gffs()
49 {
50   eval $GFFS_CHECK_VARS
51   #zapem
52   pushd "$GENII_INSTALL_DIR"
53   ant clean
54   popd
55   if [ $? -ne 0 ]; then
56     error_sound
57     return 1
58   fi
59   build_gffs
60 }
61
62 # a shortcut for doing a new build and creating a bootstrap container with it.
63 function rebu_bootstrap()
64 {
65   eval $GFFS_CHECK_VARS
66   rebuild_gffs 
67   if [ $? -ne 0 ]; then echo "failed to rebuild gffs code"; return 1; fi
68
69   quickstarter="$GENII_INSTALL_DIR/toolkit/library/bootstrap_quick_start.sh"
70   if [ ! -f "$quickstarter" ]; then
71     quickstarter="$GFFS_TOOLKIT_ROOT/library/bootstrap_quick_start.sh"
72   fi
73
74   bash "$quickstarter"
75   if [ $? -ne 0 ]; then
76     echo "failed to bootstrap a container."
77     error_sound
78     return 1
79   fi
80
81   success_sound  
82 }
83
84 # a shortcut for building without a clean, and creating a bootstrap container with the code.
85 function bu_bootstrap()
86 {
87   eval $GFFS_CHECK_VARS
88   build_gffs 
89   if [ $? -ne 0 ]; then echo "failed to rebuild gffs code"; return 1; fi
90
91   quickstarter="$GENII_INSTALL_DIR/toolkit/library/bootstrap_quick_start.sh"
92   if [ ! -f "$quickstarter" ]; then
93     quickstarter="$GFFS_TOOLKIT_ROOT/library/bootstrap_quick_start.sh"
94   fi
95
96   bash "$quickstarter"
97   if [ $? -ne 0 ]; then
98     echo "failed to bootstrap a container."
99     error_sound
100     return 1
101   fi
102
103   success_sound  
104 }
105
106 # a shortcut for doing a quick build and then creating an installer.
107 function fast_install_build()
108 {
109   eval $GFFS_CHECK_VARS
110   bash "$GFFS_TOOLKIT_ROOT/tools/installer/build_installer.sh" $* fast
111   if [ $? -ne 0 ]; then
112     echo "failed to create the installer."
113     error_sound
114     return 1
115   fi
116
117   success_sound  
118 }
119
120