Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1684 dpurdie 1
########################################################################
2
# Copyright (C) 2010 Vix-ERG Limited, All rights reserved
3
#
4
# Module name   : ZendDirective.pm
5
# Module type   : Makefile system
6
# Compiler(s)   : Perl
7
# Environment(s): jats
8
#
9
# Description   : See: TECHGP-00254 Jats Integration of ZendGuard
10
#
11
#......................................................................#
12
 
13
require 5.008_002;
14
use strict;
15
use warnings;
16
 
17
use Pod::Usage;
18
use Getopt::Long;
19
 
20
use JatsError;
21
 
22
#
23
#   Globals
24
#
25
our $ScmPlatform;                       # Target Platform
26
 
27
#-------------------------------------------------------------------------------
28
# Function        : MakeZendGuard
29
#
30
# Description     : This directive supports the processing of a ZendGuard
31
#                   project file via the ZendGuard utility
32
#
33
# Inputs          : $platform   - Platform selector
34
#                   $script     - Name of the script
35
#                   @elements   - Options and arguments
36
#
37
#                   Valid Options and Arguments
38
#                       --Verbose           - Increase verbosity
39
#                       --Verbose=n         - Set verbosity
40
#                       --Src=Path          - Source Subdir
41
#                                             Default: '.'
42
#                       --Package=Name      - Package into pkg/Name within
43
#                                             the output package
44
#                                             Default is to place the encoded
45
#                                             directory tree within the BinDir
46
#                                             in a subdirectory called 'php'
47
#
48
#
49
sub MakeZendGuard
50
{
51
    my( $platforms, $script, @elements ) = @_;
52
    my $verbose = 0;
53
    my  @args;
54
 
55
    return if ( ! ActivePlatform($platforms) );
56
 
57
    #
58
    #   Directive is only supported on the PHP platform
59
    #
60
    Error ("'MakeZendGuard' directive is only supported on the PHP platform")
61
        unless( $ScmPlatform eq 'PHP' );
62
 
63
    #
64
    #   Parse the command line arguments
65
    #
66
    foreach ( @elements )
67
    {
68
        if ( m~^--Verbose~i ) {
69
            push @args, $_;
70
 
71
        } elsif ( m~^--Src=(.+)~ ) {
72
            push @args, $_;
73
 
74
        } elsif ( m~^--Package=(.+)~ ) {
75
            push @args, $_;
76
 
77
 
78
        } else {
79
            Error ("MakeZendGuard: Unknown option: $_");
80
        }
81
    }
82
 
83
    #
84
    #   Create build time recipe to perform the hard work
85
    #       Will be done during the 'generate' phase
86
    #       Will always be done
87
    #       Output will be packaged directly
88
    #
89
    GenerateFiles ('*', '--Tool=ZendGuard.pl',
90
                        '--Text=Processing PHP with ZenGuard',
91
                        '--UnknownPreq',
92
                        '--NoGenerate',
93
                        '--Clean',
94
                        '--Var(PackageDir)',
95
                        '--Var(Target)',                          # Underlying Target
96
                        '--Var(Type)',                            # Build Type
97
                        '--Var(ObjDir)',                          # Work directory
98
                        '--Var(BinDir)',                          # Possible output directory
99
                        "-script=--Prerequisite($script)",
100
                        @args,
101
                        );
102
}
103