Subversion Repositories DevTools

Rev

Rev 1469 | Rev 1477 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1467 alewis 1
########################################################################
2
# Copyright (C) 2008 ERG Limited, All rights reserved
3
#
4
# Module name   : wsdl-tools
5
# Module type   : JATS Plugin
6
# Compiler(s)   : Perl
7
# Environment(s): JATS
8
#
9
# Description   : This package extends the JATS toolset at build time
10
#                 It provides additional directives to the JATS makefiles
11
#                 to simplify the directives.
12
#
13
#                 The directive matches up with a run-time tool to
14
#                 do the bulk of the work.
15
#
16
# Operation     : This package adds the JATS directive ShellBuild
17
#                 When used the directive will use GenerateFiles to invoke
18
#                 a shell program at make-time to actually do the hard work.
19
#
20
# Directives    : ShellBuild (platform, script, ... )
21
#
22
#......................................................................#
23
 
24
use strict;
25
use warnings;
26
use JatsError;
1475 dpurdie 27
use FileUtils;
1467 alewis 28
 
29
#
1475 dpurdie 30
#   Jats Globals
1467 alewis 31
#
1475 dpurdie 32
our $ScmPlatform;
1467 alewis 33
 
34
#-------------------------------------------------------------------------------
35
# Function        : ShellBuild
36
#
37
# Description     : Launches a shell build script that has had a set of 
38
#                   pre-invoke work performed already.
39
#
40
# Inputs          : platform          - Standard Platform Specifier
41
#                   script            - The shell build script to launch.
42
#                   uargs             - User options
43
#
44
#                     -DownloadPkg=   - Name of the package that has been 
45
#                                       downloaded.  If empty the download package
46
#                                       is generated automatically.
47
#                     -XGccInPath     - Forces the cross compiler GCC to be 
48
#                                       placed in the path directly.
1469 alewis 49
#                     -ConfigVarient= - Sets the name of the package build 
50
#                                       configuration varient.  This can then 
51
#                                       be used in the call-out script as 
52
#                                       ${CONFIG_VARIENT}.
1467 alewis 53
#
54
# Returns         : Nothing
55
#
56
sub ShellBuild
57
{
58
    my ($platforms, $script, @uargs) = @_;
59
 
60
    return if ( ! ActivePlatform($platforms) );
61
 
62
    #
63
    #   Generate the files
64
    #   Use standard JATS directive
65
    #
1475 dpurdie 66
    Src('*', $script);
67
    GenerateFiles('*', '--Tool=shellbuild.sh',      # Tool to use
68
                  '-ShellBuild='.$script,           # User script
1467 alewis 69
                  '--Var(BuildName)',               # Target Package
70
                  '--Var(BuildVersion)',            # Target Package Version
71
                  '--Var(Platform)',                # Target platform
72
                  '--Var(Type)',                    # Build Type
73
                  '--Var(Arch)',                    # Architecture
74
                  '--Var(MachType)',                # Machine Type
75
                  '--Var(BuildRoot)',               # Build Root
1475 dpurdie 76
                  '--Var(InterfaceDir)',            # Interface dir
77
                  '--Var(LocalDir)',                # Local dir
1467 alewis 78
                  '--Var(CompilerPath)',            # Path to compiler
1469 alewis 79
                  '--Var(BinDir)',                  # Binary output directory
80
                  '--Var(ObjDir)',                  # Object output directory
81
                  '--Var(LibDir)',                  # Library output directory
1467 alewis 82
                  '--Var(PackageBinDir)',           # Package Bin dir
83
                  '--Var(PackageIncDir)',           # Package Inc dir
84
                  '--Var(PackageLibDir)',           # Package Lib dir
85
                  '--Var(PackagePkgDir)',           # Package Pkg dir
86
                  '--Var(PackageDir)',              # Package dir
87
                  '--Var(PackageToolDir)',          # Tools dir
88
                  '--Var(PackageToolBin)',          # Tools binaries dir
89
                  '--Var(PackageToolScript)',       # Tools scripts dir
90
                  "--NoGenerate", "--Clean", @uargs );
91
}
92
 
93
#-------------------------------------------------------------------------------
94
# Function        : DebianShellBuild
95
#
96
# Description     : Launches a shell build script that has had a set of 
97
#                   pre-invoke work performed already.  Once the script
98
#                   Completes a Debian package builder is launched.
99
#
100
# Inputs          : platform          - Standard Platform Specifier
101
#                   script            - The shell build script to launch.
102
#                   uargs             - User options, as per ShellBuild().
103
#
104
# Returns         : Nothing
105
#
106
sub DebianShellBuild
107
{
108
    my ($platforms, $script, @uargs) = @_;
109
 
110
    return if ( ! ActivePlatform($platforms) );
111
 
1475 dpurdie 112
    #
113
    #   The ShellBuild script will create the 'debbuild.pl' file
114
    #   Create a temp copy here in order to supress warnings
115
    #
116
    my $deb_dir = "$ScmPlatform.deb";
117
    my $deb_build = $deb_dir . '/debbuild.pl';
118
    mkdir ($deb_dir);
119
    TouchFile ( $deb_build );
120
 
1467 alewis 121
    # Generate the files using ShellBuild()
1475 dpurdie 122
    ShellBuild       ('*', $script, "-DebianPackage=$deb_dir", @uargs);
123
    MakeDebianPackage('*', "--Script=$deb_build"  );
1467 alewis 124
}
125
 
126
1;