Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
1467 alewis 1
########################################################################
5721 dpurdie 2
# Copyright (c) VIX TECHNOLOGY (AUST) LTD
1467 alewis 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}.
4789 alewis 57
#                     -PatchDir=      - Sets the directory where patches are located.
6114 dpurdie 58
#                     -IgnorePatchErr= - Sets to ignore patch errors when there are 
59
#                                       mutiple tar files invloved in a single package
1467 alewis 60
#
61
# Returns         : Nothing
62
#
63
sub ShellBuild
64
{
65
    my ($platforms, $script, @uargs) = @_;
66
 
67
    return if ( ! ActivePlatform($platforms) );
4270 alewis 68
 
1467 alewis 69
    #
70
    #   Generate the files
71
    #   Use standard JATS directive
72
    #
1475 dpurdie 73
    Src('*', $script);
4270 alewis 74
    GenerateFiles('*', '--Tool=shellbuild_linux.sh',# Tool to use
1475 dpurdie 75
                  '-ShellBuild='.$script,           # User script
1467 alewis 76
                  '--Var(BuildName)',               # Target Package
77
                  '--Var(BuildVersion)',            # Target Package Version
78
                  '--Var(Platform)',                # Target platform
79
                  '--Var(Type)',                    # Build Type
80
                  '--Var(Arch)',                    # Architecture
81
                  '--Var(MachType)',                # Machine Type
82
                  '--Var(BuildRoot)',               # Build Root
1475 dpurdie 83
                  '--Var(InterfaceDir)',            # Interface dir
1477 dpurdie 84
                  '--Var(LocalDir)',                # Local dirs
85
                  '--Var(LocalIncDir)',
86
                  '--Var(LocalLibDir)',
87
                  '--Var(LocalBinDir)',
1467 alewis 88
                  '--Var(CompilerPath)',            # Path to compiler
1469 alewis 89
                  '--Var(BinDir)',                  # Binary output directory
90
                  '--Var(ObjDir)',                  # Object output directory
91
                  '--Var(LibDir)',                  # Library output directory
1467 alewis 92
                  '--Var(PackageBinDir)',           # Package Bin dir
93
                  '--Var(PackageIncDir)',           # Package Inc dir
94
                  '--Var(PackageLibDir)',           # Package Lib dir
95
                  '--Var(PackagePkgDir)',           # Package Pkg dir
96
                  '--Var(PackageDir)',              # Package dir
6112 dpurdie 97
                  If('TOOLSET', '-Toolset'),        # Flag TOOLSET packaging
1467 alewis 98
                  '--Var(PackageToolDir)',          # Tools dir
99
                  '--Var(PackageToolBin)',          # Tools binaries dir
100
                  '--Var(PackageToolScript)',       # Tools scripts dir
101
                  "--NoGenerate", "--Clean", @uargs );
102
}
103
 
104
#-------------------------------------------------------------------------------
105
# Function        : DebianShellBuild
106
#
107
# Description     : Launches a shell build script that has had a set of 
108
#                   pre-invoke work performed already.  Once the script
109
#                   Completes a Debian package builder is launched.
110
#
111
# Inputs          : platform          - Standard Platform Specifier
112
#                   script            - The shell build script to launch.
113
#                   uargs             - User options, as per ShellBuild().
114
#
115
# Returns         : Nothing
116
#
117
sub DebianShellBuild
118
{
119
    my ($platforms, $script, @uargs) = @_;
120
 
121
    return if ( ! ActivePlatform($platforms) );
122
 
1475 dpurdie 123
    #
124
    #   The ShellBuild script will create the 'debbuild.pl' file
125
    #   Create a temp copy here in order to supress warnings
126
    #
127
    my $deb_dir = "$ScmPlatform.deb";
128
    my $deb_build = $deb_dir . '/debbuild.pl';
129
    mkdir ($deb_dir);
130
    TouchFile ( $deb_build );
131
 
1467 alewis 132
    # Generate the files using ShellBuild()
1475 dpurdie 133
    ShellBuild       ('*', $script, "-DebianPackage=$deb_dir", @uargs);
134
    MakeDebianPackage('*', "--Script=$deb_build"  );
1467 alewis 135
}
136
 
4270 alewis 137
#-------------------------------------------------------------------------------
5863 alewis 138
# Function        : DebianShellBuild
139
#
140
# Description     : Launches a shell build script that has had a set of 
141
#                   pre-invoke work performed already.  Once the script
142
#                   Completes a Debian package builder is launched.
143
#
144
# Inputs          : platform          - Standard Platform Specifier
145
#                   script            - The shell build script to launch.
146
#                   variant           - The Debian package name variant.
147
#                   uargs             - User options, as per ShellBuild().
148
#
149
# Returns         : Nothing
150
#
151
sub DebianVariantShellBuild
152
{
153
    my ($platforms, $script, $variant, @uargs) = @_;
154
 
155
    return if ( ! ActivePlatform($platforms) );
156
 
157
    #
158
    #   The ShellBuild script will create the 'debbuild.pl' file
159
    #   Create a temp copy here in order to supress warnings
160
    #
161
    my $deb_dir = "$ScmPlatform.deb";
162
    my $deb_build = $deb_dir . '/debbuild.pl';
163
    mkdir ($deb_dir);
164
    TouchFile ( $deb_build );
165
 
166
    # Generate the files using ShellBuild()
167
    ShellBuild       ('*', $script, "-DebianPackage=$deb_dir", @uargs);
168
    MakeDebianPackage('*', "--Script=$deb_build", "--Variant=$variant"  );
169
}
170
 
171
#-------------------------------------------------------------------------------
4270 alewis 172
# Function        : WindowsShellBuild
173
#
174
# Description     : Runs a build script intended for Windows rather than Linux.
175
#
176
# Inputs          : platform          - Standard Platform Specifier
177
#                   script            - The shell build script to launch.
178
#                   uargs             - User options
179
#
180
#                     -DownloadPkg=   - Name of the package that has been 
181
#                                       downloaded.  If empty the download package
182
#                                       is generated automatically.
183
#                     -CopyModsDir    - Specifies that 'mods' directories should
184
#                                       be copied rather than symlink
185
#                     -WorkDir=       - Name of the package work dir
186
#                                       Will override untar'ed dirname
187
#                     -WorkDirSuffix= - An additional suffix to add to the working 
188
#                                       directory.
189
#                     -ConfigVarient= - Sets the name of the package build 
190
#                                       configuration varient.  This can then 
191
#                                       be used in the call-out script as 
192
#                                       ${CONFIG_VARIENT}.
4789 alewis 193
#                     -PatchDir=      - Sets the directory where patches are located.
4270 alewis 194
#
195
# Returns         : Nothing
196
#
197
sub WindowsShellBuild
198
{
199
    my ($platforms, $script, @uargs) = @_;
200
 
201
    return if ( ! ActivePlatform($platforms) );
202
 
203
    #
204
    #   Generate the files
205
    #   Use standard JATS directive
206
    #
207
    Src('*', $script);
208
    GenerateFiles('*', '--Tool=shellbuild_windows.pl',# Tool to use
209
                  '-ShellBuild='.$script,           # User script
210
                  '--Var(BuildName)',               # Target Package
211
                  '--Var(BuildVersion)',            # Target Package Version
212
                  '--Var(Platform)',                # Target platform
213
                  '--Var(Type)',                    # Build Type
214
                  '--Var(MachType)',                # Machine Type
215
                  '--Var(BuildRoot)',               # Build Root
216
                  '--Var(InterfaceDir)',            # Interface dir
217
                  '--Var(LocalDir)',                # Local dirs
218
                  '--Var(LocalIncDir)',
219
                  '--Var(LocalLibDir)',
220
                  '--Var(LocalBinDir)',
221
                  '--Var(BinDir)',                  # Binary output directory
222
                  '--Var(ObjDir)',                  # Object output directory
223
                  '--Var(LibDir)',                  # Library output directory
224
                  '--Var(PackageBinDir)',           # Package Bin dir
225
                  '--Var(PackageIncDir)',           # Package Inc dir
226
                  '--Var(PackageLibDir)',           # Package Lib dir
227
                  '--Var(PackagePkgDir)',           # Package Pkg dir
228
                  '--Var(PackageDir)',              # Package dir
6112 dpurdie 229
                  If('TOOLSET', '-Toolset'),        # Flag TOOLSET packaging
4270 alewis 230
                  '--Var(PackageToolDir)',          # Tools dir
231
                  '--Var(PackageToolBin)',          # Tools binaries dir
232
                  '--Var(PackageToolScript)',       # Tools scripts dir
233
                  "--NoGenerate", "--Clean", @uargs );
234
}
235
 
1467 alewis 236
1;