source: LMDZ6/branches/Amaury_dev/tools/fcm/lib/FCM/System/Make/Build/FileType/Data.pm @ 5129

Last change on this file since 5129 was 5129, checked in by abarral, 8 weeks ago

Re-add removed by mistake fcm

File size: 2.6 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::System::Make::Build::FileType::Data;
24use base qw{FCM::System::Make::Build::FileType};
25
26use FCM::Context::Make::Build;    # for FCM::Context::Make::Build::Target
27use FCM::System::Make::Build::Task::Install;
28
29# Handler of tasks
30my %TASK_CLASS_OF = (install => 'FCM::System::Make::Build::Task::Install');
31
32sub new {
33    my ($class, $attrib_ref) = @_;
34    bless(
35        FCM::System::Make::Build::FileType->new({
36            id                    => q{},
37            source_analyse_dep_of => {},
38            source_to_targets     => \&_source_to_targets,
39            target_file_ext_of    => {},
40            task_class_of         => {%TASK_CLASS_OF},
41            %{$attrib_ref},
42        }),
43        $class,
44    );
45}
46
47# Returns a list of targets for a given build source.
48sub _source_to_targets {
49    my ($attrib_ref, $source) = @_;
50    FCM::Context::Make::Build::Target->new(
51        {   category => FCM::Context::Make::Build::Target->CT_ETC,
52            key      => $source->get_ns(),
53            task     => 'install',
54        }
55    );
56}
57
58# ------------------------------------------------------------------------------
591;
60__END__
61
62=head1 NAME
63
64FCM::System::Make::Build::FileType::Data
65
66=head1 SYNOPSIS
67
68    use FCM::System::Make::Build::FileType::Data;
69    my $helper = FCM::System::Make::Build::FileType::Data->new();
70    $helper->source_analyse($handle);
71
72=head1 DESCRIPTION
73
74A class based on
75L<FCM::System::Make::Build::FileType|FCM::System::Make::Build::FileType>
76with configurations to install data files to the etc/ sub-directory of a build.
77
78=head1 COPYRIGHT
79
80Copyright (C) 2006-2021 British Crown (Met Office) & Contributors.
81
82=cut
Note: See TracBrowser for help on using the repository browser.