Subversion Repositories DevTools

Rev

Rev 315 | Rev 363 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 315 Rev 359
Line 77... Line 77...
77
    Message ("Creating C# Version File: $fname" );
77
    Message ("Creating C# Version File: $fname" );
78
 
78
 
79
    #
79
    #
80
    #   Determine the build version
80
    #   Determine the build version
81
    #
81
    #
82
    my ($major, $minor, $patch, $build, $raw_patch) = SplitVersion($BUILDNAME_VERSION);
82
    my ($major, $minor, $patch, $build, $raw_patch) = SplitVersionClean($BUILDNAME_VERSION);
83
    my $vstring = "$major.$minor.$patch.$build";
83
    my $vstring = "$major.$minor.$patch.$build";
84
 
84
 
85
 
85
 
86
    my $fh = ConfigurationFile::New( $fname, '--Type=CSharp' );
86
    my $fh = ConfigurationFile::New( $fname, '--Type=CSharp' );
87
    $fh->HeaderSimple( "buildlib (Version $BuildVersion)",
87
    $fh->HeaderSimple( "buildlib (Version $BuildVersion)",
Line 187... Line 187...
187
    Message ("Creating Windows Resource File: $fname" );
187
    Message ("Creating Windows Resource File: $fname" );
188
 
188
 
189
    #
189
    #
190
    #   Determine the build version
190
    #   Determine the build version
191
    #
191
    #
192
    my ($major, $minor, $patch, $build, $raw_patch) = SplitVersion($version);
192
    my ($major, $minor, $patch, $build, $raw_patch) = SplitVersionClean($version);
193
    my $product_version = "$major, $minor, $patch, $build";
193
    my $product_version = "$major, $minor, $patch, $build";
194
    
194
    
195
 
195
 
196
    #
196
    #
197
    #   Create the file
197
    #   Create the file
Line 473... Line 473...
473
    #   programs (that support a preprocessor) to access version information
473
    #   programs (that support a preprocessor) to access version information
474
    #
474
    #
475
    #   Allow for a user supplied filename fragment that will be used within
475
    #   Allow for a user supplied filename fragment that will be used within
476
    #   all the definitions with in the file.
476
    #   all the definitions with in the file.
477
    #
477
    #
478
    my ($major, $minor, $patch, $build, $raw_patch) = SplitVersion($BUILDNAME_VERSION);
478
    my ($major, $minor, $patch, $build, $raw_patch) = SplitVersionClean($BUILDNAME_VERSION);
479
    my @PACKAGEVERS = PackageEntry::GetPackageVersionList();
479
    my @PACKAGEVERS = PackageEntry::GetPackageVersionList();
480
 
480
 
481
    #
481
    #
482
    #   Base names on a user supplied value or a default
482
    #   Base names on a user supplied value or a default
483
    #
483
    #
Line 504... Line 504...
504
        "#define ${vtag}_MINOR_STR      \"$minor\"\n".
504
        "#define ${vtag}_MINOR_STR      \"$minor\"\n".
505
        "#define ${vtag}_PATCH_STR      \"$patch\"\n".
505
        "#define ${vtag}_PATCH_STR      \"$patch\"\n".
506
        "#define ${vtag}_BUILD_STR      \"$build\"\n".
506
        "#define ${vtag}_BUILD_STR      \"$build\"\n".
507
        "#define ${vtag}_PATCHBUILD_STR \"$raw_patch\"\n".
507
        "#define ${vtag}_PATCHBUILD_STR \"$raw_patch\"\n".
508
        "#define ${vtag}_PROJECT        \"$BUILDNAME_PROJECT\"\n".
508
        "#define ${vtag}_PROJECT        \"$BUILDNAME_PROJECT\"\n".
509
        "#define ${vtag}_MAJOR          " . strip_zeros($major) . "\n".
509
        "#define ${vtag}_MAJOR          $major\n".
510
        "#define ${vtag}_MINOR          " . strip_zeros($minor) . "\n".
510
        "#define ${vtag}_MINOR          $minor\n".
511
        "#define ${vtag}_PATCH          " . strip_zeros($patch) . "\n".
511
        "#define ${vtag}_PATCH          $patch\n".
512
        "#define ${vtag}_BUILD          " . strip_zeros($build) . "\n".
512
        "#define ${vtag}_BUILD          $build\n".
513
        "#define ${vtag}_PATCHBUILD     " . strip_zeros($raw_patch) . "\n".
513
        "#define ${vtag}_PATCHBUILD     $raw_patch\n".
514
        "#define ${vtag}_ALL            \"$BUILDNAME_PACKAGE ($BUILDNAME_VERSION.$BUILDNAME_PROJECT) @PACKAGEVERS\"\n".
514
        "#define ${vtag}_ALL            \"$BUILDNAME_PACKAGE ($BUILDNAME_VERSION.$BUILDNAME_PROJECT) @PACKAGEVERS\"\n".
515
        "#define ${vtag}_BUILDTIME      " . strip_zeros(time()) . "\n".
515
        "#define ${vtag}_BUILDTIME      " . strip_zeros(time()) . "\n".
516
        "\n".
516
        "\n".
517
        "#endif /* $guard_name */\n";
517
        "#endif /* $guard_name */\n";
518
 
518
 
Line 560... Line 560...
560
    #
560
    #
561
    my $vtag = '';
561
    my $vtag = '';
562
    $vtag = $Prefix . '.' if $Prefix;
562
    $vtag = $Prefix . '.' if $Prefix;
563
 
563
 
564
 
564
 
565
    my ($major, $minor, $patch, $build, $raw_patch) = SplitVersion($BUILDNAME_VERSION);
565
    my ($major, $minor, $patch, $build, $raw_patch) = SplitVersionClean($BUILDNAME_VERSION);
566
    my @PACKAGEVERS = PackageEntry::GetPackageVersionList();
566
    my @PACKAGEVERS = PackageEntry::GetPackageVersionList();
567
 
567
 
568
    #
568
    #
569
    #   Create properties in the same form as for "C" definitions
569
    #   Create properties in the same form as for "C" definitions
570
    #   Note:
570
    #   Note:
Line 586... Line 586...
586
        "${vtag}MINOR_STR      = $minor\n".
586
        "${vtag}MINOR_STR      = $minor\n".
587
        "${vtag}PATCH_STR      = $patch\n".
587
        "${vtag}PATCH_STR      = $patch\n".
588
        "${vtag}BUILD_STR      = $build\n".
588
        "${vtag}BUILD_STR      = $build\n".
589
        "${vtag}PATCHBUILD_STR = $raw_patch\n".
589
        "${vtag}PATCHBUILD_STR = $raw_patch\n".
590
        "${vtag}PROJECT        = $BUILDNAME_PROJECT\n".
590
        "${vtag}PROJECT        = $BUILDNAME_PROJECT\n".
591
        "${vtag}MAJOR          = " . strip_zeros($major) . "\n".
591
        "${vtag}MAJOR          = $major\n".
592
        "${vtag}MINOR          = " . strip_zeros($minor) . "\n".
592
        "${vtag}MINOR          = $minor\n".
593
        "${vtag}PATCH          = " . strip_zeros($patch) . "\n".
593
        "${vtag}PATCH          = $patch\n".
594
        "${vtag}BUILD          = " . strip_zeros($build) . "\n".
594
        "${vtag}BUILD          = $build\n".
595
        "${vtag}PATCHBUILD     = " . strip_zeros($raw_patch) . "\n".
595
        "${vtag}PATCHBUILD     = $raw_patch\n".
596
        "${vtag}ALL            = $BUILDNAME_PACKAGE ($BUILDNAME_VERSION.$BUILDNAME_PROJECT) @PACKAGEVERS\n".
596
        "${vtag}ALL            = $BUILDNAME_PACKAGE ($BUILDNAME_VERSION.$BUILDNAME_PROJECT) @PACKAGEVERS\n".
597
        "${vtag}BUILDTIME      = " . strip_zeros(time()) . "\n".
597
        "${vtag}BUILDTIME      = " . strip_zeros(time()) . "\n".
598
        "\n";
598
        "\n";
599
    #
599
    #
600
    #   Create a set of definitions for each dependent package
600
    #   Create a set of definitions for each dependent package
Line 654... Line 654...
654
    #
654
    #
655
    my $vtag = '';
655
    my $vtag = '';
656
    $vtag = $Prefix . '_' if $Prefix;
656
    $vtag = $Prefix . '_' if $Prefix;
657
 
657
 
658
 
658
 
659
    my ($major, $minor, $patch, $build, $raw_patch) = SplitVersion($BUILDNAME_VERSION);
659
    my ($major, $minor, $patch, $build, $raw_patch) = SplitVersionClean($BUILDNAME_VERSION);
660
    my @PACKAGEVERS = PackageEntry::GetPackageVersionList();
660
    my @PACKAGEVERS = PackageEntry::GetPackageVersionList();
661
 
661
 
662
    #
662
    #
663
    #   Create properties in the same form as for "C" definitions
663
    #   Create properties in the same form as for "C" definitions
664
    #   Note:
664
    #   Note:
Line 672... Line 672...
672
    }
672
    }
673
    sub pnum
673
    sub pnum
674
    {
674
    {
675
        my ($arg, $val) = @_;
675
        my ($arg, $val) = @_;
676
        Error ("Undefined value for $arg") unless ( defined $val );
676
        Error ("Undefined value for $arg") unless ( defined $val );
677
        return sprintf ( "%-24s = %s;" , $arg, strip_zeros($val) );
677
        return sprintf ( "%-24s = %s;" , $arg, $val );
678
    }
678
    }
679
 
679
 
680
    my $fh = ConfigurationFile::New( $fname, '--Type=Delphi' );
680
    my $fh = ConfigurationFile::New( $fname, '--Type=Delphi' );
681
    $fh->HeaderSimple( "buildlib (Version $BuildVersion)",
681
    $fh->HeaderSimple( "buildlib (Version $BuildVersion)",
682
                       "Delphi Unit Version Definition" );
682
                       "Delphi Unit Version Definition" );
Line 700... Line 700...
700
        pnum ("${vtag}MINOR",$minor),
700
        pnum ("${vtag}MINOR",$minor),
701
        pnum ("${vtag}PATCH",$patch),
701
        pnum ("${vtag}PATCH",$patch),
702
        pnum ("${vtag}BUILD",$build),
702
        pnum ("${vtag}BUILD",$build),
703
        pnum ("${vtag}PATCHBUILD",$raw_patch),
703
        pnum ("${vtag}PATCHBUILD",$raw_patch),
704
        pstring ("${vtag}ALL","$BUILDNAME_PACKAGE ($BUILDNAME_VERSION.$BUILDNAME_PROJECT) @PACKAGEVERS"),
704
        pstring ("${vtag}ALL","$BUILDNAME_PACKAGE ($BUILDNAME_VERSION.$BUILDNAME_PROJECT) @PACKAGEVERS"),
705
        pnum ("${vtag}BUILDTIME",time()),
705
        pnum ("${vtag}BUILDTIME",strip_zeros(time())),
706
        ''
706
        ''
707
        );
707
        );
708
 
708
 
709
    #
709
    #
710
    #   Create a set of definitions for each dependent package
710
    #   Create a set of definitions for each dependent package
Line 766... Line 766...
766
    #
766
    #
767
    my $vtag = '';
767
    my $vtag = '';
768
    $vtag = $Prefix . '_' if $Prefix;
768
    $vtag = $Prefix . '_' if $Prefix;
769
 
769
 
770
 
770
 
771
    my ($major, $minor, $patch, $build, $raw_patch) = SplitVersion($BUILDNAME_VERSION);
771
    my ($major, $minor, $patch, $build, $raw_patch) = SplitVersionClean($BUILDNAME_VERSION);
772
    my @PACKAGEVERS = PackageEntry::GetPackageVersionList();
772
    my @PACKAGEVERS = PackageEntry::GetPackageVersionList();
773
 
773
 
774
    #
774
    #
775
    #   Create properties in the same form as for "C" definitions
775
    #   Create properties in the same form as for "C" definitions
776
    #   Note:
776
    #   Note:
Line 784... Line 784...
784
    }
784
    }
785
    sub pvbnum
785
    sub pvbnum
786
    {
786
    {
787
        my ($arg, $val) = @_;
787
        my ($arg, $val) = @_;
788
        Error ("Undefined value for $arg") unless ( defined $val );
788
        Error ("Undefined value for $arg") unless ( defined $val );
789
        return sprintf ( "Public Const %-24s = %s" , $arg, strip_zeros($val) );
789
        return sprintf ( "Public Const %-24s = %s" , $arg, $val );
790
    }
790
    }
791
 
791
 
792
    my $fh = ConfigurationFile::New( $fname, '--Type=Basic' );
792
    my $fh = ConfigurationFile::New( $fname, '--Type=Basic' );
793
    $fh->HeaderSimple( "buildlib (Version $BuildVersion)",
793
    $fh->HeaderSimple( "buildlib (Version $BuildVersion)",
794
                       "Visual Basic Version Definition" );
794
                       "Visual Basic Version Definition" );
Line 811... Line 811...
811
        pvbnum    ("${vtag}MINOR",          $minor),
811
        pvbnum    ("${vtag}MINOR",          $minor),
812
        pvbnum    ("${vtag}PATCH",          $patch),
812
        pvbnum    ("${vtag}PATCH",          $patch),
813
        pvbnum    ("${vtag}BUILD",          $build),
813
        pvbnum    ("${vtag}BUILD",          $build),
814
        pvbnum    ("${vtag}PATCHBUILD",     $raw_patch),
814
        pvbnum    ("${vtag}PATCHBUILD",     $raw_patch),
815
        pvbstring ("${vtag}ALL",            "$BUILDNAME_PACKAGE ($BUILDNAME_VERSION.$BUILDNAME_PROJECT) @PACKAGEVERS"),
815
        pvbstring ("${vtag}ALL",            "$BUILDNAME_PACKAGE ($BUILDNAME_VERSION.$BUILDNAME_PROJECT) @PACKAGEVERS"),
816
        pvbnum    ("${vtag}BUILDTIME",      time()),
816
        pvbnum    ("${vtag}BUILDTIME",      strip_zeros(time())),
817
        ''
817
        ''
818
        );
818
        );
819
 
819
 
820
    #
820
    #
821
    #   Create a set of definitions for each dependent package
821
    #   Create a set of definitions for each dependent package
Line 831... Line 831...
831
 
831
 
832
    $fh->WriteLn();
832
    $fh->WriteLn();
833
    $fh->Close();
833
    $fh->Close();
834
}
834
}
835
 
835
 
-
 
836
#-------------------------------------------------------------------------------
-
 
837
# Function        : SplitVersionClean
-
 
838
#
-
 
839
# Description     : Pull apart the Version Number and clean it up
-
 
840
#                   Remove leading zeros from components
-
 
841
#
-
 
842
# Inputs          : $version    - Version Number
-
 
843
#
-
 
844
# Returns         : A list of:
-
 
845
#                       Major, Minor, Patch, Build, RawPatch
-
 
846
#                   with leading zeros removed
-
 
847
#
-
 
848
sub SplitVersionClean
-
 
849
{
-
 
850
    my ($version) = @_;
-
 
851
    my ($major, $minor, $patch, $build, $raw_patch) = SplitVersion($version);
-
 
852
 
-
 
853
    return (
-
 
854
        strip_zeros($major),
-
 
855
        strip_zeros($minor),
-
 
856
        strip_zeros($patch),
-
 
857
        strip_zeros($build),
-
 
858
        strip_zeros($raw_patch)
-
 
859
    );
-
 
860
}
836
 
861
 
837
#-------------------------------------------------------------------------------
862
#-------------------------------------------------------------------------------
838
# Function        : stip_zeros
863
# Function        : stip_zeros
839
#
864
#
840
# Description     : Remove leading 0's from a string
865
# Description     : Remove leading 0's from a string