Subversion Repositories DevTools

Rev

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

Rev 255 Rev 261
Line 13... Line 13...
13
use MakeEntry;
13
use MakeEntry;
14
 
14
 
15
#
15
#
16
#   Global data
16
#   Global data
17
#
17
#
18
our $ScmExpert;
-
 
19
 
-
 
20
my %resource_files;
18
my %resource_files;
21
my $pdb_none;
19
my $pdb_none;
22
 
20
 
23
my $toolset_info;
21
my $toolset_info;
24
my $toolset_version = '1.1';
22
my $toolset_version = '1.1';
Line 91... Line 89...
91
 
89
 
92
    #.. Toolset configuration
90
    #.. Toolset configuration
93
    #
91
    #
94
    $::ScmToolsetVersion = "1.0.0";             # our version
92
    $::ScmToolsetVersion = "1.0.0";             # our version
95
    $::ScmToolsetGenerate = 0;                  # generate optional
93
    $::ScmToolsetGenerate = 0;                  # generate optional
96
    $::ScmToolsetIFLAG3 = 1;                    # supports IFLAG3
-
 
97
    $::ScmToolsetProgDependancies = 0;          # handle Prog dependancies myself
94
    $::ScmToolsetProgDependancies = 0;          # handle Prog dependancies myself
98
    %::ScmToolsetProgSource = (                 # handle these files directly
95
    %::ScmToolsetProgSource = (                 # handle these files directly
99
            '.cs'       => '',                  # Will be flagged as "CSRCS"
96
            '.cs'       => '',                  # Will be flagged as "CSRCS"
100
            '.resx'     => '--Resource=',       # Will be passed with prefix
97
            '.resx'     => '--Resource=',       # Will be passed with prefix
101
            '.dtd'      => '--Dtd=',            # Will be passed with prefix
98
            '.dtd'      => '--Dtd=',            # Will be passed with prefix
Line 152... Line 149...
152
#
149
#
153
sub NoWarns
150
sub NoWarns
154
{
151
{
155
    my ($key, $value, $ukey) = @_;
152
    my ($key, $value, $ukey) = @_;
156
    my @NoWarnList =  split (',', $::ScmCompilerOpts{$ukey});
153
    my @NoWarnList =  split (',', $::ScmCompilerOpts{$ukey});
157
    UniquePush \@NoWarnList, split (',', $value);
154
    UniquePush ( \@NoWarnList, split (',', $value) );
158
    return join ',', @NoWarnList;
155
    return join ',', @NoWarnList;
159
}
156
}
160
 
157
 
161
##############################################################################
158
##############################################################################
162
#   ToolsetPreprocess()
159
#   ToolsetPreprocess()
Line 199... Line 196...
199
        my $src  = $resource_files{$resource}{src};
196
        my $src  = $resource_files{$resource}{src};
200
        my $root = $resource_files{$resource}{root};
197
        my $root = $resource_files{$resource}{root};
201
 
198
 
202
        my $me = MakeEntry::New (*MAKEFILE, $resource );
199
        my $me = MakeEntry::New (*MAKEFILE, $resource );
203
        $me->AddComment ("Build Resource: $root" );
200
        $me->AddComment ("Build Resource: $root" );
204
#        $me->AddDependancy ( '$(GBE_PLATFORM).mk' ) if ( ! $ScmExpert );
201
#        $me->AddDependancy ( '$(SCM_MAKEFILE)' );
205
        $me->AddDependancy ( $src );
202
        $me->AddDependancy ( $src );
206
        $me->AddRecipe ( '$(RESGEN)' );
203
        $me->AddRecipe ( '$(RESGEN)' );
207
        $me->Print();
204
        $me->Print();
208
 
205
 
209
        #
206
        #
Line 362... Line 359...
362
    #   Create Rules and Recipes to create the SNK wrapper file
359
    #   Create Rules and Recipes to create the SNK wrapper file
363
    #
360
    #
364
    my $me = MakeEntry::New (*MAKEFILE, $snk_file );
361
    my $me = MakeEntry::New (*MAKEFILE, $snk_file );
365
    $me->AddComment ("Build Strong Name Key File Wrapper: $snk" );
362
    $me->AddComment ("Build Strong Name Key File Wrapper: $snk" );
366
    $me->AddDependancy ( $snk );
363
    $me->AddDependancy ( $snk );
367
    $me->AddDependancy ( '$(GBE_PLATFORM).mk' ) if ( ! $ScmExpert );
364
    $me->AddDependancy ( '$(SCM_MAKEFILE)' );
368
    $me->AddRecipe ( '$(call GenSnkWrapper,' . $tag .  ')' );
365
    $me->AddRecipe ( '$(call GenSnkWrapper,' . $tag .  ')' );
369
    $me->Print();
366
    $me->Print();
370
 
367
 
371
    #
368
    #
372
    #   Create the data t be placed into the wrapper file
369
    #   Create the data t be placed into the wrapper file
Line 577... Line 574...
577
    #   This will be a combination of source, libraries and resources
574
    #   This will be a combination of source, libraries and resources
578
    #
575
    #
579
    my $me = MakeEntry::New (*MAKEFILE, $full );
576
    my $me = MakeEntry::New (*MAKEFILE, $full );
580
    $me->AddComment ("Build Program: $name" );
577
    $me->AddComment ("Build Program: $name" );
581
    $me->AddName    ( $docFile ) if ( $docFile );
578
    $me->AddName    ( $docFile ) if ( $docFile );
582
    $me->AddDependancy ( '$(GBE_PLATFORM).mk' ) if ( ! $ScmExpert );
579
    $me->AddDependancy ( '$(SCM_MAKEFILE)' );
583
    $me->AddDependancy ( @resources );
580
    $me->AddDependancy ( @resources );
584
    $me->AddDependancy ( @csource );
581
    $me->AddDependancy ( @csource );
585
    $me->AddDependancy ( @dtd );
582
    $me->AddDependancy ( @dtd );
586
    $me->AddDependancy ( $icon );
583
    $me->AddDependancy ( $icon );
587
    $me->AddRecipe ( '$(CSC)' );
584
    $me->AddRecipe ( '$(CSC)' );
Line 772... Line 769...
772
        #   This will be a combination of source, libraries and resources
769
        #   This will be a combination of source, libraries and resources
773
        #
770
        #
774
        my $me = MakeEntry::New (*MAKEFILE, $full );
771
        my $me = MakeEntry::New (*MAKEFILE, $full );
775
        $me->AddComment ("Build Shared Library: $name" );
772
        $me->AddComment ("Build Shared Library: $name" );
776
        $me->AddName    ( $_docFile ) if ( $_docFile );
773
        $me->AddName    ( $_docFile ) if ( $_docFile );
777
        $me->AddDependancy ( '$(GBE_PLATFORM).mk' ) if ( ! $ScmExpert );
774
        $me->AddDependancy ( '$(SCM_MAKEFILE)' );
778
        $me->AddDependancy ( @_resources );
775
        $me->AddDependancy ( @_resources );
779
        $me->AddDependancy ( @_csource );
776
        $me->AddDependancy ( @_csource );
780
        $me->AddDependancy ( @_dtd );
777
        $me->AddDependancy ( @_dtd );
781
        $me->AddDependancy ( $_icon );
778
        $me->AddDependancy ( $_icon );
782
        $me->AddRecipe ( '$(CSC)' );
779
        $me->AddRecipe ( '$(CSC)' );
Line 993... Line 990...
993
{
990
{
994
    my ($pEntry) = @_;
991
    my ($pEntry) = @_;
995
    my $test_dll_name;
992
    my $test_dll_name;
996
    my @copy_dlls;
993
    my @copy_dlls;
997
    my %copy_dll_flags;
994
    my %copy_dll_flags;
998
    my @nunit_files = qw ( nunit.framework.dll );
-
 
999
 
995
 
1000
    #
996
    #
1001
    #   Extract base name of DLL under test
997
    #   Extract base name of DLL under test
1002
    #   Thsi will not have any extension.
998
    #   Thsi will not have any extension.
1003
    #
999
    #
Line 1027... Line 1023...
1027
        }
1023
        }
1028
    }
1024
    }
1029
 
1025
 
1030
    #
1026
    #
1031
    #   Locate the Nunit essentials
1027
    #   Locate the Nunit essentials
-
 
1028
    #       This list may change with each version of nunit
-
 
1029
    #       Look for a known file and use its contents
-
 
1030
    #       Format:
-
 
1031
    #           One file name per line
1032
    #       nunit-console.exe
1032
    #           Line comments only
-
 
1033
    #           Comment marker is a #
-
 
1034
    #           First one MUST be the executable
-
 
1035
    #
-
 
1036
    my @nunit_files;
-
 
1037
 
-
 
1038
    my $mfile = 'nunit-jats-manifest.txt';
-
 
1039
    my $nunit_file = ToolExtensionProgram ( $mfile );
-
 
1040
    Error ("Cannot find Nunit Jats Manifest: $mfile") unless ( $nunit_file );
-
 
1041
    open (JM, $nunit_file ) || Error( "Cannot open file: $nunit_file", "Reason: $!" );
-
 
1042
    while ( <JM> )
-
 
1043
    {
-
 
1044
        s~\s+$~~;                   # Remove trailing white space
-
 
1045
        s~^\s+~~;                   # Remove Leading whitespace
-
 
1046
        next unless ( $_ );         # Skip block lines
-
 
1047
        next if ( m~^#~ );          # Skip comments
-
 
1048
        Verbose ("Nunit File: $_");
1033
    #       nunit.framework.dll
1049
        push @nunit_files, $_;
-
 
1050
    }
-
 
1051
    close JM;
-
 
1052
    
-
 
1053
    #
-
 
1054
    #   Locate all the required files
1034
    #   These will be provided by a JATS plugin package
1055
    #   The first one will be the console executable
1035
    #
1056
    #
1036
    my $nunit_console = ToolExtensionProgram ('nunit-console','.exe' );
-
 
1037
    Error ("Cannot locate nunit-console") unless ( $nunit_console );
-
 
1038
 
-
 
1039
    my @nunit_framework;
1057
    my @nunit_framework;
1040
    foreach my $file ( @nunit_files )
1058
    foreach my $file ( @nunit_files )
1041
    {
1059
    {
1042
        my $path = ToolExtensionProgram ($file );
1060
        my $path = ToolExtensionProgram ($file );
1043
        Error ("Cannot locate nunit file: $file") unless ( $path );
1061
        Error ("Cannot locate nunit file: $file") unless ( $path );
1044
        push @nunit_framework, $path;
1062
        push @nunit_framework, $path;
1045
    }
1063
    }
-
 
1064
    my $nunit_console = $nunit_framework[0];
-
 
1065
    Error ("Nunit console executable not specified") unless ( $nunit_console );
1046
 
1066
 
1047
    #
1067
    #
1048
    #   Locate the test DLL.
1068
    #   Locate the test DLL.
1049
    #   This will be created locally within this makefile
1069
    #   This will be created locally within this makefile
1050
    #   It will be a known shared library
1070
    #   It will be a known shared library
Line 1115... Line 1135...
1115
    $pEntry->{'command'}  = $nunit_console . ' ' . $test_dll_name;
1135
    $pEntry->{'command'}  = $nunit_console . ' ' . $test_dll_name;
1116
    unshift @{$pEntry->{args}}, "/xml=$pEntry->{test_name}.xml";
1136
    unshift @{$pEntry->{args}}, "/xml=$pEntry->{test_name}.xml";
1117
    $pEntry->{'prog'} = $test_dll_name;
1137
    $pEntry->{'prog'} = $test_dll_name;
1118
    $pEntry->{'copyprog'} = 0;
1138
    $pEntry->{'copyprog'} = 0;
1119
    push @{$pEntry->{'copyin'}}, $test_dll;
1139
    push @{$pEntry->{'copyin'}}, $test_dll;
1120
    push @{$pEntry->{'copyonce'}}, $nunit_console, @nunit_framework;
1140
    push @{$pEntry->{'copyonce'}}, @nunit_framework;
1121
    $pEntry->{'testdir'}  = 'TESTDIR';
1141
    $pEntry->{'testdir'}  = 'TESTDIR';
1122
 
1142
 
1123
    #   
1143
    #   
1124
    #   Create the Test Directory
1144
    #   Create the Test Directory
1125
    #   Tests will be done in a .NUNIT subdir
1145
    #   Tests will be done in a .NUNIT subdir