<commit_before>-----------------------------------------------------------------------
--  gen-artifacts-distribs -- Artifact for distributions
--  Copyright (C) 2012 <NAME>
--  Written by <NAME> (<EMAIL>)
--
--  Licensed under the Apache License, Version 2.0 (the "License");
--  you may not use this file except in compliance with the License.
--  You may obtain a copy of the License at
--
--      http://www.apache.org/licenses/LICENSE-2.0
--
--  Unless required by applicable law or agreed to in writing, software
--  distributed under the License is distributed on an "AS IS" BASIS,
--  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--  See the License for the specific language governing permissions and
--  limitations under the License.
-----------------------------------------------------------------------
with Ada.Directories;
with Ada.Exceptions;

with Util.Files;
with Util.Strings;
with Util.Log.Loggers;

with Gen.Utils;
with Gen.Artifacts.Distribs.Copies;
with Gen.Artifacts.Distribs.Exec;
with Gen.Artifacts.Distribs.Concat;
with Gen.Artifacts.Distribs.Libs;

--  The <b>Gen.Artifacts.Distribs</b> package is an artifact for the generation of
--  application distributions.
--
--  1/ A package.xml file describes a set of distribution rules which indicate
--     how
package body Gen.Artifacts.Distribs is

   use Util.Log;

   Log : constant Loggers.Logger := Loggers.Create ("Gen.Artifacts.Distribs");

   --  ------------------------------
   --  Create a distribution rule identified by <b>Kind</b>.
   --  The distribution rule is configured according to the DOM tree whose node is <b>Node</b>.
   --  ------------------------------
   function Create_Rule (Kind : in String;
                         Node : in DOM.Core.Node) return Distrib_Rule_Access is
   begin
      Log.Debug ("Creating distribution rule {0}", Kind);

      if Kind = "copy" or Kind = "" then
         return Gen.Artifacts.Distribs.Copies.Create_Rule (Node, False);
      elsif Kind = "copy-first" then
         return Gen.Artifacts.Distribs.Copies.Create_Rule (Node, True);
      elsif Kind = "exec" then
         return Gen.Artifacts.Distribs.Exec.Create_Rule (Node, False);
      elsif Kind = "copy-exec" then
         return Gen.Artifacts.Distribs.Exec.Create_Rule (Node, True);
      elsif Kind = "concat" then
         return Gen.Artifacts.Distribs.Concat.Create_Rule (Node);<commit_msg>Add the new artifact bundle<commit_after>-----------------------------------------------------------------------
--  gen-artifacts-distribs -- Artifact for distributions
--  Copyright (C) 2012, 2013 <NAME>
--  Written by <NAME> (<EMAIL>)
--
--  Licensed under the Apache License, Version 2.0 (the "License");
--  you may not use this file except in compliance with the License.
--  You may obtain a copy of the License at
--
--      http://www.apache.org/licenses/LICENSE-2.0
--
--  Unless required by applicable law or agreed to in writing, software
--  distributed under the License is distributed on an "AS IS" BASIS,
--  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--  See the License for the specific language governing permissions and
--  limitations under the License.
-----------------------------------------------------------------------
with Ada.Directories;
with Ada.Exceptions;

with Util.Files;
with Util.Strings;
with Util.Log.Loggers;

with Gen.Utils;
with Gen.Artifacts.Distribs.Copies;
with Gen.Artifacts.Distribs.Exec;
with Gen.Artifacts.Distribs.Concat;
with Gen.Artifacts.Distribs.Libs;
with Gen.Artifacts.Distribs.Bundles;

--  The <b>Gen.Artifacts.Distribs</b> package is an artifact for the generation of
--  application distributions.
--
--  1/ A package.xml file describes a set of distribution rules which indicate
--     how
package body Gen.Artifacts.Distribs is

   use Util.Log;

   Log : constant Loggers.Logger := Loggers.Create ("Gen.Artifacts.Distribs");

   --  ------------------------------
   --  Create a distribution rule identified by <b>Kind</b>.
   --  The distribution rule is configured according to the DOM tree whose node is <b>Node</b>.
   --  ------------------------------
   function Create_Rule (Kind : in String;
                         Node : in DOM.Core.Node) return Distrib_Rule_Access is
   begin
      Log.Debug ("Creating distribution rule {0}", Kind);

      if Kind = "copy" or Kind = "" then
         return Gen.Artifacts.Distribs.Copies.Create_Rule (Node, False);
      elsif Kind = "copy-first" then
         return Gen.Artifacts.Distribs.Copies.Create_Rule (Node, True);
      elsif Kind = "exec" then
         return Gen.Artifacts.Distribs.Exec.Create_Rule (Node, False);
      elsif Kind = "copy-exec" then
         return Gen.Artifacts.Distribs.Exec.Create_Rule (Node, True);
      elsif Kind = "concat" then
         return Gen.Artifacts.Distribs.Concat.Create_Rule (Node);
      elsif Kind = "bundle" then
         return Gen.Artifacts.Distribs.Bundles.Create_Rule (Node);
{'fraction_non_alphanumeric': 0.17658849468831428, 'fraction_numerical': 0.004810583283223091, 'mean_word_length': 2.2193548387096773, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '338390', 'n_tokens_mistral': 1399, 'n_tokens_neox': 1365, 'n_words': 467}