source: LMDZ6/branches/Amaury_dev/tools/fcm/lib/FCM/Context/Make.pm @ 5095

Last change on this file since 5095 was 5095, checked in by abarral, 2 months ago

Revert cosp*/ from the trunk, as it's external code
Add missing bits from FCM2 source

File size: 3.9 KB
Line 
1# ------------------------------------------------------------------------------
2# Copyright (C) 2006-2021 British Crown (Met Office) & Contributors.
3#
4# This file is part of FCM, tools for managing and building source code.
5#
6# FCM is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10#
11# FCM is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with FCM. If not, see <http://www.gnu.org/licenses/>.
18# ------------------------------------------------------------------------------
19use strict;
20use warnings;
21
22# ------------------------------------------------------------------------------
23package FCM::Context::Make;
24use base qw{FCM::Class::HASH};
25
26use constant {
27    ST_UNKNOWN =>  0,
28    ST_INIT    =>  1,
29    ST_OK      =>  2,
30    ST_FAILED  => -1,
31};
32
33__PACKAGE__->class({
34    ctx_of            => '%',
35    description       => '$',
36    dest              => '$',
37    dest_lock         => '$',
38    error             => {},
39    inherit_ctx_list  => '@',
40    name              => {isa => '$', default => q{}},
41    option_of         => '%',
42    prev_ctx          => __PACKAGE__,
43    status            => {isa => '$', default => ST_UNKNOWN},
44    steps             => '@',
45});
46
47# ------------------------------------------------------------------------------
481;
49__END__
50
51=head1 NAME
52
53FCM::Context::Make
54
55=head1 SYNOPSIS
56
57    use FCM::Context::Make;
58    my $ctx = FCM::Context::Make->new();
59
60=head1 DESCRIPTION
61
62Provides a context object for the FCM make system. It is a sub-class of
63L<FCM::Class::HASH|FCM::Class::HASH>.
64
65=head1 OBJECTS
66
67=head2 FCM::Context::Make
68
69An instance of this class represents a make. It has the following
70attributes:
71
72=over 4
73
74=item ctx_of
75
76A HASH containing the (keys) IDs and the (values) context objects of the make.
77
78=item description
79
80A description string for this make.
81
82=item dest
83
84The destination of this make.
85
86=item dest_lock
87
88The destination lock of this make.
89
90=item error
91
92This should be set to the value of the exception, if this make ends in one.
93
94=item inherit_ctx_list
95
96An ARRAY of contexts inherited by this make.
97
98=item name
99
100The name of the context. This is useful if we need to have multiple (but
101non-overlapping) "fcm make" runs in the same destination. (Default is a null
102string.)
103
104=item option_of
105
106A HASH to store the options of this make. See L</OPTION> for detail.
107
108=item status
109
110The status of the make.
111
112=item steps
113
114The names of the steps to make.
115
116=back
117
118=head1 OPTION
119
120The C<option_of> attribute of a FCM::Context::Make object may contain the
121following elements:
122
123=over 4
124
125=item config-file
126
127An ARRAY of configuration file names.
128
129=item directory
130
131The working directory of the make.
132
133=item ignore-lock
134
135Ignores lock file in the destination.
136
137=item jobs
138
139The number of (child) threads that can be run simultaneously.
140
141=item new
142
143Performs a make in "new" mode (as opposed to the "incremental" mode).
144
145=back
146
147=head1 CONSTANTS
148
149=over 4
150
151=item FCM::Context::Make->ST_UNKNOWN
152
153The status of a make context or the context of a subsystem. Status is unknown.
154
155=item FCM::Context::Make->ST_INIT
156
157The status of a make context or the context of a subsystem. The make or the
158subsystem has initialised, but not completed.
159
160=item FCM::Context::Make->ST_OK
161
162The status of a make context or the context of a subsystem. The make or the
163subsystem has completed successfully.
164
165=item FCM::Context::Make->ST_FAILED
166
167The status of a make context or the context of a subsystem. The make or the
168subsystem has failed.
169
170=back
171
172=head1 COPYRIGHT
173
174Copyright (C) 2006-2021 British Crown (Met Office) & Contributors.
175
176=cut
Note: See TracBrowser for help on using the repository browser.