/[pcsx2_0.9.7]/auto_build_latest_upstream.sh
ViewVC logotype

Annotation of /auto_build_latest_upstream.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 143 - (hide annotations) (download) (as text)
Fri Sep 10 15:59:23 2010 UTC (9 years, 2 months ago) by william
File MIME type: application/x-sh
File size: 4237 byte(s)
fix BUILD_PATH saving, and add built files to svn in trunk
1 william 92 #!/bin/bash
2 william 119 . ./auto_defs.sh
3 william 92
4 william 109
5    
6 william 97 if [ "$1" != "" ] ; then
7     export OVERRIDE_TMP_BUILD_PATH="$1"
8     . ./auto_build_defs.sh
9     fi
10    
11 william 143 export OVERRIDE_TMP_BUILD_PATH_SAVE="$OVERRIDE_TMP_BUILD_PATH"
12    
13 william 134 export DISABLE_AUTO_BRANCH="0"
14     export DISABLE_PREBUILD="0"
15     export DISABLE_CLEANUP="0"
16 william 100
17 william 105 if [ "$2" == "--no-auto-branch" ] ; then
18     DISABLE_AUTO_BRANCH="1"
19 william 100 fi
20 william 101 if [ "$3" == "--no-prebuild" ] ; then
21     DISABLE_PREBUILD="1"
22     fi
23 william 103 if [ "$4" == "--no-cleanup" ] ; then
24     DISABLE_CLEANUP="1"
25     fi
26 william 100
27 william 92 # output variables
28     echo "---------------------------------------------------------------------------------------"
29     echo "AUTO BUILD CONFIG:"
30     echo
31     echo -e "\\tPCSX2 VCS BUILD PATH: $PCSX2_BUILD_TMP"
32     echo -e "\\tPCSX2 VCS PROJECT FILE: $VSC_PROJECT_FILE"
33 william 116 echo -e "\\tPCSX2 VCS BUILD VERSION: $PCSX2_VERSION"
34 william 92 echo
35 william 119 echo -e "\\tMSBUILD PATH: $VSC_MSBUILD"
36     echo -e "\\tMSBUILD OPTIONS: $VSC_MSBUILD_OPTIONS"
37     echo
38 william 92 echo "---------------------------------------------------------------------------------------"
39    
40     echo
41     echo "PERFORMING AUTOBUILD:"
42    
43 william 95
44    
45 william 96 # call auto prebuild
46 william 101 if [ "$DISABLE_PREBUILD" == "0" ] ; then
47 william 143 export PREBUILD_SUCCESS="0"
48     "$downstream_export_location/auto_prebuild_latest_upstream.sh" "$OVERRIDE_TMP_BUILD_PATH_SAVE" && PREBUILD_SUCCESS="1" || PREBUILD_SUCCESS="0"
49     if [ "$PREBUILD_SUCCESS" == "0" ] ; then
50     echo "PREBUILD FAILED!"
51     exit 1
52 william 102 fi
53 william 101 else
54 william 119 echo "PREBUILD HAS BEEN DISABLED ... to enable do not use --no-prebuild"
55     cd "$PCSX2_BUILD_TMP"
56     find -name *.pch -exec rm -f {} \;
57     echo
58 william 98 fi
59 william 92
60 william 119 # re-generate pcsx2-version.txt
61     echo "$PCSX2_VERSION" > "$PCSX2_BUILD_TMP/bin/pcsx2-version.txt"
62    
63 william 92 # START VISUAL STUDIO BUILD SUPPORT
64     export BUILD_SUCCESS=0
65     echo "PERFORMING BUILD:"
66 william 121
67     # remove log files
68     rm -f "$downstream_export_location/"$VSC_MSBUILD_LOG_FILE_PREFIX*.log
69 william 119 "$VSC_MSBUILD" $VSC_MSBUILD_OPTIONS "$VSC_PROJECT_PATH_WIN32" && BUILD_SUCCESS=0 || BUILD_SUCCESS=1
70 william 121
71 william 92 # END VISUAL STUDIO BUILD SUPPORT
72    
73     #echo "BUILD SUCCESS: $BUILD_SUCCESS"
74    
75     if [ "$BUILD_SUCCESS" == 0 ] ; then
76     echo "BUILD COMPLETED..."
77     echo
78    
79     # START POST BUILD
80     echo "PERFORMING POSTBUILD:"
81 william 119 echo -e "\\tCOPYING $PCSX2_BUILD_TMP/bin/* $downstream_export_location/trunk/bin/ ... {}"
82     cp -Rfv "$PCSX2_BUILD_TMP/bin"/* "$downstream_export_location/trunk/bin/" >/dev/null 2>/dev/null
83 william 143
84     # commit newly built files in trunk
85     cd "$downstream_export_location/trunk/bin/"
86     # add the newly built files to svn
87     find -not -path "*.svn*" \
88     -not -name "*.bsc" \
89     -not -name "*.exp" \
90     -not -name "*.ilk" \
91     -not -name "*.lib" -exec bash -c '
92     #echo "{}"
93     if [ "{}" != "." ] ; then
94     export svn_file=`echo "{}" | sed s/".\/"//`
95     export svn_need_to_add=`svn status | grep "$svn_file"`
96     if [ "$svn_need_to_add" != "" ] ; then
97     svn add "{}" >/dev/null 2>/dev/null
98     fi
99     fi
100     ' \;
101     svn commit -m "Committing Build: $PCSX2_VERSION" --non-interactive --trust-server-cert >/dev/null 2>/dev/null
102    
103    
104 william 92 echo "POSTBUILD COMPLETED..."
105     # END POST BUILD
106    
107     # CLEANUP
108     echo "PERFORMING CLEANUP"
109 william 103 if [ "$DISABLE_CLEANUP" == "0" ] ; then
110 william 119 echo -e "\\tCLEANING $PCSX2_BUILD_TMP/bin/ ... {}"
111 william 103 cd "$BUILD_TMP_DIR"
112 william 119 rm -Rf "$PCSX2_BUILD_TMP" >/dev/null 2>/dev/null
113     #rm -Rf *
114 william 103 echo "CLEANUP COMPLETE..."
115     else
116 william 119 echo "CLEANUP HAS BEEN DISABLED ... to enable do not use --no-cleaup"
117 william 103 fi
118 william 92
119     echo
120     echo "AUTOBUILD COMPLETE..."
121     # perform auto tagging
122 william 105 if [ "$DISABLE_AUTO_BRANCH" == "0" ] ; then
123 william 143 cd "$downstream_export_location"
124 william 106 # Always force auto branch update after building
125     "$downstream_export_location/auto_branch_latest_upstream.sh" --force-update
126 william 95 else
127 william 105 echo "AUTO BUILD BRANCH HAS BEEN DISABLED ... not calling auto_branch_latest_upstream.sh --> to enable do not use --no-auto-branch"
128 william 95 fi
129 william 92 else
130    
131     # CLEANUP
132     echo "PERFORMING CLEANUP"
133 william 103
134     if [ "$DISABLE_CLEANUP" == "0" ] ; then
135 william 119 echo -e "\\tCLEANING $PCSX2_BUILD_TMP/bin/ ... {}"
136 william 103 cd "$BUILD_TMP_DIR"
137 william 119 rm -Rf "$PCSX2_BUILD_TMP" >/dev/null 2>/dev/null
138     #rm -Rf *
139 william 103 echo "CLEANUP COMPLETE..."
140     else
141 william 119 echo "CLEANUP HAS BEEN DISABLED ... to enable do not use --no-cleaup"
142 william 103 fi
143 william 92 echo
144     echo "BUILD FAILED..."
145     echo
146     echo "AUTOBUILD FAILED..."
147     fi

  ViewVC Help
Powered by ViewVC 1.1.22