| 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) );
|
| 4270 |
alewis |
65 |
|
| 1467 |
alewis |
66 |
#
|
|
|
67 |
# Generate the files
|
|
|
68 |
# Use standard JATS directive
|
|
|
69 |
#
|
| 1475 |
dpurdie |
70 |
Src('*', $script);
|
| 4270 |
alewis |
71 |
GenerateFiles('*', '--Tool=shellbuild_linux.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 |
|
| 4270 |
alewis |
133 |
#-------------------------------------------------------------------------------
|
|
|
134 |
# Function : WindowsShellBuild
|
|
|
135 |
#
|
|
|
136 |
# Description : Runs a build script intended for Windows rather than Linux.
|
|
|
137 |
#
|
|
|
138 |
# Inputs : platform - Standard Platform Specifier
|
|
|
139 |
# script - The shell build script to launch.
|
|
|
140 |
# uargs - User options
|
|
|
141 |
#
|
|
|
142 |
# -DownloadPkg= - Name of the package that has been
|
|
|
143 |
# downloaded. If empty the download package
|
|
|
144 |
# is generated automatically.
|
|
|
145 |
# -CopyModsDir - Specifies that 'mods' directories should
|
|
|
146 |
# be copied rather than symlink
|
|
|
147 |
# -WorkDir= - Name of the package work dir
|
|
|
148 |
# Will override untar'ed dirname
|
|
|
149 |
# -WorkDirSuffix= - An additional suffix to add to the working
|
|
|
150 |
# directory.
|
|
|
151 |
# -ConfigVarient= - Sets the name of the package build
|
|
|
152 |
# configuration varient. This can then
|
|
|
153 |
# be used in the call-out script as
|
|
|
154 |
# ${CONFIG_VARIENT}.
|
|
|
155 |
#
|
|
|
156 |
# Returns : Nothing
|
|
|
157 |
#
|
|
|
158 |
sub WindowsShellBuild
|
|
|
159 |
{
|
|
|
160 |
my ($platforms, $script, @uargs) = @_;
|
|
|
161 |
|
|
|
162 |
return if ( ! ActivePlatform($platforms) );
|
|
|
163 |
|
|
|
164 |
#
|
|
|
165 |
# Generate the files
|
|
|
166 |
# Use standard JATS directive
|
|
|
167 |
#
|
|
|
168 |
Src('*', $script);
|
|
|
169 |
GenerateFiles('*', '--Tool=shellbuild_windows.pl',# Tool to use
|
|
|
170 |
'-ShellBuild='.$script, # User script
|
|
|
171 |
'--Var(BuildName)', # Target Package
|
|
|
172 |
'--Var(BuildVersion)', # Target Package Version
|
|
|
173 |
'--Var(Platform)', # Target platform
|
|
|
174 |
'--Var(Type)', # Build Type
|
|
|
175 |
'--Var(MachType)', # Machine Type
|
|
|
176 |
'--Var(BuildRoot)', # Build Root
|
|
|
177 |
'--Var(InterfaceDir)', # Interface dir
|
|
|
178 |
'--Var(LocalDir)', # Local dirs
|
|
|
179 |
'--Var(LocalIncDir)',
|
|
|
180 |
'--Var(LocalLibDir)',
|
|
|
181 |
'--Var(LocalBinDir)',
|
|
|
182 |
'--Var(BinDir)', # Binary output directory
|
|
|
183 |
'--Var(ObjDir)', # Object output directory
|
|
|
184 |
'--Var(LibDir)', # Library output directory
|
|
|
185 |
'--Var(PackageBinDir)', # Package Bin dir
|
|
|
186 |
'--Var(PackageIncDir)', # Package Inc dir
|
|
|
187 |
'--Var(PackageLibDir)', # Package Lib dir
|
|
|
188 |
'--Var(PackagePkgDir)', # Package Pkg dir
|
|
|
189 |
'--Var(PackageDir)', # Package dir
|
|
|
190 |
'--Var(PackageToolDir)', # Tools dir
|
|
|
191 |
'--Var(PackageToolBin)', # Tools binaries dir
|
|
|
192 |
'--Var(PackageToolScript)', # Tools scripts dir
|
|
|
193 |
"--NoGenerate", "--Clean", @uargs );
|
|
|
194 |
}
|
|
|
195 |
|
| 1467 |
alewis |
196 |
1;
|