Subversion Repositories DevTools

Rev

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