* Bug 16062 fixed: tbx_make(Dir,'*') for all sections despite custom builder 43/20943/8
Samuel GOUGEON [Sun, 14 Apr 2019 12:36:26 +0000 (14:36 +0200)]
  http://bugzilla.scilab.org/16062

Change-Id: If5556e9837c1e4009ddf9d215e2e4c29111a768e

scilab/CHANGES.md
scilab/modules/modules_manager/help/en_US/tbx_make.xml
scilab/modules/modules_manager/macros/tbx_make.sci

index c7e9ccb..1943026 100644 (file)
@@ -413,6 +413,7 @@ Bug Fixes
 * [#16046](https://bugzilla.scilab.org/16046): After `w=ssrand(2,3,4)`, `[]+w`, `[]-w`, `w+[]` and `w-[]` yielded an "operation +/- []" warning.
 * [#16051](https://bugzilla.scilab.org/16051): undefined list elements could be of 2 distinct typeof "void" or "listundefined" according to the way they are created.
 * [#16053](https://bugzilla.scilab.org/16053): `plot(,"color",c)` no longer supported standard abbreviated color names c like "k" for black.
+* [#16062](https://bugzilla.scilab.org/16062): `tbx_make` did not allow easily to force building all toolbox sections without the toolbox builder (if any). `tbx_make(Dir,"*")` now does it.
 * [#16065](https://bugzilla.scilab.org/16065): Building help pages including some <scilab:image> tags used and finally deleted the current on-screen figures (if any)!
 * [#16067](https://bugzilla.scilab.org/16067): The display of matrices of signed integers was misaligned (regression of 6.0.0 vs 5.5.2)
 * [#16071](https://bugzilla.scilab.org/16071): `prettyprint(complex(1,%nan))` omitted the "+" in `1 + Nani`. It printed positive exponents with a useless "+". For any input nul polynomial, the string result never included the name of the variable. Default input arguments could not be skipped. ExportFormat was uselessly case-sensitive. For tex|latex: for text input, $ \ % & { } ~ and ^ special characters were not protected ; spaces were not protected, all words were concatenated ; for polynomials and rationals, the result string could be extremely long and not easily wrappable. For MathML: "<" was not protected ; <mi></mi> were missing for text input ; <mtable>, </mtable>, <mtr>, </mtr>, <mtd>, <mfenced> and </mfenced> tags were not wrapped and could not be indented. Delimiters: "" was not documented as possible value ; ")" was wrongly documented. Dynamical linear systems were not documented as possible input.
index 2c57e0b..fbd9259 100644 (file)
@@ -2,9 +2,9 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) INRIA
- * Copyright (C) 2016 - Scilab Enterprises - Pierre-Aimé AGNEL
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2016 - Scilab Enterprises - Pierre-Aimé AGNEL
+ * Copyright (C) 2019 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -41,7 +41,7 @@
             <varlistentry>
                 <term>tbx_path</term>
                 <listitem>
-                    <para>a single string; path to the toolbox root directory.</para>
+                    <para>a single string: absolute or relative path to the toolbox root directory.</para>
                     <para>Default path is the current working directory.</para>
                 </listitem>
             </varlistentry>
                 <term>sections</term>
                 <listitem>
                     <para>
-                        a matrix of string; list of the toolbox sections to be buit, amongst
+                        matrix of strings: Names of the toolbox sections to be built, amongst
                         <literal>["macros", "help", "src", "sci_gateway", "localization"]</literal>.
+                        <literal>"*"</literal> can be used to force building all available
+                        sections instead of running the builder script when it exists.
                     </para>
                     <para>
-                        Default or <literal>[]</literal> will select all possible sections.
+                        Default or <literal>[]</literal> will select all available sections
+                        in case of missing builder script.
                     </para>
                 </listitem>
             </varlistentry>
     <refsection role="description">
         <title>Description</title>
         <para>
-            The short name (id) <literal>tbx_name</literal> of the toolbox is retrieved as the basename of the
-            <literal>etc/*.start</literal> file. This file is mandatory, even if it is empty.
+            The short name (id) <literal>tbx_name</literal> of the toolbox is retrieved as the
+            basename of the <literal>etc/*.start</literal> file.
+            This file is mandatory, even if it is empty.
         </para>
         <para>
             <varname>tbx_make</varname> builds the toolbox pointed to by its root directory
             <varname>tbx_path</varname>, by executing an explicit or default builder script.
         </para>
         <para>
-            <varname>tbx_path</varname> is scanned for a script named like <literal>build*.sce</literal>.
+
+        </para>
+        <para>
+            If some <varname>sections</varname> are explicitly required to build,
+            <literal>tbx_make(..)</literal> runs a default builder for each of them.
         </para>
         <para>
-            If such a file is found and no specific <varname>sections</varname> are requested to
-            build, <varname>tbx_make</varname> executes the available builder script, and that's it.
+            Otherwise, <literal>tbx_path</literal> is scanned for a script named like
+            <literal>build*.sce</literal>.
+            <itemizedlist>
+                <listitem>
+                    If such a file is found, <literal>tbx_make</literal> executes it, and that's it.
+                </listitem>
+                <listitem>
+                    Otherwise, all available toolbox sections are built with the default builders.
+                </listitem>
+            </itemizedlist>
         </para>
         <para>
-            Otherwise, <varname>tbx_make</varname> builds the toolbox using directory naming
-            conventions. The sections of the toolbox are processed according to the following conventions:
+            Default builders process the sections of the toolbox according to the following conventions:
         </para>
         <para>
             <informaltable border="1" valign="top">
                         <literal>macros/</literal>
                     </th>
                     <td>
-                        All macros files <literal>*.sci</literal> available in the <literal>~/macros/*</literal>
-                        directory are compiled and gathered into a library named <term>tbx_name</term>lib
-                        (see <link linkend="tbx_builder_macros">tbx_builder_macros</link>)
+                        All macros files <literal>*.sci</literal> available in the
+                        <literal>~/macros/*</literal> directory are compiled and gathered into a
+                        library named <literal><emphasis role="bold">tbx_name</emphasis>lib</literal>
+                        (Please see <link linkend="tbx_builder_macros">tbx_builder_macros</link>).
+                        <para/>
+                        Unless there is a custom macros builder script in <literal>~/macros/*</literal>,
+                        no automatical recursive processing aiming to build sublibraries in
+                        subdirectories is performed.
                     </td>
                 </tr>
                 <tr>
                     </th>
                     <td>
                         Functional external code in src is compiled.
-                        (see <link linkend="tbx_builder_src">tbx_builder_src</link>)
+                        (Please see <link linkend="tbx_builder_src">tbx_builder_src</link>)
                     </td>
                 </tr>
                 <tr>
                     </th>
                     <td>
                         gateway functions in sci_gateway are compiled.
-                        (see <link linkend="tbx_builder_gateway">tbx_builder_gateway</link>)
+                        (Please see <link linkend="tbx_builder_gateway">tbx_builder_gateway</link>)
                     </td>
                 </tr>
                 <tr>
                     <th>
-                        <literal>help/</literal>
+                        <literal>localization</literal>
                     </th>
                     <td>
-                        help is generated (see <link linkend="tbx_builder_help">tbx_builder_help</link>)
+                        Localization files are built and/or postprocessed
+                        (Please see <link linkend="tbx_build_localization">tbx_build_localization</link>)
                     </td>
                 </tr>
                 <tr>
                     <th>
-                        <literal>localization</literal>
+                        <literal>help/</literal>
                     </th>
                     <td>
-                        Localization files are processed
-                        (see <link linkend="tbx_build_localization">tbx_build_localization</link>)
+                        Help pages are generated from XML source files stored in
+                        <literal>~/help/*</literal> available languages subdirectories
+                        (en_US, fr_FR, etc)
+                        (Please see <link linkend="tbx_builder_help">tbx_builder_help</link>).
                     </td>
                 </tr>
             </informaltable>
         </para>
         <para>
-            This default behaviour mimics the <literal>builder.sce</literal> script from the toolbox_skeleton
-            provided with Scilab.
-        </para>
-        <para>
-           Only the selected <varname>sections</varname> are built.
+            This default behaviour mimics the <literal>builder.sce</literal> script provided in the
+            toolbox_skeleton template module available in <literal>SCI/contrib</literal>.
         </para>
         <para>
             <literal>loader.sce</literal>, <literal>unloader.sce</literal> and <literal>cleaner.sce</literal>
     <refsection>
         <title>Examples</title>
         <programlisting role="no-scilab-exec"><![CDATA[
-// Builds the toolbox mytoolbox at current location
-tbx_make() // build the toolbox in the current working directory
-tbx_make(".", "macros") build the macros in "./macros/" from the current directory.
+// The working directory is set at the toolbox root:
+tbx_make()          // builds the toolbox with the toolbox builder (if any),
+                    //  or for all sections with default builders otherwise.
+tbx_make .  macros  // builds only its macros section from files in ./macros/
+tbx_make .  *       // builds all available sections, without using the toolbox builder
 
 // Builds the toolbox located in path/to/mytoolbox directory
 tbx_make("path/to/mytoolbox")
index addf3e1..5bb0c13 100644 (file)
@@ -1,8 +1,7 @@
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 // Copyright (C) 2016 - Scilab Enterprises - Pierre-Aimé AGNEL
-// Copyright (C) 2016, 2018 - Samuel GOUGEON
-//
 // Copyright (C) 2012 - 2016 - Scilab Enterprises
+// Copyright (C) 2016, 2018, 2019 - Samuel GOUGEON
 //
 // This file is hereby licensed under the terms of the GNU GPL v2.0,
 // pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -51,7 +50,7 @@ function [] = tbx_make(tbx_path, sections)
         tbx_path = pwd()
     end
     noSelectedSections = ~isdef("sections","l") || sections==[]
-    if noSelectedSections then
+    if noSelectedSections | and(sections=="*") then
         sections = ["macros", "help", "src", "sci_gateway", "localization"]
     end
 
@@ -74,7 +73,7 @@ function [] = tbx_make(tbx_path, sections)
 
     // Default is to exec builder (in current directory or given tbx_path)
     buildscript = findfiles(tbx_path, "build*.sce");
-    if ~isempty(buildscript) & noSelectedSections 
+    if ~isempty(buildscript) & noSelectedSections
         exec(tbx_path + "/" + buildscript);
         return
     end