Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.3 KiB

  1. require Build;
  2. while ($_ = $ARGV[0], /^-/) {
  3. shift;
  4. last if /^--$/;
  5. /^-n(.*)/i && ($build = $1);
  6. /^-f(.*)/i && ($projectfile = $1);
  7. /^-d(.*)/i && ($targetroot = $1);
  8. /^-p(.*)/i && ($platformfilter = $1);
  9. }
  10. ($build && $projectfile && $targetroot) ||
  11. die "Usage: UpdateBuild.pl -N<Build Number> -F<Project INI File> -D<Target Root Directory> [-P<Platform Filter>]\n";
  12. open (FILE, $projectfile) || die "Error opening $projectfile: $!.\n";
  13. while (<FILE>) {
  14. /^\[(.*)\]/ && ($projectname = $1);
  15. if ( $projectname ) {
  16. /^Directory=(.*)/i && ($directory{$projectname} = $1);
  17. /^Platform=(.*)/i && ($platform{$projectname} = $1);
  18. if ( !$platformfilter || ($platform{$projectname} =~ /$platformfilter/i) ) {
  19. if ( /^VersionResource=(.*)/i ) {
  20. @versionfiles = split( ",", $1 );
  21. for ( $index = 0; $versionfiles[$index]; $index++ ) {
  22. $version{"$directory{$projectname}\\$versionfiles[$index]"} = $build;
  23. }
  24. }
  25. }
  26. }
  27. }
  28. close FILE;
  29. print "\n";
  30. foreach $versionfile (sort keys %version) {
  31. $targetfile = "$targetroot\\$versionfile";
  32. print "Updating $targetfile to build number $version{$versionfile}...\n";
  33. &Build::SetBuildNumber( $version{$versionfile}, $targetfile );
  34. }
  35. exit 0;