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

Diff of /auto_build_latest_upstream.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- auto_build_latest_upstream.sh	2010/09/09 21:12:48	109
+++ auto_build_latest_upstream.sh	2010/09/10 15:59:23	143
@@ -1,5 +1,5 @@
 #!/bin/bash
-#. ./auto_defs.sh
+. ./auto_defs.sh
 
 
 
@@ -8,10 +8,11 @@
         . ./auto_build_defs.sh
 fi
 
-#UPDATE PCSX2 VERSION
-PCSX2_VERSION=`cat "$$PCSX2_BUILD_TMP/bin/pcsx2-version.txt"`
+export OVERRIDE_TMP_BUILD_PATH_SAVE="$OVERRIDE_TMP_BUILD_PATH"
 
-export DISABLE_AUTO_TAG="0"
+export DISABLE_AUTO_BRANCH="0"
+export DISABLE_PREBUILD="0"
+export DISABLE_CLEANUP="0"
 
 if [ "$2" == "--no-auto-branch" ] ; then
         DISABLE_AUTO_BRANCH="1"
@@ -27,12 +28,12 @@
 echo "---------------------------------------------------------------------------------------"
 echo "AUTO BUILD CONFIG:"
 echo
-echo -e "\\tMSBUILD PATH: $MSBUILD"
 echo -e "\\tPCSX2 VCS BUILD PATH: $PCSX2_BUILD_TMP"
 echo -e "\\tPCSX2 VCS PROJECT FILE: $VSC_PROJECT_FILE"
-echo -e "\\tPCSX2 UPSTREAM VERSION: $VSC_BUILD_VERSION_UPSTREAM"
-echo -e "\\tPCSX2 LOCAL TRUNK VERSION: $PCSX2_VERSION"
-echo -e "\\tPCSX2 LOCAL VERSION: $VSC_BUILD_VERSION_LOCAL"
+echo -e "\\tPCSX2 VCS BUILD VERSION: $PCSX2_VERSION"
+echo
+echo -e "\\tMSBUILD PATH: $VSC_MSBUILD"
+echo -e "\\tMSBUILD OPTIONS: $VSC_MSBUILD_OPTIONS"
 echo
 echo "---------------------------------------------------------------------------------------"
 
@@ -43,24 +44,30 @@
 
 # call auto prebuild
 if [ "$DISABLE_PREBUILD" == "0" ] ; then
-	if [ "$AUTO_PREBUILD_DONE" == "" ] ; then
-		"$downstream_export_location/auto_prebuild_latest_upstream.sh"
-		if [ "$AUTO_PREBUILD_DONE" != "true" ] ; then
-			echo "PREBUILD FAILED..."
-			exit 1
-		fi	
+	export PREBUILD_SUCCESS="0"	
+	"$downstream_export_location/auto_prebuild_latest_upstream.sh" "$OVERRIDE_TMP_BUILD_PATH_SAVE" && PREBUILD_SUCCESS="1" || PREBUILD_SUCCESS="0"
+	if [ "$PREBUILD_SUCCESS" == "0" ] ; then
+		echo "PREBUILD FAILED!"
+		exit 1
 	fi
 else
-echo "PREBUILD HAS BEEN DISABLED..."	
-cd "$PCSX2_BUILD_TMP"
-find -name *.pch -exec rm -f {} \;
-echo	
+	echo "PREBUILD HAS BEEN DISABLED ... to enable do not use --no-prebuild"	
+	cd "$PCSX2_BUILD_TMP"
+	find -name *.pch -exec rm -f {} \;
+	echo	
 fi
 
+# re-generate pcsx2-version.txt
+echo "$PCSX2_VERSION" > "$PCSX2_BUILD_TMP/bin/pcsx2-version.txt"
+
 # START VISUAL STUDIO BUILD SUPPORT
 export BUILD_SUCCESS=0
 echo "PERFORMING BUILD:"
-"$MSBUILD" /nologo /t:Clean,rebuild "$VSC_PROJECT_PATH_WIN32" && BUILD_SUCCESS=0 || BUILD_SUCCESS=1
+
+# remove log files
+rm -f "$downstream_export_location/"$VSC_MSBUILD_LOG_FILE_PREFIX*.log
+"$VSC_MSBUILD" $VSC_MSBUILD_OPTIONS "$VSC_PROJECT_PATH_WIN32" && BUILD_SUCCESS=0 || BUILD_SUCCESS=1
+
 # END VISUAL STUDIO BUILD SUPPORT
 
 #echo "BUILD SUCCESS: $BUILD_SUCCESS"
@@ -71,25 +78,49 @@
 
 	# START POST BUILD
 	echo "PERFORMING POSTBUILD:"
-	cp -Rfv "$PCSX2_BUILD_TMP/bin"/* "$BRANCH_LOCATION/$BRANCH_NAME/bin/"
+	echo -e "\\tCOPYING $PCSX2_BUILD_TMP/bin/* $downstream_export_location/trunk/bin/ ... {}"
+	cp -Rfv "$PCSX2_BUILD_TMP/bin"/* "$downstream_export_location/trunk/bin/" >/dev/null 2>/dev/null
+	
+	# commit newly built files in trunk
+	cd "$downstream_export_location/trunk/bin/"
+	# add the newly built files to svn
+		find  -not -path "*.svn*" \
+		        -not -name "*.bsc" \
+		        -not -name "*.exp" \
+		        -not -name "*.ilk" \
+		        -not -name "*.lib" -exec bash -c '
+		#echo "{}"
+		if [ "{}" != "." ] ; then
+		        export svn_file=`echo "{}" | sed s/".\/"//`
+		        export svn_need_to_add=`svn status | grep "$svn_file"`
+		        if [ "$svn_need_to_add" != "" ] ; then
+		                svn add "{}" >/dev/null 2>/dev/null
+		        fi
+		fi
+	' \;
+	svn commit -m "Committing Build: $PCSX2_VERSION" --non-interactive --trust-server-cert >/dev/null 2>/dev/null
+                                                                                	
+	
 	echo "POSTBUILD COMPLETED..."
 	# END POST BUILD
 
 	# CLEANUP
 	echo "PERFORMING CLEANUP"
 	if [ "$DISABLE_CLEANUP" == "0" ] ; then
+		echo -e "\\tCLEANING $PCSX2_BUILD_TMP/bin/ ... {}"
 		cd "$BUILD_TMP_DIR"
-		rm -Rf "$PCSX2_BUILD_TMP"
-		rm -Rf *
+		rm -Rf "$PCSX2_BUILD_TMP" >/dev/null 2>/dev/null
+		#rm -Rf *
 		echo "CLEANUP COMPLETE..."
 	else
-	echo "CLEANUP DISABLED..."
+		echo "CLEANUP HAS BEEN DISABLED ... to enable do not use --no-cleaup"
 	fi
 
 	echo
 	echo "AUTOBUILD COMPLETE..."
 	# perform auto tagging
 	if [ "$DISABLE_AUTO_BRANCH" == "0" ] ; then
+		cd "$downstream_export_location"
 		# Always force auto branch update after building
 		"$downstream_export_location/auto_branch_latest_upstream.sh" --force-update
 	else
@@ -101,12 +132,13 @@
 	echo "PERFORMING CLEANUP"
 	
 	if [ "$DISABLE_CLEANUP" == "0" ] ; then
+		echo -e "\\tCLEANING $PCSX2_BUILD_TMP/bin/ ... {}"
 		cd "$BUILD_TMP_DIR"
-		rm -Rf "$PCSX2_BUILD_TMP"
-		rm -Rf *
+		rm -Rf "$PCSX2_BUILD_TMP" >/dev/null 2>/dev/null
+		#rm -Rf *
 		echo "CLEANUP COMPLETE..."
 	else
-	echo "CLEANUP DISABLED..."
+		echo "CLEANUP HAS BEEN DISABLED ... to enable do not use --no-cleaup"
 	fi
 	echo
 	echo "BUILD FAILED..."

 

  ViewVC Help
Powered by ViewVC 1.1.22