Subversion Repositories DevTools

Rev

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