update readme and add gitignore
[client-tools.git] / tools / AutomatedDailyBuild.pl
blob29463df9787a0ae9ae2b1de3ba6d1fd1d8978175
1 #!/usr/bin/perl -w
2 use File::Find;
3 use BuildFunctions;
6 ###
7 # Copyright (C)2000-2002 Sony Online Entertainment Inc.
8 # All Rights Reserved
10 # Title: AutomatedDailyBuild.pl
11 # Description: Forces a sync to current, syncs to head, builds all_Client, SWGGameServer, PlanetServer, and SwgLoadServer and check for writable files in the src directory then emails log files to gmcdaniel.
12 # @author $Author: gmcdaniel $
13 # @version $Revision: #17 $
18 # This subroutine finds any non-authorized writable files in a passed directory
20 sub Find_Writable
22 if (-d $_)
24 # found a directory entry
26 # prune the directory if it's one we want to ignore
27 if (m/^(compile)$/)
29 #prune it
30 $File::Find::prune = 1;
33 elsif (-f and -w $_)
34 { if (!m/^.*(aps|ncb|opt|plg)$/)
36 print "n $File::Find::name\n";
37 print Logfile "n $File::Find::name\n";
40 } # End of sub Find_Writable
44 ########## MAIN ##########
49 # Delete compile directory for clean build
51 system("c:\\4nt302\\4nt /c del /s /y ..\\src\\compile");
54 ## End of Delete compile directory for clean build
59 # Sync Code to Head
61 print ("Beginning Sync to Head...\n");
62 # sync client that points to d:\workdaily
63 system ("p4 -c gmcdaniel-wxp-gmcdaniel-build-station-machine_daily_build sync //depot/swg...\#head");
64 print ("Sync Complete\n");
65 print ("\n");
66 print ("\n");
69 ## End of Sync Code to Head
74 # Forced Code
76 print ("Beginning Forced Sync...\n");
77 # sync client that points to d:\workdaily
78 system ("p4 -c gmcdaniel-wxp-gmcdaniel-build-station-machine_daily_build sync -f //depot/swg...\#have");
79 print ("Sync Complete\n");
80 print ("\n");
81 print ("\n");
84 ## End of Forced Sync
90 # Build Projects and Check for Errors
92 build_project ("_all_client");
93 Check_For_Warnings_and_Errors("_all_client");
95 #build_project ("PlanetServer");
96 #Check_For_Warnings_and_Errors("PlanetServer");
98 #build_project ("SwgGameServer");
99 #Check_For_Warnings_and_Errors("SwgGameServer");
101 #build_project ("SwgLoadClient");
102 #Check_For_Warnings_and_Errors("SwgLoadClient");
105 ## End of Build Projects and Check for Errors
112 # Check for any non-authorized writable files in the /swg/current/src directory and email the results
116 ### Email addresses
117 #$gmcdaniel = "gmcdaniel\@soe.sony.com";
120 #$writable_files_log = "WritableFiles.log";
122 #print ("Checking for writable files...\n");
123 #open (Logfile, ">d:\\buildlogs\\$writable_files_log") || die "Sorry, I couldn't create $writable_files_log";
124 #print Logfile "The writable files that were found:\n";
126 # do a find
127 #$search_path = "..\\src";
128 #@ARGV = ($search_path);
129 #find(\&Find_Writable, @ARGV);
131 #close (Logfile);
133 #$writable_test_time_and_date = get_time_and_date();
134 #$date_stamp = get_date();
135 #system ("copy d:\\buildlogs\\$writable_files_log d:\\buildlogs\\WritableFiles_$writable_test_time_and_date.log");
136 #print ("Checking for writable files completed\n");
137 #print ("\n");
138 #print ("\n");
139 #system ("postie -host:sdt-mx1.station.sony.com -to:$gmcdaniel -from:$gmcdaniel -s:\"Writable Files Results $date_stamp\" -nomsg -file:d:\\buildlogs\\WritableFiles_$writable_test_time_and_date.log");
142 ## End of Check for any non-authorized writable files in the /swg/current/src directory and email the results
146 ########## END OF MAIN ##########