Subversion Repositories DevTools

Rev

Rev 4064 | Rev 4270 | 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.
1491 alewis 47
#                     -CopyModsDir    - Specifies that 'mods' directories should
48
#                                       be copied rather than symlink
1477 dpurdie 49
#                     -WorkDir=       - Name of the package work dir
50
#                                       Will override untar'ed dirname
1495 alewis 51
#                     -WorkDirSuffix= - An additional suffix to add to the working 
52
#                                       directory.
1469 alewis 53
#                     -ConfigVarient= - Sets the name of the package build 
54
#                                       configuration varient.  This can then 
55
#                                       be used in the call-out script as 
56
#                                       ${CONFIG_VARIENT}.
1467 alewis 57
#
58
# Returns         : Nothing
59
#
60
sub ShellBuild
61
{
62
    my ($platforms, $script, @uargs) = @_;
63
 
64
    return if ( ! ActivePlatform($platforms) );
65
 
66
    #
67
    #   Generate the files
68
    #   Use standard JATS directive
69
    #
1475 dpurdie 70
    Src('*', $script);
4069 dpurdie 71
    GenerateFiles('*', '--Tool=shellbuild.sh',      # Tool to use
1475 dpurdie 72
                  '-ShellBuild='.$script,           # User script
1467 alewis 73
                  '--Var(BuildName)',               # Target Package
74
                  '--Var(BuildVersion)',            # Target Package Version
75
                  '--Var(Platform)',                # Target platform
76
                  '--Var(Type)',                    # Build Type
77
                  '--Var(Arch)',                    # Architecture
78
                  '--Var(MachType)',                # Machine Type
79
                  '--Var(BuildRoot)',               # Build Root
1475 dpurdie 80
                  '--Var(InterfaceDir)',            # Interface dir
1477 dpurdie 81
                  '--Var(LocalDir)',                # Local dirs
82
                  '--Var(LocalIncDir)',
83
                  '--Var(LocalLibDir)',
84
                  '--Var(LocalBinDir)',
1467 alewis 85
                  '--Var(CompilerPath)',            # Path to compiler
1469 alewis 86
                  '--Var(BinDir)',                  # Binary output directory
87
                  '--Var(ObjDir)',                  # Object output directory
88
                  '--Var(LibDir)',                  # Library output directory
1467 alewis 89
                  '--Var(PackageBinDir)',           # Package Bin dir
90
                  '--Var(PackageIncDir)',           # Package Inc dir
91
                  '--Var(PackageLibDir)',           # Package Lib dir
92
                  '--Var(PackagePkgDir)',           # Package Pkg dir
93
                  '--Var(PackageDir)',              # Package dir
94
                  '--Var(PackageToolDir)',          # Tools dir
95
                  '--Var(PackageToolBin)',          # Tools binaries dir
96
                  '--Var(PackageToolScript)',       # Tools scripts dir
97
                  "--NoGenerate", "--Clean", @uargs );
98
}
99
 
100
#-------------------------------------------------------------------------------
101
# Function        : DebianShellBuild
102
#
103
# Description     : Launches a shell build script that has had a set of 
104
#                   pre-invoke work performed already.  Once the script
105
#                   Completes a Debian package builder is launched.
106
#
107
# Inputs          : platform          - Standard Platform Specifier
108
#                   script            - The shell build script to launch.
109
#                   uargs             - User options, as per ShellBuild().
110
#
111
# Returns         : Nothing
112
#
113
sub DebianShellBuild
114
{
115
    my ($platforms, $script, @uargs) = @_;
116
 
117
    return if ( ! ActivePlatform($platforms) );
118
 
1475 dpurdie 119
    #
120
    #   The ShellBuild script will create the 'debbuild.pl' file
121
    #   Create a temp copy here in order to supress warnings
122
    #
123
    my $deb_dir = "$ScmPlatform.deb";
124
    my $deb_build = $deb_dir . '/debbuild.pl';
125
    mkdir ($deb_dir);
126
    TouchFile ( $deb_build );
127
 
1467 alewis 128
    # Generate the files using ShellBuild()
1475 dpurdie 129
    ShellBuild       ('*', $script, "-DebianPackage=$deb_dir", @uargs);
130
    MakeDebianPackage('*', "--Script=$deb_build"  );
1467 alewis 131
}
132
 
133
1;