diff options
Diffstat (limited to 'Master/texmf-dist')
189 files changed, 18600 insertions, 11265 deletions
diff --git a/Master/texmf-dist/doc/support/arara/README b/Master/texmf-dist/doc/support/arara/README deleted file mode 100644 index 4c75b41a66f..00000000000 --- a/Master/texmf-dist/doc/support/arara/README +++ /dev/null @@ -1,11 +0,0 @@ -Welcome to arara! - -Current version: 3.0a (patched to support Java 9) -Author/maintainer: Paulo Roberto Massa Cereda -Released under the New BSD license - -https://github.com/cereda/arara - -arara is a TeX automation tool based on rules and directives. It gives you subsidies to enhance your TeX experience. The tool is an effort to provide a concise way to automate the daily TeX workflow for users and also package writers. Users might write their own rules when the provided ones do not suffice. - -arara requires a Java virtual machine. diff --git a/Master/texmf-dist/doc/support/arara/README.md b/Master/texmf-dist/doc/support/arara/README.md new file mode 100644 index 00000000000..0ba4f59b3c2 --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/README.md @@ -0,0 +1,73 @@ +![arara](https://i.stack.imgur.com/hjUsN.png) + +# arara + +![Version: 4.0](https://img.shields.io/badge/current_version-4.0-blue.svg?style=flat-square) +![Revision: 1](https://img.shields.io/badge/revision-1-blue.svg?style=flat-square) +![Language: Java](https://img.shields.io/badge/language-Java-blue.svg?style=flat-square) +![Minimum JRE: 5.0](https://img.shields.io/badge/minimum_JRE-5.0-blue.svg?style=flat-square) +[![License: New BSD](https://img.shields.io/badge/license-New_BSD-blue.svg?style=flat-square)](https://opensource.org/licenses/bsd-license) + +`arara` is a TeX automation tool based on rules and directives. It gives you a way to enhance your TeX experience. The tool is an effort to provide a concise way to automate the daily TeX workflow for users and also package writers. Users might write their own rules when the provided ones do not suffice. + +## Basic use + +To use `arara`, you need to tell it what to do. Unlike most other tools, you give `arara` these _directives_ in the document itself – usually near the top. So to run `pdflatex` once on your document, you should say something like: + +```tex +% arara: pdflatex +\documentclass{article} +\begin{document} +Hello, world! +\end{document} +``` + +Now when you run `arara myfile`, that directive (`% arara: ...`) will be seen and carried out as described by the `pdflatex` rule. You can read more about rules and directives in the user manual available in our [releases](https://github.com/cereda/arara/releases) section. In addition to documenting all of the rules that come standard with `arara`, the manual gives a detailed explanation of how `arara` works, as well as how to create and use your own rules. + +## Versions + +![Current version: 4.0](https://img.shields.io/badge/current_version-4.0-blue.svg?style=flat-square) +![Development version: 5.0](https://img.shields.io/badge/development_version-5.0-red.svg?style=flat-square) + +The stable major version of `arara` is the 4.0 series (note that revision numbers may vary). Please refer to the development branch for more information on the upcoming 5.0 series release. The master branch always refers to the stable version (including potential revisions). + +For historical purposes, the source code for older versions of `arara` is available in the [releases](https://github.com/cereda/arara/releases) section of our repository. However, be mindful that these versions are unsupported. + +## Build status + +[![Version: 4.0](https://img.shields.io/badge/version-4.0-blue.svg?style=flat-square)](https://travis-ci.org/cereda/arara/) +![Travis CI for 4.0](https://img.shields.io/travis/cereda/arara.svg?style=flat-square) +[![Version: 5.0](https://img.shields.io/badge/version-5.0-red.svg?style=flat-square)](https://travis-ci.org/cereda/arara/branches) +![Travis CI for 5.0](https://img.shields.io/travis/cereda/arara/development.svg?style=flat-square) + +`arara` uses [Travis CI](https://travis-ci.org) as a hosted continuous integration service. For each and every commit, we can see in real time the build status of our application checked against a range of Java VM vendors. It is worth noting that the current series is designed and built to be Java 5.0 compliant, so if you have an old JVM, it is almost sure that you will be able to run `arara` in it without any problems. + +## Support + +[![Gitter chatroom](https://img.shields.io/badge/gitter-join_chat-blue.svg?style=flat-square)](https://gitter.im/cereda/arara) +[![GitHub issues](https://img.shields.io/badge/github-issues-blue.svg?style=flat-square)](https://github.com/cereda/arara/issues) + +We use a [Gitter](https://gitter.im/cereda/arara) chatroom for discussing things related to `arara`. You are more than welcome to come join the fun and say *hi!* to us. We also have the [issues](https://github.com/cereda/arara/issues) section in our repository as a valid channel to report problems, bugs and suggest improvements. + +## Localization + +Would you like to make `arara` speak your own language? Splendid! We would love to have you in the team! Just send us an e-mail, join our dedicated chatroom or open an issue about it. The localization process is quite straightforward, we can help you! Any language is welcome! + +A big thanks to our translators Marco Daniel, Clemens Niederberger, Ulrike Fischer, Gert Fischer, Enrico Gregorio and Marijn Schraagen for the awesome localization work! + +## Downloads + +[![Download from GitHub](https://img.shields.io/badge/github-4.0-blue.svg?style=flat-square)](https://github.com/cereda/arara/releases) +[![Download from Bintray](https://img.shields.io/badge/bintray-4.0-blue.svg?style=flat-square)](https://bintray.com/cereda/arara) + +From the 4.0 series on, the team decided to not release cross-platform installers any more. Our tool is available out of the shelf on all major TeX distributions, including TeX Live and MiKTeX, which makes manual installation unnecessary given the significant coverage of such distributions. Chances are you already have `arara` in your system! + +You can obtain the official package available in the [releases](https://github.com/cereda/arara/releases) section of our project repository, as well as the [Bintray](https://bintray.com/cereda/arara) software distribution service. Please refer to the documentation on how to manually deploy our tool. + +## License + +This application is licensed under the [New BSD License](http://www.opensource.org/licenses/bsd-license.php). Please note that the New BSD License has been verified as a GPL-compatible free software license by the [Free Software Foundation](http://www.fsf.org/), and has been vetted as an open source license by the [Open Source Initiative](http://www.opensource.org/). + +## The team + +`arara`, the cool TeX automation tool, is brought to you by Paulo Cereda, Marco Daniel, Brent Longborough and Nicola Talbot. If you want to support TeX development by a donation, the best way to do this is donating to the [TeX Users Group](https://www.tug.org/donate.html). diff --git a/Master/texmf-dist/doc/support/arara/arara-manual.pdf b/Master/texmf-dist/doc/support/arara/arara-manual.pdf Binary files differnew file mode 100644 index 00000000000..80b70a56564 --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/arara-manual.pdf diff --git a/Master/texmf-dist/doc/support/arara/arara-manual.tex b/Master/texmf-dist/doc/support/arara/arara-manual.tex new file mode 100644 index 00000000000..c46b529f0fc --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/arara-manual.tex @@ -0,0 +1,202 @@ +% arara: manual + +% Arara, the cool TeX automation tool +% Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda +% All rights reserved. +% +% Redistribution and use in source and binary forms, with or without +% modification, are permitted provided that the following conditions +% are met: +% +% 1. Redistributions of source code must retain the above copyright +% notice, this list of conditions and the following disclaimer. +% +% 2. Redistributions in binary form must reproduce the above copyright +% notice, this list of conditions and the following disclaimer in the +% documentation and/or other materials provided with the distribution. +% +% 3. Neither the name of the project's author nor the names of its +% contributors may be used to endorse or promote products derived from +% this software without specific prior written permission. +% +% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +% "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +% FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +% COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +% INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +% BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +% LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY +% WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +% POSSIBILITY OF SUCH DAMAGE. +\documentclass[a4paper,oneside,12pt]{memoir} + +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} +\usepackage[margin=2.5cm]{geometry} +\usepackage{arara} +\usepackage[record,postpunc=dot]{glossaries-extra} + +\newcommand{\araraversion}{4.0} + +\glssetcategoryattribute{abbreviation}{glossdesc}{firstuc} +\glssetcategoryattribute{general}{glossname}{firstuc} +\glssetcategoryattribute{general}{glossdesc}{firstuc} + +\setabbreviationstyle{short-nolong-desc} +\renewcommand{\glsxtrshortdescname}{% + \protect\glsabbrvfont{\the\glsshorttok} (\the\glslongtok)% +} + + \newabbreviation + [description={an interface that allows users to interact +through graphical components, such as buttons and menus}] + {GUI}{GUI}{Graphical User Interface} + + \newabbreviation + [description={an organisation that develops and promotes Internet standards}] + {IETF}{IETF}{Internet Engineering Task Force} + + \newabbreviation + [description={a virtual machine that enables Java programs to be run}] + {JVM}{JVM}{Java Virtual Machine} + + \newabbreviation + [description={a hybrid, dynamic, statically typed, embeddable + expression language and runtime for the Java platform}, + location={(See Chapter~\ref{chap:mvel}.)}] + {MVEL}{MVEL}{MVFLEX Expression Language} + +\newglossaryentry{orb-tag}{name={orb tag}, + description={a dynamic element of an \gls{MVEL} template which is + evaluated at runtime}, + location={(See Section~\ref{sec:mvelbasictemplating}.)}} + +\newabbreviation + [description={a simple computer programming environment that takes + a single expression (input), evaluates it and results the result}] + {REPL}{REPL}{Read--Eval--Print Loop} + +\newabbreviation + [description={a database language}] + {SQL}{SQL}{Structured Query Language} + +\newabbreviation + [description={a markup language that defines a set of rules for +encoding documents in a format that is both human-readable and +machine-readable}] + {XML}{XML}{Extensible Markup Language} + +\newabbreviation + [description={human-friendly data, commonly used for configuration +files but also used for data storage or transmission}, + location={(See Chapter~\ref{chap:yaml}.)}] + {YAML}{YAML}{YAML Ain't Markup Language} + +\begin{document} + +\begin{titlingpage} +\vspace*{2em} + +\begin{center} +\includegraphics[scale=0.7]{../logos/logo2.pdf} + +\vspace{4em} + +\begin{tcolorbox}[ + boxrule=0pt, + colback=araracolour, + top=1em, + bottom=1em +] + \color{white} + \centering + \Huge + \sffamily + \bfseries User manual +\end{tcolorbox} + +\vspace{6em} + +{\large\em Paulo Cereda, Marco Daniel,\\ +Brent Longborough, and Nicola Talbot\par} + +\vspace{3em} + +\href{mailto:cereda.paulo@gmail.com}{\fpemail{0.4}}% +\quad\href{https://github.com/cereda/arara}{\fpgithub{0.4}}% +\quad\href{http://twitter.com/paulocereda}{\fptwitter{0.4}} + +\vfill + +{\color{araracolour} +\LARGE +\sffamily +\bfseries +Version \araraversion} + +\end{center} +\end{titlingpage} + +\chapterstyle{araraheadings} +\pagestyle{headings} +\frontmatter +\nouppercaseheads + +\cleardoublepage + +\vspace*{25em} + +\begin{flushright} +\em No birds were harmed in the making of this manual. +\end{flushright} + +\include{chapters/foreword} +\include{chapters/prologue} +\include{chapters/license} +\printunsrtglossary + +\cleardoublepage + +\vspace*{25em} + +\thispagestyle{empty} +\begin{flushright} +\em To Marco's son Niclas. +\end{flushright} + +\cleardoublepage + +\tableofcontents* + +\cleardoublepage + +\mainmatter + +\include{chapters/introduction} + +\part{The application} +\label{part:application} + +\include{chapters/concepts} +\include{chapters/cli} +\include{chapters/configuration} +\include{chapters/logging} +\include{chapters/methods} +\include{chapters/rules} + +\part{Development and deployment} +\label{part:developmentanddeployment} + +\include{chapters/building} +\include{chapters/deploying} + +\part{A primer on formats and scripting} +\label{part:primer} + +\include{chapters/yaml} +\include{chapters/mvel} + +\end{document} diff --git a/Master/texmf-dist/doc/support/arara/arara-usermanual.pdf b/Master/texmf-dist/doc/support/arara/arara-usermanual.pdf Binary files differdeleted file mode 100644 index 1a40b22f748..00000000000 --- a/Master/texmf-dist/doc/support/arara/arara-usermanual.pdf +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/arara-usermanual.tex b/Master/texmf-dist/doc/support/arara/arara-usermanual.tex deleted file mode 100644 index 9add503f320..00000000000 --- a/Master/texmf-dist/doc/support/arara/arara-usermanual.tex +++ /dev/null @@ -1,3498 +0,0 @@ -% arara: pdflatex -% arara: pdflatex -% arara: biber -% arara: pdflatex -% arara: pdflatex -% arara: clean: { files: [ arara-usermanual.aux, arara-usermanual.bbl ] } -% arara: clean: { files: [ arara-usermanual.bcf, arara-usermanual.cod ] } -% arara: clean: { files: [ arara-usermanual.blg, arara-usermanual.lof ] } -% arara: clean: { files: [ arara-usermanual.lot, arara-usermanual.out ] } -% arara: clean: { files: [ arara-usermanual.toc, arara-usermanual.log ] } -% arara: clean: { files: [ arara-usermanual.run.xml ] } -% ------------------------------------------------- -% Arara -- the cool TeX automation tool -% Copyright (c) 2012, Paulo Roberto Massa Cereda -% All rights reserved. -% -% Redistribution and use in source and binary forms, with or without -% modification, are permitted provided that the following conditions -% are met: -% -% 1. Redistributions of source code must retain the above copyright -% notice, this list of conditions and the following disclaimer. -% -% 2. Redistributions in binary form must reproduce the above copyright -% notice, this list of conditions and the following disclaimer in the -% documentation and/or other materials provided with the distribution. -% -% 3. Neither the name of the project's author nor the names of its -% contributors may be used to endorse or promote products derived from -% this software without specific prior written permission. -% -% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -% "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -% FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -% COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -% INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -% BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -% LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -% WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -% POSSIBILITY OF SUCH DAMAGE. -% ------------------------------------------------- - -\documentclass[a4paper,twoside,12pt]{memoir} - -% packages -% ------------------------------------------------- -\usepackage[T1]{fontenc} -\usepackage[utf8]{inputenc} -\usepackage{arara} -% ------------------------------------------------- - -% bibliography -% ------------------------------------------------- -\addbibresource{references.bib} -% ------------------------------------------------- - -% current version -% ------------------------------------------------- -\newcommand{\araraversion}{3.0a} -% ------------------------------------------------- - -% document -% ------------------------------------------------- -\begin{document} - -% title page -% ------------------------------------------------- -\begin{titlingpage} - -\begin{center} -\vspace*{2em} - -\scalebox{1.15}{\araralogo} - -\vspace{2em} - -{\color{araracolor}\fontfamily{fco}\bfseries\Huge The cool \TeX{} automation tool} - -\vspace{10em} - -{\Huge\sffamily\bfseries User Manual} - -\vspace{3em} - -{\large -\tabcolsep=1em -\begin{tabular}{cc} -\multicolumn{2}{c}{Paulo R.\ M.\ Cereda}\\ -\multicolumn{2}{c}{\url{cereda@users.sf.net}}\\[1.5em] -Marco Daniel & Brent Longborough\\ -\url{marco.daniel@mada-nada.de} & \url{brent@longborough.org} -\end{tabular}} - -\vfill - -{\LARGE\sffamily\bfseries Version \araraversion} - -\end{center} - -\end{titlingpage} -% ------------------------------------------------- - -% set styles -% ------------------------------------------------- -\chapterstyle{madsen} -\pagestyle{headings} -\frontmatter -\nouppercaseheads -% ------------------------------------------------- - -% Prologue -% ------------------------------------------------- -\chapter*{Prologue} -\label{chap:prologue} - -\epigraph{\emph{Moral of the story: never read the documentation, bad things happen.}}{David Carlisle} - -When I released the very first version of \arara on a Friday 13th, April 2012, I never thought the tool would -receive so many positive comments and feedback. To be honest, since \arara was written for helping me -with my own personal \LaTeX\ projects, I really doubted if the tool could be of service to anyone else. And, -to my surprise, it seems \arara did good. To a lot of people around the \TeX\ world. - -I never intended to release the tool to the whole world, since I wasn't sure if other people could benefit from -\arara's features. After all, there's already a plethora of tools available to the \TeX\ community in general, -although with different approaches. The reason I decided to make \arara publicly available is quite simple: -I wanted to somehow contribute to the \TeX\ community, and I wanted to give my best to make such -community even more awesome. - -As time goes by, I'm quite satisfied with the current state of \arara~--~this is our 3rd major release. We -have reached a very mature code and a great team of developers, translators and testers. Since version 1.0, -the code evolved a lot -- new features, lots of bug fixes, improvements -- thanks to all the feedback I -received. In my humble opinion, that's how any project should evolve: based on what our users expect and -want to achieve. I'm proud to see \arara being 100\% community-driven, it's a big achievement for a project -with less than one year old. - -First of all, I'd like to thank some friends of mine that really made \arara possible: Alan Munn, for providing -great ideas and suggestions to the manual; Andrew Stacey, for heavily testing \arara, providing great user -cases, and for suggesting improvements to the program; Brent Longborough, a member of the core team, -for providing great suggestions and ideas to the program logic, writing rules, testing the code and also for -working with the Portuguese and Turkish translations; Clemens Niederberger, for testing \arara, and also -writing a great tutorial about it in his -\href{http://www.mychemistry.eu/2012/06/arara-automate-latex-birds-music/}{blog on chemistry and \LaTeX}; -David Carlisle, for reminding me to work on \arara, and also encouraging me to write answers about it in -our \TeX\ community; Enrico Gregorio, for reviewing the original manual, testing \arara, providing great -ideas and suggestions to the manual and to the program itself, and for working with the Italian translation; -Francesco Endrici, for providing the very first \arara rule outside our core team; Harish Kumar, for being a -heavy \arara user and integrating it with WinEdt and Inlage; \.Ilhan Polat for working with Brent in the Turkish -translation; Joseph Wright, for testing it, providing contributed code for Linux and Mac installations, and also -blogging about \arara in his \href{http://www.texdev.net}{personal blog}; Gonzalo Medina, for providing the -Spanish translation; Mikaël Maunier, for providing the French translation; Marco Daniel, one of core team -members, for heavily testing \arara, suggesting enhancements to the manual and to the program itself, -providing lots of contributed rules for common tasks, and also for the German version; Patrick Gundlach, -for advertising \arara in the official Twitter channel of \href{http://www.dante.de}{Dante} -- the German -\TeX\ User Group; Sergey Ulyanov, for providing the Russian translation and contributed rules; Stefan Kottwitz, -for encouraging me to write an article about \arara, published in the -\href{http://latex-community.org/know-how/435-gnuplot-arara}{\LaTeX\ Community} forum, and also -tweeting about it. Thank you very much. I'm sorry if I forgot to mention somebody, I really have so much -people to thank and my memory happens to be very short. - -That said, I still believe that the warning featured in the first version of this manual still applies: -\textsc{Hic Sunt Dracones}. Though the code really evolved from the first commit I made, \arara is far from -being bug-free. And you will learn that \arara gives you enough rope. In other words, \emph{you} will be -responsible for how \arara behaves and all the consequences from your actions. Sorry to sound scary, but I -really needed to tell you this. After all, one of \arara's greatest features is the freedom it offers. But as you -know, freedom always comes at a cost. Please, don't send us angry letters -- or e-mails, perhaps -- if -something bad happen. - -Feedback is surely welcome for me to improve this humble tool, just write an e-mail to me or any other -member of the team and we will reply as soon as possible. The source code is fully available at -\url{http://github.com/cereda/arara}, feel free to contribute to the project by forking it, submitting bugs, -sending pull requests or even translating it to your language. If you want to support the \LaTeX\ development -by a donation, the best way to do this is donating to the \href{http://www.tug.org/}{\TeX\ Users Group}. -Please also consider joining our \TeX\ community at \href{http://tex.stackexchange.com}{StackExchange}. - -\vspace{2em} - -\begin{flushright} -Paulo Roberto Massa Cereda\\ -\emph{on behalf of the \arara team} -\end{flushright} - -%\vspace{8em} -\vfill - -\begin{center} -\scalebox{0.55}{\araralogo} - -\vspace{0.3em} - -{\color{araracolor}\fontfamily{fco}\bfseries\large Proudly made on Earth} -\end{center} -% ------------------------------------------------- - -\cleardoublepage - -% Special thanks -% ------------------------------------------------- -\section*{Special thanks} - -\begin{mdframed}[roundcorner=10pt,linecolor=araracolor,middlelinewidth=1pt] -\centering -{\renewcommand{\arraystretch}{1.5} -\sffamily -\begin{tabular}{ccc} -Alan Munn & Andrew Stacey & Brent Longborough\\ -Clemens Niederberger & David Carlisle & Enrico Gregorio\\ -Francesco Endrici & Harish Kumar & \.Ilhan Polat\\ -Joseph Wright & Gonzalo Medina & Mikaël Maunier\\ -Marco Daniel & Patrick Gundlach & Sergey Ulyanov\\ -Stefan Kottwitz & & -\end{tabular}} -\end{mdframed} - -\vspace{1em} - -\noindent\arara also makes use of some specific opensource Java projects and libraries in order to properly -work. I would like to thank the following projects and their respective developers: - -\begin{enumerate} -\item \href{http://commons.apache.org}{Apache Commons}, a project from the Apache Foundation focused -on all aspects of reusable Java components. \arara uses three of the Commons libraries: -\href{http://commons.apache.org/cli/}{CLI}, which provides a command line arguments parser, -\href{http://commons.apache.org/collections/}{Collections}, a library which extends the Java Collections -Framework, and \href{http://commons.apache.org/exec/}{Exec}, an API for dealing with external process -execution and environment management in Java. - -\item \href{http://logback.qos.ch}{Logback}, a logging framework intended to be the successor to the -popular \href{http://logging.apache.org/log4j/}{log4j} project. According to some benchmarks, it is faster -and has a smaller footprint than all existing logging systems, sometimes by a wide margin. - -\item \href{http://code.google.com/p/snakeyaml}{SnakeYAML}, a YAML parser and emitter for the Java -programming language. YAML is a data serialization format designed for human readability and interaction -with scripting languages. \arara uses YAML as the rule format. - -\item \href{http://www.slf4j.org/}{SLF4J}, a simple facade or abstraction for various logging frameworks, -allowing the end user to plug in the desired logging framework at deployment time. - -\item \href{http://mvel.codehaus.org}{MVEL}, a powerful expression language for Java-based applications. -It provides a plethora of features and is suited for everything from the smallest property binding and extraction, -to full blown scripts. \arara relies on MVEL to provide the expansion mechanism for rules. - -\item \href{http://maven.apache.org/}{Apache Maven}, a software project management and comprehension tool. -Based on the concept of a project object model, Maven can manage a project's build, reporting and documentation -from a central piece of information. - -\item \href{http://izpack.github.com}{IzPack}, a Java-based software installer builder that will run on any -operating system coming with a Java Virtual Machine that is compliant with the Oracle JVM 1.5 or higher. -\end{enumerate} - -A special thanks goes to my great friend \href{http://antoineneveux.fr/}{Antoine Neveux} for encouraging me to -try out the \href{http://maven.apache.org}{Apache Maven} software project management. In the past, \arara was -released as a NetBeans project, which is based on \href{http://ant.apache.org/}{Apache Ant}, another great tool -from the Apache Foundation. Although I'm really fine with Ant, thanks to Maven, now it is way easier to build and -to maintain the code. And it's always nice to learn another tool. - -And at last but not least, I want to thank you, dear reader and potential user, for giving \arara a try. Do not despair -if you don't succeed with \arara at first; just try again. I'm sure you will find your way. This humble project is -opensource and it will always be. Let the bird be your guide through the journey to the typographic land. Have a -good read. -% ------------------------------------------------- - -\cleardoublepage - -% Release information -% ------------------------------------------------- -\section*{Release information} - -\subsection*{Version 3.0} -\begin{itemize} -\item[\newfeature] Localizated messages in English, Brazilian Portuguese, German, Italian, Spanish, French, Turkish and Russian. -\item[\bugfix] Improved error analysis for rules and directives. -\item[\newfeature] Friendly and very detailed messages instead of generic ones. -\item[\newfeature] An optional configuration file is now available in order to customize and enhance the application behaviour. -\item[\bugfix] Improved rule syntax, new keys added. -\item[\newfeature] Now rules are unified in a plain format. No more compiled rules. -\item[\newfeature] Rules can allow an arbitrary number of commands instead of just one. -\item[\newfeature] Built-in functions in the rule context to ease the writing process. -\item[\bugfix] Improved expansion mechanism. -\end{itemize} - -{\renewcommand{\arraystretch}{1.5} -\begin{table}[ht] -\centering -\caption{Lines of code for version 3.0.} -\begin{tabular}{lrrrr} -\hline -\textbf{Language} & \textbf{Files} & \textbf{Blank} & \textbf{Comment} & \textbf{Code}\\ -\hline -\hline -Java & 25 & 847 & 2722 & 1659\\ -XML & 2 & 12 & 0 & 181\\ -\hline -Sum & 27 & 859 & 2722 & 1840\\ -\hline -\end{tabular} -\label{tab:locarara30} -\end{table}} - -\subsection*{Version 2.0} -\begin{itemize} -\item[\newfeature] - Added the |--timeout n| flag to allow setting a timeout for every task. If - the timeout is reached before the task ends, \arara will kill it and - interrupt the processing. The $n$ value is expressed in milliseconds. -\item[\bugfix] - Fixed the |--verbose| flag to behave as a realtime output. -\item[\newfeature] - There's no need of noninteractive commands anymore. \arara can now handle - user input through the |--verbose| tag. If the flag is not set and the - command requires user interaction, the task execution is interrupted. -\item[\bugfix] - Fixed the execution of some script-based system commands to ensure - cross-platform compatibility. -\item[\newfeature] - Added the |@{SystemUtils}| orb tag to provide specific operating system - checks. The orb tag maps the |SystemUtils| class from the amazing - \href{http://commons.apache.org/lang/}{Apache Commons Lang} library and - all of its methods and properties. -\end{itemize} - -{\renewcommand{\arraystretch}{1.5} -\begin{table}[ht] -\centering -\caption{Lines of code for version 2.0.} -\begin{tabular}{lrrrr} -\hline -\textbf{Language} & \textbf{Files} & \textbf{Blank} & \textbf{Comment} & \textbf{Code}\\ -\hline -\hline -Java & 20 & 608 & 1642 & 848\\ -XML & 1 & 0 & 0 & 12\\ -\hline -Sum & 21 & 608 & 1642 & 860\\ -\hline -\end{tabular} -\label{tab:locarara20} -\end{table}} - -\subsection*{Version 1.0.1} - -\begin{itemize} -\item[\newfeature] - Added support for |.tex|, |.dtx| and |.ltx| files. When no extension is - provided, \arara will automatically look for these extensions in this - specific order. -\item[\newfeature] - Added the |--verbose| flag to allow printing the complete log in the - terminal. A short |-v| tag is also available. Both |stdout| and |stderr| - are printed. -\item[\bugfix] - Fixed exit status when an exception is thrown. Now \arara also returns a - non-zero exit status when something wrong happened. Note that this - behaviour happens only when \arara is processing a file. -\end{itemize} - -{\renewcommand{\arraystretch}{1.5} -\begin{table}[ht] -\centering -\caption{Lines of code for version 1.0.1.} -\begin{tabular}{lrrrr} -\hline -\textbf{Language} & \textbf{Files} & \textbf{Blank} & \textbf{Comment} & \textbf{Code}\\ -\hline -\hline -Java & 20 & 585 & 1671 & 804\\ -XML & 1 & 0 & 6 & 12\\ -\hline -Sum & 21 & 585 & 1677 & 816\\ -\hline -\end{tabular} -\label{tab:locarara101} -\end{table}} - -\subsection*{Version 1.0} - -\begin{itemize} -\item[\newfeature] First public release. -\end{itemize} - -{\renewcommand{\arraystretch}{1.5} -\begin{table}[ht] -\centering -\caption{Lines of code for version 1.0.} -\begin{tabular}{lrrrr} -\hline -\textbf{Language} & \textbf{Files} & \textbf{Blank} & \textbf{Comment} & \textbf{Code}\\ -\hline -\hline -Java & 20 & 524 & 1787 & 722\\ -XML & 1 & 0 & 6 & 12\\ -\hline -Sum & 21 & 524 & 1793 & 734\\ -\hline -\end{tabular} -\label{tab:locarara10} -\end{table}} -% ------------------------------------------------- - -\cleardoublepage - -% License -% ------------------------------------------------- -\section*{License} -\label{sec:license} - -\arara is licensed under the -\href{http://www.opensource.org/licenses/bsd-license.php}{New BSD License}. It's -important to observe that the New BSD License has been verified as a -GPL-compatible free software license by the -\href{http://www.fsf.org/}{Free Software Foundation}, and has been vetted as an -open source license by the -\href{http://www.opensource.org/}{Open Source Initiative}. - -\vspace{1.5em} - -\ornamentline - -\vfill - -\begin{mdframed}[roundcorner=10pt,linecolor=araracolor,middlelinewidth=1pt] -\noindent -\begingroup - \color{araracolor}\fontfamily{fco}\bfseries - \arara \ -- the cool \TeX{} automation tool -\endgroup - -\vspace{.5em} - -\noindent Copyright \copyright{} 2012, Paulo Roberto Massa Cereda - -\noindent All rights reserved. - -\vspace{1em} - -\noindent Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -\vspace{1em} - -\begin{itemize} -\item Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -\item Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -\end{itemize} - -\vspace{1em} - -\noindent\textsc{This software is provided by the copyright holders and -contributors ``as is'' and any express or implied warranties, including, but not - limited to, the implied warranties of merchantability and fitness for a -particular purpose are disclaimed. In no event shall the copyright holder or -contributors be liable for any direct, indirect, incidental, special, exemplary, - or consequential damages (including, but not limited to, procurement of -substitute goods or services; loss of use, data, or profits; or business -interruption) however caused and on any theory of liability, whether in contract, - strict liability, or tort (including negligence or otherwise) arising in any -way out of the use of this software, even if advised of the possibility of such -damage.} -\end{mdframed} -% ------------------------------------------------- - -\cleardoublepage - -\vspace*{25em} - -\begin{flushright} -\em To my cat Fubá, who loves birds. -\end{flushright} - -\cleardoublepage - -% TOC and list of codes -% ------------------------------------------------- -\tableofcontents* - -\cleardoublepage - -\listoffigures* - -\cleardoublepage - -\listoftables* - -\cleardoublepage - -\listofcodes* -% ------------------------------------------------- - -\mainmatter - -\part{The application} -\label{part:application} - -\chapter{Introduction} -\label{chap:introduction} - -\epigraph{\emph{You can do such a lot with a Wompom, you can use every part of it too. -For work or for pleasure, it's a triumph, it's a treasure, -oh there's nothing that a Wompom cannot do.}}{Flanders \& Swann} - -Hello there, welcome to \arara! I'm glad you were not intimidated by the threatening -message in the prologue. This chapter is actually a quick introduction to what you -can expect from \arara. Don't be afraid, it will be easy to digest, I promise. - -\section{What is \texorpdfstring{\arara}{arara}?} -\label{sec:whatisarara} - -Good question! \arara is a \TeX\ automation tool based on rules and directives. It is, -in some aspects, similar to other well-known tools like |latexmk|~\cite{collins:2001} -and |rubber|~\cite{rubber:2009}. The key difference might be the fact that \arara -aims at explicit instructions in the source code in order to determine what to do instead -of relying on other resources, such as log file analysis. It's a different approach for an automation tool, and -we have both advantages and disadvantages of such decision. Let's talk about -disadvantages first. - -Since we need to explicitly tell \arara what we want it to do, it might not be intuitive -for casual users. Tools like |latexmk| and |rubber| rely on a analysis scheme in which -the document is generated with a simple call to |latexmk mydoc.tex| or |rubber --pdf mydoc.tex|, -while a similar call to |arara mydoc.tex| does absolutely nothing; it's not wrong, it's by design: -\arara needs to know what you want. We do this by adding a directive in our |.tex| file, as shown -in line~1 of Code~\ref{code:hellolatex}. Don't worry with the terms now, we will come back to the -concepts later on in this manual, in Chapter~\ref{chap:importantconcepts}. - -\begin{code}[htbp] -\caption{\mycmd{mydoc.tex}} -\label{code:hellolatex} -\begin{latex} -% (*@@*)arara: pdflatex -\documentclass{article} - -\begin{document} -Hello world. -\end{document} -\end{latex} -\end{code} - -When we add a directive in our source code, we are explicitly telling \arara what we want it to do, -but I'm afraid that's not sufficient. So far, \arara knows \emph{what} to do, but now it needs to know -\emph{how} the task should be done. Then, for every directive, we need to have an associated rule. -In other words, if we want \arara to run |pdflatex| on |mydoc.tex|, we need to have a set of instructions -which tells our tool how to run that specific application. Although the core team provides a lot of rules -shipped with \arara out of the box, with the possibility of extending the set by adding more rules, -some users might find this decision rather annoying, since other tools have most of their rules hardcoded, -making the automation process even more transparent. - -Now, let's talk about some advantages. In my humble opinion, since \arara doesn't rely on a specific -automation or compilation scheme, it becomes more extensible. The use of directives in the source code -make the automation steps more fluent, which allows the specification of complex workflows very easily. -Maybe \arara's verbosity on automation steps might not be suitable for small documents, but the tool -really shines when you have a document which needs full control of the automation process. - -Another advantage that comes to my mind right now is the fact that directives and rules can be parametrized. -In other words, you can create conditional branches, execution workflows based on parameters, flags, and so -on, by simply providing a parameter in a directive. Besides, \arara also provides a lot of helper functions -in order to enhance rules; for example, you can have a rule which executes a certain command when in Windows, -and a different one when in Unix. - -The rules are written in a human-readable format. The reason for this decision came as an attempt to simplify -the life of many casual users which are not versed into programming. Sadly, writing complex XML mappings or -even deliberately injecting code into an application is not a trivial task, so we opted for an easy way of declaring -the set of instructions that tells \arara how to do a task. We will discuss about the format later on, in Section~\ref{sec:rules}. - -Now that \arara was properly introduced, let me explain the meaning of the name. \emph{Arara} is the Brazilian -name of a macaw bird (Figure~\ref{fig:arara}). Have you ever watched \emph{Rio: the movie}, produced by Blue -Sky Studios? The protagonist is a blue arara. The word \emph{arara} comes from the Tupian word \emph{a'rara}, -which means \emph{big bird}~\cite{tupi:2012}. - -\begin{figure}[htbp] -\centering -\includegraphics[scale=0.6]{figures/arara.png} -\caption{A lovely photo of an arara.} -\label{fig:arara} -\end{figure} - -Lovely bird, isn't it? Now, you are probably wondering why I chose this name. Well, araras are colorful, noisy, -naughty and very funny. Everybody loves araras. So why can't you love a tool with the very same name? And -there is also another motivation of the name \emph{arara}: the chatroom residents of -\href{http://chat.stackexchange.com/rooms/41}{\TeX.sx} -- including myself -- are fans of palindromes, -especially palindromic numbers. As you can already tell, \emph{arara} is a palindrome. - -\section{How does it work?} -\label{sec:howdoesitwork} - -Now that we know what \arara is, let's take a look on how the tool actually works. The whole idea is pretty -straightforward, but some concepts might be confusing at first. Do not despair, we will come back to -them later on in the manual, in Chapter~\ref{chap:importantconcepts}. - -First of all, we need to add at least one instruction in the source code to tell \arara what to do. This instruction -is named \emph{directive} and it will be parsed during the preparation phase. By default, an \arara directive is -defined in a line of its own, started with a comment, followed by the word |arara:| and the name of the task. -Code~\ref{code:hellolatex} has one directive, referencing |pdflatex|. It's important to observe that |pdflatex| -is not the command to be executed, but the name of the rule associated with that directive. - -Once \arara finds a directive, it will look for the associated \emph{rule}. In our example, it will look for a rule named -|pdflatex| which will evidently run the |pdflatex| command line application. The rule is analyzed, all possible -parameters are defined, the command line call is built and then it goes to a queue of commands to be executed. - -After extracting all directives from a source code and mapping each one of them to their respective rules, \arara -then executes the queue of commands. The execution chain requires that the command $i$ was successfully -executed to then proceed to the command $i+1$, and so forth. This is also by design: \arara will halt the execution -if any of the commands in the queue had raised an error. If we run \arara on |mydoc.tex| -- we can also run -|arara mydoc| too, we will discuss this later on -- presented in Code~\ref{code:hellolatex}, we get the output -presented in Code~\ref{code:araraoutputexample}. - -\begin{code}[htbp] -\caption{Running \arara on \mycmd{mydoc.tex}.} -\label{code:araraoutputexample} -\begin{bash} -$ arara mydoc - __ _ _ __ __ _ _ __ __ _ - / _` | '__/ _` | '__/ _` | -| (_| | | | (_| | | | (_| | - \__,_|_| \__,_|_| \__,_| - -Running PDFLaTeX... SUCCESS -\end{bash} -\end{code} - -That is pretty much how \arara works: directives in the source code are mapped to rules, which are converted to -commands and added to a queue. The queue is then executed and the status is reported. We will cover more details -about the expansion process later on in the manual. In short, we teach \arara to do a task by providing a rule, -and tell it to execute it via directives in the source code. - -\section{Features} -\label{sec:features} - -To name a few features I like in \arara, I'd mention the ability to write rules in a human-readable format called YAML, -which rhymes with the word \emph{camel}. YAML is actually a recursive acronym for \emph{YAML Ain't Markup Language}, -and it's known as a human friendly data serialization standard for all programming languages~\cite{yaml:2001}. So far, -I think this format is quite suitable to write rules, specially if you want to avoid the need of writing complicated XML mappings or -even injecting code directly into the application. - -Another feature worth mentioning is the fact that \arara is platform independent. The application was written in Java, -so \arara runs on top of a Java virtual machine, available on all the major operating systems~--~in some cases, you -might need to install the proper virtual machine. We tried very hard to keep both code and libraries compatible with -older virtual machines or from other vendors. Currently, \arara is known to run on Oracle's Java 5, 6 and 7, and OpenJDK 6 and 7. -In Chapter~\ref{chap:buildingfromsources}, there are instructions on how to build \arara from sources. Even if -you use multiple operating systems, \arara should behave the same, including the rules. There are helper functions -available in order to provide support for system-specific rules based on the underlying operating system, presented -in Section~\ref{sec:functions}. - -From version 3.0 on, \arara can now display localized messages. The default language is set to English, but the user can -receive feedback from the execution process and logging in other languages as well, such as Brazilian Portuguese, German, -Italian, French, Spanish, Russian and Turkish. There's also a way to redefine the default language by adding an entry in the configuration -file, discussed later on in Section~\ref{sec:language}. - -Speaking of which, \arara has now an optional configuration file in which we can add rule paths, set the default language and -define custom extensions and directive patterns, located in the user home directory. That way, we can extend \arara's behaviour -to deal with other extensions, such as |.c| files, and use the tool with other formats. We will come back on this subject later on -in Chapter~\ref{chap:configurationfile}. - -\arara is also easily integrated with other \TeX\ integrated development environment, such as \TeX works~\cite{texworks:2009}, an -environment for authoring \TeX\ documents shipped with both \TeX\ Live and MiK\TeX. Chapter~\ref{chap:ideintegration} covers -the integration of \arara with several environments. - -\section{Common uses} -\label{sec:commonuses} - -\arara can be used in complex workflows, like theses and books. You can tell \arara to compile the document, generate -indices and apply styles, remove temporary files, compile other |.tex| documents, create glossaries, call |pdfcrop|, move files, -run \hologo{METAPOST} or \hologo{METAFONT}, and so forth. You can easily come up with your own rules. - -There's an \href{http://latex-community.org/know-how/435-gnuplot-arara}{article} available in the \LaTeX\ community which -describes the integration of |gnuplot| and \arara~\cite{cereda:2012}. This article was submitted as an entry to a contest organized -by Stefan Kottwitz. It might be worth a read. - -Let's see a few examples. Code~\ref{code:exlatexone} contains the workflow I used for another article I recently wrote. Note that the first call to -|pdflatex| creates the |.aux| file, then |bibtex| will extract the cited publications. The next calls to |pdflatex| will insert -and refine the references. - -\begin{code}[htbp] -\caption{\mycmd{article.tex}} -\label{code:exlatexone} -\begin{latex} -% (*@@*)arara: pdflatex -% (*@@*)arara: bibtex -% (*@@*)arara: pdflatex -% (*@@*)arara: pdflatex -\documentclass[journal]{IEEEtran} -... -\end{latex} -\end{code} - -Code~\ref{code:exlatextwo} contains another workflow I used for a manual. I had to use a package that required shell escape, -so the calls to |pdflatex| had to enable it. Also, I had an index with a custom formatting, then |makeindex| was called with the - proper style. - -\begin{code}[htbp] -\caption{\mycmd{manual.tex}} -\label{code:exlatextwo} -\begin{latex} -% (*@@*)arara: pdflatex: { shell: yes } -% (*@@*)arara: makeindex: { style: mystyle } -% (*@@*)arara: pdflatex: { shell: yes } -% (*@@*)arara: pdflatex: { shell: yes } -\documentclass{book} -... -\end{latex} -\end{code} - -And of course, the \arara user manual is also compiled with |arara|. You can take a look in the source code and check the -header. By the way, note that I had to use a trick to avoid |arara| to read the example directives in this manual. As we will -see later, \arara reads directives everywhere. Actually, I could have changed the directive pattern for |.tex| files through -the configuration file, but that's another story. - -Other workflows can be easily created. There can be an arbitrary number of instructions for \arara to execute, so feel free to -come up with your own workflow. \arara will handle it for you. My friend Joseph Wright wrote a great article about \arara in -his personal blog, it's really worth a read~\cite{wright:2012}. - -I really hope you like my humble contribution to the \TeX\ community. Let \arara enhance your \TeX\ experience, it will help you -when you'll need it the most. Enjoy the manual. - -\printbibliography[heading=subbibliography] - -\chapter{Installation} -\label{chap:installation} - -\epigraph{\emph{Adjust \texttt{\string\hsize}: old man Fermat couldn't.}}{Enrico Gregorio} - -Spledid, so you decided to give \arara a try? This chapter will cover the installation procedure. We basically -have two methods of installing \arara: the first one is through a cross-platform installer, which is of course -the recommended method; the second one is a manual deployment, with the provided |.jar| file -- a -self-contained, batteries-included executable Java archive file. If you have a recent \TeX\ Live distribution, -good news: \arara is already available in your system! - -\section{Prerequisites} -\label{sec:prerequisites} - -I know I've mentioned this before in Section~\ref{sec:features} and, at the risk of being repetitive, there we -go again: \arara is written in Java and thus depends on a virtual machine in the underlying operating system. -If you use a Mac or even a fairly recent Linux distribution, I have good news for you: it's mostly certain that -you already have a Java virtual machine installed. - -It's very easy to check if you have a Java virtual machine installed: try running |java -version| in the terminal -(bash, command prompt, you name it) and see if you get an output similar to the one provided in -Code~\ref{code:javainstalled}. - -\begin{code}[htbp] -\caption{Checking if \mycmd{java} is installed.} -\label{code:javainstalled} -\begin{bash} -$ java -version -java version "1.6.0_24" -OpenJDK Runtime Environment (IcedTea6 1.11.1) -OpenJDK Client VM (build 20.0-b12, mixed mode) -\end{bash} -\end{code} - -If the output goes along the lines of |java: command not found|, I'm afraid you don't have a Java virtual -machine installed in your operating system. Since the virtual machine is a prerequisite for \arara to run, -you can install one via your favorite package manager or manually install it from the binaries available -in the official \href{http://www.java.com}{Java website}. Make sure to download the correct version for -your operating system. The installation procedure is very straightforward. If you get stuck, take a look -on the installation instructions. - -It's important to mention that \arara runs also with the Java virtual machine from the OpenJDK -project~\cite{openjdk:2006}, which is already available in most of the recent Linux distributions -- actually -the output from Code~\ref{code:javainstalled} shows the OpenJDK version from my Fedora machine. -Feel free to use the virtual machine you feel most comfortable with. - -Speaking of virtual machines, \arara requires at least Java 5 to run. Don't worry, it's quite easy to spot the Java -version: just look at the second digit of the version string. For example, Code~\ref{code:javainstalled} outputs |1.6.0_24|, -which means we have Java 6 installed. - -\section{Obtaining \texorpdfstring{\arara}{arara}} -\label{sec:obtainingarara} - -Before proceeding, we need to choose the installation method. We have two options: the first option is the easiest one, -which installs \arara through a cross-platform installer; the second option is a manual deployment. - -From version 3.0 on, \arara is also available as part of the \TeX\ Live distribution. If you have a recent \TeX\ distro, -it's almost certain that you already have \arara; make sure to select it in the |tlmgr| application. - -If we opt for the installer, go to the \href{http://github.com/cereda/arara/downloads}{downloads} section of the project - repository and download |arara-3.0-installer.jar| for all operating systems or |arara-3.0-installer.exe| for Windows. -Please note that the |.exe| version is only a wrapper which will launch |arara-3.0-installer.jar| under the hood. The -installer also requires Java. - -If we want to do things the complicated way, go to the \href{http://github.com/cereda/arara/downloads}{downloads} -section of the project repository and download the |arara.jar| file, which is a self-contained, batteries-included executable -Java archive file. - -In case you want to build \arara from source, please refer to Chapter~\ref{chap:buildingfromsources} which will -cover the whole process. Thanks to Apache Maven, the build process is very easy. - -\section{Using the cross-platform installer} -\label{sec:usingthecrossplatforminstaller} - -After downloading |arara-3.0-installer.jar| (or its |.exe| counterpart), it's now just a matter of running it. -The installer is built with IzPack~\cite{izpack:2001}, an amazing tool for packaging applications on the Java -platform. Of course the source is also available at the project repository. Personally, I suggest you to run the -installer in privileged mode, but you can also run it in user mode -- just keep in mind that some features might -not work, like creating symbolic links or adding the application to the system path, which inevitably requires a -privileged mode. - -When running |arara-3.0-installer.jar| or its |.exe| wrapper on Windows by simply double-clicking it, the installer -will automatically run in privileged mode. A general Unix-based installation can be triggered by the command -presented in Code~\ref{code:runinstaller1}. There's also an alternative command presented in -Code~\ref{code:runinstaller2}. - -\begin{code}[htbp] -\caption{Running the installer in a Unix-based system -- method 1.} -\label{code:runinstaller1} -\begin{bash} -$ sudo java -jar arara-3.0-installer.jar -\end{bash} -\end{code} - -\begin{code}[htbp] -\caption{Running the installer in a Unix-based system -- method 2.} -\label{code:runinstaller2} -\begin{bash} -$ su -c 'java -jar arara-3.0-installer.jar' -\end{bash} -\end{code} - -Since Windows doesn't have a similar command to |su| or |sudo|, you need to open the command prompt as -administrator and then run the command presented in Code~\ref{code:runinstallerwin}. You can right-click -the command prompt shortcut and select the ``Run as administrator\ldots'' option. - -\begin{code}[htbp] -\caption{Running the installer in the Windows command prompt as administrator.} -\label{code:runinstallerwin} -\begin{bash} -C:\> java -jar arara-3.0-installer.jar -\end{bash} -\end{code} - -The installation process will begin. Hopefully, the first screen of the installer will appear, which is the -language selection (Figure~\ref{fig:instlang}). By the way, if you called the installer through the command line, -please do not close the terminal! It might end the all running processes, including our installer. - -\begin{figure}[htbp] -\centering -\includegraphics[scale=0.5]{figures/installer/install-langsel.png} -\caption{Language selection screen.} -\label{fig:instlang} -\end{figure} - -The installer currently supports six languages: English, German, French, Italian, Spanish, and Brazilian Portuguese. -I plan to add more languages to the list in the near feature. - -The next screen welcomes you to the installation (Figure~\ref{fig:instwelcome}). There's the application name, the -current version, the team, and the project homepage. We can proceed by clicking the \textit{Next} button. -Note that you can quit the installer at any time by clicking the \textit{Quit} button -- please, don't do it; a kitten dies -every time you abort the installation\footnote{Of course, this statement is just a joke. No animals were -harmed, killed or severely wounded during the making of this user manual. After all, \arara is environmentally friendly.}. - -\begin{figure}[htbp] -\centering -\includegraphics[scale=0.5]{figures/installer/install-welcome.png} -\caption{Welcome screen.} -\label{fig:instwelcome} -\end{figure} - -Moving on, the next screen shows the license agreement (Figure~\ref{fig:instlicense}). \arara is licensed under the -\href{http://www.opensource.org/licenses/bsd-license.php}{New BSD License}~\cite{bsd:2012}. It's important to -observe that the New BSD License has been verified as a GPL-compatible free software license by the Free Software -Foundation~\cite{fsf:1985}, and has been vetted as an open source license by the Open Source Initiative~\cite{osi:1998}. -The full license is also available in this document (page~\pageref{sec:license}). You need to accept the terms of the -license agreement before proceeding. - -The next screen is probably the most important section of the installation: in here we will choose the packs we want to -install (Figure~\ref{fig:instpacks}). All packs are described in Table~\ref{tab:packs}. Note that the grayed packs are -required. - -\begin{figure}[htbp] -\centering -\includegraphics[scale=0.5]{figures/installer/install-packs.png} -\caption{Packs screen.} -\label{fig:instpacks} -\end{figure} - -\begin{table}[htbp] -\centering -\caption{Available packs.} -\label{tab:packs} -\renewcommand{\arraystretch}{1.5} -\footnotesize -\begin{tabular}{p{0.30\textwidth}p{0.12\textwidth}p{0.4\textwidth}} -\hline -\textbf{Pack name} & \textbf{OS} & \textbf{Description} \\ -\hline -\hline -Main application & All & This pack contains the core application. It also -provides an |.exe| wrapper for Windows and a bash file for Unix. \\ -\hline -Include the \arara user manual & All & This pack installs this user manual into -the |docs/| subdirectory of \arara. \\ -\hline -Include predefined rules & All & Of course, \arara has a set of predefined rules -for you to start with. If you prefer to write your own rules from scratch, do -not select this pack. \\ -\hline -Add a symbolic link to \arara in |/usr/local/bin| & Unix & If you ran the -installer in privileged mode, a symbolic link to \arara can be created in the -|/usr/local/bin| directory. There's no magic here, the installer uses the good -old |ln| command. \\ -\hline -Add \arara to the system path & Windows & Like the Unix task, \arara can also -add itself to the system path. This feature is provided by a Windows script named -\href{http://legroom.net/software/modpath}{Modify Path}~\cite{modpath:2012}. \\ -\hline -\end{tabular} -\end{table} - -It's very important to mention that all these modifications in the operating -system -- the symbolic link creation for Unix or the addition to the path for -Windows -- are safely removed when you run the \arara uninstaller. We will talk -about it later, in Section~\ref{sec:uninstallingarara}. - -\begin{figure}[htbp] -\centering -\includegraphics[scale=0.5]{figures/installer/install-license.png} -\caption{License agreement screen.} -\label{fig:instlicense} -\end{figure} - -In the next screen, we will select the installation path (Figure~\ref{fig:instpath}). The installer -will automatically set the default installation path according to the Table~\ref{tab:paths}, but -feel free to install \arara in your favorite structure -- even |/opt| or your home folder. - -\begin{table}[htbp] -\centering -\caption{Default installation paths.} -\label{tab:paths} -\renewcommand{\arraystretch}{1.5} -\begin{tabular}{cl} -\hline -\textbf{OS} & \textbf{Default installation path}\\ -\hline -\hline -Windows & |C:\Program Files\arara|\\ -Unix & |/usr/local/arara|\\ -\hline -\end{tabular} -\end{table} - -\begin{figure}[htbp] -\centering -\includegraphics[scale=0.5]{figures/installer/install-path.png} -\caption{Installation path screen.} -\label{fig:instpath} -\end{figure} - -After selecting the installation path, the installer will then confirm the creation of the target directory -(Figure~\ref{fig:instnewfolder}). We simply click \textit{OK} to accept it. For convenience, the full installation path -defined in the installation path screen (Figure~\ref{fig:instpath}) will be referred as |ARARA_HOME| from now on. - -\begin{figure}[htbp] -\centering -\includegraphics[scale=0.5]{figures/installer/install-pathwarning.png} -\caption{Target directory confirmation.} -\label{fig:instnewfolder} -\end{figure} - -Now, just sit back and relax while \arara is being installed (Figure~\ref{fig:instprogress}). All selected packs will -be installed accordingly. The post installation tasks -- like creating the symbolic link or adding \arara to the system -path -- are performed here as well. If the installation has completed successfully, we will reach the final screen of -the installer congratulating us for installing \arara (Figure~\ref{fig:instfinish}). - -\begin{figure}[htbp] -\centering -\includegraphics[scale=0.5]{figures/installer/install-progress.png} -\caption{Progress screen.} -\label{fig:instprogress} -\end{figure} - -\begin{figure}[htbp] -\centering -\includegraphics[scale=0.5]{figures/installer/install-finish.png} -\caption{Final screen.} -\label{fig:instfinish} -\end{figure} - -The full installation scheme is presented in Figure~\ref{fig:ararastructure}. The directory structure is -presented here as a whole; keep in mind that some parts will be omitted according to your operating -system and pack selection. For example, the |etc/| subdirectory will only be installed if and only if -you are in Windows and the system path pack is selected. Other files are platform-specific, such as -|arara.exe| for Windows and the |arara| bash file for Unix. - -\begin{figure}[htbp] -\centering -\begin{tikzpicture}[grow via three points={one child at (0.5,-0.7) and two children at (0.5,-0.7) and (0.5,-1.4)}, edge from parent path={(\tikzparentnode.south) |- (\tikzchildnode.west)}, anchor=west, font=\ttfamily] - \node {ARARA\_HOME/} - child { node {arara.jar}} - child { node {arara.exe}} - child { node {arara}} - child { node {docs/} - child { node {arara-usermanual.pdf}} - } - child [missing] {} - child { node {etc/} - child { node {modpath.exe}} - } - child [missing] {} - child { node {Uninstaller/} - child { node {uninstaller.jar}} - } - child [missing] {} - child { node {rules/} - child { node {biber.yaml}} - child { node {\ldots}} - child { node {xetex.yaml}} - }; -\end{tikzpicture} -\caption{Installation scheme.} -\label{fig:ararastructure} -\end{figure} - -That's it, \arara is installed in your operating system. If you opted for the symbolic link creation or the path addition, -\arara is already available in your terminal by simply typing |arara|. Have fun! - -\section{Manual installation} -\label{sec:manualinstallation} - -Thankfully, \arara is also very easy to be manually deployed. First of all, we must create the application directory. -Feel free to create this directory anywhere in your computer; it can be |C:\arara|, |/opt/arara| or another location -of your choice. This procedure is similar to the installation path screen (Figure~\ref{fig:instpath}) from -Section~\ref{sec:usingthecrossplatforminstaller}. Again, for convenience, the full installation path will be referred as |ARARA_HOME| from -now on. Although it's not mandatory, try to avoid folders structures with spaces in the path. In any case, -\arara can handle such spaces. - -After downloading |arara.jar| from the \href{http://github.com/cereda/arara/downloads}{downloads} section of -the project repository, let's copy it to the |ARARA_HOME| directory we've created in the previous step. -Since |arara.jar| is a self-contained, batteries-included executable Java archive file, \arara is already installed. - -In order to run \arara from a manual installation, we should open a terminal and run |java -jar $ARARA_HOME/arara.jar|, -but that is far from being intuitive. To make our lives easier, we will create a shortcut for this -command. - -If you are deploying \arara in Windows, there are two methods for creating a shortcut: the first method -- the -easiest -- consists of downloading the |arara.exe| wrapper from the \href{http://github.com/cereda/arara/downloads}{downloads} -section and copying it to the |ARARA_HOME| directory, in the same level of |arara.jar|. This |.exe| wrapper, provided by \href{http://launch4j.sourceforge.net}{Launch4J}~\cite{launch4j:2005}, wraps |.jar| files in Windows native executables -and allows to run them like a regular Windows program. - -The second method for creating a shortcut in Windows is to provide a batch file which will call |java -jar $ARARA_HOME/arara.jar| -for us. Create a file named |arara.bat| or |arara.cmd| inside the |ARARA_HOME| directory, in the same level of |arara.jar|, and -add the content from Code~\ref{code:windows}. - -\begin{code}[htbp] -\caption{Creating a batch file for \arara in Windows.} -\label{code:windows} -\begin{bash} -@echo off -java -jar "%~dp0\arara.jar" %* -\end{bash} -\end{code} - -After creating the batch file, add the full |ARARA_HOME| path to the system path. Unfortunately, this manual can't cover -the path settings, since it's again a matter of personal taste. I'm sure you can find tutorials on how to add a directory to -the system path. - -If you are deploying \arara in Linux or Mac, we also need to create a shortcut to |java -jar $ARARA_HOME/arara.jar|. -Create a file named |arara| inside the |ARARA_HOME| directory, in the same level of |arara.jar|, and add the content -from Code~\ref{code:unix}. - -\begin{code}[htbp] -\caption{Creating a script for \arara in Linux and Mac.} -\label{code:unix} -\begin{bash} -#!/bin/bash -# Example script of arara -# Installation and usage are described in the documentation -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd -P "$( dirname "$SOURCE" )" && pwd )" -java -jar "$DIR/arara.jar" "$@" -\end{bash} -\end{code} - -We now need to add execute permissions for our newly created script through |chmod +x arara|. The |arara| script can -be invoked through path addition or symbolic link. I personally prefer to add |ARARA_HOME| to my user path, but a -symbolic link creation seems way more robust -- it's what the installer does. Anyway, it's up to you to decide which method -you want to use. There's no need to use both. - -Once we conclude the manual installation, it's time to check if \arara is working properly. Try running |arara| in the terminal -and see if you get the output shown in Code~\ref{code:arararun}. - -\begin{code}[p] -\caption{Testing if \arara is working properly.} -\label{code:arararun} -\begin{nolanguage} -$ arara - __ _ _ __ __ _ _ __ __ _ - / _` | '__/ _` | '__/ _` | -| (_| | | | (_| | | | (_| | - \__,_|_| \__,_|_| \__,_| - -arara 3.0 - The cool TeX automation tool -Copyright (c) 2012, Paulo Roberto Massa Cereda -All rights reserved. - -usage: arara [file [--log] [--verbose] [--timeout N] [--language L] | --help | --version] - - -h,--help print the help message - -L,--language <arg> set the application language - -l,--log generate a log output - -t,--timeout <arg> set the execution timeout (in milliseconds) - -v,--verbose print the command output - -V,--version print the application version -\end{nolanguage} -\end{code} - -If the terminal doesn't display the \arara logo and usage, please review the manual installation steps. -Every step is important in order to make \arara available in your system. You can also try the cross-platform -installer. If you still have any doubts, feel free to contact us. - -\section{Updating \texorpdfstring{\arara}{arara}} -\label{sec:updatingarara} - -If there is a newer version of \arara available in the \href{http://github.com/cereda/arara/downloads}{downloads} -section of the project repository, simply download the |arara.jar| file and copy it to the |ARARA_HOME| directory, -replacing the current one. No further steps are needed, the newer version is deployed. Try running |arara --version| -in the terminaland see if the version shown in the output is equal to the one you have downloaded. - -Anyway, for every version, \arara has the proper cross-platform installer available for download in the project repository. -You can always uninstall the old \arara setup and install the new one. Please note that only major versions are released -with the installer. - -If you have \arara through the \TeX\ Live distribution, the update process is straightforward: simply open a -terminal and run |tlmgr update arara| in order to update the application. This is of course the preferred method. - -\section{Uninstalling \texorpdfstring{\arara}{arara}} -\label{sec:uninstallingarara} - -If you want to uninstall \arara, there are two methods available. If you installed \arara through the cross-platform installer, -I have good news for you: it's just a matter of running the uninstaller. Now, if \arara was deployed through the manual -installation, we might have to remove some links or path additions. - -A general Unix-based uninstallation can be triggered by the command presented in Code~\ref{code:uninstall1}. -There's also an alternative command presented in Code~\ref{code:uninstall2}. - -\begin{code}[htbp] -\caption{Running the uninstaller in a Unix-based system -- method 1.} -\label{code:uninstall1} -\begin{bash} -$ sudo java -jar $ARARA_HOME/Uninstaller/uninstaller.jar -\end{bash} -\end{code} - -\begin{code}[htbp] -\caption{Running the uninstaller in a Unix-based system -- method 2.} -\label{code:uninstall2} -\begin{bash} -$ su -c 'java -jar $ARARA_HOME/Uninstaller/uninstaller.jar' -\end{bash} -\end{code} - -Since Windows doesn't have a similar command to |su| or |sudo|, you need to open the command prompt as administrator -and then run the command presented in Code~\ref{code:uninstallwin}. You can right-click the command prompt shortcut -and select the ``Run as administrator\ldots'' option. - -\begin{code}[htbp] -\caption{Running the uninstaller in the Windows command prompt as administrator.} -\label{code:uninstallwin} -\begin{bash} -C:\> java -jar $ARARA_HOME/Uninstaller/uninstaller.jar -\end{bash} -\end{code} - -The uninstallation process will begin. Hopefully, the first and only creen of the uninstaller will appear -(Figure~\ref{fig:uninstallone}). By the way, if you called the uninstaller through the command line, please -do not close the terminal! It might end the all running processes, including our uninstaller. - -\begin{figure}[htbp] -\centering -\includegraphics[scale=0.5]{figures/installer/uninstall-welcome.png} -\caption{The uninstaller screen.} -\label{fig:uninstallone} -\end{figure} - -There's nothing much to see in the uninstaller. We have an option to force the deletion of the |ARARA_HOME| directory, -but that's all. By clicking the \textit{Uninstall} button, the uninstaller will remove the symbolic link or the path entry for -\arara from the operating system, if selected during the installation. Then it will erase the |ARARA_HOME| directory -(Figure~\ref{fig:uninstalltwo}). - -\begin{figure}[htbp] -\centering -\includegraphics[scale=0.5]{figures/installer/uninstall-finish.png} -\caption{The uninstaller screen, after the execution.} -\label{fig:uninstalltwo} -\end{figure} - -Unfortunately, even if you force the deletion of the |ARARA_HOME| directory in Windows, the operating system can't -remove the |Uninstaller| subdirectory because the uninstaller was being executed from there. But that's the only trace -left. You can safely delete |ARARA_HOME| after running the uninstaller. - -If \arara was manually installed, we need to remove the symbolic link reference or the path entry, if any, then delete -the |ARARA_HOME| directory. Don't leave any traces of \arara in system directories or configuration files; a broken -symbolic link or a wrong path entry might cause trouble in the future. - -\printbibliography[heading=subbibliography] - -\chapter{Building from sources} -\label{chap:buildingfromsources} - -\epigraph{\emph{Knowledge brings fear.}}{From a \emph{Futurama} episode} - -Although \arara already features a self-contained, batteries-included executable Java archive file, an |.exe| wrapper, and a cross-platform -installer, you can easily build it from sources. The only requirements are a working Java Development Kit~\cite{oracle:2012} -and the Apache Maven software project management~\cite{maven:2012}. The next sections will cover the entire process, -from obtaining the sources to the build itself. Sadly, this manual doesn't cover Java and Maven deployments, so I kindly ask you -to check their websites and read the available documentation. - -\section{Obtaining the sources} -\label{sec:obtainingthesources} - -First of all, we need to get the source code, available in the project repository hosted on \href{https://github.com/cereda/arara}{GitHub}. -We have two options on how to obtain the sources: either by clicking the \href{https://github.com/cereda/arara/archive/master.zip}{Zip} button in the project page and download a snapshot -of the whole structure in an archive file, or by using |git| and clone the repository into our machine. The second option is easily done by executing the command presented in Code~\ref{code:gitobtain}, provided of course that you have |git| installed. - -\begin{code}[htbp] -\caption{Cloning the project repository.} -\label{code:gitobtain} -\begin{bash} -$ git clone git://github.com/cereda/arara.git -\end{bash} -\end{code} - -After cloning the project repository (Code~\ref{code:gitobtain}), a new subdirectory named |arara| is created in the current directory -with the project structure -- the very same available in the project repository on GitHub. The application source code is inside -|arara/arara|. Note that there are other source codes for the cross-platform installer and the |.exe| wrapper, as well as the predefined -rules, each one in a subdirectory of its own. - -If you opted for downloading the archive file, you'll have a file named |arara-master.zip| generated automatically by GitHub. -Just extract the file somewhere in your computer and you'll end up with the very same project structure as the one available in the -project repository. - -\section{Building \texorpdfstring{\arara}{arara}} -\label{sec:buildingarara} - -Inside the |arara/arara| directory, we have the most important file for building \arara: a file named |pom.xml|. We now just need to -call the |mvn| command with the proper target and relax while Maven takes care of the building process for us. First of all, let's take -a look at some targets available in our |pom.xml| file: - -\begin{ruleoptions} -\item[compile] This target compiles the source code, generating the Java bytecode. -\item[package] The |package| target is very similar to the |compile| one, but instead of only compiling the source code, it also -packs the Java bytecode into an executable Java archive file without dependencies. The file will be available inside the -|arara/arara/target| directory. -\item[assembly:assembly] This target is almost identical to the |package| one, but it also includes all the dependencies into a -final Java archive file. The file will be available inside the |arara/arara/target| directory. This is of course our preferred target, -since \arara is shipped as a self-contained executable Java archive file. -\item[clean] The |clean| target removes all the generated Java bytecode and deployment traces, cleaning the project structure. -\end{ruleoptions} - -Now that we know the targets, we only need to call |mvn| with the target we want. If you want to generate the very same Java archive file -we use for releases, execute the command presented in Code~\ref{code:mvnassembly}. - -\begin{code}[htbp] -\caption{Building \arara with Maven, first attempt.} -\label{code:mvnassembly} -\begin{bash} -$ mvn assembly:assembly -\end{bash} -\end{code} - -Actually, the command presented in Code~\ref{code:mvnassembly}, as the project structure is at the moment, will fail! Let me explain -why: the application is not yet linked with the localized messages, so we need to convert our translation files into a correct format and -then run the target in Maven. The error message after running |mvn assembly:assembly| presented in Code~\ref{code:errorlangnotfound} -gives us a hint on what we should do. - -\begin{code}[htbp] -\caption{The Maven error message about missing localization files.} -\label{code:errorlangnotfound} -\begin{bash} -Failed tests: testLocalizationFile(com.github.arara.AraraTest): -arara requires at least the default localization file -Messages.properties located at the translations/ directory in -the project repository. Rename Messages.input to -Messages.properties and copy the new file to the src/ -directory, under com/github/arara/localization, and build -arara again. - -Tests run: 1, Failures: 1, Errors: 0, Skipped: 0 - -[INFO] --------------------------------------------- -[INFO] BUILD FAILURE -[INFO] --------------------------------------------- -\end{bash} -\end{code} - -Let's go into |arara/translations| and run the commands presented in Code~\ref{code:convertinglocales}. Since we are dealing with -languages that require an encoding in UTF-8 while the localization files are set in ASCII, we need to run a conversion program in -order to generate valid |.properties| files. - -\begin{code}[htbp] -\caption{Converting the localization files.} -\label{code:convertinglocales} -\begin{bash} -$ native2ascii -encoding utf8 Messages.input ../application/src/main/resources/com/github/arara/localization/Messages.properties -$ native2ascii -encoding utf8 Messages_de.input ../application/src/main/resources/com/github/arara/localization/Messages_de.properties -$ native2ascii -encoding utf8 Messages_es.input ../application/src/main/resources/com/github/arara/localization/Messages_es.properties -$ native2ascii -encoding utf8 Messages_fr.input ../application/src/main/resources/com/github/arara/localization/Messages_fr.properties -$ native2ascii -encoding utf8 Messages_it.input ../application/src/main/resources/com/github/arara/localization/Messages_it.properties -$ native2ascii -encoding utf8 Messages_pt_BR.input ../application/src/main/resources/com/github/arara/localization/Messages_pt_BR.properties -$ native2ascii -encoding utf8 Messages_ru.input ../application/src/main/resources/com/github/arara/localization/Messages_ru.properties -$ native2ascii -encoding utf8 Messages_tr.input ../application/src/main/resources/com/github/arara/localization/Messages_tr.properties -\end{bash} -\end{code} - -Now we can simply rerun the command presented in Code~\ref{code:mvnassembly}. Hopefully, we won't have trouble this time. -Relax while Maven takes care of the building process. It might take a while, since all dependencies will be downloaded to your Maven repository. After a while, Maven will tell us that the project was built successfully! - -After a successful build via Maven, we can now get the generated executable Java archive file |arara-3.0-with-dependencies.jar| which is inside the |arara/arara/target| directory, rename it to |arara.jar| and use it as we have seen in the previous chapters. - -\section{Notes on the installer and wrapper} -\label{sec:notesontheinstallerandwrapper} - -The project directory has additional subdirectories regarding the \arara cross-platform installer and the |.exe| wrapper. It's important to -observe that only the build files are available, which means that you need to review the compilation process and make adjustments -according to your directory structure. - -The cross-platform installer Java archive file is generated with IzPack~\cite{izpack:2001}, while the |.exe| wrapper is built with -Launch4J~\cite{launch4j:2005}. Both build files are written in plain XML, so you can easily adapt them to your needs. Sadly, the main -purpose of this chapter is to cover the build process of \arara itself and not its helper tools; if you want to generate your own wrapper -or installer, please refer to the available documentation on how to build each file. The build process is also very straightforward. - -\printbibliography[heading=subbibliography] - -\chapter{IDE integration} -\label{chap:ideintegration} - -\epigraph{\emph{The answer to ``can Emacs\ldots'' is always ``yes''.}}{David Carlisle} - -This chapter covers the integration of \arara with several integrated development environments. For obvious reasons, it's almost -impossible for us to cover the full range of editors available nowadays, so we tried to focus only on a couple of them. If you use -\arara with an IDE other than the ones listed here, please let us know! It would be great to include your contribution in this user -manual. - -\section{\texorpdfstring{\TeX works}{TeXworks}} -\label{sex:texworks} - -\arara can be easily integrated with \TeX works~\cite{texworks:2009}, an environment for authoring \TeX\ documents shipped -with both \TeX\ Live and MiK\TeX. In this section, we will learn how to integrate \arara and this cross-platform \TeX\ front-end -program. - -First of all, make sure \arara is properly installed in your operating system. Thankfully, it's very easy to add a new tool in \TeX works, -just open the program and click in \textit{Edit} $\rightarrow$ \textit{Preferences\ldots} to open the preferences screen (Figure~\ref{fig:texworkspref}). - -\begin{figure}[htbp] -\centering -\includegraphics[scale=0.5]{figures/texworks/texworks-prefs.png} -\caption{Opening the preferences screen in \TeX works.} -\label{fig:texworkspref} -\end{figure} - -The next screen is the \TeX works preferences (Figure~\ref{fig:texworksprefscreen}). There are several tabs available. Navigate to the -\textit{Typesetting} tab, which contains two lists: the paths for \TeX\ and related programs, and the processing tools. In the second -list -- the processing tools -- click the \textit{Plus (+)} button to add another tool. - -\begin{figure}[htbp] -\centering -\includegraphics[scale=0.5]{figures/texworks/texworks-add.png} -\caption{The \TeX works preferences screen.} -\label{fig:texworksprefscreen} -\end{figure} - -We are now in the new tool screen (Figure~\ref{fig:texworksarara}). \TeX works provides an very straightforward interface for adding -new tools; we just need to provide the tool name, the executable path, and the parameters. Table~\ref{tab:texworksarara} helps us on -what to type in each field. When done, just click \textit{OK} and our new tool will be available. - -\begin{figure}[htbp] -\centering -\includegraphics[scale=0.5]{figures/texworks/texworks-arara.png} -\caption{The new tool screen.} -\label{fig:texworksarara} -\end{figure} - -{\renewcommand{\arraystretch}{1.5} -\begin{table}[htbp] -\centering -\footnotesize -\begin{tabular}{p{0.15\textwidth}p{0.25\textwidth}p{0.50\textwidth}} -\hline -\textbf{Field name} & \textbf{Value} & \textbf{Description} \\ -\hline -\hline -Name & |arara| & The tool name. You can actually type whatever name your heart -desires. This value will be displayed in the compilation profile. \\ -\hline -Program & |$ARARA_HOME/arara| & The full executable path. Just browse the -filesystem and select the correct \arara path. Observe that symbolic links are -resolved to their full targets. For Windows, select the |.exe| wrapper; for -Unix, select the bash script. \\ -\hline -Arguments & {\renewcommand{\arraystretch}{1} -\begin{tabular}[t]{l} -|$fullname|\\ -|--verbose|\\ -|--log| -\end{tabular}} & The tool arguments. Note that you need to type one argument at -a time, by clicking the \textit{Plus (+)} button. The first argument is a -\TeX works variable which will expand to the current filename. The second and -third arguments are \arara flags, discussed later, in -Chapter~\ref{chap:runningarara}. \\ -\hline -\end{tabular} -\caption{Configuring \arara in \TeX works.} -\label{tab:texworksarara} -\end{table}} - -We are now back to the preferences screen (Figure~\ref{fig:texworksprefscreen}). Hopefully, \arara is in the list of processing tools. -Just click \textit{OK} to confirm the new addition. Congratulations, now \arara is available as a compilation profile in \TeX works -(Figure~\ref{fig:texworksprofile}). - -\begin{figure}[htbp] -\centering -\includegraphics[scale=0.5]{figures/texworks/texworks-profile.png} -\caption{Using \arara in the \TeX works compilation profile.} -\label{fig:texworksprofile} -\end{figure} - -And we are done, \arara is now integrated with \TeX works! Just make sure to select the correct profile when running the compilation -process. - -\section{WinEdt} -\label{sec:winedt} - -The following procedure is kindly provided by Harish Kumar. It's very easy to integrate \arara with WinEdt, let's take a look at the steps. - -\subsection{Getting images for icons and toolbar} - -WinEdt uses $16 \times 16$ |.png| images for menu items, the toolbar and the tree control. They are available in \texttt{\%B\textbackslash Bitmaps\textbackslash Images}\footnote{\texttt{\%B} maps to \texttt{C:\textbackslash Program Files\textbackslash WinEdt Team\textbackslash WinEdt 7} for default installation.} folder and they are automatically loaded on startup or later through the \textit{Options Interface} (or |ReloadImages| macro function). Restricted users can place additional images in their \texttt{\%b\textbackslash Bitmaps\textbackslash Images}\footnote{\texttt{\%b} maps to \texttt{C:\textbackslash Users\textbackslash <username>\textbackslash AppData\textbackslash Roaming\textbackslash WinEdt Team\textbackslash WinEdt 7} for default installation} folder. At the moment all images have a $16\times16$ dimension and use 32-bit transparent |.png| format. - -The images for the \arara toolbar can be downloaded from the \href{http://github.com/cereda/arara/downloads}{downloads area} of the project repository. It would suffice to have a $16 \times 16$ |.png| image for WinEdt v7 while for WinEdt v6, one has to use $16 \times 16$ |.bmp| image. The downloaded images must be copied to \texttt{\%B\textbackslash Bitmaps\textbackslash Images} or \texttt{\%b\textbackslash Bitmaps\textbackslash Images} (depending upon the admin privileges). Once copied, WinEdt has to be restarted to load the images. Now the images should be available for use. - -\subsection{Adding a menu entry} - -The following steps describe how to add a menu entry for \arara in WinEdt v6 and v7. - -\begin{enumerate} -\item Go to \textit{Options $\rightarrow$ Options Interface}. A side window will appear on the left side as shown in Figure~\ref{fig:optionsinterface}. -\item From the \textit{Menus and Toolbar} drop down list, select \textit{Main Menu} and double click to open the file |Main Menu.ini|. -\item In the |Main Menu.ini| file, type the code presented in Code~\ref{code:mainmenuwinedt} somewhere in the file. -\item Save the file. Now the current script has to be loaded by clicking the \textit{Load current script} button, which is the first button in the tool bar in \textit{Options Interface} window shown in Figure~\ref{fig:optionsinterface}. -\item Now in the WinEdt \textit{\TeX} menu, a submenu called \textit{Arara} should be visible and functional (Figure~\ref{fig:winedtmenu}). -\item From the \textit{Menus and Toolbar} drop down list, select \textit{Toolbar} and double click to open the file |Toolbar.ini|. -\item In the |Toolbar.ini| file, type the following line, somewhere in the file: |BUTTON="arara"|. -\item Save the file |Toolbar.ini|. Now the current script has to be loaded by clicking the \textit{Load current script} button, which is the first button in the tool bar in \textit{Options Interface} window (Figure~\ref{fig:optionsinterface}). -\item Now a button for \arara should be visible as shown in Figure~\ref{fig:wineditararabutton}. -\end{enumerate} - -\begin{figure}[htbp] -\centering -\includegraphics[width=.4\textwidth]{figures/winedt/winedt-optionsinterface.png} -\caption{The \textit{Options Interface} window in WinEdt.} -\label{fig:optionsinterface} -\end{figure} - -\begin{code}[htbp] -\caption{Adding an entry to \arara in \mycmd{Main Menu.ini}.} -\label{code:mainmenuwinedt} -\begin{lstlisting}[basicstyle=\footnotesize\ttfamily, columns=flexible, showspaces=false, breaklines=true] -ITEM="Arara" -CAPTION="Arara" -IMAGE="arara16" -SAVE_INPUT=1 -MACRO=:RunConsole('arara "\%F"','\%P','arara...'); -REQ_FILTER=:"\%!M=TeX"|"\%!M=TeX:STY"|"\%!M=TeX:AUX" -\end{lstlisting} -\end{code} - -\begin{figure}[htbp] -\centering -\includegraphics[width=.7\textwidth]{figures/winedt/winedt-menu.png} -\caption{The WinEdt \textit{\TeX} menu.} -\label{fig:winedtmenu} -\end{figure} - -\begin{figure}[htbp] -\centering -\includegraphics[width=.5\textwidth]{figures/winedt/winedt-ararabutton.png} -\caption{The \arara button in WinEdt.} -\label{fig:wineditararabutton} -\end{figure} - -And we are done! \arara is successfully integrated in WinEdt. Now you can add directives to your files and click the buttons to trigger the execution. - -\section{Inlage} -\label{sec:inlage} - -The following procedure is kindly provided by Harish Kumar. It's very easy to integrate \arara with Inlage, let's take a look at the steps. - -\subsection{Inlage v4} - -The following steps describe how to add a menu entry for \arara in Inlage v4. It's an easy procedure. - -\begin{enumerate} -\item Go to \textit{Build $\rightarrow$ User Commands}. A window named \textit{Edit Commands} will appear as shown in Figure~\ref{fig:inlageeditcommands}. -\item Now press the \textit{Plus (+)} button to get the \textit{Add Command} window as shown in Figure~\ref{fig:inlageaddcommand}. -\item Under the \textit{Name} textfield, type |arara| and under the \textit{Command Line} textarea, type |arara \%f|. Now the new configuration should be saved using the \textit{Save} button. Now an entry for \arara should be visible as seen in Figure~\ref{fig:inlagelistarara}. -\item These settings must be then updated using the \textit{Update} button in the \textit{Edit Commands} window shown in Figure~\ref{fig:inlageeditcommands}. -\item Now a menu entry for \arara should be visible in \textit{Build $\rightarrow$ Execute $\rightarrow$ arara}. -\end{enumerate} - -\begin{figure}[htbp] -\centering -\includegraphics[width=.4\textwidth]{figures/inlage/inlage-editcommands.png} -\caption{The \textit{Edit Commands} window in Inlage.} -\label{fig:inlageeditcommands} -\end{figure} - -\begin{figure}[htbp] -\centering -\includegraphics[width=.5\textwidth]{figures/inlage/inlage-addcommand.png} -\caption{The \textit{Add Command} window in Inlage.} -\label{fig:inlageaddcommand} -\end{figure} - -\begin{figure}[htbp] -\centering -\includegraphics[width=.4\textwidth]{figures/inlage/inlage-listarara.png} -\caption{\arara added to the \textit{Edit Commands} window in Inlage.} -\label{fig:inlagelistarara} -\end{figure} - -That's it, \arara is now successfully integrated in Inlage v4. Have fun! - -\subsection{Inlage v5} - -The following steps describe how to add a menu entry for \arara in Inlage v5. It's an easy procedure. - -\begin{enumerate} -\item Go to \textit{Build $\rightarrow$ Compiler Options\ldots}. A \textit{Settings} window will appear as shown in Figure~\ref{fig:inlagesettings}. -\item Under \textit{Profiles}, create a new profile clicking the \textit{New} button. A new window will open; now let's type the name for the new profile as |arara|, as shown in Figure~\ref{fig:inlagenewprofile}. Now press \textit{Okay}. -\item Under \textit{Compiler Order}, press \textit{Add Compiler}, as shown in Figure~\ref{fig:inlageaddcompiler}. -\item Under \textit{Binaries}, change the following: -\begin{enumerate} -\item In \textit{Implementation}, choose \textit{Custom}. -\item In \textit{Binary Name}, choose the executable for \arara using the \textit{Browse} button. -\item In \textit{Parameters}, you can choose the parameters, such as |--verbose|. -\item In \textit{Target File}, choose \textit{Active File/Masterfile}. -\end{enumerate} -\item Save these settings. After the previous steps, you should get a menu for \arara in Inlage v5 as seen in Figure~\ref{fig:inlageararamenu}. -\end{enumerate} - -\begin{figure}[htbp] -\centering -\includegraphics[width=.7\textwidth]{figures/inlage/inlage-settings.png} -\caption{The \textit{Settings} window in Inlage.} -\label{fig:inlagesettings} -\end{figure} - -\begin{figure}[htbp] -\centering -\includegraphics[width=.7\textwidth]{figures/inlage/inlage-newprofile.png} -\caption{Adding a new profile in Inlage.} -\label{fig:inlagenewprofile} -\end{figure} - -\begin{figure}[htbp] -\centering -\includegraphics[width=.7\textwidth]{figures/inlage/inlage-addcompiler.png} -\caption{Adding a compiler in Inlage.} -\label{fig:inlageaddcompiler} -\end{figure} - -\begin{figure}[htbp] -\centering -\includegraphics[width=.7\textwidth]{figures/inlage/inlage-araramenu.png} -\caption{\arara added to the menu in Inlage.} -\label{fig:inlageararamenu} -\end{figure} - -That's it, \arara is successfully integrated with Inlage v5. Have fun! - -\section{\texorpdfstring{\TeX Shop}{TeXShop}} -\label{sec:texshop} - -Integrating \arara with \TeX shop is probably one of the easiest procedures. Simply open your terminal, go to |~/Library/TeXShop/Engines| and create a file named |arara.engine| with the content presented in Code~\ref{code:texshopcode}. - -Now, we need to add execute permissions to our newly created file. A simple |chmod +x arara.engine| will do the trick. Now, open \TeX shop and you will see \arara available for use in the list of engines (Figure~\ref{fig:texshop}). - -\begin{figure}[htbp] -\centering -\includegraphics[width=.8\textwidth]{figures/texshop/texshop-arara.png} -\caption{\arara available in \TeX shop.} -\label{fig:texshop} -\end{figure} - -No more steps are needed, \arara is successfully deployed in \TeX shop. If you want to remove \arara from \TeX shop, just remove |arara.engine| from the |Engines| directory. - -\begin{code}[htbp] -\caption{\mycmd{arara.engine}} -\label{code:texshopcode} -\begin{bash} -#!/bin/bash -export PATH=/usr/texbin:/usr/local/bin:${PATH} -arara "$1" -\end{bash} -\end{code} - -\section{\texorpdfstring{\TeX nic Center}{TeXnic Center}} -\label{sec:texniccenter} - -\TeX nic Center has also an easy integration with \arara. The first step is to go to \textit{Build $\rightarrow$ Define Output Profiles\ldots}. The \textit{Profiles} window should open, as shown in Figure~\ref{fig:txnprofiles}. - -\begin{figure}[htbp] -\centering -\includegraphics[width=.8\textwidth]{figures/texniccenter/texniccenter-profiles.png} -\caption{The \textit{Profiles} window in \TeX nic Center.} -\label{fig:txnprofiles} -\end{figure} - -Let's now create a new profile! Click the \textit{Add} button. A window will pop up and ask for the new profile name (Figure~\ref{fig:txnnewprofile}). Type |arara| as the profile name and click \textit{OK}. - -\begin{figure}[htbp] -\centering -\includegraphics[width=.7\textwidth]{figures/texniccenter/texniccenter-newprofile.png} -\caption{Creating a new profile in \TeX nic Center.} -\label{fig:txnnewprofile} -\end{figure} - -The last step is the easiest one. With the |arara| profile selected, check the box which says \textit{Run (La)\TeX in this profile}, then enter the full path to |arara| in the textbox named \textit{Path to the (La)\TeX compiler} and write |--log --verbose "%wm"| in the texbox named \textit{Command line arguments to pass to the compiler}; click \textit{OK}, as shown in Figure~\ref{fig:txnsettings}. - -\begin{figure}[htbp] -\centering -\includegraphics[width=.8\textwidth]{figures/texniccenter/texniccenter-config.png} -\caption{Configuring \arara in \TeX nic Center.} -\label{fig:txnsettings} -\end{figure} - -That's it, now \arara is integrated with \TeX nic Center! Just make sure to select |arara| in the dropdown list of available profiles. - -\printbibliography[heading=subbibliography] - -\chapter{Important concepts} -\label{chap:importantconcepts} - -\epigraph{\emph{Beware of bugs in the above code; I have only proved it correct, not tried it.}}{Donald Knuth} - -Time for our first contact with \arara! It's important to understand a few concepts in which \arara relies before we proceed -to the usage itself. Do not worry, these concepts are easy to follow, yet they are vital to the comprehension of the application -and the logic behind it. - -\section{Rules} -\label{sec:rules} - -Do you remember |mydoc.tex| from Code~\ref{code:hellolatex} in page~\pageref{code:hellolatex}? When we tried to mimic |rubber| and -run |arara mydoc|, nothing happened. We should tell \arara how it should handle this execution. Let's start with the rules. - -A \emph{rule} is a formal description of how \arara should handle a certain task. For example, if we want to use |pdflatex| with -\arara, we should have a rule for that. Once a rule is defined, \arara automatically provides an access layer to that rule through -directives, a concept to be introduced in Section~\ref{sec:directives}. - -A rule is a plain text file written in the YAML format~\cite{yaml:2001}. I opted for this format because it's cleaner and more intuitive to -use than other markup languages, besides of course being a data serialization standard for all programming languages. As a bonus, the -acronym \emph{YAML} rhymes with the word \emph{camel}, so \arara is heavily environmentally friendly\footnote{Perl, I'm looking at you.}. - -The default rules, that is, the rules shipped with \arara, are placed inside a special subdirectory named |rules/| inside |ARARA_HOME|. We will learn in -Section~\ref{sec:searchpaths} that we can add an arbitrary number of paths for storing our own rules, in order of priority, so don't worry -with the location of the default rules, although it's important to understand and acknowledge their existance. The basic structure of an -\arara rule is presented in Code~\ref{code:yamlrule}. - -\begin{code}[htbp] -\caption{\mycmd{makefoo.yaml}, a basic structure of an \arara rule.} -\label{code:yamlrule} -\begin{yaml} -!config -# I am a comment -identifier: makefoo -name: MakeFoo -command: makefoo @{file} -arguments: [] -\end{yaml} -\end{code} - -The |!config| keyword (line 1) is mandatory and it must be the first line of any \arara rule. Note that the format also accepts -comments (line 2) by simply starting a line with the |#| symbol. The following keys are defined: - -\begin{ruleoptions} -\item[identifier] This key (line 3) acts as a unique identifier for the rule. It's highly recommended to use lowercase letters without -spaces, accents or punctuation symbols. As a convention, if you have an identifier named |makefoo|, the rule filename must -be |makefoo.yaml|. -\item[name] The |name| key (line 4) holds the name of the task. When running \arara, this value will be displayed in the output. -In our example, \arara will display |Running MakeFoo| in the output when dealing with this task. -\item[command] This key (line 5) contains the system command to be executed. You can use virtually any type of command, -interactive or noninteractive. But beware: if \arara is running in silent mode, which is the default behaviour, an -interactive command wich might require the user input will be halted and the execution will fail. Don't despair, you can use a -special |--verbose| flag with \arara in order to interact with such commands -- we will talk about flags in -Chapter~\ref{chap:runningarara}. There are cases in which you might want to have a list of commands instead of a single one; -\arara has support for multiple commands inside one rule, we just need to replace |command| by |commands| and provide -a list of commands to be executed, as seen in Code~\ref{code:excommands}. -You probably noticed a strange element |@{file}| in the |command| line: this element is called \emph{orb tag}. For now, just admit these elements exist. We will come back to them later on, in Section~\ref{sec:orbtags}, I promise. -\item[arguments] The |arguments| key (line 6) denotes a list of arguments for the rule command. In our example, we have an empty list, -denoted as |[]|. You can define as many arguments as your command requires. Please check Code~\ref{code:makebar} for an example of a list of arguments. -\end{ruleoptions} - -There are cases in which we need to run more than just one command for a certain rule. Take, for example, the |frontespizio| rule -released with \arara: when using the |frontespizio| package\footnote{\url{http://ctan.org/pkg/frontespizio}, written by Enrico Gregorio.}, -the document has to processed by the choosen engine, say |pdflatex|, no less than three times; if |latex| is used, there's an additional -run of |dvips|. In that case, the logic is enclosed inside the rule, so there's no need to write every compilation step as required by the -package as directives in the source code; a simple call to |frontespizio| is enough to generate the proper results. - -If you need to run more than one command inside a rule, replace the |command| identifier by |commands| and add one command per line, -preceeded by |-| to indicate an item in the list. Code~\ref{code:excommands} presents a sample |makefoobar| rule which runs the -|makefoo| program two times, followed by one run of the |makebar| program. - -\begin{code}[htbp] -\caption{\mycmd{makefoobar.yaml}, an \arara rule with multiple commands.} -\label{code:excommands} -\begin{yaml} -!config -identifier: makefoobar -name: MakeFooBar -commands: -- makefoo @{file} -- makefoo @{file} -- makebar @{file} -arguments: [] -\end{yaml} -\end{code} - -For more complex rules, we might want to use arguments. Code~\ref{code:makebar} presents a new rule which makes use of them -instead of an empty list as we saw in Code~\ref{code:yamlrule}. - -\begin{code}[htbp] -\caption{\mycmd{makebar.yaml}, a rule with arguments.} -\label{code:makebar} -\begin{yaml} -!config -identifier: makebar -name: MakeBar -command: makebar @{one} @{two} @{file} -arguments: -- identifier: one - flag: -i @{parameters.one} -- identifier: two - flag: -j @{parameters.two} -\end{yaml} -\end{code} - -For every argument in the |arguments| list, we have a |-| mark and the proper indentation. The required keys for an argument are: - -\begin{ruleoptions} -\item[identifier] This key (lines 6 and 8) acts as a unique identifier for the argument. It's highly recommended to use lowercase letters -without spaces, accents or punctuation symbols. -\item[flag] The |flag| key (lines 7 and 9) represents the argument value. Note that we have other orb tags in the arguments definitions, -|@{parameters.one}| and |@{parameters.two}|; we will discuss them later on, in Section~\ref{sec:orbtags}. Just to give some context, -|parameters| is a special keyword which maps the elements available in the directives. For example, if we have |one: 1| in a directive, -|parameters.one| will resolve to |1|. The argument |flag| value is only triggered, that is, resolved, if and only if there's an explicit directive argument. Say, if |one| is not defined as a directive argument, the |flag| value of the argument |one| will be resolved to an empty string. There's a way of overriding the default empty string value when a directive argument is not specified, which is done by using the |default| key. -By the way, the |flag| key is not really mandatory, but for most of the rules, you'll need it. At least one of the |flag| and |default| keys is -mandatory. -\end{ruleoptions} - -If we need to set a default value other than an empty string to a rule argument, we can use the |default| key. When a rule argument just needs -a default value, you can safely ignore the |flag| key and rely on the |default| key. If you need to map a directive argument into a rule argument -without falling back to a default value different than an empty string, just use the |flag| key. Now, if you need mapping and fallback, -stick with both keys. - -For now, we need to keep in mind that \arara uses rules to tell it how to do a certain task. In the next sections, when more concepts are -presented, we will come back to this subject. Just a taste of things to come, as we mentioned before already: directives are mapped to rules through orb tags. Don't worry, I'll explain how things work. - -\section{Directives} -\label{sec:directives} - -A \emph{directive} is a special comment inserted in the |.tex| file in which you indicate how \arara should behave. You can -insert as many directives as you want, and in any position of the |.tex| file. \arara will read the whole file and extract the directives. -A directive should be placed in a line of its own, in the form |% arara: <directive>| -- actually, we will see in Section~\ref{sec:filepatterns} -that the prefix search can be altered. There are two types of directives: - -\begin{description} -\item[empty directive] An empty directive, as the name indicates, has only the rule identifier, as we seen in Section~\ref{sec:rules}. -Lines 1 and 3 of Code~\ref{code:directiveslatex} show an example of empty directives. Note that you can suppress arguments -(line 3 in contrast to line 2), but we will see that \arara assumes that you know exactly what you are doing. The syntax for an empty -directive is |% arara: makefoo|. -\item[parametrized directive] A parametrized directive has the rule identifier followed by its arguments. Line 2 of Code~\ref{code:directiveslatex} shows an -example of a parametrized directive. It's very important to mention that the arguments are mapped by their identifiers and not by -their positions. The syntax for a parametrized directive is |% arara: makefoo: { arglist }|. The argument is in the form |arg: value|; a -list of arguments and their respective values is separated by comma. -\end{description} - -\begin{code}[htbp] -\caption{Example of directives in a .tex file.} -\label{code:directiveslatex} -\begin{latex} -%% (*@@*)arara: makefoo -%% (*@@*)arara: makebar: { one: hello, two: bye } -%% (*@@*)arara: makebar -\documentclass{article} -... -\end{latex} -\end{code} - -The arguments are defined according to the rule mapped by the directive. For example, the rule |makebar| (Code~\ref{code:makebar}) -has a list of two arguments, |one| and |two|. So you can safely write |makebar: { one: hello }|, but trying to map a nonexisting argument -with |makebar: { three: hi }| will raise an error. - -If you want to disable an \arara directive, there's no need of removing it from the |.tex| file. Simply replace |% arara:| by |% !arara:| and -this directive will be ignored. \arara always look for a line that, after removing the leading and trailing spaces, starts with a comment |%| -and has the keyword |arara:| in it. In Section~\ref{sec:filepatterns}, we will learn how to override this search pattern, but the |arara:| -keyword is always immutable. - -Directives are mapped to rules. In Section~\ref{sec:orbtags} we will learn about orb tags and then revisit rules and directives. I hope the concepts will be clearer since we will understand what an orb tag is and how it works. How about a nice cup of coffee? - -\section{Orb tags} -\label{sec:orbtags} - -When I was planning the mapping scheme, I opted for a templating mechanism. I was looking for flexibility, and the powerful -\href{http://mvel.codehaus.org}{MVEL} expression language~\cite{mvel:2012} was perfect for the job. I could extend my mapping -plans by using orb tags. An \emph{orb tag} consists of a |@| character followed by braces |{...}| which contain regular MVEL expressions. -In particular, \arara uses the |@{}| expression orb, which contains a value expression which will be evaluated to a string, and -appended to the output template. For example, the following template |Hello, my name is @{name}| with the |name| variable resolving -to |Paulo| will be expanded to the string |Hello, my name is Paulo|. Cool, isn't it? Code~\ref{code:exorbtags} presents a few examples -on how orb tags are expanded. - -\begin{code}[htbp] -\caption{A few examples on how orb tags are expanded.} -\label{code:exorbtags} -\begin{bash} -# always consider: name = Paulo - -In[1]: Hello, my name is @{name}. -Out[1]: Hello, my name is Paulo. - -In[2]: @{name == "Paulo"} -Out[2]: true - -In[3]: @{name.toUpperCase()} -Out[3]: PAULO - -In[4]: Hello, I am @{name == "Paulo" ? "John" : "Mary"}. -Out[4]: Hello, I am John. -\end{bash} -\end{code} - -In the first example of Code~\ref{code:exorbtags}, |@{name}| simply indicates the expansion of the variable into its value, so the output is a -concatenation of the text with the variable value. The second example is a conditional test, that is, whether the |name| variable has its -value equals to |Paulo|; the result of this evaluation is then expanded, which is |true|. The third example presents a more complex construction: since |name| holds a string, MVEL resolves this variable to a |String| object and automatically all methods from the |String| class in Java are available to the variable, so the method |toUpperCase()| is called in order to make all characters in the string to be capitalized, and the output is presented. The fourth and last example presents a ternary operation, which starts with a conditional to be evaluated; if this test evaluates to true, the first string is printed, with the second string being printed in case the test is false. - -When mapping rules, every command argument will be mapped to the form |@{identifier}| with value equals to the content of the |flag| key. -The |@{identifier}| orb tag might hold the value of the |default| key instead, if the key is defined and there were no directive parameters -referring to |identifier|. There are three reserved orb tags, |@{file}|, |@{item}| and |@{parameters}| -- actually, that's not true, there's a -fourth reserved orb tag which plays a very special role in \arara \ -- |@{SystemUtils}| -- but we will talk about it later on. The |@{file}| -orb tag refers to the filename argument passed to \arara. The |@{file}| value can be overriden, but we will discuss it later. The second -reserved orb tag |@{item}| refers to a list of items, in case the rule might use some sort of list iteration, discussed later on. The -third reserved orb tag |@{parameters}| is a map which can expand to the argument value passed in the directive. If you have |makebar: { one: hello }|, the |flag| key of argument |one| will be expanded from the original definition |-i @{parameters.one}| to |-i hello|. Now |@{one}| contains the expanded |flag| value, which is |-i hello|. All arguments tags are expanded in the rule command. If one of them is not defined in the directive, \arara will admit an empty value, so the |command| flag will be expanded to |makebar -i hello mydoc|, unless of course the current argument doesn't have a |default| elements in its definition. The whole procedure is summarized as follows: - -\begin{enumerate} -\item \arara processes a file named |mydoc.tex|. -\item A directive |makebar: { one: hello }| is found, so \arara will look up the rule |makebar.yaml| (Code~\ref{code:makebar}) inside the default rules directory. -\item The argument |one| is defined and has value |hello|, so the corresponding |flag| key will have the orb tag |@{parameters.one}| expanded to |hello|. The new value is now added to the template referenced by the |command| key and then |@{one}| is -expanded to |-i hello|. -\item The argument |two| is not defined, so the template referenced by the |command| key has |@{two}| expanded to an empty string, since there's no |default| key in the argument definition. -\item There are no more arguments, so the template referenced by the |command| key now expands |@{file}| to |mydoc|. -\item The final command is now |makebar -i hello mydoc|. -\end{enumerate} - -There's a reserved directive key named |files|, which is in fact a list. In case you want to override the default value of the |@{file}| orb tag, use the |files| key, -like |makebar: { files: [ thedoc.tex ] }|. This will result in |makebar thedoc.tex| instead of |makebar mydoc.tex|. The very same concept applies -to the other reserved directive key named |items|, which is also a list, and the expansion happens in the |@{item}| orb tag. - -If you provide more than one element in the list, \arara will replicate the directive for every file found, so |makebar: { files: [ a, b, c ] }| will -result in three commands: |makebar a|, |makebar b| and |makebar c|. If you happen to have a rule which makes use of both |files| and -|items| in the directive, you'll end up with a cartesian product of those two lists. - -\printbibliography[heading=subbibliography] - -\chapter{Configuration file} -\label{chap:configurationfile} - -\epigraph{\emph{An algorithm must be seen to be believed.}}{Donald Knuth} - -\arara has support for an optional configuration file in order to enhance and override some settings of the application without the need of delving into the source code. The optional configuration file has to reside inside the user home directory, which is usually |C:\Users\Username| for Windows Vista and superior, or |~/username| for the Unix world, under the name |araraconfig.yaml|. \arara always looks for a configuration file during every execution. In fact, |araraconfig.yaml| is just a plain text file written in the YAML format, starting with the |!config| line and at with least one of the three settings presented in the following sections. The order doesn't matter, as long as they are consistent. - -\section{Search paths} -\label{sec:searchpaths} - -When looking for rules, \arara always searches the default rule path located at |ARARA_HOME/rules|; if no rule is found, the execution -halts with an error. It's not wise to mess with the default rule path, so we use the configuration file to add search paths, that is, a list of -directories in which \arara should look for rules. An example of a new search path is presented in Code~\ref{code:searchone}. - -\begin{code}[htbp] -\caption{An example of a new search path for the configuration file.} -\label{code:searchone} -\begin{yaml} -!config -paths: -- /home/paulo/rules -\end{yaml} -\end{code} - -According to Code~\ref{code:searchone}, from now on, \arara will look for rules first in the |/home/paulo/rules|; if the rule is not found, -then the search falls back to the default search path located at |ARARA_HOME/rules|. We can even add an arbitrary number of paths, as seen in Code~\ref{code:searchtwo}. - -\begin{code}[htbp] -\caption{An arbitrary number of paths added in the configuration file.} -\label{code:searchtwo} -\begin{yaml} -!config -paths: -- /home/paulo/rules -- /opt/arara/rules -- /home/paulo/myrules -\end{yaml} -\end{code} - -The items order defines the search priority. \arara also features a special orb tag for search paths named |@{userhome}| which maps the variable to the user home directory, for example, |/home/paulo|, according to your operating system. But before we proceed, a word on the YAML format. - -Sadly, we can't start values with |@| because this symbol is reserved for future use in the YAML format. For example, |foo: @bar| is an invalid YAML format, so the correct usage is to enclose it in quotes: |foo: '@bar'| or |foo: "@bar"|. We also need to enclose our strings with quotes in \arara, but now we can save them by simply adding the |<arara>| prefix to the value. In other words, |foo: <arara > @bar| is correctly parsed; when that keyword in that specific position is found, \arara removes it. That means that the orb tag presented in Code~\ref{code:searchthree} will be correctly parsed. - -\begin{code}[htbp] -\caption{Using the special orb tag for mapping the home directory in the configuration file.} -\label{code:searchthree} -\begin{yaml} -!config -- '@{userhome}/rules' -- /opt/arara/rules -- <arara> @{userhome}/myrules -\end{yaml} -\end{code} - -It's important to observe that the |<arara>| prefix is also valid in the rules context, presented in Section~\ref{sec:rules}. The idea of using this prefix is to actually ease the writing of rules that involve quoting without the need of escaping all internal quotes or even alternating between single and double quotes. It's also a way of writing cleaner rules. - -\section{Language} -\label{sec:language} - -\arara currently features localized messages in English, French, Italian, German, Spanish, Brazilian Portuguese, Russian and Turkish. The default language fallback is English, but we can easily change the language by adding |language: <code>| to the configuration file, as seen in Code~\ref{code:conflang}. The list of languages and codes is presented in Table~\ref{tab:langcodeconf}. - -\begin{code}[htbp] -\caption{Changing the language in the configuration file.} -\label{code:conflang} -\begin{yaml} -!config -language: en -\end{yaml} -\end{code} - -\begin{table}[htbp] -\centering -\caption{Languages and codes.} -\label{tab:langcodeconf} -\renewcommand{\arraystretch}{1.5} -\begin{tabular}{lr} -\hline -\textbf{Language} & \textbf{Code} \\ -\hline -\hline -English & |en| \\ -Brazilian Portuguese & |ptbr| \\ -Italian & |it| \\ -Spanish & |es| \\ -German & |de| \\ -French & |fr| \\ -Russian & |ru| \\ -Turkish & |tr| -\end{tabular} -\end{table} - -There's also a |--language| command line flag which has a higher priority, so it overrides the configuration file setting, if any. Beware of the terminal you use; the Windows command prompt has serious troubles in understanding UTF-8. You probably won't run into problems with the applications shipped in Mac or Linux. - -\section{File patterns} -\label{sec:filepatterns} - -\arara accepts the following filetypes: |tex|, |dtx| and |ltx|. If no file extension is provided in the command line, for example, calling |arara mydoc| instead of |arara mydoc.tex|, the application will automatically look for files that match the filetypes in that specific order, that is, |mydoc.tex|, |mydoc.dtx| and |mydoc.ltx|. Let's say we want to change the order by promoting |dtx| to the first match; we can easily achieve that by rearranging the items of the list of filetypes in the configuration file according to Code~\ref{code:itemsconf}. - -\begin{code}[htbp] -\caption{Rearranging the list of filetypes in the configuration file.} -\label{code:itemsconf} -\begin{yaml} -!config -filetypes: -- extension: dtx -- extension: tex -- extension: ltx -\end{yaml} -\end{code} - -The |filetypes| key in the configuration file is actually way more powerful than the example shown in Code~\ref{code:itemsconf}. Before -we continue, let's start with some basics. Consider the three directives presented in Code~\ref{code:confdirectives}. - -\begin{code}[htbp] -\caption{Three directives with different formatting patterns.} -\label{code:confdirectives} -\begin{latex} -% (*@@*)arara: foo - % (*@@*)arara: foo -% (*@@*) arara: foo -\documentclass{book} -... -\end{latex} -\end{code} - -The default setting for \arara is to recognize the three directives shown in Code~\ref{code:confdirectives}. In other words, the search pattern for all the three extensions is |^(\\s)*%\\s+| plus |arara:\\s| which is immutable, of course. Let’s say that, for the |dtx| format, you want -\arara to look for directives that have no spaces in the beginning of the line, that is, the line must start with only one percentage sign followed by at least one space and the default prefix. We can easily achieve such requirement by adding a |pattern| element to our list, as presented in Code~\ref{code:confdirectivessearch}. - -\begin{code}[htbp] -\caption{Changing the search pattern for \mycmd{.dtx} files.} -\label{code:confdirectivessearch} -\begin{yaml} -!config -!config filetypes: -- extension: dtx - pattern: ^%\\s+ -- extension: tex -- extension: ltx -\end{yaml} -\end{code} - -Now, only the first directive of Code~\ref{code:confdirectives} is recognized, if the analyzed file has the |.dtx| extension. All other extensions -- |.tex| and |.ltx| -- will follow the default search pattern. - -We can also extend \arara to analyze files with arbitrary extensions. As an example, let's suppose we have a sample |hello.c| file, presented in Code~\ref{code:helloc}. Note that the code was omitted for obvious reasons, since we are interested in the header. - -\begin{code}[htbp] -\caption{A sample \mycmd{hello.c} code.} -\label{code:helloc} -\begin{clang} -// arara: gcc -#include <stdio.h> -... -\end{clang} -\end{code} - -We can add the |.c| extension to be recognized by \arara by simply adding the extension and search pattern entries in the configuration file, as presented in Code~\ref{code:confc}. - -\begin{code}[htbp] -\caption{Adding support for \mycmd{.c} files in the configuration file.} -\label{code:confc} -\begin{yaml} -!config -filetypes: -- extension: c - pattern: ^\\s*//\\s* -\end{yaml} -\end{code} - -Done, now \arara can support |.c| files! We can run |arara hello.c| and have our code compiled, provided we have a |gcc| rule, of course. The extensions list will be |.tex|, |.dtx|, |.ltx| and |.c|. If you want to change the order, it’s a matter of rearranging the items, as shown in Code~\ref{code:confctwo}. - -\begin{code}[htbp] -\caption{Rearranging items of arbitrary extensions in the configuration file.} -\label{code:confctwo} -\begin{yaml} -!config -filetypes: -- extension: c - pattern: ^\\s*//\\s* -- extension: tex -- extension: dtx -- extension: ltx -\end{yaml} -\end{code} - -From now on, the |.c| has priority over all other extensions. It's very important to note that for customized extensions, the |pattern| key is mandatory. For default extensions, use the |pattern| key if and only if you want to override the search pattern. - -\arara comes with a rule for Sketch~\cite{sketch:2013}, written by Sergey Ulyanov. We can easily add |% arara: sketch: { files: [ drawing.sk ] }| -and Sketch will be properly called. Let's say we want to make \arara recognize Sketch files; it's just a matter of adding the extension and the -search pattern in our configuration file, as presented in Code~\ref{code:sketchconfig}. - -\begin{code}[htbp] -\caption{Adding support for Sketch files in the configuration file.} -\label{code:sketchconfig} -\begin{yaml} -!config -filetypes: -- extension: sk - pattern: ^(\\s)*[%#]\\s+ -\end{yaml} -\end{code} - -Now \arara supports |.sk| files! We can write a sample Sketch file (borrowed from the documentation) presented in Code~\ref{code:sketchsample} and add a |sketch| directive. The comments in the Sketch language allow both |%| and |#| symbols at the beginning of the line. - -\begin{code}[htbp] -\caption{\mycmd{drawing.sk}, a sample Sketch file.} -\label{code:sketchsample} -\begin{latex} -% arara: sketch -polygon(0,0,1)(1,0,0)(0,1,0) -line(-1,-1,-1)(2,2,2) -\end{latex} -\end{code} - -With the new settings presented in Code~\ref{code:sketchconfig}, we can run |arara drawing| or |arara drawing.sk| (Code~\ref{code:sketchsample}) and Sketch will be properly executed through \arara with no problems. - -\printbibliography[heading=subbibliography] - -\chapter{Running \texorpdfstring{\arara}{arara}} -\label{chap:runningarara} - -\epigraph{\emph{Never trust a computer you can't throw out a window.}}{Steve Wozniak} - -Now that we have learned some basics, it's time to run \arara! Thankfully, the application is very user-friendly; if something -goes wrong, we can easily find out what happened through messages and the log file. - -\section{Command line} -\label{sec:commandline} - -\arara has a very simple command line interface. A simple |arara mydoc| does the trick -- provided that |mydoc| has the proper directives. -The default behaviour is to run in silent mode, that is, only the name and the execution status of the current task are displayed. -The idea of the silent mode is to provide a concise output. Sadly, in some cases, we want to follow the compilation workflow and even -interact with a command which requires user input. If you have an interactive command, \arara won't even bother about it: the execution -will halt and the command will fail. Well, that's the silent mode. Thankfully, \arara has a set of flags that can change the default -behaviour or even enhance the compilation workflow. Table~\ref{tab:araraflags} shows the list of available \arara flags, -with both short and long options. - -{\renewcommand{\arraystretch}{1.5} -\begin{table}[htbp] -\centering -\footnotesize -\begin{tabular}{p{0.1\textwidth}p{0.2\textwidth}p{0.55\textwidth}} -\hline -\textbf{Flag} & & \textbf{Behaviour}\\ -\hline -\hline -|-h| & |--help| & This flag prints the help message, as seen in -Code~\ref{code:arararun}, and exits the application. If you run |arara| without -any flags or a file to process, this is the default behaviour. \\ -\hline -|-L c| & |--language c| & The |--language| flag sets the language of the current -execution of \arara, where |c| is the language code presented in Table~\ref{tab:langcodeconf}, -on page~\pageref{tab:langcodeconf}. Note that this flag has higher priority than the -language set in the configuration file. \\ -\hline -|-l| & |--log| & The |--log| flag enables the logging feature of \arara. All -streams from all commands will be logged and, at the end of the execution, an -|arara.log| file will be generated. The logging feature is discussed in -Section~\ref{sec:logging}. \\ -\hline -|-t n| & |--timeout n| & This flag sets an execution timeout for every task. If -the timeout is reached before the task ends, \arara will kill it and interrupt -the processing. The $n$ value is expressed in milliseconds. \\ -\hline -|-v| & |--verbose| & The |--verbose| flag enables all streams to be flushed to -the terminal -- exactly the opposite of the silent mode. This flag also allows -user input if the current command requires so. The user input interaction is -possible thanks to the amazing Apache Commons Exec library~\cite{exec:2010}. \\ -\hline -|-V| & |--version| & This flag, as the name indicates, prints the current -\arara version and exits the application. \\ -\hline -\end{tabular} -\caption{The list of available \arara flags.} -\label{tab:araraflags} -\end{table}} - -\arara can recognize three types of files based on their extension, in this order: |.tex|, |.dtx| and |.ltx|. Other extensions are not recognized, unless of -course you provide the correct mapping for them in the configuration file, as discussed in Section~\ref{sec:filepatterns}. - -The combination of flags is very useful to enhance the \TeX\ experience. They can provide nice features for integrating \arara with -\TeX\ IDEs, as seen in Chapter~\ref{chap:ideintegration}. Note that both |--log| and |--verbose| flags are the most common combo -to use in an IDE, so we can have both terminal and file output at the same time without any cost. - -\section{Messages} -\label{sec:messages} - -Messages are the first type of feedback provided by \arara. They are basically related to rules, directives and configuration settings. -Bad syntax, nonexisting rules, malformed directives, wrong expansion, \arara tries to tell you what went wrong. Those messages are -usually associated with errors. We tried to include useful messages, like telling in which directive and line an error ocurred, or -that a certain rule does not exist or has an incorrect format. \arara also checks if a command is valid. For example, if you try to call a rule -that executes a nonexisting |makefoo| command, \arara will complain about it. - -These messages usually cover the events that can happen during the preprocessing phase. Don't panic, \arara will tell you what happened. -Of course, an error halts the execution, so we need to fix the reported issue before proceeding. Note that \arara can also complain about nonexisting commands -- in this case, the error will be raised in runtime, since it's an underlying operating system dependency. - -If you use the |--language| flag or set up the |language| key in the configuration file, \arara will be able to display localized messages -according to the provided language code. In other words, users will be able to read messages from the application in languages other -English. Currently, \arara is able to display messages in English, Brazilian Portuguese, Spanish, German, Italian, French, Russian and Turkish. -Have fun! - -\section{Logging} -\label{sec:logging} - -Another way of looking for an abnormal behaviour is to read the proper |.log| file. Unfortunately, not every command emits a report of -its execution and, even if the command generates a |.log| file, multiple runs would overwrite the previous reports and we would have -only the last call. \arara provides a more consistent way of monitoring commands and their own behaviour through a global -|.log| file that holds every single bit of information. You can enable the logging feature by adding either the |--log| or |-l| flags to -the |arara| application. - -Before we continue, I need to explain about standard streams, since they constitute an important part of the generated |.log| file -by \arara. Wikipedia~\cite{streams:2012} has a nice definition of them: - -\begin{quotation} -\noindent ``In computer programming, standard streams are preconnected input and -output channels between a computer program and its environment (typically a -text terminal) when it begins execution. The three \textsc{i/o} connections are -called standard input (|stdin|), standard output (|stdout|) and standard error -(|stderr|).'' -\end{quotation} - -Basically, the operating system provides two streams directed to display data: |stdout| and |stderr|. Usually, the first stream is -used by a program to write its output data, while the second one is typically used to output error messages or diagnostics. -Of course, the decision of what output stream to use is up to the program author. - -When \arara traces a command execution, it logs both |stdout| and |stderr|. The log entry for both |stdout| and |stderr| is referred -as \emph{Output logging}. Again, an output to |stderr| does not necessarily mean that an error was found in the code, while an -output to |stdout| does not necessarily mean that everything ran flawlessly. It's just a naming convention, as the program author -decides how to handle the messages flow. That's why \arara logs them both in the same output stream. Read the log entries carefully. -A excerpt of the resulting |arara.log| from |arara helloindex --log| is shown in Code~\ref{code:araralog} -- several lines were removed in order to leave only the more important parts. - -\begin{code}[htbp] -\caption{\mycmd{arara.log} from \mycmd{arara helloindex {-}{-}log}.} -\label{code:araralog} -\begin{lstlisting}[basicstyle=\footnotesize\ttfamily, columns=flexible, showspaces=false, breaklines=true] -09 Abr 2012 11:27:58.400 INFO Arara - Welcome to Arara! -09 Abr 2012 11:27:58.406 INFO Arara - Processing file helloindex.tex, please wait. -09 Abr 2012 11:27:58.413 INFO DirectiveExtractor - Reading directives from helloindex.tex. -09 Abr 2012 11:27:58.413 TRACE DirectiveExtractor - Directive found in line 1 with pdflatex. -... -09 Abr 2012 11:27:58.509 INFO DirectiveParser - Parsing directives. -09 Abr 2012 11:27:58.536 INFO TaskDeployer - Deploying tasks into commands. -09 Abr 2012 11:27:58.703 INFO CommandTrigger - Ready to run commands. -09 Abr 2012 11:27:58.704 INFO CommandTrigger - Running PDFLaTeX. -09 Abr 2012 11:27:58.704 TRACE CommandTrigger - Command: pdflatex helloindex.tex -09 Abr 2012 11:27:59.435 TRACE CommandTrigger - Output logging: This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011) -... -Output written on helloindex.pdf (1 page, 12587 bytes). -Transcript written on helloindex.log. -09 Abr 2012 11:27:59.435 INFO CommandTrigger - PDFLaTeX was successfully executed. -09 Abr 2012 11:27:59.655 INFO CommandTrigger - Running MakeIndex. -09 Abr 2012 11:27:59.655 TRACE CommandTrigger - Command: makeindex helloindex.idx -09 Abr 2012 11:27:59.807 TRACE CommandTrigger - Output logging: This is makeindex, version 2.15 [TeX Live 2011] (kpathsea + Thai support). -... -Generating output file helloindex.ind..done (9 lines written, 0 warnings). -Output written in helloindex.ind. -Transcript written in helloindex.ilg. -09 Abr 2012 11:27:59.807 INFO CommandTrigger - MakeIndex was successfully executed. -... -09 Abr 2012 11:28:00.132 INFO CommandTrigger - All commands were successfully executed. -09 Abr 2012 11:28:00.132 INFO Arara - Done. -\end{lstlisting} -\end{code} - -The \arara log is useful for keeping track of the execution flow as well as providing feedback on how both rules and directives are being -expanded. The log file contains information about the directive extraction and parsing, rules checking and expansion, deployment of tasks -and execution of commands. The \arara messages are also logged. - -If by any chance your code is not working, try to run |arara| with the logging feature enabled. It might take a while for you to digest the log -entries, but I'm sure you will be able to track every single step of the execution and fix the offending line in your code. - -\section{Command output} -\label{sec:commandoutput} - -Even when the |--log| flag is enabled, \arara still runs in silent mode. There's a drawback of this mode: if there's an interactive command -wich requires the user input, \arara will simply halt the task and the execution will fail. We need to make |stdin| -- the standard input stream -- available for us. Thanks to the amazing Apache Commons Exec library~\cite{exec:2010}, \arara can also provide an access layer to the -standard input stream in order to interact with commands, when needed. We just need to use a special |--verbose| flag. - -It's important to note that both |--log| and |--verbose| flags can be used together; \arara will log everything, including the input stream. -I usually recommend those two flags when integrating \arara with \TeX\ IDEs, like we did in Chapter~\ref{chap:ideintegration}. - -\printbibliography[heading=subbibliography] - -\part{For authors} -\label{part:forauthors} - -\chapter{Quick start} -\label{sec:quickstarta} - -\epigraph{\emph{Snakes! Why did it have to be snakes?}}{Indiana Jones, \emph{Raiders of the Lost Ark} (1981)} - -This chapter covers a quick start of \arara, including an overview of the predefined rules and some notes on how to properly organize -directives in the source code. - -\section{Predefined rules} -\label{sec:predefinedrules} - -Let's take a look on the predefined rules and a brief description of their parameters. Note that these rules are constantly updated; -the most recent versions are available in the project repository. - -For convenience, we will use |yes| and |no| for representing boolean values. Note that you can also use other pairs: |on| and |off|, -and |true| and |false|. These values are also case insensitive, so entries like |True| or |NO| are valid. - -Note that the |latex|, |pdflatex|, |xelatex| and |lualatex| rules have a |shell| parameter resolving to |--shell-escape|. This flag is -also available in MiK\TeX, but as an alias to the special |--enable-write18| flag. If you want to use \arara with an outdated -MiK\TeX\ distribution which doesn't support the |--shell-escape| alias, make sure to edit the predefined rules accordingly -- -these rules are located inside |$ARARA_HOME/rules| -- and replace all occurrences of |--shell-escape| by |--enable-write18|. -Another option is to add another search path in the configuration file with modified rules, since custom search paths have higher priority -than the default rules directory. If you use \TeX~Live or a recent Mik\TeX\ installation, there's no need to edit the rules, since the -|--shell-escape| flag is already available. - -\subsection*{\texorpdfstring{\hologo{biber}}{biber}} - -\begin{description} -\item[Description] This rule maps \hologo{biber}, calling the |biber| command -with the proper parameters, when available. All parameters are optional. -\item[Syntax] |% arara: biber| -\end{description} - -\subsubsection*{Parameters} - -\begin{ruleoptions} -\item[options] This parameter is used to provide flags which were not -mapped. It is recommended to enclose the value with single or double quotes. -\end{ruleoptions} - -\subsection*{\texorpdfstring{\hologo{BibTeX}}{BibTeX}} - -\begin{description} -\item[Description] This rule maps \hologo{BibTeX}, calling the |bibtex| command -with the proper parameters, when available. All parameters are optional. -\item[Syntax] |% arara: bibtex| -\end{description} - -\subsubsection*{Parameters} - -\begin{ruleoptions} -\item[options] This parameter is used to provide flags which were not -mapped. It is recommended to enclose the value with single or double quotes. -\end{ruleoptions} - -\subsection*{Clean} - -\begin{description} -\item[Description] This rule maps the removal command from the underlying operating system. There are no parameters for this rule, -except the the reserved directive key |files| which \textit{must} be used. If |files| is not used in the directive, \arara will simply ignore this rule. -\item[Syntax] |% arara: clean| -\end{description} - -\subsection*{dvips} - -\begin{description} -\item[Description] This rule maps dvips, calling the |dvips| command with the -proper parameters, when available. All parameters are optional. -\item[Syntax] |% arara: dvips| -\end{description} - -\subsubsection*{Parameters} - -\begin{ruleoptions} -\item[output] This parameter is used to set the output PostScript filename. -If not provided, the default output name is set to |@{getBasename(file)}.ps|. -\item[options] This parameter is used to provide flags which were not -mapped. It is recommended to enclose the value with single or double quotes. -\end{ruleoptions} - -\subsection*{frontespizio} - -\begin{description} -\item[Description] This rule maps a compilation chain defined in |frontespizio|, a package written by Enrico Gregorio; it calls a defined \TeX\ engine three times with the proper parameters, when available. All parameters are optional. If no engine is provided, |pdflatex| is used as default. When |latex| is the chosen engine, there's an additional call to dvips. -\item[Syntax] |% arara: frontespizio| -\end{description} - -\subsubsection*{Parameters} - -\begin{ruleoptions} -\item[engine] This parameter is used to set the \TeX\ engine. If not provided, |pdflatex| is used as a default value. -\end{ruleoptions} - -\subsection*{\texorpdfstring{\hologo{LaTeX}}{LaTeX}} - -\begin{description} -\item[Description] This rule maps \hologo{LaTeX}, calling the |latex| command -with the proper parameters, when available. All parameters are optional. -\item[Syntax] |% arara: latex| -\end{description} - -\subsubsection*{Parameters} - -\begin{ruleoptions} -\item[action] This parameter sets the interaction mode flag. Possible options -are |batchmode|, |nonstopmode|, |scrollmode|, and |errorstopmode|. If not -defined, no flag will be set. -\item[shell] This is a boolean parameter which sets the shell escape mode. If -true, shell escape will be enabled; if the value is set to false, the feature -will be completely disabled. If not defined, the default behaviour is rely on -restricted mode. -\item[synctex] This parameter is defined as boolean and sets the generation of -Sync\TeX\ data for previewers. If true, data will be generated; false will -disable this feature. If not defined, no flag will be set. -\item[draft] This is a boolean parameter which sets the draft mode, that is, no -PDF output is generated. When value set to true, the draft mode is enabled, -while false disables it. If not defined, no flag will be set. -\item[options] This parameter is used to provide flags which were not -mapped. It is recommended to enclose the value with single or double quotes. -\end{ruleoptions} - -\subsection*{Latexmk cleanup} - -\begin{description} -\item[Description] This rule calls the cleanup option of Latexmk, according to the provided parameters. All parameters are optional. -\item[Syntax] |% arara: lmkclean| -\end{description} - -\subsubsection*{Parameters} - -\begin{ruleoptions} -\item[include] This parameter, if equals to |all|, will remove all generated files, leaving only the source code intact; otherwise only the auxiliary files will be removed. -\end{ruleoptions} - -\subsection*{\texorpdfstring{\hologo{LuaLaTeX}}{LuaLaTeX}} - -\begin{description} -\item[Description] This rule maps \hologo{LuaLaTeX}, calling the |lualatex| -command with the proper parameters, when available. All parameters are optional. -\item[Syntax] |% arara: lualatex| -\end{description} - -\subsubsection*{Parameters} - -\begin{ruleoptions} -\item[action] This parameter sets the interaction mode flag. Possible options -are |batchmode|, |nonstopmode|, |scrollmode|, and |errorstopmode|. If not -defined, no flag will be set. -\item[shell] This is a boolean parameter which sets the shell escape mode. If -true, shell escape will be enabled; if the value is set to false, the feature -will be completely disabled. If not defined, the default behaviour is rely on -restricted mode. -\item[synctex] This parameter is defined as boolean and sets the generation of -Sync\TeX\ data for previewers. If true, data will be generated; false will -disable this feature. If not defined, no flag will be set. -\item[draft] This is a boolean parameter which sets the draft mode, that is, -no PDF output is generated. When value set to true, the draft mode is enabled, -while false disables it. If not defined, no flag will be set. -\item[options] This parameter is used to provide flags which were not -mapped. It is recommended to enclose the value with single or double quotes. -\end{ruleoptions} - -\subsection*{Latexmk with \texorpdfstring{\hologo{LuaLaTeX}}{LuaLaTeX}} - -\begin{description} -\item[Description] This rule calls Latexmk with \hologo{LuaLaTeX} as engine. All parameters are optional. -\item[Syntax] |% arara: lualatexmk| -\end{description} - -\begin{ruleoptions} -\item[action] This parameter sets the interaction mode flag. Possible options -are |batchmode|, |nonstopmode|, |scrollmode|, and |errorstopmode|. If not -defined, no flag will be set. -\item[shell] This is a boolean parameter which sets the shell escape mode. If -true, shell escape will be enabled; if the value is set to false, the feature -will be completely disabled. If not defined, the default behaviour is rely on -restricted mode. -\item[synctex] This parameter is defined as boolean and sets the generation of -Sync\TeX\ data for previewers. If true, data will be generated; false will -disable this feature. If not defined, no flag will be set. -\item[options] This parameter is used to provide flags which were not -mapped. It is recommended to enclose the value with single or double quotes. -\item[style] This parameter is used in case you want to provide a style for |makeindex|, if different than the default style. -\end{ruleoptions} - - -\subsection*{\texorpdfstring{\hologo{LuaTeX}}{LuaTeX}} - -\begin{description} -\item[Description] This rule maps \hologo{LuaTeX}, calling the |luatex| -command with the proper parameters, when available. All parameters are optional. -\item[Syntax] |% arara: luatex| -\end{description} - -\subsubsection*{Parameters} - -\begin{ruleoptions} -\item[action] This parameter sets the interaction mode flag. Possible options -are |batchmode|, |nonstopmode|, |scrollmode|, and |errorstopmode|. If not -defined, no flag will be set. -\item[shell] This is a boolean parameter which sets the shell escape mode. If -true, shell escape will be enabled; if the value is set to false, the feature -will be completely disabled. If not defined, the default behaviour is rely on -restricted mode. -\item[synctex] This parameter is defined as boolean and sets the generation of -Sync\TeX\ data for previewers. If true, data will be generated; false will -disable this feature. If not defined, no flag will be set. -\item[draft] This is a boolean parameter which sets the draft mode, that is, -no PDF output is generated. When value set to true, the draft mode is enabled, -while false disables it. If not defined, no flag will be set. -\item[options] This parameter is used to provide flags which were not -mapped. It is recommended to enclose the value with single or double quotes. -\end{ruleoptions} - - -\subsection*{Make} - -\begin{description} -\item[Description] This rule maps Make, calling the |make| command with the -proper parameters, when available. All parameters are optional. -\item[Syntax] |% arara: make| -\end{description} - -\subsubsection*{Parameters} - -\begin{ruleoptions} -\item[task] This parameter is used to set the task name for |make| to execute. -\end{ruleoptions} - -\subsection*{MakeGlossaries} - -\begin{description} -\item[Description] This rule maps MakeGlossaries, calling the |makeglossaries| -command with the proper parameters, when available. All parameters are optional. -\item[Syntax] |% arara: makeglossaries| -\end{description} - -\subsubsection*{Parameters} - -\begin{ruleoptions} -\item[options] This parameter is used to provide flags which were not -mapped. It is recommended to enclose the value with single or double quotes. -\end{ruleoptions} - -\subsection*{MakeIndex} - -\begin{description} -\item[Description] This rule maps MakeIndex, calling the |makeindex| command -with the proper parameters, when available. All parameters are optional. -\item[Syntax] |% arara: makeindex| -\end{description} - -\subsubsection*{Parameters} - -\begin{ruleoptions} -\item[style] This parameter sets the index style. If not defined, |makeindex| -relies on the default index style. -\item[german] This is a boolean parameter which sets the German word ordering -in the index. If true, the German word ordering will be employed; if the value -is set to false, |makeindex| will rely on the default behaviour. -\item[options] This parameter is used to provide flags which were not -mapped. It is recommended to enclose the value with single or double quotes. -\end{ruleoptions} - -\subsection*{Nomencl} - -\begin{description} -\item[Description] This rule maps Nomencl, which is in fact a call to the -|makeindex| command with the the nomenclature feature. All parameters are optional. -\item[Syntax] |% arara: nomencl| -\end{description} - -\subsubsection*{Parameters} - -\begin{ruleoptions} -\item[style] This parameter sets the nomenclature style. If not defined, -|makeindex| relies on the default nomenclature style. -\item[options] This parameter is used to provide flags which were not -mapped. It is recommended to enclose the value with single or double quotes. -\end{ruleoptions} - -\subsection*{\texorpdfstring{\hologo{pdfLaTeX}}{PDFLaTeX}} - -\begin{description} -\item[Description] This rule maps \hologo{pdfLaTeX}, calling the |pdflatex| -command with the proper parameters, when available. All parameters are optional. -\item[Syntax] |% arara: pdflatex| -\end{description} - -\subsubsection*{Parameters} - -\begin{ruleoptions} -\item[action] This parameter sets the interaction mode flag. Possible options -are |batchmode|, |nonstopmode|, |scrollmode|, and |errorstopmode|. If not -defined, no flag will be set. -\item[shell] This is a boolean parameter which sets the shell escape mode. If -true, shell escape will be enabled; if the value is set to false, the feature -will be completely disabled. If not defined, the default behaviour is rely on -restricted mode. -\item[synctex] This parameter is defined as boolean and sets the generation of -Sync\TeX\ data for previewers. If true, data will be generated; false will -disable this feature. If not defined, no flag will be set. -\item[draft] This is a boolean parameter which sets the draft mode, that is, no -PDF output is generated. When value set to true, the draft mode is enabled, -while false disables it. If not defined, no flag will be set. -\item[options] This parameter is used to provide flags which were not -mapped. It is recommended to enclose the value with single or double quotes. -\end{ruleoptions} - -\subsection*{Latexmk with \texorpdfstring{\hologo{pdfLaTeX}}{pdfLaTeX}} - -\begin{description} -\item[Description] This rule calls Latexmk with \hologo{pdfLaTeX} as engine. All parameters are optional. -\item[Syntax] |% arara: pdflatexmk| -\end{description} - -\begin{ruleoptions} -\item[action] This parameter sets the interaction mode flag. Possible options -are |batchmode|, |nonstopmode|, |scrollmode|, and |errorstopmode|. If not -defined, no flag will be set. -\item[shell] This is a boolean parameter which sets the shell escape mode. If -true, shell escape will be enabled; if the value is set to false, the feature -will be completely disabled. If not defined, the default behaviour is rely on -restricted mode. -\item[synctex] This parameter is defined as boolean and sets the generation of -Sync\TeX\ data for previewers. If true, data will be generated; false will -disable this feature. If not defined, no flag will be set. -\item[options] This parameter is used to provide flags which were not -mapped. It is recommended to enclose the value with single or double quotes. -\item[style] This parameter is used in case you want to provide a style for |makeindex|, if different than the default style. -\end{ruleoptions} - -\subsection*{\texorpdfstring{\hologo{pdfTeX}}{PDFTeX}} - -\begin{description} -\item[Description] This rule maps \hologo{pdfTeX}, calling the |pdftex| -command with the proper parameters, when available. All parameters are optional. -\item[Syntax] |% arara: pdflatex| -\end{description} - -\subsubsection*{Parameters} - -\begin{ruleoptions} -\item[action] This parameter sets the interaction mode flag. Possible options -are |batchmode|, |nonstopmode|, |scrollmode|, and |errorstopmode|. If not -defined, no flag will be set. -\item[shell] This is a boolean parameter which sets the shell escape mode. If -true, shell escape will be enabled; if the value is set to false, the feature -will be completely disabled. If not defined, the default behaviour is rely on -restricted mode. -\item[synctex] This parameter is defined as boolean and sets the generation of -Sync\TeX\ data for previewers. If true, data will be generated; false will -disable this feature. If not defined, no flag will be set. -\item[draft] This is a boolean parameter which sets the draft mode, that is, no -PDF output is generated. When value set to true, the draft mode is enabled, -while false disables it. If not defined, no flag will be set. -\item[options] This parameter is used to provide flags which were not -mapped. It is recommended to enclose the value with single or double quotes. -\end{ruleoptions} - -\subsection*{ps2pdf} - -\begin{description} -\item[Description] This rule maps pdf2pdf, calling the |ps2pdf| command with -the proper parameters, when available. All parameters are optional. -\item[Syntax] |% arara: ps2pdf| -\end{description} - -\subsubsection*{Parameters} - -\begin{ruleoptions} -\item[output] This parameter is used to set the output PDF filename. If not -provided, the default output name is set to |@{getBasename(file)}.pdf|. -\item[options] This parameter is used to provide flags which were not -mapped. It is recommended to enclose the value with single or double quotes. -\end{ruleoptions} - -\subsection*{Sketch} - -\begin{description} -\item[Description] This rule maps Sketch, a small, simple system for producing line drawings of two or three-dimensional objects and scenes. All parameters are optional. -\item[Syntax] |% arara: sketch| -\end{description} - -\subsubsection*{Parameters} - -\begin{ruleoptions} -\item[input] This parameter is used to provide flags which were not -mapped. It is recommended to enclose the value with single or double quotes. -\end{ruleoptions} - -\subsection*{songidx} - -\begin{description} -\item[Description] This rule maps |songidx|, a command line tool used to extract songs metadata from an file generated by the |songs| package\footnote{\url{http://songs.sourceforge.net}, written by Kevin Hamlen.} The parameter is mandatory. -\item[Syntax] |% arara: songidx| -\end{description} - -\subsubsection*{Parameters} - -\begin{ruleoptions} -\item[input] This parameter sets the name of the file generated by |songs| in which |songidx| will extract the songs metadata. -\end{ruleoptions} - -\subsection*{\texorpdfstring{\TeX}{TeX}} - -\begin{description} -\item[Description] This rule maps \TeX, calling the |tex| -command with the proper parameters, when available. All parameters are optional. -\item[Syntax] |% arara: pdflatex| -\end{description} - -\subsubsection*{Parameters} - -\begin{ruleoptions} -\item[action] This parameter sets the interaction mode flag. Possible options -are |batchmode|, |nonstopmode|, |scrollmode|, and |errorstopmode|. If not -defined, no flag will be set. -\item[shell] This is a boolean parameter which sets the shell escape mode. If -true, shell escape will be enabled; if the value is set to false, the feature -will be completely disabled. If not defined, the default behaviour is rely on -restricted mode. -\item[options] This parameter is used to provide flags which were not -mapped. It is recommended to enclose the value with single or double quotes. -\end{ruleoptions} - -\subsection*{\texorpdfstring{\hologo{XeLaTeX}}{XeLaTeX}} - -\begin{description} -\item[Description] This rule maps \hologo{XeLaTeX}, calling the |xelatex| -command with the proper parameters, when available. All parameters are optional. -\item[Syntax] |% arara: xelatex| -\end{description} - -\subsubsection*{Parameters} - -\begin{ruleoptions} -\item[action] This parameter sets the interaction mode flag. Possible options -are |batchmode|, |nonstopmode|, |scrollmode|, and |errorstopmode|. If not -defined, no flag will be set. -\item[shell] This is a boolean parameter which sets the shell escape mode. If -true, shell escape will be enabled; if the value is set to false, the feature -will be completely disabled. If not defined, the default behaviour is rely on -restricted mode. -\item[synctex] This parameter is defined as boolean and sets the generation of -Sync\TeX\ data for previewers. If true, data will be generated; false will -disable this feature. If not defined, no flag will be set. -\item[options] This parameter is used to provide flags which were not -mapped. It is recommended to enclose the value with single or double quotes. -\end{ruleoptions} - -\subsection*{Latexmk with \texorpdfstring{\hologo{XeLaTeX}}{XeLaTeX}} - -\begin{description} -\item[Description] This rule calls Latexmk with \hologo{XeLaTeX} as engine. All parameters are optional. -\item[Syntax] |% arara: xelatexmk| -\end{description} - -\begin{ruleoptions} -\item[action] This parameter sets the interaction mode flag. Possible options -are |batchmode|, |nonstopmode|, |scrollmode|, and |errorstopmode|. If not -defined, no flag will be set. -\item[shell] This is a boolean parameter which sets the shell escape mode. If -true, shell escape will be enabled; if the value is set to false, the feature -will be completely disabled. If not defined, the default behaviour is rely on -restricted mode. -\item[synctex] This parameter is defined as boolean and sets the generation of -Sync\TeX\ data for previewers. If true, data will be generated; false will -disable this feature. If not defined, no flag will be set. -\item[options] This parameter is used to provide flags which were not -mapped. It is recommended to enclose the value with single or double quotes. -\item[style] This parameter is used in case you want to provide a style for |makeindex|, if different than the default style. -\end{ruleoptions} - -\subsection*{\texorpdfstring{\hologo{XeTeX}}{XeTeX}} - -\begin{description} -\item[Description] This rule maps \hologo{XeTeX}, calling the |xetex| -command with the proper parameters, when available. All parameters are optional. -\item[Syntax] |% arara: xelatex| -\end{description} - -\subsubsection*{Parameters} - -\begin{ruleoptions} -\item[action] This parameter sets the interaction mode flag. Possible options -are |batchmode|, |nonstopmode|, |scrollmode|, and |errorstopmode|. If not -defined, no flag will be set. -\item[shell] This is a boolean parameter which sets the shell escape mode. If -true, shell escape will be enabled; if the value is set to false, the feature -will be completely disabled. If not defined, the default behaviour is rely on -restricted mode. -\item[synctex] This parameter is defined as boolean and sets the generation of -Sync\TeX\ data for previewers. If true, data will be generated; false will -disable this feature. If not defined, no flag will be set. -\item[options] This parameter is used to provide flags which were not -mapped. It is recommended to enclose the value with single or double quotes. -\end{ruleoptions} - -\section{Organizing directives} -\label{sec:organizingdirectives} - -Actually, there's nothing much to say about directives, they are really easy to use. The important part when dealing with directives is to make sure we will only use the right amount of them. Remember, for each directive, there will be call to the command line tool, and this might take some time. - -Since a directive can have as many parameters as its corresponding rule has, we need to take care. If an argument value has spaces, enclose it with quotes. Again, try to avoid at all costs values with spaces, but if you really need them, enclose the value with single quotes. If you want to make sure that both rules and directives are being mapped and expanded correctly, enable the logging option with the |--log| flag and verify -the output. All expansions are logged. - -Although \arara reads the whole file looking for directives, it's a good idea to organize them at the top of the file. It will surely make your life easier, as you can quickly spot the compilation chain to be applied to the current document. If there's something wrong with a directive, don't worry, \arara will be able to track the inconsistency down and warn us about it. - -\chapter{Reference for rule library} -\label{chap:referenceforrulelibraryone} - -\epigraph{\emph{Your brain may give birth to any technology, but other brains will decide whether the technology thrives. The number of possible technologies is infinite, and only a few pass this test of affinity with human nature.}}{Robert Wright} - -This chapter aims at discussing the reserved keywords of \arara for directive arguments and special orb tags, their purpose and how to correctly use them in the context of a document. - -\section{Directive arguments} -\label{sec:directivearguments} - -As seen in the previous chapters, \arara has two reserved keywords for directive arguments which cannot be defined as arguments of a rule: |files| and |items|. Those variables do not hold a single value as the usual directive argument does, but they actually refer to a list of values instead. in the YAML format, a list is defined as a sequence of elements separated by a comma and enclosed with |[]|. For example, |items: [ a, b, c ]| is a list and refers to the elements |a|, |b| and |c|. Let's see in more details about each directive argument. - -\begin{ruleoptions} -\item[files] When not defined with a proper value in the directive definition, |files| contains only one value: the current file reference. When we explicitly add this argument to a directive, the value is overriden, and \arara considers one iteration per element. In order words, if we have |foo: { files: [ a, b, c ] }|, \arara will perform the execution of the task |foo| three times, one for each value of |files|. Each value of |files| is expanded to the |@{file}| orb tag in the rule context. -\item[items] The |items| directive argument, although it has the exact behaviour of |files| in the processing phase, happens to have a different semantics. Think of a rule that needs to process a list of elements, say, a list of extensions, files to copy, and so forth; for every value defined in |items|, \arara will perform the execution the current task. It's important to note that |items| has an empty list by default. Each value of |items| is expanded to the |@{item}| orb tag in the rule context. -\end{ruleoptions} - -Both |files| and |items| can be used in any directive, if the rule of course makes use of their corresponding |@{file| and |@{item}| orb tags. Please note that, if those two lists are defined in the directive, \arara will resolve the variables as the cartesian product of the lists. - -\section{Special orb tags} -\label{sec:specialorbtags} - -In the rule context, \arara has four reserved keywords which cannot be assigned as arguments identifiers; each one of them has its own purpose and semantics, besides of course mapping different values. These orb tags are |@{file}|, |@{item}|, |@{parameters}| and |@{SystemUtils}|. - -\begin{ruleoptions} -\item[file] This orb tags always resolve to the filename processed by \arara. If the |files| directive argument is used in the directive definition, |@{file}| will resolve, in each iteration, to the current value of that list. The variable always hold an string value and it's never empty. -\item[item] The |@{item}| orb tag resolves to each element of the list of items defined through the |items| directive argument. In each iteration of the |items| list, |@{item}| will resolve to the current value of that list. The variable always hold an string value and it is empty by default. -\item[parameters] This orb tag is actually a map, that is, a collection of variables. The |@{parameters}| orb tag is set with all the directive arguments and their corresponding values. The access to a variable is done through |parameters.<variable>|, so if we want to access the |foo| directive argument value, we simply write |@{parameters.foo}|. -\item[SystemUtils] This orb tag maps the |SystemUtils| class from the Apache Commons Lang library~\cite{lang:2001} and provides a lot of methods and properties in order to write cross-platform rules. Table~\ref{tab:properties} on page~\pageref{tab:properties} presents the list of properties available in the |@{SystemUtils}| orb tag. -\end{ruleoptions} - -Since these are reserved keywords used for special orb tags, \arara will raise an error if there's an attempt of assigning one of them as rule argument identifier. - -\printbibliography[heading=subbibliography] - -\part{For rulemakers} -\label{part:forrulemakers} - -\chapter{Quick start} -\label{chap:quickstartrm} - -\epigraph{\emph{Cause and effect act in webs, not chains.}}{Steve Grand} - -Now that we know about rules, directives and orb tags, it's time to come up with some examples. I know it might not be trivial to understand how \arara works in a glance, but I'm sure the examples will help with the concepts. Please note that there might have platform-specific rules, so double-check the commands before running them -- actually, don't worry, \arara has a card up its sleeve. - -\section{Writing rules} -\label{sec:writingrules} - -Before we proceed, I think it's important to mention this note again: we can't start values with |@| because this symbol is reserved for future use in the YAML format. For example, |foo: @bar| is an invalid YAML format, so the correct usage is to enclose it in quotes: |foo: '@bar'| or |foo: "@bar"|. We also need to enclose our strings with quotes in \arara, but we can save them by simply adding the |<arara>| prefix to the value. In other words, |foo: <arara > @bar| is correctly parsed; when that keyword in that specific position is found, \arara removes it. - -Our first example is to add support to \hologo{pdfLaTeX} instead of using the default rule. Our first attempt to write this rule is presented in Code~\ref{code:pdflatexone}. Make sure to create a directory to store your own rules and don't forget to add this directory to the search path in the configuration file (Chapter~\ref{chap:configurationfile}). - -\begin{code}[htbp] -\caption{\mycmd{pdflatex.yaml}, first attempt.} -\label{code:pdflatexone} -\begin{yaml} -!config -identifier: pdflatex -name: PDFLaTeX -command: pdflatex "@{file}" -arguments: [] -\end{yaml} -\end{code} - -So far, so good. The |command| flag has the |pdflatex| program and the |@{file}| -orb tag. Now we can add the |pdflatex| directive to our |.tex| file, as we can see in -Code~\ref{code:helloexampleone}. - -\begin{code}[htbp] -\caption{\mycmd{helloworld.tex}} -\label{code:helloexampleone} -\begin{latex} -% (*@@*)arara: pdflatex -\documentclass{article} - -\begin{document} -Hello world. -\end{document} -\end{latex} -\end{code} - -It's just a matter of calling |arara helloworld| -- you can also provide the |.tex| -extension by calling |arara helloworld.tex|, after all the extension will be -removed anyway -- and \arara will process our file, according to the -Code~\ref{code:araraoutputone}. - -\begin{code}[htbp] -\caption{\arara output for the \mycmd{pdflatex} task.} -\label{code:araraoutputone} -\begin{bash} -$ arara helloworld - __ _ _ __ __ _ _ __ __ _ - / _` | '__/ _` | '__/ _` | -| (_| | | | (_| | | | (_| | - \__,_|_| \__,_|_| \__,_| - -Running PDFLaTeX... SUCCESS -\end{bash} -\end{code} - -Great, our first rule works like a charm. Once we define a rule, the directive is -automatically available for us to call it as many times as we want. What if we -make this rule better? Consider the following situation: - -\begin{quotation} -\noindent Sometimes, we need to use |\write18| to call a package that makes use of -it (for example, |minted|). It's very dangerous to enable shell escape globally, -but changing the |pdflatex| call every time we need it sounds boring. -\end{quotation} - -\arara has a special treatment for cases like this. We will rewrite our |pdflatex| rule to include a flag for shell escape. Another -cool feature will be presented now, as we can see in the new rule shown in Code~\ref{code:pdflatextwo}. - -\begin{code}[htbp] -\caption{\mycmd{pdflatex.yaml}, second attempt.} -\label{code:pdflatextwo} -\begin{yaml} -!config -identifier: pdflatex -name: PDFLaTeX -command: pdflatex @{shell} "@{file}" -arguments: -- identifier: shell - flag: <arara> @{parameters.shell == "yes" ? "--shell-escape" : "--no-shell-escape" } -\end{yaml} -\end{code} - -Line 7 from Code~\ref{code:pdflatextwo} makes use of the ternary operator |?:| which defines a conditional expression. In the first part of the evaluation, we check if |parameters.shell| is equal to the string |"yes"|. If so, |"--shell-escape"| is defined as the result of the operation. If the conditional expression is false, |"--no-shell-escape"| is set instead. - -What if you want to allow |true| and |on| as valid options as well? We can easily rewrite our orb tag to check for additional values, but \arara has a clever way of doing that: a function to look for boolean values! In this case, we will use a function named |isTrue()|, available in the rule context. Please refer to Section~\ref{sec:functions} for a list of the available functions and their meanings. The new attempt is presented in Code~\ref{code:pdflatexthree} - -\begin{code}[htbp] -\caption{\mycmd{pdflatex.yaml}, third attempt.} -\label{code:pdflatexthree} -\begin{yaml} -!config -identifier: pdflatex -name: PDFLaTeX -command: pdflatex @{shell} "@{file}" -arguments: -- identifier: shell - flag: <arara> @{ isTrue( parameters.shell, "--shell-escape" , "--no-shell-escape" ) } -\end{yaml} -\end{code} - -With this new rule, it's now easy to enable the shell escape option in |pdflatex|. Simply go with the directive |pdflatex: { shell: yes }|. You can also use |true| or |on| instead of |yes|. Any other value for |shell| will disable the shell escape option. It's important to observe that \arara directives have no mandatory arguments. If you want to add a dangerous option like |--shell-escape|, consider calling it as an argument with a proper check and rely on a safe state for the argument fallback. - -For the next example, we will create a rule for MakeIndex. To be honest, although |makeindex| has a lot of possible arguments, I only use the |-s| flag once in a while. Code~\ref{code:makeindexone} shows our first attempt of writing this rule. Note that we are making use of another built-in function of \arara named |getBasename()|; this function returns the name of the file without the extension. - -\begin{code}[htbp] -\caption{\mycmd{makeindex.yaml}, first attempt.} -\label{code:makeindexone} -\begin{yaml} -!config -identifier: makeindex -name: MakeIndex -command: makeindex @{style} "@{ getBasename(file) }.idx" -arguments: -- identifier: style - flag: <arara> -s @{parameters.style} -\end{yaml} -\end{code} - -As a follow-up to our first attempt, we will now add support for the |-g| flag that employs German word ordering in the index. Since this flag is basically a switch, we can borrow the same tactic used for enabling shell escape in the |pdflatex| rule from Code~\ref{code:pdflatexthree}. The new rule is presented in Code~\ref{code:makeindextwo}. - -\begin{code}[htbp] -\caption{\mycmd{makeindex.yaml}, second attempt.} -\label{code:makeindextwo} - -\begin{yaml} -!config -identifier: makeindex -name: MakeIndex -command: makeindex @{style} "@{ getBasename(file) }.idx" -arguments: -- identifier: style - flag: <arara> -s @{parameters.style} -- identifier: german - flag: <arara> @{ isTrue( parameters.german, "-g" ) } -\end{yaml} -\end{code} - -The new |makeindex| rule presented in Code~\ref{code:makeindextwo} looks good. We can now test the compilation workflow with an example. Consider a file named |helloindex.tex| which has a few index entries for testing purposes, presented in Code~\ref{code:examplemakeindex}. As usual, I'll present my normal workflow, that involves calling |pdflatex| two times to get references right, one call to |makeindex| and finally, a last call to |pdflatex|. Though there's no need of calling |pdflatex| two times in the beginning, I'll keep that as a good practice from my side. - -\begin{code}[htbp] -\caption{\mycmd{helloindex.tex}} -\label{code:examplemakeindex} -\begin{latex} -% (*@@*)arara: pdflatex -% (*@@*)arara: pdflatex -% (*@@*)arara: makeindex -% (*@@*)arara: pdflatex -\documentclass{article} - -\usepackage{makeidx} - -\makeindex - -\begin{document} - -Hello world\index{Hello world}. - -Goodbye world\index{Goodbye world}. - -\printindex - -\end{document} -\end{latex} -\end{code} - -By running |arara helloindex| or |arara helloindex.tex| in the terminal, we will obtain the same output from Code~\ref{code:araramakeexample}. The execution order is defined by the order of directives in the |.tex| file. If any command fails, \arara halts at that position and nothing else is executed. - -You might ask how \arara knows if the command was successfully executed. The idea is quite simple: good programs like |pdflatex| make use of a concept known as exit status. In short, when a program had a normal execution, the exit status is zero. Other values are returned when an abnormal execution happened. When |pdflatex| successfully compiles a |.tex| file, it returns zero, so \arara intercepts this number. Again, it's a good practice to make command line applications return a proper exit status according to the execution flow, but beware: you might find applications or shell commands that don't feature this control (in the worst case, the returned value is always zero). \arara relies on -the \href{http://commons.apache.org/exec/}{Apache Commons Exec} library to provide the system calls. - -\begin{code}[!htbp] -\caption{Running \mycmd{helloindex.tex}.} -\label{code:araramakeexample} -\begin{bash} -$ arara helloindex - __ _ _ __ __ _ _ __ __ _ - / _` | '__/ _` | '__/ _` | -| (_| | | | (_| | | | (_| | - \__,_|_| \__,_|_| \__,_| - -Running PDFLaTeX... SUCCESS -Running PDFLaTeX... SUCCESS -Running MakeIndex... SUCCESS -Running PDFLaTeX... SUCCESS -\end{bash} -\end{code} - -According to the terminal output shown in Code~\ref{code:araramakeexample}, \arara executed all the commands successfully. In Section~\ref{sec:logging} we discuss how \arara works with commands and how to get their streams for a more detailed analysis. - -For the next example, we will write a rule for both \hologo{BibTeX} and \hologo{biber}. Instead of writing two rules -- one for each command -- I'll show how we can use conditional expressions and run different commands in a single rule. The common scenario is to have each tool mapped to its own rule, but as we can see, rules are very flexible. Let's see how \arara handles this unusual |bibliography| rule presented in Code~\ref{code:bibone}. - -\begin{code}[htbp] -\caption{\mycmd{bibliography.yaml}} -\label{code:bibone} -\begin{yaml} -!config -identifier: bibliography -name: Bibliography -command: <arara> @{engine} @{args} @{ getBasename(file) } -arguments: -- identifier: engine - flag: <arara> @{ isTrue( parameters.engine == "biber", "biber", "bibtex" ) } - default: bibtex -- identifier: args - flag: <arara> @{parameters.args} -\end{yaml} -\end{code} - -The |bibliography| rule is quite simple, actually. If no |engine| is provided in the |bibliography| directive, the |default| element of the |engine| argument will be set to |bibtex|. Otherwise, if the |engine| parameter is set to |biber| -- and only this value -- the |engine| orb tag -will expand the result to |biber|. Code~\ref{code:examplebib} presents only the header of our |biblio.tex| file using the new |bibliography| directive. Other options are shown in Table~\ref{tab:biblio}. - -\begin{code}[htbp] -\caption{\mycmd{biblio.tex}} -\label{code:examplebib} -\begin{latex} -% (*@@*)arara: pdflatex -% (*@@*)arara: bibliography -% (*@@*)arara: pdflatex -\documentclass{article} -... -\end{latex} -\end{code} - -{\renewcommand{\arraystretch}{1.5} -\begin{table}[ht] -\centering -\footnotesize -\begin{tabular}{p{0.3\textwidth}p{0.55\textwidth}} -\hline -\textbf{Directive} & \textbf{Behaviour}\\ -\hline -\hline -\mycmd{bibliography: \{ engine: bibtex \}} & This directive sets the |engine| -parameter to |bibtex|, which will expand the command to |bibtex| in the rule. -Note that any value other than |biber| will expand the command to |bibtex|. \\ -\hline -\mycmd{bibliography: \{ engine: biber \}} & This directive sets the |engine| -parameter to |biber|, which will expand the command to |biber| in the rule. -This is the only possible value that will set |biber| as the rule command. \\ -\hline -\mycmd{bibliography: \{ engine: bibtex, args: '-min-crossrefs=2' \}} & This -directive sets the |engine| parameter to |bibtex| and also provides an argument -to the command. Note that the |args| value is specific to |bibtex| -- using this -argument value with |biber| will surely raise an error. \\ -\hline -\mycmd{bibliography: \{ engine: biber, args: '{-}{-}sortcase=true' \}} & This -directive sets the |engine| parameter to |biber| and also provides an argument -to the command. Note that the |args| value is specific to |biber| -- using this -argument value with |bibtex| will surely raise an error. \\ -\hline -\end{tabular} -\caption{Other directive options for \mycmd{bibliography}.} -\label{tab:biblio} -\end{table}} - -It's important to note that |bibtex| and |biber| differ in their flags, so I used a global |args| parameter. It is recommended to enclose the |args| value with single or double quotes. Use this parameter with great care, since the values differ from tool to tool. The output is presented in -Code~\ref{code:ararabib}. - -\begin{code}[!htbp] -\caption{Running \mycmd{biblio.tex}.} -\label{code:ararabib} -\begin{bash} -$ arara biblio - __ _ _ __ __ _ _ __ __ _ - / _` | '__/ _` | '__/ _` | -| (_| | | | (_| | | | (_| | - \__,_|_| \__,_|_| \__,_| - -Running PDFLaTeX... SUCCESS -Running Bibliography... SUCCESS -Running PDFLaTeX... SUCCESS -\end{bash} -\end{code} - -According to the terminal output shown in Code~\ref{code:ararabib}, \arara -executed all the commands successfully. A friendly warning: this rule is very -powerful because of its flexibility, but the syntax -- specially the conditional -expression and the expansion tricks -- might mislead the user. My advice is to -exhaustively test the rules before deploying them into production. After all, -better be safe than sorry. - -Note that \arara already includes both |bibtex| and |biber| rules. We believe this is the best approach to deal with such tools instead of a generic |bibliography| rule. Take a look on the existing rules, they might help the learning process. - -\section{Cross-platform rules} -\label{sec:crossplatformrules} - -One of the goals when writing \arara was to provide a cross-platform tool which -behaves exactly the same on every single operating system. Similarly, the rules -also follow the same idea, but sadly that's not always possible. After all, at -some point, commands are bounded to the underlying operating system. - -A rule that call |pdflatex|, for example, is easy to maintain; you just need to -ensure there's an actual |pdflatex| command available in the operating system -- -in the worst case, \arara warns about a nonexisting command. But there are cases -in which you need to call system-specific commands. You could write two or three -rules for the same task, say |makefoowin|, |makefoolinux|, and |makefoomac|, but -this approach is not intuitive. Besides, if you share documents between operating -systems, you'd have to also change the respective directive in your |.tex| file -in order to reflect which operating system you are on. - -Thankfully, there's a better solution for writing cross-platform rules which -require system-specific commands. In Section~\ref{sec:specialorbtags}, we mentioned about -a special orb tag called |@{SystemUtils}| -- it's now time to unveil its power. -This orb tag is available for all rules and maps the |SystemUtils| class from -the Apache Commons Lang library~\cite{lang:2001}. In other words, we -have access to all methods and properties from that class. - -Even though we have access to all public methods of the |SystemUtils| class, I -believe we won't need to use them -- the available properties are far more useful -for us. Table~\ref{tab:properties} shows the most relevant properties for our -context. The -\href{http://commons.apache.org/lang/api/org/apache/commons/lang3/SystemUtils.html}% -{Apache Commons Lang documentation} contains the full class description. - -{\renewcommand{\arraystretch}{1.5} -\begin{table}[htpb] -\centering -\footnotesize -\begin{tabular}{lp{0.6\textwidth}} -\hline -\textbf{Property} & \textbf{Description}\\ -\hline -\hline -|IS_OS_AIX| & True if this is AIX.\\ -|IS_OS_FREE_BSD| & True if this is FreeBSD.\\ -|IS_OS_HP_UX| & True if this is HP-UX.\\ -|IS_OS_IRIX| & True if this is Irix.\\ -|IS_OS_LINUX| & True if this is Linux.\\ -|IS_OS_MAC| & True if this is Mac.\\ -|IS_OS_MAC_OSX| & True if this is Mac.\\ -|IS_OS_NET_BSD| & True if this is NetBSD.\\ -|IS_OS_OPEN_BSD| & True if this is OpenBSD.\\ -|IS_OS_OS2| & True if this is OS/2.\\ -|IS_OS_SOLARIS| & True if this is Solaris.\\ -|IS_OS_SUN_OS| & True if this is Sun OS.\\ -|IS_OS_UNIX| & True if this is a Unix-like system, as in any of AIX, HP-UX, Irix, Linux, Mac~OS~X, Solaris or Sun OS.\\ -|IS_OS_WINDOWS| & True if this is Windows.\\ -|IS_OS_WINDOWS_2000| & True if this is Windows 2000.\\ -|IS_OS_WINDOWS_2003| & True if this is Windows 2003.\\ -|IS_OS_WINDOWS_2008| & True if this is Windows 2008.\\ -|IS_OS_WINDOWS_7| & True if this is Windows 7.\\ -|IS_OS_WINDOWS_95| & True if this is Windows 95.\\ -|IS_OS_WINDOWS_98| & True if this is Windows 98.\\ -|IS_OS_WINDOWS_ME| & True if this is Windows ME.\\ -|IS_OS_WINDOWS_NT| & True if this is Windows NT.\\ -|IS_OS_WINDOWS_VISTA| & True if this is Windows Vista.\\ -|IS_OS_WINDOWS_XP| & True if this is Windows XP.\\ -\hline -\end{tabular} -\caption{Most relevant properties of \mycmd{SystemUtils}.} -\label{tab:properties} -\end{table}} - -Every time we want to call any of the available properties presented in -Table~\ref{tab:properties}, we just need to use the |SystemUtils.PROPERTY| -syntax, check the corresponding value through conditional expressions and define -commands or arguments according to the underlying operating system. - -Let's go back to our examples and add a new plain rule featuring the new |@{SystemUtils}| orb tag. Right after -running |arara helloindex| successfully (Code~\ref{code:araramakeexample}), we now have as a result a new |helloindex.pdf| file, but also a lot of auxiliary files, as we can see in Code~\ref{code:lsone}. - -\begin{code}[htbp] -\caption{List of all files after running \mycmd{arara helloindex}.} -\label{code:lsone} -\begin{bash} -$ ls -helloindex.aux helloindex.ilg helloindex.log helloindex.tex -helloindex.idx helloindex.ind helloindex.pdf -\end{bash} -\end{code} - -What if we write a new |clean| rule to remove all the auxiliary files? The idea is to use |rm| to remove each one of them. For now, let's stick with a system-specific rule -- don't worry, we will improve this rule later on. - -Since we want our rule to be generic enough, it's now a good opportunity to introduce the use of the reserved directive key |files|. This special key is a list that overrides the default |@{file}| value and replicates the directive for every element in the list. I'm sure this will be the easiest rule we've written so far. The |clean| rule is presented in Code~\ref{code:cleanone}. - -\begin{code}[htbp] -\caption{\mycmd{clean.yaml}, first attempt.} -\label{code:cleanone} -\begin{yaml} -!config -identifier: clean -name: CleaningTool -command: rm -f "@{file}" -arguments: [] -\end{yaml} -\end{code} - -Note that the command |rm| has a |-f| flag. As mentioned before, commands return an exit status after their calls. If we try to remove a nonexisting file, |rm| will complain and return a value different than zero. This will make \arara halt and print a big ``failure'' on screen, since a non-zero exit status is considered an abnormal execution. If we provide the |-f| flag, |rm| will not complain of a nonexisting file, so we won't be bothered for this trivial task. - -Now we need to add the new |clean| directive to our |helloindex.tex| file (Code~\ref{code:examplemakeindex}). Of course, |clean| will be the last directive, since it will only be reachable if everything executed before was returned withno errors. The new header of |helloindex.tex| is presented in -Code~\ref{code:examplemakeindextwo}. - -\begin{code}[htbp] -\caption{\mycmd{helloindex.tex} with the new \mycmd{clean} directive.} -\label{code:examplemakeindextwo} -\begin{latex} -% (*@@*)arara: pdflatex -% (*@@*)arara: pdflatex -% (*@@*)arara: makeindex -% (*@@*)arara: pdflatex -% (*@@*)arara: clean: { files: [ helloindex.aux, helloindex.idx, helloindex.ilg, helloindex.ind, helloindex.log ] } -\documentclass{article} -... -\end{latex} -\end{code} - -The reserved directive key |files| has five elements, so the |clean| rule will be replicated five times with the orb tag |@{file}| being expanded to each element. Time to run |arara helloindex| again and see if our new |clean| rule works! Code~\ref{code:araramakeexampletwo} shows both \arara execution and directory listing. We expect to find only our source |helloindex.tex| and the resulting |helloindex.pdf| file. - -\begin{code}[htbp] -\caption{Running \mycmd{helloindex.tex} with the new \mycmd{clean} rule.} -\label{code:araramakeexampletwo} -\begin{bash} -$ arara helloindex - __ _ _ __ __ _ _ __ __ _ - / _` | '__/ _` | '__/ _` | -| (_| | | | (_| | | | (_| | - \__,_|_| \__,_|_| \__,_| - -Running PDFLaTeX... SUCCESS -Running PDFLaTeX... SUCCESS -Running MakeIndex... SUCCESS -Running PDFLaTeX... SUCCESS -Running CleaningTool... SUCCESS -Running CleaningTool... SUCCESS -Running CleaningTool... SUCCESS -Running CleaningTool... SUCCESS -Running CleaningTool... SUCCESS -$ ls -helloindex.pdf helloindex.tex -\end{bash} -\end{code} - -Great, the |clean| rule works like a charm! But we have a big issue: if we try to use this rule in Windows, it doesn't work -- after all, |rm| is not a proper Windows command. Worse, replacing |rm| by the equivalent |del| won't probably work. Commands like |del| must be called in the form |cmd /c del|. Should we write another system-specific rule, say, |cleanwin|? Of course not, there's a very elegant way to solve this issue: the |@{SystemUtils}| orb tag. - -The idea is very simple: we check if \arara is running in a Windows operating system; if true, we set the command to |cmd /c del|, or |rm -f| otherwise. The new version of our |clean| rule is presented in Code~\ref{code:cleantwo}. - -\begin{code}[htbp] -\caption{\mycmd{clean.yaml}, second attempt.} -\label{code:cleantwo} -\begin{yaml} -!config -identifier: clean -name: CleaningTool -command: <arara> @{ SystemUtils.IS_OS_WINDOWS ? "cmd /c del" : "rm -f" } "@{file}" -arguments: [] -\end{yaml} -\end{code} - -There we go, our first cross-platform rule! There's no need of writing a bunch of system-specific rules; only one cross-platform rule is enough. We know that the |clean| rule will work as expected in every operating system, even if the task to be performed relies on system-specific commands. With cross-platform rules, we are able to write cleaner and more concise code. - -There's another way of writing the |clean| rule, now with a built-in function instead of the |@{SystemUtils}| orb tag: we can use a function named |isWindows()| to check if \arara is running in a Windows operating System. The third attempt of our |clean| rule is presented in Code~\ref{code:cleanthree}. - -\begin{code}[htbp] -\caption{\mycmd{clean.yaml}, third attempt.} -\label{code:cleanthree} -\begin{yaml} -!config -identifier: clean -name: CleaningTool -command: <arara> @{ isWindows( "cmd /c del" , "rm -f" ) } "@{file}" -arguments: [] -\end{yaml} -\end{code} - -Note that the |clean| rule is expecting |@{file}| to be overriden, since we rely on the reserved directive key |files|. If by any chance this rule is called without the |files| directive key, that is, an empty directive |% arara: clean|, I have very bad news to you: the rule will be expanded to -|rm -f mydoc.tex| and your |.tex| file will be gone! Is there any way to avoid this behaviour? Yes, there is. - -For our fourth attempt of rewritting the |clean| rule, we will make use of two new built-in functions. The first one is named |isFalse()|, which only expands the value if the conditional expression resolves to false; the second one is named |getOriginalFile()|, which holds the original reference to the file processed by \arara. The idea here is very simple: if the current |@{file}| is different than the original file, run the task; otherwise, the whole command is expanded to an empty string -- empty commands are discarded by \arara. We will use a rule argument to hold the whole command, but note that the |flag| element is not important here, since we won't use this argument in the directive; only |default| matters in this context. The new |clean| rule is presented in Code~\ref{code:cleanfour}. - -\begin{code}[htbp] -\caption{\mycmd{clean.yaml}, fourth attempt.} -\label{code:cleanfour} -\begin{yaml} -!config -identifier: clean -name: CleaningTool -command: <arara> @{remove} -arguments: -- identifier: remove - default: <arara> @{ isFalse( file == getOriginalFile(), isWindows( "cmd /c del", "rm -f" ).concat(' "').concat(file).concat('"')) } -\end{yaml} -\end{code} - -Now we have a safe version of the |clean| rule. If we try to run \arara on our document with |% arara: clean|, nothing will happen and our original file won't be removed. That means that |clean| will only take action when we have an explicit list of files to be removed, and even -if the element in the |files| list is different than the original file. - -Take a look in all the default rules available in the \href{http://github.com/cereda/arara}{project directory} on GitHub. They are very easy to understand. If you get stuck in any part, a good advice is to enable the logging feature through the |--log| flag, since \arara logs every expansion and command. - -\printbibliography[heading=subbibliography] - -\chapter{Reference for rule library} -\label{chap:referenceforrulelibrarytwo} - -\epigraph{\emph{I first saw the \TeX book lying beside a brand new Macintosh Plus back in 1985 and was instantly amazed by both.}}{Enrico Gregorio} - -This chapter presents a list of built-in functions of \arara available in the rule context, as well as some notes on expansion. These functions have to be used always inside an orb tag, that is, |@{ <function> }|, in order to properly work, since they are written for the MVEL expression language. - -\section{Functions} -\label{sec:functions} - -\arara features some functions in order to ease trivial tasks during the writing process of a rule. In this section, we will present a list of these functions, including their parameters and return value. - -\subsection*{getOriginalFile} - -\begin{description} -\item[Syntax] |string getOriginalFile()| -\item[Description] Returns the original file reference processed by \arara as |string|. -\end{description} - -\subsection*{isEmpty} - -\begin{description} -\item[Syntax] |boolean isEmpty(string s)| -\item[Description] Checks if |s| is empty and returns a |boolean| value: |true| if |s| is empty, |false| otherwise. -\end{description} - -\begin{description} -\item[Syntax] |string isEmpty(string s1, string s2)| -\item[Description] Checks if |s1| is empty and returns a |string| value: |s2| if |s1| is empty, or an empty |string| otherwise. -\end{description} - -\begin{description} -\item[Syntax] |string isEmpty(string s1, string s2, string s3)| -\item[Description] Checks if |s1| is empty and returns a |string| value: |s2| if |s1| is empty, or |s3| otherwise. -\end{description} - -\subsection*{isNotEmpty} - -\begin{description} -\item[Syntax] |boolean isNotEmpty(string s)| -\item[Description] Checks if |s| is not empty and returns a |boolean| value: |true| if |s| is not empty, |false| otherwise. -\end{description} - -\begin{description} -\item[Syntax] |string isNotEmpty(string s1, string s2)| -\item[Description] Checks if |s1| is not empty and returns a |string| value: |s2| if |s1| is not empty, or an empty |string| otherwise. -\end{description} - -\begin{description} -\item[Syntax] |string isNotEmpty(string s1, string s2, string s3)| -\item[Description] Checks if |s1| is not empty and returns a |string| value: |s2| if |s1| is not empty, or |s3| otherwise. -\end{description} - -\subsection*{isTrue} - -\begin{description} -\item[Syntax] |boolean isTrue(string s)| -\item[Description] Checks if |s| has any of the values in the \arara context that are considered |true| -- |true|, |yes|, |y| and |1| -- and returns a |boolean| value: |true| if |s| has a valid |true| value, or |false| otherwise. -\end{description} - -\begin{description} -\item[Syntax] |string isTrue(string s1, string s2)| -\item[Description] Checks if |s1| has any of the values in the \arara context that are considered |true| -- |true|, |yes|, |y| and |1| -- and returns a |string| value: |s2| if |s1| has a valid |true| value, or an empty |string| otherwise. -\end{description} - -\begin{description} -\item[Syntax] |string isTrue(string s1, string s2, string s3)| -\item[Description] Checks if |s1| has any of the values in the \arara context that are considered |true| -- |true|, |yes|, |y| and |1| -- and returns a |string| value: |s2| if |s1| has a valid |true| value, or |s3| otherwise. -\end{description} - -\begin{description} -\item[Syntax] |string isTrue(string s1, string s2, string s3, string s4)| -\item[Description] Checks if |s1| has any of the values in the \arara context that are considered |true| -- |true|, |yes|, |y| and |1| -- and returns a |string| value: |s2| if |s1| has a valid |true| value, |s3| if |s1| has any of the values in the \arara context that are considered |false| -- |false|, |no|, |n| and |0| -- or |s4| otherwise as a default fallback. -\end{description} - -\begin{description} -\item[Syntax] |string isTrue(boolean b, string s)| -\item[Description] Returns |s| if |b| is |true|, or an empty |string| otherwise. -\end{description} - -\begin{description} -\item[Syntax] |string isTrue(boolean b, string s1, string s2)| -\item[Description] Returns |s1| if |b| is |true|, or |s2| otherwise. -\end{description} - -\subsection*{isFalse} - -\begin{description} -\item[Syntax] |boolean isFalse(string s)| -\item[Description] Checks if |s| has any of the values in the \arara context that are considered |false| -- |false|, |no|, |n| and |0| -- and returns a |boolean| value: |true| if |s| has a valid |false| value, or |false| otherwise. -\end{description} - -\begin{description} -\item[Syntax] |string isFalse(string s1, string s2)| -\item[Description] Checks if |s1| has any of the values in the \arara context that are considered |false| -- |false|, |no|, |n| and |0| -- and returns a |string| value: |s2| if |s1| has a valid |false| value, or an empty |string| otherwise. -\end{description} - -\begin{description} -\item[Syntax] |string isFalse(string s1, string s2, string s3)| -\item[Description] Checks if |s1| has any of the values in the \arara context that are considered |false| -- |false|, |no|, |n| and |0| -- and returns a |string| value: |s2| if |s1| has a valid |false| value, or |s3| otherwise. -\end{description} - -\begin{description} -\item[Syntax] |string isFalse(string s1, string s2, string s3, string s4)| -\item[Description] Checks if |s1| has any of the values in the \arara context that are considered |false| -- |false|, |no|, |n| and |0| -- and returns a |string| value: |s2| if |s1| has a valid |false| value, |s3| if |s1| has any of the values in the \arara context that are considered |true| -- |true|, |yes|, |y| and |1| -- or |s4| otherwise as a default fallback. -\end{description} - -\begin{description} -\item[Syntax] |string isFalse(boolean b, string s)| -\item[Description] Returns |s| if |b| is |false|, or an empty |string| otherwise. -\end{description} - -\begin{description} -\item[Syntax] |string isFalse(boolean b, string s1, string s2)| -\item[Description] Returns |s1| if |b| is |false|, or |s2| otherwise. -\end{description} - -\subsection*{trimSpaces} - -\begin{description} -\item[Syntax] |string trimSpaces(string s)| -\item[Description] Returns |s| with the trailing and leading spaces trimmed. -\end{description} - -\subsection*{getFilename} - -\begin{description} -\item[Syntax] |string getFilename(string s)| -\item[Description] This function takes a file path in the form of a |string| and returns a |string| containing only the file name, or an empty |string| in case of error. -\end{description} - -\subsection*{getBasename} - -\begin{description} -\item[Syntax] |string getBasename(string s)| -\item[Description] Returns the base name of |s| as a |string|, that is, the file name without the extension, or an empty |string| in case of error. -\end{description} - -\subsection*{getFiletype} - -\begin{description} -\item[Syntax] |string getFiletype(string s)| -\item[Description] Returns the file type of |s| as a |string|, that is, the extension of the file name, or an empty |string| in case of error. -\end{description} - -\subsection*{getDirname} - -\begin{description} -\item[Syntax] |string getDirname(string s)| -\item[Description] This function takes a file path in the form of a |string| and returns a |string| containing only the directory structure without the file name, or an empty |string| in case of error. -\end{description} - -\subsection*{isFile} - -\begin{description} -\item[Syntax] |boolean isFile(string s)| -\item[Description] Returns |true| if |s| is a valid reference to a file, or |false| otherwise. -\end{description} - -\subsection*{isDir} - -\begin{description} -\item[Syntax] |boolean isDir(string s)| -\item[Description] Returns |true| if |s| is a valid reference to a directory, or |false| otherwise. -\end{description} - -\subsection*{isWindows} - -\begin{description} -\item[Syntax] |string isWindows(string s1, string s2)| -\item[Description] Returns |s1| if \arara is running in a Windows operating system, or |s2| otherwise. -\end{description} - -\subsection*{isLinux} - -\begin{description} -\item[Syntax] |string isLinux(string s1, string s2)| -\item[Description] Returns |s1| if \arara is running in a Linux operating system, or |s2| otherwise. -\end{description} - -\subsection*{isUnix} - -\begin{description} -\item[Syntax] |string isUnix(string s1, string s2)| -\item[Description] Returns |s1| if \arara is running in a Unix operating system, or |s2| otherwise. -\end{description} - -\subsection*{isMac} - -\begin{description} -\item[Syntax] |string isMac(string s1, string s2)| -\item[Description] Returns |s1| if \arara is running in a Mac operating system, or |s2| otherwise. -\end{description} - -All the functions described are available in the rule context and can be concatenated in order to create more complex checkings. - -\section{Notes on expansion} -\label{sec:notesonexpansion} - -It's important to observe that \arara always try to rely on a smooth fallback to empty strings in case of function errors or unused arguments. This approach allows the application to not halt in case of a recoverable situation. If, for example, \arara finds an empty command to execute -- like in the |clean| rule presented in Code~\ref{code:cleanfour} when |files| isn't used -- the task is simply ignored. That way, we can make more robust rules without worrying too much with expansion. - -Remember that \arara basically deals with string values, and some times, with boolean operations. We decided to stick with those two types because of simplicity. Taking care of string comparisons, using the built-in functions and limiting the scope of the command is sufficient to write good rules. - -\end{document} diff --git a/Master/texmf-dist/doc/support/arara/arara.sty b/Master/texmf-dist/doc/support/arara/arara.sty index c03fa484e61..14576d7acae 100644 --- a/Master/texmf-dist/doc/support/arara/arara.sty +++ b/Master/texmf-dist/doc/support/arara/arara.sty @@ -1,6 +1,5 @@ -% ------------------------------------------------- -% Arara -- the cool TeX automation tool -% Copyright (c) 2012, Paulo Roberto Massa Cereda +% Arara, the cool TeX automation tool +% Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda % All rights reserved. % % Redistribution and use in source and binary forms, with or without @@ -30,645 +29,1018 @@ % LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY % WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE % POSSIBILITY OF SUCH DAMAGE. -% ------------------------------------------------- - -% package definition -% ------------------------------------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{arara}[2012/04/02 Arara User Manual Configuration] -% ------------------------------------------------- +\ProvidesPackage{arara}[2018/04/11 Arara User Manual Configuration] -% required packages -% ------------------------------------------------- -\RequirePackage{graphicx} -\RequirePackage{xcolor} -\RequirePackage{listings} \RequirePackage{tikz} -\usetikzlibrary{trees} -\RequirePackage{cantarell} -\RequirePackage{enumitem} -\RequirePackage{xspace} +\RequirePackage{xcolor} \RequirePackage{upquote} -\RequirePackage{hologo} -\RequirePackage{lmodern} -\RequirePackage[scaled=0.8]{beramono} -\RequirePackage[framemethod=TikZ]{mdframed} -\RequirePackage{fourier-orns} - -\RequirePackage[backend=biber,backref=true,hyperref=auto,refsection=chapter,citereset=chapter]{biblatex} - -% colors -% ------------------------------------------------- -\definecolor{araracolor}{cmyk}{1.0,0.8,0.0,0.6} -% ------------------------------------------------- - -% language environments - -% YAML -% ------------------------------------------------- -\lstnewenvironment{yaml}{\lstset{% - basicstyle=\ttfamily, - numbers=left, - xleftmargin=1.5em, - breaklines=true, - numberstyle=\ttfamily\small, - columns=flexible, - mathescape=false -}}{} -% ------------------------------------------------- - -% Java -% ------------------------------------------------- -\lstnewenvironment{java}{\lstset{% - language=Java, - basicstyle=\ttfamily, - columns=flexible, - showspaces=false, - numbers=left, - xleftmargin=1.5em, - breaklines=true, - numberstyle=\ttfamily\small, - breakatwhitespace=true, - showstringspaces=false -}}{} -% ------------------------------------------------- - -% C -% ------------------------------------------------- -\lstnewenvironment{clang}{\lstset{% - language=C, - basicstyle=\ttfamily, - columns=flexible, - showspaces=false, - numbers=left, - xleftmargin=1.5em, - breaklines=true, - numberstyle=\ttfamily\small, - breakatwhitespace=true, - showstringspaces=false -}}{} -% ------------------------------------------------- - -% LaTeX -% ------------------------------------------------- -\lstnewenvironment{latex}{\lstset{% - language=[LaTeX]TeX, - basicstyle=\ttfamily, - columns=flexible, - showspaces=false, - numbers=left, - xleftmargin=1.5em, - breaklines=true, - numberstyle=\ttfamily\small, - breakatwhitespace=true, - showstringspaces=false, - escapeinside={(*@}{@*)} -}}{} - -% bash -% ------------------------------------------------- -\lstnewenvironment{bash}{\lstset{% - language=bash, - basicstyle=\ttfamily, - columns=flexible, - showspaces=false, - xleftmargin=1.5em, - breaklines=true, - numberstyle=\ttfamily\small, - %breakatwhitespace=true, - showstringspaces=false -}}{} - -\lstnewenvironment{nolanguage}{\lstset{% - basicstyle=\ttfamily, - columns=flexible, - showspaces=false, - xleftmargin=1.5em, - breaklines=true, - numberstyle=\ttfamily\small, - breakatwhitespace=true, - showstringspaces=false -}}{} -% ------------------------------------------------- - -\lstMakeShortInline[basicstyle=\ttfamily]{|} - -% list of codes -% ------------------------------------------------- -\newcommand{\codename}{Code} -\newcommand{\listcodename}{List of Codes} -\newlistof{listofcodes}{cod}{\listcodename} -\newfloat{code}{cod}{\codename} -\newlistentry{code}{cod}{0} -% ------------------------------------------------- - -% caption style -% ------------------------------------------------- -\captionnamefont{\bfseries} -% ------------------------------------------------- - -% sectional styles -% ------------------------------------------------- -\renewcommand{\booknamefont}{\huge\sffamily\bfseries} -\renewcommand{\booknumfont}{\huge\sffamily\bfseries} -\renewcommand{\booktitlefont}{\Huge\sffamily\bfseries} -\renewcommand{\partnumfont}{\huge\sffamily\bfseries} -\renewcommand{\partnamefont}{\huge\sffamily\bfseries} -\renewcommand{\parttitlefont}{\Huge\sffamily\bfseries} -\renewcommand{\chapnamefont}{\huge\sffamily\bfseries} -\renewcommand{\chapnumfont}{\huge\sffamily\bfseries} -\renewcommand{\chaptitlefont}{\Huge\sffamily\bfseries} -\renewcommand{\secheadstyle}{\Large\sffamily\bfseries} -\renewcommand{\subsecheadstyle}{\large\sffamily\bfseries} -\renewcommand{\subsubsecheadstyle}{\normalsize\sffamily\bfseries} -\renewcommand{\paraheadstyle}{\normalsize\sffamily\bfseries} -\renewcommand{\subparaheadstyle}{\normalsize\sffamily\bfseries} -\renewcommand{\cftpartnumwidth}{25pt} -% ------------------------------------------------- - -% description style -% ------------------------------------------------- + +\usetikzlibrary{patterns} + +\definecolor{okcolour}{rgb}{0.09, 0.45, 0.27} +\definecolor{araracolour}{rgb}{0, 0.72, 0.28} +\definecolor{warningcolour}{rgb}{0.75, 0.09, 0} +\definecolor{attentioncolour}{rgb}{0.82, 0.86, 0.07} + +\RequirePackage{tcolorbox} +\tcbuselibrary{skins} +\tcbuselibrary{breakable} +\tcbuselibrary{listings} + +\RequirePackage{amsmath} +\RequirePackage{amssymb} +\RequirePackage{amsfonts} +\RequirePackage{kmath} +\RequirePackage{bookman} +\RequirePackage[regular]{sourcecodepro} + +\RequirePackage{adforn} + +\RequirePackage{forest} +\useforestlibrary{edges} + +\RequirePackage{enumitem} \setlist[description]{font=\sffamily\bfseries,style=nextline,leftmargin=2em} -\newlist{ruleoptions}{description}{1} -\setlist[ruleoptions]{font=\normalfont\ttfamily,style=nextline,leftmargin=2em} -% ------------------------------------------------- - -% hyperref here, so it won't cause any trouble -% ------------------------------------------------- -\RequirePackage[colorlinks, linkcolor={black},citecolor={araracolor}, urlcolor={araracolor},pdfpagelabels]{hyperref} - -% ------------------------------------------------- - -% Helper macros -% ------------------------------------------------- -\newcommand*\arara{{\fontfamily{fco}\color{araracolor}\bfseries arara}\xspace} -\newcommand{\feature}[1]{% -\begin{tikzpicture}[baseline=-0.65ex]% -\node[fill=araracolor,inner sep=1pt,minimum height=0.5cm, minimum width=0.8cm,rounded corners=3pt,font=\color{white}\sffamily\bfseries\tiny] {#1}; -\end{tikzpicture}% + +\RequirePackage{tabularx} +\newcolumntype{Y}{>{\centering\arraybackslash}X} + +\RequirePackage[ + colorlinks, + linkcolor={black}, + citecolor={araracolour}, + urlcolor={araracolour}, + pdfpagelabels +]{hyperref} + +\newcommand{\araratext}[1]{{\normalfont\fontfamily{fco}\selectfont\color{araracolour}\bfseries#1}} +\newcommand*\arara{\araratext{ar\kern-.03emar\kern-.03ema}} +\newcommand*\slogan{\araratext{The cool \TeX\ automation tool}} + +\newcommand{\icattention}[1]{% + \begin{scope}[ + y=0.80pt, + x=0.80pt, + yscale=-1.000000, + xscale=1.000000, + inner sep=0pt, + outer sep=0pt, + shift={([xshift=0.35em, yshift=0.31em]frame.north west)}, + scale=.11 + ] + + \path[fill=#1!5] (208.8560,104.4280) .. controls (208.8560,162.1050) and + (162.1040,208.8610) .. (104.4270,208.8610) .. controls (46.7500,208.8610) and + (0.0000,162.1050) .. (0.0000,104.4280) .. controls (0.0000,46.7540) and + (46.7500,0.0000) .. (104.4270,0.0000) .. controls (162.1040,0.0000) and + (208.8560,46.7540) .. (208.8560,104.4280) -- cycle; + + \begin{scope}[shift={(-46.415,-45.369)}] + \path[fill=#1] (166.3660,93.4020) -- (165.8010,162.0250) -- + (137.0310,162.0250) -- (135.3300,93.4020) -- cycle; + \path[fill=#1] (164.4210,200.6400) .. controls (160.6350,204.3420) and + (156.0710,206.1950) .. (150.7290,206.1950) .. controls (145.1560,206.1950) and + (140.5820,204.4020) .. (136.9930,200.8000) .. controls (133.3970,197.2110) and + (131.6020,192.6350) .. (131.6020,187.0710) .. controls (131.6020,181.6690) and + (133.4650,177.0890) .. (137.1910,173.3350) .. controls (140.9190,169.5810) and + (145.4270,167.7130) .. (150.7290,167.7130) .. controls (156.0230,167.7130) and + (160.5790,169.6260) .. (164.3730,173.4640) .. controls (168.1870,177.2980) and + (170.0840,181.8620) .. (170.0840,187.1560) .. controls (170.0880,192.4580) and + (168.1950,196.9410) .. (164.4210,200.6400) -- cycle; + \end{scope} + \end{scope}% +} + +\newcommand{\icerror}[1]{% + \begin{scope}[ + y=0.80pt, + x=0.80pt, + yscale=-1.000000, + xscale=1.000000, + inner sep=0pt, + outer sep=0pt, + shift={([xshift=0.35em, yshift=0.31em]frame.north west)}, + scale=.11 + ] + + \path[fill=#1!5] (104.4280,104.4280) circle (2.9472cm); + \path[shift={(-46.913,-45.374)},fill=#1] (88.7990,180.6000) -- + (119.5860,149.8020) -- (88.7990,119.0130) -- (120.5410,87.2560) -- + (151.3380,118.0580) -- (182.1310,87.2560) -- (213.8780,119.0130) -- + (183.0770,149.8020) -- (213.8780,180.6000) -- (182.1310,212.3440) -- + (151.3380,181.5470) -- (120.5410,212.3440) -- cycle; + \end{scope}% +} + +\newcommand{\ichelp}[1]{% + \begin{scope}[ + y=0.80pt, + x=0.80pt, + yscale=-1.000000, + xscale=1.000000, + inner sep=0pt, + outer sep=0pt, + shift={([xshift=0.35em, yshift=0.31em]frame.north west)}, + scale=.11 + ] + + \path[fill=#1!5] (209.4880,104.7460) .. controls (209.4880,162.5980) and + (162.5940,209.4910) .. (104.7430,209.4910) .. controls (46.8930,209.4910) and + (0.0000,162.5970) .. (0.0000,104.7460) .. controls (0.0000,46.8950) and + (46.8930,0.0000) .. (104.7430,0.0000) .. controls (162.5940,0.0000) and + (209.4880,46.8940) .. (209.4880,104.7460) -- cycle; + \begin{scope}[shift={(-46.099,-45.188)}] + \path[fill=#1] (164.9220,204.1480) .. controls (160.9950,207.9860) and + (156.2530,209.9090) .. (150.7010,209.9090) .. controls (144.9260,209.9090) and + (140.1760,208.0510) .. (136.4420,204.3170) .. controls (132.7170,200.5840) and + (130.8520,195.8340) .. (130.8520,190.0560) .. controls (130.8520,184.4490) and + (132.7830,179.6940) .. (136.6530,175.7990) .. controls (140.5190,171.9020) and + (145.2050,169.9540) .. (150.6960,169.9540) .. controls (156.1910,169.9540) and + (160.9140,171.9450) .. (164.8720,175.9240) .. controls (168.8230,179.9060) and + (170.8020,184.6460) .. (170.8020,190.1410) .. controls (170.8070,195.6410) and + (168.8440,200.3070) .. (164.9220,204.1480) -- cycle; + \path[fill=#1] (172.9950,153.2160) .. controls (169.6370,154.9020) and + (167.5810,156.3590) .. (166.8560,157.5930) .. controls (166.1250,158.8210) and + (165.7700,161.4630) .. (165.7700,165.5020) -- (134.5650,165.5020) -- + (134.5650,160.1990) .. controls (134.5650,153.1880) and (135.3450,148.0140) .. + (136.9200,144.6720) .. controls (138.4870,141.3370) and (141.3490,138.7460) .. + (145.5030,136.8920) -- (151.2240,134.3740) .. controls (155.5440,132.4630) and + (157.7010,129.7760) .. (157.7010,126.2960) .. controls (157.7010,124.2730) and + (156.9890,122.5710) .. (155.5970,121.1590) .. controls (154.1980,119.7670) and + (152.4800,119.0550) .. (150.4640,119.0550) .. controls (144.9690,119.0550) and + (142.2170,122.8770) .. (142.2170,130.5000) -- (113.1980,130.5000) .. controls + (113.1980,120.2900) and (115.5590,111.9670) .. (120.2680,105.5190) .. controls + (123.7470,100.7520) and (128.2570,96.9670) .. (133.8090,94.1630) .. controls + (139.3620,91.3630) and (145.1090,89.9550) .. (151.0550,89.9550) .. controls + (161.6020,89.9550) and (170.4680,93.4510) .. (177.6770,100.4300) .. controls + (184.8860,107.4090) and (188.4870,116.0620) .. (188.4870,126.3810) .. controls + (188.4710,139.1080) and (183.3130,148.0590) .. (172.9950,153.2160) -- cycle; + \end{scope} + \end{scope}% +} + +\newcommand{\icinfo}[1]{% + \begin{scope}[ + y=0.80pt, + x=0.80pt, + yscale=-1.000000, + xscale=1.000000, + inner sep=0pt, + outer sep=0pt, + shift={([xshift=0.35em, yshift=0.31em]frame.north west)}, + scale=.11 + ] + + \path[fill=#1!5] (104.4310,104.4310) circle (2.9473cm); + \begin{scope}[shift={(-46.694,-45.371)}] + \path[fill=#1] (139.1560,93.9220) .. controls (142.1760,91.1310) and + (145.7940,89.7390) .. (149.9850,89.7390) .. controls (154.1800,89.7390) and + (157.7700,91.1310) .. (160.7780,93.9220) .. controls (163.7740,96.7260) and + (165.2740,100.0830) .. (165.2740,104.0130) .. controls (165.2740,107.9440) and + (163.7570,111.2920) .. (160.7340,114.0640) .. controls (157.7130,116.8320) and + (154.1320,118.2150) .. (149.9850,118.2150) .. controls (145.8020,118.2150) and + (142.1840,116.8360) .. (139.1560,114.0640) .. controls (136.1320,111.2930) and + (134.6200,107.9440) .. (134.6200,104.0130) .. controls (134.6200,100.0830) and + (136.1320,96.7260) .. (139.1560,93.9220) -- cycle; + \path[fill=#1] (176.6040,209.8610) -- (127.5580,209.8610) -- + (127.5580,204.1980) .. controls (128.9050,204.0980) and (130.2210,203.9620) .. + (131.5200,203.8090) .. controls (132.8070,203.6490) and (133.9220,203.3960) .. + (134.8490,203.0310) .. controls (136.5140,202.4180) and (137.6730,201.5150) .. + (138.3540,200.3520) .. controls (139.0200,199.1890) and (139.3650,197.6530) .. + (139.3650,195.7360) -- (139.3650,150.5640) .. controls (139.3650,148.7550) and + (138.9480,147.1710) .. (138.1260,145.7990) .. controls (137.2960,144.4190) and + (136.2570,143.3160) .. (135.0180,142.4940) .. controls (134.0920,141.8760) and + (132.6720,141.2790) .. (130.7910,140.7050) .. controls (128.9060,140.1400) and + (127.1820,139.7830) .. (125.6330,139.6220) -- (125.6330,133.9630) -- + (163.6620,131.9450) -- (164.8250,133.1040) -- (164.8250,194.7240) .. controls + (164.8250,196.5370) and (165.2180,198.0690) .. (165.9830,199.3400) .. controls + (166.7650,200.6080) and (167.8730,201.5460) .. (169.3240,202.1750) .. controls + (170.3590,202.6410) and (171.5070,203.0620) .. (172.7370,203.4140) .. controls + (173.9850,203.7790) and (175.2720,204.0320) .. (176.6200,204.1920) -- + (176.6200,209.8590) -- (176.6040,209.8590) -- cycle; + \end{scope} + \end{scope}% +} + +\newcommand{\icnote}[1]{% + \begin{scope}[ + y=0.80pt, + x=0.80pt, + yscale=-1.000000, + xscale=1.000000, + inner sep=0pt, + outer sep=0pt, + shift={([xshift=0.35em, yshift=0.31em]frame.north west)}, + scale=.11 + ] + + \path[fill=#1!5] (104.4280,104.4280) circle (2.9472cm); + \begin{scope}[shift={(-46.08801,-45.37)}] + \path[fill=#1] (113.9190,187.9100) -- (127.1980,200.4160) -- + (109.7220,205.6600) -- (92.2560,210.9060) -- (96.4470,193.1470) -- + (100.6380,175.3930) -- cycle; + \path[fill=#1] (133.3760,194.1100) -- (106.7160,169.1000) -- + (182.1210,88.6910) -- (208.7790,113.7040) -- cycle; + \end{scope} + \end{scope}% +} + +\newcommand{\icok}[1]{% + \begin{scope}[ + y=0.80pt, + x=0.80pt, + yscale=-1.000000, + xscale=1.000000, + inner sep=0pt, + outer sep=0pt, + shift={([xshift=0.35em, yshift=0.31em]frame.north west)}, + scale=.11 + ] + + \path[fill=#1!5] (209.4910,104.7440) .. controls (209.4910,162.5960) and + (162.5940,209.4880) .. (104.7470,209.4880) .. controls (46.8950,209.4880) and + (0.0000,162.5950) .. (0.0000,104.7440) .. controls (0.0000,46.8930) and + (46.8950,0.0000) .. (104.7470,0.0000) .. controls (162.5930,-0.0010) and + (209.4910,46.8930) .. (209.4910,104.7440) -- cycle; + \path[shift={(-45.773,-45.19)},fill=#1] (219.0590,88.4660) -- + (137.2020,211.4010) -- (81.9780,125.9940) -- (81.9780,124.9200) -- + (133.7180,148.3000) -- cycle; + \end{scope}% +} + +% 1 -> title +% 2 -> frame colour +% 3 -> icon description +% 4 -> title colour +\newtcolorbox{messagebox}[4]{ + adjusted title=#1, + adjusted title after break={\centering #1 (ctd.)}, + halign title=center, + fonttitle=\bfseries\sffamily, + enhanced, + drop lifted shadow, + colback=#2!5, + colframe=#2, + breakable, + overlay={#3{#2}}, + toptitle=0.2em, + bottomtitle=.2em, + coltitle=#4, + before skip=1em, + after skip=1.4em +} + +% 1 -> title +% 2 -> frame colour +% 3 -> icon description +% 4 -> title colour +\newtcblisting{codebox}[4]{ + adjusted title=#1, + adjusted title after break={\centering #1 (ctd.)}, + halign title=center, + fonttitle=\bfseries\sffamily, + enhanced, + drop lifted shadow, + colback=#2!5, + colframe=#2, + breakable, + overlay={#3{#2}}, + toptitle=0.2em, + bottomtitle=.2em, + coltitle=#4, + before skip=1em, + left=8mm, + listing only, + listing options={ + numbers=left, + numberstyle=\scriptsize\sffamily\color{#2}, + basicstyle=\footnotesize\ttfamily, + }, + after skip=1.4em } -\newcommand{\newfeature}{\feature{\raisebox{-.5pt}[\height][0pt]{new}}} -\newcommand{\bugfix}{\feature{\raisebox{0pt}[\height][0pt]{fixed}}} -\newcommand{\mycmd}[1]{\texttt{#1}} -% ------------------------------------------------- - -% Ornament line -% ------------------------------------------------- -\newcommand{\ornamentline}{{\color{araracolor}\noindent\hrulefill\hspace{0.2cm} \raisebox{-0.6ex}{\decoone} \hspace{0.2cm} \hrulefill}} -% ------------------------------------------------- - -% arara logo -% ------------------------------------------------- -\newcommand{\araralogo}{% -\begin{tikzpicture}[y=0.80pt, x=0.8pt,yscale=-1, inner sep=0pt, outer sep=0pt] - \path[fill=araracolor,nonzero rule] (202.9198,250.4579) .. controls - (197.7300,250.5135) and (196.4604,250.6090) .. (193.5875,251.0766) .. controls - (189.6630,251.7153) and (186.8193,252.3214) .. (184.6162,252.9843) -- - (182.9663,253.4999) -- (184.1521,253.6030) -- (185.2864,253.7061) -- - (183.4819,254.4280) .. controls (177.5843,256.8119) and (175.0673,258.3967) .. - (170.8498,262.2650) .. controls (167.7616,265.0978) and (166.8640,266.1713) .. - (166.1063,268.1428) .. controls (165.6202,269.4081) and (165.5328,271.5399) .. - (165.9517,271.8035) .. controls (166.2357,271.9824) and (168.1533,271.6859) .. - (169.0969,271.2879) .. controls (169.5043,271.1162) and (169.9170,271.0159) .. - (170.0249,271.0817) .. controls (170.1314,271.1469) and (170.7823,270.8337) .. - (171.4686,270.4114) .. controls (172.7982,269.5931) and (173.4230,269.4984) .. - (173.8403,269.9989) .. controls (174.3567,270.6187) and (178.3274,270.1478) .. - (179.0994,269.3802) .. controls (179.4043,269.0772) and (182.2175,268.1336) .. - (186.4208,266.9054) .. controls (188.2651,266.3662) and (192.9219,265.6164) .. - (194.3094,265.6164) .. controls (194.9313,265.6164) and (195.4557,265.7314) .. - (195.6500,265.9257) .. controls (196.0821,266.3578) and (197.2259,266.3305) .. - (199.1560,265.8226) .. controls (200.0353,265.5912) and (201.2344,265.3586) .. - (201.7855,265.3586) .. controls (202.3315,265.3586) and (203.2903,265.2745) .. - (203.8479,265.1524) .. controls (204.8067,264.9426) and (204.9676,264.9587) .. - (206.4259,265.6679) .. controls (207.2837,266.0851) and (208.2121,266.4413) .. - (208.4883,266.4413) .. controls (208.7596,266.4413) and (209.3785,266.6168) .. - (209.8288,266.8023) .. controls (211.2657,267.3939) and (217.3810,271.0660) .. - (217.3049,271.2879) .. controls (217.2650,271.4044) and (217.3581,271.8601) .. - (217.5112,272.2676) .. controls (218.1236,273.8974) and (217.9797,274.8143) .. - (216.9956,275.5158) .. controls (216.5566,275.8287) and (215.9914,276.5050) .. - (215.7066,277.0626) -- (215.1910,278.0938) -- (213.7989,277.9392) .. controls - (213.0268,277.8691) and (211.7681,277.7515) .. (211.0662,277.6814) .. controls - (209.8438,277.5591) and (209.7665,277.5763) .. (208.9007,278.2485) .. controls - (208.4075,278.6315) and (207.9727,279.1282) .. (207.9727,279.3313) .. controls - (207.9727,279.5414) and (208.2957,280.0417) .. (208.7461,280.4140) .. controls - (209.5421,281.0722) and (209.6134,281.0449) .. (211.7365,280.9812) .. controls - (213.7524,280.9206) and (213.9454,280.8629) .. (214.9332,280.2078) .. controls - (215.5122,279.8237) and (216.0922,279.5375) .. (216.2222,279.5375) .. controls - (216.3543,279.5375) and (216.3209,279.5961) .. (216.1707,279.6921) .. controls - (215.9780,279.8154) and (215.9771,280.0754) .. (216.1192,280.5686) .. controls - (216.3463,281.3576) and (216.6321,281.2471) .. (212.6647,281.7545) .. controls - (210.0483,282.0890) and (206.8417,282.8687) .. (205.4979,283.5075) .. controls - (205.1439,283.6761) and (203.6176,284.0434) .. (202.0950,284.3325) .. controls - (200.5724,284.6215) and (199.3064,284.9040) .. (199.2592,284.9512) .. controls - (199.2125,284.9979) and (199.4919,285.2008) .. (199.8779,285.3637) .. controls - (201.1027,285.8805) and (203.3319,285.6809) .. (205.4979,284.8996) .. controls - (208.2631,283.9024) and (208.7196,283.8150) .. (213.1803,283.6622) -- - (217.2019,283.5591) -- (219.8314,286.0855) .. controls (221.2683,287.4927) and - (222.8650,289.0247) .. (223.3890,289.4368) .. controls (224.3326,290.1791) and - (224.3682,290.1654) .. (224.0078,290.6743) .. controls (223.7375,291.0558) and - (223.6002,291.6949) .. (223.5953,293.0460) .. controls (223.5853,295.4265) and - (223.3091,296.6248) .. (222.5641,297.4286) .. controls (222.2365,297.7820) and - (221.6079,298.7577) .. (221.1720,299.5941) .. controls (220.4119,301.0524) and - (219.7926,301.6049) .. (218.9549,301.6049) .. controls (218.7756,301.6049) and - (218.1318,302.2163) .. (217.4597,302.9454) .. controls (215.8189,304.7254) and - (214.6638,305.3806) .. (213.5928,305.1625) .. controls (213.1527,305.0729) and - (212.2855,305.0295) .. (211.6851,305.0594) .. controls (210.8487,305.1008) and - (210.3910,304.9477) .. (209.5711,304.4922) .. controls (208.9921,304.1705) and - (208.0974,303.8969) .. (207.6119,303.8735) .. controls (207.1083,303.8492) and - (206.0076,303.4914) .. (205.0855,303.0485) .. controls (204.1847,302.6160) and - (203.3317,302.2751) .. (203.1778,302.2751) .. controls (202.7503,302.2751) and - (201.5553,301.4737) .. (200.0326,300.1612) .. controls (197.8237,298.2573) and - (192.8295,294.5590) .. (191.9378,294.1803) .. controls (191.5059,293.9969) and - (190.3851,293.7220) .. (189.4629,293.5616) .. controls (186.7822,293.0954) and - (185.8344,292.2455) .. (186.9365,291.2414) .. controls (187.2885,290.9208) and - (187.7427,290.8470) .. (189.3083,290.8805) .. controls (192.0962,290.9401) and - (192.7726,290.4138) .. (191.4222,289.2822) .. controls (190.3958,288.4220) and - (186.0136,286.3238) .. (181.5743,284.5387) .. controls (179.3869,283.6590) and - (177.2522,282.7027) .. (176.7793,282.4248) .. controls (176.3049,282.1460) and - (174.6326,280.8522) .. (173.0670,279.4859) .. controls (169.3355,276.2296) and - (166.3066,274.2116) .. (165.5909,274.4846) .. controls (165.2214,274.6255) and - (163.6690,279.1089) .. (162.9098,282.2185) .. controls (161.9098,286.3146) and - (161.5808,288.9276) .. (161.5693,292.9429) .. controls (161.5492,299.6982) and - (162.6653,303.6356) .. (165.9518,308.4107) .. controls (169.5090,313.5791) and - (173.6364,317.2964) .. (178.0683,319.3413) .. controls (180.9849,320.6871) and - (185.1371,321.4579) .. (186.8850,320.9912) .. controls (187.5671,320.8091) and - (187.5233,320.6794) .. (186.4725,320.0116) .. controls (184.7140,318.8941) and - (182.3701,316.7394) .. (181.1619,315.1134) .. controls (179.8869,313.3978) and - (178.3785,310.7301) .. (178.5839,310.5246) .. controls (178.6431,310.4652) and - (179.6730,310.6806) .. (180.8525,310.9887) .. controls (182.8826,311.5190) and - (183.1621,311.5176) .. (186.9365,311.4012) .. controls (193.9707,311.1837) and - (198.1762,309.9105) .. (204.6214,305.9874) .. controls (205.6722,305.3477) and - (206.5454,304.8633) .. (206.5807,304.9047) .. controls (206.6163,304.9461) and - (206.8196,306.2265) .. (206.9932,307.7920) .. controls (207.4401,311.8238) and - (208.5266,314.0822) .. (210.0867,314.0822) .. controls (210.7828,314.0822) and - (211.1048,314.5992) .. (210.8601,315.3712) .. controls (210.6017,316.1862) and - (210.9226,316.8049) .. (211.6851,316.9696) .. controls (212.5643,317.1595) and - (213.1287,317.6549) .. (213.1287,318.2586) .. controls (213.1287,318.6924) and - (213.1990,318.7181) .. (214.0568,318.6195) .. controls (214.9146,318.5208) and - (215.0385,318.6018) .. (215.7583,319.3413) .. controls (216.1932,319.7881) and - (216.9534,320.7562) .. (217.4597,321.5068) -- (218.3878,322.8473) -- - (221.4814,322.8473) .. controls (227.9099,322.9005) and (235.3038,322.5246) .. - (241.0739,317.3820) .. controls (241.1432,317.4513) and (241.3363,317.4913) .. - (241.4864,317.4335) .. controls (241.6625,317.3658) and (241.5892,317.2923) .. - (241.3318,317.2789) .. controls (241.2452,317.2739) and (241.1775,317.3177) .. - (241.1256,317.3304) .. controls (241.3405,317.1374) and (241.5341,316.9184) .. - (241.7443,316.7117) .. controls (241.2941,316.4462) and (240.8437,316.1770) .. - (240.4037,315.8868) .. controls (240.1620,315.8010) and (239.9612,315.7167) .. - (239.8881,315.6290) .. controls (239.8297,315.5589) and (239.7952,315.5138) .. - (239.7850,315.4744) .. controls (238.8533,314.8281) and (237.9892,314.1197) .. - (237.1039,313.3605) .. controls (237.0859,313.5565) and (237.0620,313.6227) .. - (237.0008,313.4636) .. controls (236.9775,313.4030) and (236.9510,313.3200) .. - (236.9493,313.2573) .. controls (236.9413,313.2493) and (236.9573,313.2132) .. - (236.9493,313.2058) .. controls (236.3039,312.6454) and (235.6108,312.0735) .. - (234.9901,311.4528) .. controls (228.6483,305.1110) and (225.4516,297.4802) .. - (225.4516,288.5089) .. controls (225.4516,287.7205) and (225.5054,286.9571) .. - (225.5547,286.1887) .. controls (225.3447,286.0418) and (225.1422,285.8627) .. - (225.1422,285.8278) .. controls (225.1422,285.6775) and (225.3280,285.7714) .. - (225.5547,285.9309) .. controls (225.8603,281.6579) and (226.9703,277.7176) .. - (228.8029,274.0722) .. controls (228.4759,274.0169) and (228.2499,273.9890) .. - (227.8233,273.9176) .. controls (227.4876,273.8613) and (227.4073,273.9440) .. - (227.4624,274.3301) .. controls (227.5502,274.9445) and (227.1038,274.9658) .. - (225.9672,274.3816) .. controls (224.7662,273.7646) and (222.3330,273.7642) .. - (221.9455,274.3816) .. controls (221.6629,274.8319) and (221.6521,274.8575) .. - (220.9659,274.2785) -- (220.2956,273.6598) -- (220.0374,275.4643) .. controls - (219.8896,276.4508) and (219.7354,277.3129) .. (219.6765,277.3720) .. controls - (219.5755,277.4729) and (217.6183,277.4258) .. (217.5110,277.3205) .. controls - (217.4874,277.2974) and (217.6478,276.5111) .. (217.8719,275.5674) .. controls - (218.0960,274.6238) and (218.2844,273.5274) .. (218.2844,273.1442) .. controls - (218.2844,272.7581) and (218.2824,272.4739) .. (218.3359,272.4739) .. controls - (218.3881,272.4739) and (218.8351,272.6995) .. (219.2640,272.9895) -- - (220.0374,273.5566) -- (220.5014,273.0926) .. controls (221.1596,272.4795) and - (224.0352,272.4741) .. (225.1933,273.0926) .. controls (225.6222,273.3216) and - (226.2041,273.5566) .. (226.4823,273.5566) .. controls (226.8906,273.5566) and - (226.9817,273.4321) .. (226.8948,273.0926) .. controls (226.7690,272.6007) and - (226.7974,272.6339) .. (229.3696,272.9895) .. controls (230.8408,270.3347) and - (232.6861,267.8169) .. (234.9896,265.5134) .. controls (237.2453,263.2577) and - (239.6753,261.4457) .. (242.2595,259.9965) -- (242.2595,259.8419) -- - (241.0737,259.2746) .. controls (232.1952,255.0792) and (218.7587,251.3145) .. - (209.8802,250.5095) .. controls (209.3495,250.4615) and (206.2223,250.4225) .. - (202.9197,250.4580) -- cycle(216.0159,277.8875) .. controls - (216.1030,277.8727) and (216.2634,277.8875) .. (216.5315,277.8875) .. controls - (217.0676,277.8875) and (217.3151,277.9429) .. (217.0471,277.9906) .. controls - (216.7897,278.0363) and (216.3248,278.0363) .. (216.0674,277.9906) .. controls - (215.9335,277.9667) and (215.9287,277.9030) .. (216.0159,277.8875) -- - cycle(218.0782,277.8875) .. controls (218.1656,277.8727) and - (218.3579,277.8845) .. (218.5938,277.8875) .. controls (219.0657,277.8945) and - (219.2200,277.9435) .. (218.9547,277.9906) .. controls (218.6974,278.0371) and - (218.2783,277.9906) .. (218.0782,277.9391) .. controls (218.0897,277.9341) and - (218.0564,277.8914) .. (218.0782,277.8877) -- cycle(222.5639,278.5578) .. - controls (222.8464,278.5029) and (223.1555,278.5377) .. (223.5951,278.6609) .. - controls (224.0776,278.7962) and (224.0578,278.8223) .. (223.2857,278.9187) .. - controls (222.5566,279.0098) and (222.5147,279.0913) .. (222.9248,279.2281) .. - controls (223.1822,279.3139) and (223.3889,279.4345) .. (223.3889,279.5374) .. - controls (223.3889,279.9192) and (222.4161,280.7151) .. (221.4296,281.0842) .. - controls (220.5949,281.3964) and (220.1858,281.3838) .. (219.0063,281.1873) .. - controls (217.4837,280.9334) and (217.4037,280.7452) .. (218.6454,280.5171) .. - controls (219.8463,280.2966) and (221.4270,279.5472) .. (221.8421,279.0218) .. - controls (222.0371,278.7750) and (222.2814,278.6128) .. (222.5639,278.5578) -- - cycle(224.0076,282.4763) .. controls (224.5557,282.5591) and - (224.5610,282.8089) .. (224.2138,283.8169) .. controls (223.9922,284.4602) and - (224.0553,284.5904) .. (224.5232,284.9512) .. controls (224.8020,285.1661) and - (224.9204,285.3121) .. (224.7810,285.3121) .. controls (224.6308,285.3121) and - (224.4436,285.2309) .. (224.3685,285.1059) .. controls (224.2913,284.9772) and - (224.1814,284.9320) .. (224.0591,285.0027) .. controls (223.9427,285.0700) and - (223.8738,285.0283) .. (223.9045,284.8996) .. controls (223.9344,284.7746) and - (223.7106,284.4459) .. (223.3889,284.1778) .. controls (222.8099,283.6953) and - (222.7666,283.7384) .. (223.1311,283.0950) .. controls (223.3985,282.6232) and - (223.6617,282.4242) .. (224.0076,282.4763) -- cycle(163.3737,285.1058) .. - controls (163.5881,285.1058) and (163.8239,285.2048) .. (163.8893,285.3121) .. - controls (163.9542,285.4182) and (163.7272,287.2019) .. (163.3737,289.2822) .. - controls (163.0200,291.3624) and (162.7034,293.5896) .. (162.7034,294.2319) .. - controls (162.7034,294.9610) and (162.6443,295.4177) .. (162.4972,295.4177) .. - controls (162.1759,295.4177) and (162.3353,288.0589) .. (162.7034,286.3433) .. - controls (162.9106,285.3782) and (163.0743,285.1058) .. (163.3737,285.1058) -- - cycle(198.1247,308.4107) .. controls (198.1785,308.4027) and - (198.2008,308.4109) .. (198.2279,308.4107) .. controls (198.1403,308.4658) and - (197.9273,308.5963) .. (197.6607,308.7201) .. controls (194.6154,310.1340) and - (189.7205,311.1519) .. (189.7205,310.3700) .. controls (189.7205,310.1716) and - (190.1344,309.9980) .. (190.9064,309.9059) .. controls (191.5455,309.8298) and - (193.3237,309.4851) .. (194.8249,309.1326) .. controls (196.7765,308.6745) and - (197.7662,308.4639) .. (198.1247,308.4107) -- cycle; - \path[fill=araracolor,nonzero rule] (187.5922,267.3762) .. controls - (187.5922,267.6466) and (187.2920,268.1530) .. (186.9274,268.4974) .. controls - (186.1844,269.1991) and (185.6622,270.2499) .. (185.6622,271.0434) .. controls - (185.6622,271.3436) and (185.5206,271.6597) .. (185.3405,271.7618) .. controls - (185.0750,271.9123) and (185.0600,272.0621) .. (185.2547,272.6196) .. controls - (185.4297,273.1204) and (185.4213,273.6169) .. (185.2225,274.5390) -- - (184.9544,275.7829) -- (184.5255,274.8285) .. controls (184.2915,274.3080) and - (184.0526,273.2845) .. (184.0001,272.5768) .. controls (183.9059,271.3117) and - (183.9308,271.2364) .. (184.9924,269.5637) .. controls (186.5034,267.1832) and - (187.5922,266.2671) .. (187.5922,267.3762); - \path[fill=araracolor,nonzero rule] (184.8043,267.7408) .. controls - (184.8043,267.8703) and (184.4661,268.4163) .. (184.0537,268.9525) .. controls - (183.6413,269.4886) and (183.2427,270.2568) .. (183.1689,270.6574) .. controls - (183.0117,271.5118) and (182.6598,271.4080) .. (182.6598,270.5072) .. controls - (182.6598,269.5851) and (183.3636,268.3404) .. (184.1395,267.8904) .. controls - (184.5470,267.6541) and (184.8043,267.5962) .. (184.8043,267.7408); - \path[fill=araracolor,nonzero rule] (182.0057,270.9791) .. controls - (182.2362,272.5660) and (182.2259,272.9641) .. (181.9306,273.8313) .. controls - (181.7408,274.3889) and (181.5874,275.0020) .. (181.5874,275.2038) .. controls - (181.5874,275.4043) and (181.2014,275.8877) .. (180.7296,276.2783) .. controls - (179.7427,277.0951) and (179.7324,277.0910) .. (180.2364,276.0831) .. controls - (180.4654,275.6250) and (180.6168,274.7320) .. (180.6438,273.6812) .. controls - (180.6712,272.6089) and (180.8407,271.6081) .. (181.1156,270.8933) .. controls - (181.3548,270.2714) and (181.5872,269.6359) .. (181.6411,269.4564) .. controls - (181.6939,269.2806) and (181.8592,269.9711) .. (182.0056,270.9791); - \path[fill=araracolor,nonzero rule] (180.1828,270.5823) .. controls - (179.8924,271.2042) and (179.6527,272.0923) .. (179.6467,272.5660) .. controls - (179.6367,273.3595) and (179.6119,273.3917) .. (179.3158,272.9949) .. controls - (179.0082,272.5830) and (178.8909,270.8718) .. (179.1275,270.2499) .. controls - (179.2027,270.0520) and (179.4108,269.9694) .. (179.6681,270.0355) .. controls - (179.9255,270.1015) and (180.1358,270.0109) .. (180.2150,269.7996) .. controls - (180.2873,269.6066) and (180.4234,269.4564) .. (180.5259,269.4564) .. controls - (180.6267,269.4564) and (180.4729,269.9604) .. (180.1828,270.5823); - \path[fill=araracolor,nonzero rule] (177.9418,271.4938) .. controls - (177.9659,272.0942) and (178.0225,272.8491) .. (178.0704,273.2094) .. controls - (178.1178,273.5650) and (178.2575,274.5819) .. (178.3825,275.4826) .. controls - (178.6297,277.2626) and (178.4975,277.8850) .. (177.7273,278.5646) -- - (177.2341,278.9997) -- (177.3647,278.2491) .. controls (177.7675,275.9330) and - (177.7641,275.3173) .. (177.3404,273.9386) .. controls (177.1035,273.1665) and - (176.8502,272.0709) .. (176.7730,271.4830) -- (176.6336,270.4215) -- - (177.0518,271.1721) -- (177.4700,271.9227) -- (177.6844,271.1721) -- - (177.8989,270.4215) -- (177.9418,271.4938); - \path[fill=araracolor,nonzero rule] (193.0180,271.0451) .. controls - (194.6352,271.6454) and (195.6056,273.1236) .. (195.5936,274.9679) .. controls - (195.5804,277.0786) and (194.0473,278.6984) .. (191.9242,278.8464) .. controls - (189.8011,278.9944) and (188.1509,277.8018) .. (187.5961,275.7185) .. controls - (186.8075,272.7590) and (190.0671,269.9497) .. (193.0180,271.0451) -- - cycle(189.3079,272.6233) .. controls (188.1981,273.7232) and - (188.0031,274.8822) .. (188.6971,276.2547) .. controls (189.3396,277.5262) and - (190.3158,278.0852) .. (191.6883,277.9682) .. controls (192.9107,277.8642) and - (193.6686,277.3308) .. (194.2461,276.1689) .. controls (194.8857,274.8821) and - (194.6693,273.7026) .. (193.5970,272.6304) .. controls (192.8346,271.8680) and - (192.6963,271.8154) .. (191.4524,271.8154) .. controls (190.2086,271.8154) and - (190.0703,271.8676) .. (189.3079,272.6233); - \path[fill=araracolor,nonzero rule] (175.5068,272.0942) .. controls - (175.6307,272.8234) and (175.8152,273.6175) .. (175.9151,273.8528) .. controls - (176.0897,274.2639) and (176.0760,274.2675) .. (175.5827,273.9450) .. controls - (174.7740,273.4157) and (174.4884,272.6732) .. (174.7387,271.7511) .. controls - (175.0651,270.5493) and (175.2591,270.6359) .. (175.5068,272.0942); - \path[fill=araracolor,nonzero rule] (204.6200,272.2356) .. controls - (204.9569,272.3603) and (204.8559,272.4243) .. (204.1482,272.5339) .. controls - (203.4405,272.6434) and (203.1763,272.8135) .. (202.9151,273.3274) .. controls - (202.7036,273.7436) and (202.2395,274.1275) .. (201.6391,274.3831) .. controls - (200.7176,274.7756) and (200.3225,275.2467) .. (200.0337,276.2976) .. controls - (199.8979,276.7919) and (199.8550,276.7372) .. (199.6554,275.8150) .. controls - (199.5022,275.1073) and (199.4980,274.5761) .. (199.6422,274.1530) .. controls - (199.8577,273.5204) and (200.7597,272.8877) .. (201.4459,272.8877) .. controls - (201.6486,272.8877) and (201.9821,272.7326) .. (202.1965,272.5390) .. controls - (202.6205,272.1562) and (203.9551,271.9889) .. (204.6199,272.2356); - \path[fill=araracolor,nonzero rule] (171.0577,272.1800) .. controls - (171.0692,272.3198) and (171.3781,272.7805) .. (171.7333,273.1880) .. controls - (172.2269,273.7543) and (172.4163,274.2173) .. (172.5053,275.0752) .. controls - (172.5698,275.6971) and (172.5310,276.4496) .. (172.4195,276.7372) -- - (172.2158,277.2626) -- (171.6368,276.6836) .. controls (170.5064,275.5532) and - (170.1411,273.8742) .. (170.7412,272.5660) .. controls (170.9085,272.2014) and - (171.0455,272.0342) .. (171.0577,272.1800); - \path[fill=araracolor,nonzero rule] (207.3221,274.7477) .. controls - (208.2130,275.0479) and (210.1744,275.6150) .. (211.7185,276.0188) -- - (214.5064,276.7479) -- (212.2546,276.6510) .. controls (208.2657,276.4797) and - (204.3356,275.7036) .. (203.4834,274.9189) .. controls (202.5340,274.0450) and - (204.9202,273.9386) .. (207.3222,274.7477); - \path[fill=araracolor,nonzero rule] (183.1421,276.2761) .. controls - (183.2686,276.7374) and (183.0340,277.2626) .. (182.3754,277.9917) .. controls - (181.7732,278.6585) and (181.0513,279.0074) .. (179.9147,279.1807) .. controls - (179.0569,279.3115) and (179.0082,279.2930) .. (179.2178,278.9139) .. controls - (179.3415,278.6900) and (179.8826,278.3372) .. (180.4187,278.1311) .. controls - (181.0192,277.9002) and (181.7078,277.3887) .. (182.2094,276.8015) .. controls - (182.9236,275.9651) and (183.0389,275.9002) .. (183.1421,276.2761); - \path[fill=araracolor,nonzero rule] (198.3071,276.7694) .. controls - (197.4997,278.2706) and (196.4896,279.5998) .. (195.4842,280.4846) .. controls - (194.4548,281.3905) and (194.3030,281.4569) .. (193.5112,281.3484) .. controls - (191.4953,281.0720) and (185.7012,279.9558) .. (184.8043,279.6707) -- - (183.8393,279.3643) -- (185.1260,279.3543) .. controls (185.8376,279.3473) and - (187.2277,279.5275) .. (188.2356,279.7553) .. controls (190.9807,280.3751) and - (192.2378,280.3120) .. (194.0903,279.4617) .. controls (194.9481,279.0680) and - (196.3150,278.1857) .. (197.1141,277.5100) .. controls (198.0362,276.7302) and - (198.4748,276.4583) .. (198.3071,276.7701); - \path[fill=araracolor,nonzero rule] (202.9473,278.9532) .. controls - (201.6605,279.6474) and (199.6018,281.4445) .. (199.6018,281.8734) .. controls - (199.6018,282.0055) and (199.7197,282.1093) .. (199.8698,282.1093) .. controls - (200.0216,282.1093) and (200.4167,282.2952) .. (200.7813,282.5382) -- - (201.4246,282.9671) -- (199.4945,282.9496) .. controls (197.4358,282.9308) and - (196.1027,283.1581) .. (194.2833,283.8381) .. controls (192.6757,284.4390) and - (191.8814,284.3738) .. (189.9941,283.4864) .. controls (189.0797,283.0564) and - (187.0990,282.3892) .. (185.5549,281.9914) -- (182.7670,281.2730) -- - (184.5899,281.3266) .. controls (186.1983,281.3739) and (186.6272,281.4787) .. - (188.2356,282.2166) .. controls (189.9433,283.0002) and (190.1872,283.0536) .. - (192.0958,283.0637) .. controls (193.6399,283.0717) and (194.5069,282.9576) .. - (195.6772,282.5919) .. controls (197.0283,282.1696) and (197.2976,281.9955) .. - (197.8325,281.1979) .. controls (198.1720,280.6916) and (198.8726,280.0482) .. - (199.4087,279.7503) .. controls (199.9449,279.4525) and (200.6455,278.9998) .. - (200.9850,278.7317) .. controls (201.4759,278.3442) and (201.8535,278.2513) .. - (202.9043,278.2599) -- (204.2125,278.2714) -- (202.9472,278.9540); - \path[fill=araracolor,nonzero rule] (181.9521,281.9129) .. controls - (182.4363,282.0092) and (183.8285,282.4203) .. (185.0510,282.8277) .. controls - (186.2733,283.2352) and (187.8487,283.7315) .. (188.5573,283.9322) .. controls - (189.2650,284.1327) and (190.0370,284.4177) .. (190.2729,284.5657) .. controls - (190.9002,284.9592) and (192.2674,285.1415) .. (195.7416,285.2955) -- - (198.8512,285.4334) -- (197.0283,285.7341) .. controls (195.0124,286.0665) and - (192.1709,286.1791) .. (191.6669,285.9464) .. controls (191.4910,285.8654) and - (190.6161,285.6558) .. (189.7368,285.4842) .. controls (188.3323,285.2101) and - (187.2277,284.8829) .. (185.5549,284.2457) .. controls (185.3119,284.1530) and - (184.8472,284.0212) .. (184.4826,283.9414) .. controls (183.6463,283.7579) and - (179.4082,282.1186) .. (179.1427,281.8758) .. controls (178.8907,281.6453) and - (180.7297,281.6697) .. (181.9521,281.9129); - \path[fill=araracolor,nonzero rule] (242.2784,299.2121) .. controls - (242.2784,300.4560) and (242.2197,300.7232) .. (241.9674,300.6275) .. controls - (241.7947,300.5622) and (241.5898,300.0807) .. (241.5063,299.5445) .. controls - (241.3796,298.7296) and (241.4279,298.5094) .. (241.8173,298.1291) -- - (242.2784,297.6788) -- (242.2784,299.2121); - \path[fill=araracolor,nonzero rule] (192.6963,272.2967) .. controls - (192.9547,272.4206) and (193.3649,272.9306) .. (193.6034,273.4239) .. controls - (194.1632,274.5819) and (193.9830,275.4732) .. (193.0180,276.3207) .. controls - (190.8500,278.2247) and (187.8018,275.6327) .. (189.3083,273.1665) .. controls - (189.9493,272.1172) and (191.4953,271.7202) .. (192.6963,272.2967) -- - cycle(190.0585,273.7455) .. controls (190.0585,274.1316) and - (190.1966,274.3012) .. (190.5517,274.3512) .. controls (191.0870,274.4264) and - (191.3785,273.9814) .. (191.1586,273.4239) .. controls (191.0806,273.2255) and - (190.8198,273.1080) .. (190.5410,273.1451) .. controls (190.1936,273.1914) and - (190.0585,273.3595) .. (190.0585,273.7455); - \path[fill=araracolor] (261.4271,267.9564) .. controls (258.5655,267.9565) and - (255.8973,268.4978) .. (253.4225,269.5805) .. controls (250.9476,270.6633) and - (248.8014,272.1231) .. (246.9840,273.9599) .. controls (245.1665,275.7967) and - (243.7261,277.9525) .. (242.6627,280.4273) .. controls (241.5992,282.9022) and - (241.0675,285.5317) .. (241.0676,288.3159) .. controls (241.0675,291.1002) and - (241.5992,293.7297) .. (242.6627,296.2045) .. controls (243.7261,298.6794) and - (245.1665,300.8352) .. (246.9840,302.6720) .. controls (248.8014,304.5088) and - (250.9476,305.9686) .. (253.4225,307.0513) .. controls (255.8973,308.1341) and - (258.5655,308.6755) .. (261.4271,308.6755) .. controls (264.2499,308.6755) and - (266.8988,308.1341) .. (269.3737,307.0513) .. controls (271.8485,305.9686) and - (274.0043,304.4992) .. (275.8412,302.6430) .. controls (277.6779,300.7869) and - (279.1280,298.6311) .. (280.1915,296.1755) .. controls (281.2549,293.7200) and - (281.7866,291.1002) .. (281.7866,288.3159) .. controls (281.7866,285.5318) and - (281.2549,282.9119) .. (280.1915,280.4564) .. controls (279.1280,278.0009) and - (277.6779,275.8450) .. (275.8412,273.9889) .. controls (274.0043,272.1328) and - (271.8485,270.6633) .. (269.3737,269.5805) .. controls (266.8988,268.4978) and - (264.2499,267.9565) .. (261.4271,267.9564) -- cycle(281.7866,314.7659) -- - (281.7866,313.6058) .. controls (278.8863,315.9260) and (275.7348,317.7048) .. - (272.3319,318.9422) .. controls (268.9289,320.1797) and (265.2940,320.7984) .. - (261.4271,320.7984) .. controls (252.4557,320.7984) and (244.7992,317.6275) .. - (238.4574,311.2857) .. controls (232.1155,304.9439) and (228.9446,297.2873) .. - (228.9446,288.3159) .. controls (228.9446,279.3446) and (232.1155,271.6881) .. - (238.4574,265.3462) .. controls (244.7992,259.0044) and (252.4557,255.8335) .. - (261.4271,255.8335) .. controls (270.3210,255.8335) and (277.9776,259.0044) .. - (284.3968,265.3462) .. controls (290.7386,271.6881) and (293.9095,279.3446) .. - (293.9095,288.3159) -- (293.9095,314.7659) .. controls (293.9095,316.4287) and - (293.3198,317.8498) .. (292.1404,319.0292) .. controls (290.9609,320.2087) and - (289.5398,320.7984) .. (287.8771,320.7984) .. controls (286.1756,320.7984) and - (284.7351,320.2087) .. (283.5557,319.0292) .. controls (282.3763,317.8498) and - (281.7866,316.4287) .. (281.7866,314.7659) -- cycle; - \path[fill=araracolor] (315.0811,261.8659) -- (315.0811,263.0260) .. controls - (317.9813,260.7059) and (321.1329,258.9271) .. (324.5358,257.6896) .. controls - (327.9387,256.4523) and (331.5737,255.8336) .. (335.4407,255.8335) .. controls - (337.1421,255.8336) and (338.9692,255.9495) .. (340.9221,256.1815) .. controls - (342.8748,256.4136) and (344.6730,256.8293) .. (346.3165,257.4286) .. controls - (347.9599,258.0281) and (349.3230,258.8498) .. (350.4058,259.8938) .. controls - (351.4885,260.9379) and (352.0298,262.2914) .. (352.0299,263.9541) .. controls - (352.0298,264.8049) and (351.8656,265.5976) .. (351.5369,266.3323) .. controls - (351.2081,267.0671) and (350.7731,267.7148) .. (350.2318,268.2754) .. controls - (349.6904,268.8362) and (349.0523,269.2712) .. (348.3176,269.5805) .. controls - (347.5828,269.8899) and (346.7901,270.0446) .. (345.9394,270.0446) .. controls - (345.2047,270.0446) and (344.3540,269.8319) .. (343.3873,269.4065) .. controls - (340.9510,268.4398) and (338.3022,267.9565) .. (335.4407,267.9564) .. controls - (332.6177,267.9565) and (329.9689,268.4882) .. (327.4941,269.5515) .. controls - (325.0192,270.6150) and (322.8634,272.0651) .. (321.0266,273.9018) .. controls - (319.1898,275.7387) and (317.7396,277.8945) .. (316.6762,280.3693) .. controls - (315.6128,282.8442) and (315.0811,285.4931) .. (315.0811,288.3159) -- - (315.0811,314.7659) .. controls (315.0811,316.4287) and (314.4914,317.8498) .. - (313.3120,319.0293) .. controls (312.1326,320.2087) and (310.7114,320.7984) .. - (309.0487,320.7984) .. controls (307.3472,320.7984) and (305.9067,320.2087) .. - (304.7273,319.0293) .. controls (303.5479,317.8498) and (302.9582,316.4287) .. - (302.9582,314.7659) -- (302.9582,261.8659) .. controls (302.9582,260.2032) and - (303.5479,258.7821) .. (304.7273,257.6026) .. controls (305.9067,256.4233) and - (307.3472,255.8336) .. (309.0487,255.8335) .. controls (310.7115,255.8336) and - (312.1326,256.4233) .. (313.3120,257.6026) .. controls (314.4914,258.7821) and - (315.0811,260.2032) .. (315.0811,261.8659) -- cycle; - \path[fill=araracolor] (384.7572,267.9564) .. controls (381.8957,267.9565) and - (379.2275,268.4978) .. (376.7526,269.5805) .. controls (374.2778,270.6633) and - (372.1316,272.1231) .. (370.3142,273.9599) .. controls (368.4967,275.7967) and - (367.0562,277.9525) .. (365.9928,280.4273) .. controls (364.9294,282.9022) and - (364.3977,285.5317) .. (364.3977,288.3159) .. controls (364.3977,291.1002) and - (364.9294,293.7297) .. (365.9928,296.2045) .. controls (367.0562,298.6794) and - (368.4967,300.8352) .. (370.3142,302.6720) .. controls (372.1316,304.5088) and - (374.2778,305.9686) .. (376.7526,307.0513) .. controls (379.2275,308.1341) and - (381.8957,308.6755) .. (384.7572,308.6755) .. controls (387.5801,308.6755) and - (390.2289,308.1341) .. (392.7039,307.0513) .. controls (395.1787,305.9686) and - (397.3345,304.4992) .. (399.1713,302.6430) .. controls (401.0081,300.7869) and - (402.4582,298.6311) .. (403.5217,296.1755) .. controls (404.5850,293.7200) and - (405.1167,291.1002) .. (405.1168,288.3159) .. controls (405.1167,285.5318) and - (404.5850,282.9119) .. (403.5217,280.4564) .. controls (402.4582,278.0009) and - (401.0081,275.8450) .. (399.1713,273.9889) .. controls (397.3345,272.1328) and - (395.1787,270.6633) .. (392.7039,269.5805) .. controls (390.2289,268.4978) and - (387.5801,267.9565) .. (384.7572,267.9564) -- cycle(405.1168,314.7659) -- - (405.1168,313.6058) .. controls (402.2165,315.9260) and (399.0649,317.7048) .. - (395.6621,318.9422) .. controls (392.2591,320.1797) and (388.6242,320.7984) .. - (384.7572,320.7984) .. controls (375.7859,320.7984) and (368.1293,317.6275) .. - (361.7875,311.2857) .. controls (355.4457,304.9439) and (352.2748,297.2873) .. - (352.2748,288.3159) .. controls (352.2748,279.3446) and (355.4457,271.6881) .. - (361.7875,265.3462) .. controls (368.1293,259.0044) and (375.7859,255.8335) .. - (384.7572,255.8335) .. controls (393.6512,255.8335) and (401.3078,259.0044) .. - (407.7270,265.3462) .. controls (414.0687,271.6881) and (417.2396,279.3446) .. - (417.2397,288.3159) -- (417.2397,314.7659) .. controls (417.2396,316.4287) and - (416.6499,317.8498) .. (415.4706,319.0292) .. controls (414.2911,320.2087) and - (412.8700,320.7984) .. (411.2072,320.7984) .. controls (409.5057,320.7984) and - (408.0653,320.2087) .. (406.8859,319.0292) .. controls (405.7064,317.8498) and - (405.1167,316.4287) .. (405.1168,314.7659) -- cycle; - \path[fill=araracolor] (438.4113,261.8659) -- (438.4113,263.0260) .. controls - (441.3115,260.7059) and (444.4630,258.9271) .. (447.8660,257.6896) .. controls - (451.2689,256.4523) and (454.9038,255.8336) .. (458.7708,255.8335) .. controls - (460.4722,255.8336) and (462.2994,255.9495) .. (464.2522,256.1815) .. controls - (466.2050,256.4136) and (468.0031,256.8293) .. (469.6466,257.4286) .. controls - (471.2900,258.0281) and (472.6531,258.8498) .. (473.7359,259.8938) .. controls - (474.8186,260.9379) and (475.3600,262.2914) .. (475.3601,263.9541) .. controls - (475.3600,264.8049) and (475.1957,265.5976) .. (474.8670,266.3323) .. controls - (474.5383,267.0671) and (474.1033,267.7148) .. (473.5619,268.2754) .. controls - (473.0205,268.8362) and (472.3825,269.2712) .. (471.6478,269.5805) .. controls - (470.9130,269.8899) and (470.1203,270.0446) .. (469.2696,270.0446) .. controls - (468.5348,270.0446) and (467.6841,269.8319) .. (466.7174,269.4065) .. controls - (464.2812,268.4398) and (461.6323,267.9565) .. (458.7708,267.9564) .. controls - (455.9479,267.9565) and (453.2990,268.4882) .. (450.8242,269.5515) .. controls - (448.3493,270.6150) and (446.1935,272.0651) .. (444.3567,273.9018) .. controls - (442.5199,275.7387) and (441.0698,277.8945) .. (440.0064,280.3693) .. controls - (438.9430,282.8442) and (438.4113,285.4931) .. (438.4113,288.3159) -- - (438.4113,314.7659) .. controls (438.4113,316.4287) and (437.8216,317.8498) .. - (436.6422,319.0293) .. controls (435.4627,320.2087) and (434.0416,320.7984) .. - (432.3788,320.7984) .. controls (430.6774,320.7984) and (429.2369,320.2087) .. - (428.0575,319.0293) .. controls (426.8781,317.8498) and (426.2884,316.4287) .. - (426.2884,314.7659) -- (426.2884,261.8659) .. controls (426.2884,260.2032) and - (426.8781,258.7821) .. (428.0575,257.6026) .. controls (429.2369,256.4233) and - (430.6774,255.8336) .. (432.3788,255.8335) .. controls (434.0416,255.8336) and - (435.4627,256.4233) .. (436.6422,257.6026) .. controls (437.8216,258.7821) and - (438.4113,260.2032) .. (438.4113,261.8659) -- cycle; - \path[fill=araracolor] (508.0874,267.9564) .. controls (505.2258,267.9565) and - (502.5576,268.4978) .. (500.0828,269.5805) .. controls (497.6079,270.6633) and - (495.4618,272.1231) .. (493.6443,273.9599) .. controls (491.8268,275.7967) and - (490.3864,277.9525) .. (489.3230,280.4273) .. controls (488.2596,282.9022) and - (487.7279,285.5317) .. (487.7279,288.3159) .. controls (487.7279,291.1002) and - (488.2596,293.7297) .. (489.3230,296.2045) .. controls (490.3864,298.6794) and - (491.8268,300.8352) .. (493.6443,302.6720) .. controls (495.4618,304.5088) and - (497.6079,305.9686) .. (500.0828,307.0513) .. controls (502.5576,308.1341) and - (505.2258,308.6755) .. (508.0874,308.6755) .. controls (510.9103,308.6755) and - (513.5591,308.1341) .. (516.0340,307.0513) .. controls (518.5088,305.9686) and - (520.6646,304.4992) .. (522.5015,302.6430) .. controls (524.3382,300.7869) and - (525.7884,298.6311) .. (526.8518,296.1755) .. controls (527.9152,293.7200) and - (528.4469,291.1002) .. (528.4469,288.3159) .. controls (528.4469,285.5318) and - (527.9152,282.9119) .. (526.8518,280.4564) .. controls (525.7884,278.0009) and - (524.3382,275.8450) .. (522.5015,273.9889) .. controls (520.6646,272.1328) and - (518.5088,270.6633) .. (516.0340,269.5805) .. controls (513.5591,268.4978) and - (510.9102,267.9565) .. (508.0874,267.9564) -- cycle(528.4469,314.7659) -- - (528.4469,313.6058) .. controls (525.5467,315.9260) and (522.3951,317.7048) .. - (518.9922,318.9422) .. controls (515.5893,320.1797) and (511.9543,320.7984) .. - (508.0874,320.7984) .. controls (499.1160,320.7984) and (491.4595,317.6275) .. - (485.1177,311.2857) .. controls (478.7759,304.9439) and (475.6050,297.2873) .. - (475.6050,288.3159) .. controls (475.6050,279.3446) and (478.7759,271.6881) .. - (485.1177,265.3462) .. controls (491.4595,259.0044) and (499.1160,255.8335) .. - (508.0874,255.8335) .. controls (516.9814,255.8335) and (524.6379,259.0044) .. - (531.0571,265.3462) .. controls (537.3989,271.6881) and (540.5698,279.3446) .. - (540.5698,288.3159) -- (540.5698,314.7659) .. controls (540.5698,316.4287) and - (539.9801,317.8498) .. (538.8007,319.0292) .. controls (537.6212,320.2087) and - (536.2001,320.7984) .. (534.5374,320.7984) .. controls (532.8359,320.7984) and - (531.3954,320.2087) .. (530.2161,319.0292) .. controls (529.0366,317.8498) and - (528.4469,316.4287) .. (528.4469,314.7659) -- cycle; + +\newcommand{\addname}[2]{% + \begin{scope}[ + y=0.80pt, + x=0.80pt, + yscale=-1.000000, + xscale=1.000000, + inner sep=0pt, + outer sep=0pt, + shift={([xshift=-0.8em, yshift=3.6em]frame.north east)}, + ] + \node [anchor=east] {\rbox[#2]{#1}}; + \end{scope} +} + +% 1 -> title +% 2 -> frame colour +% 3 -> icon description +% 4 -> title colour +% 5 -> code name +\newtcblisting{ncodebox}[5]{ + adjusted title=#1, + adjusted title after break={\centering #1 (ctd.)}, + halign title=center, + fonttitle=\bfseries\sffamily, + enhanced, + drop lifted shadow, + colback=#2!5, + colframe=#2, + breakable, + overlay={#3{#2}\addname{#5}{#2}}, + toptitle=0.2em, + bottomtitle=.2em, + coltitle=#4, + before skip=1em, + left=8mm, + listing only, + listing options={ + numbers=left, + numberstyle=\scriptsize\sffamily\color{#2}, + basicstyle=\footnotesize\ttfamily, + }, + after skip=1.4em +} + +\newtcbox{\abox}[1][teal]{ + on line, + arc=3pt, + colback=#1!10, + tcbox raise=-1.1mm, + colframe=#1, + before upper={ + \vphantom{dp} + }, + boxrule=1pt, + fontupper=\footnotesize\normalfont\ttfamily\color{#1}, + boxsep=0pt, + left=2pt, + right=2pt, + top=1.6pt, + bottom=0.8pt +} + +\newtcbox{\rbox}[1][teal]{ + on line, + arc=3pt, + colback=#1, + tcbox raise=-1.1mm, + colframe=#1, + before upper={ + \vphantom{dp} + }, + boxrule=1pt, + fontupper=\footnotesize\normalfont\ttfamily\color{#1!10}, + boxsep=0pt, + left=2pt, + right=2pt, + top=1.6pt, + bottom=0.8pt +} + +\newcommand{\varbox}[1]{\rbox[araracolour]{$\diamondsuit$\,#1}} +\newcommand{\mtbox}[1]{\rbox{$\diamondsuit$\,#1}} +\newcommand{\prbox}[1]{\rbox[attentioncolour]{\color{black}$\rhd$\,#1}} +\newcommand{\opbox}[1]{\rbox[cyan]{\color{black}{-}#1}} +\newcommand{\cdbox}[1]{\rbox{$\star$\,#1}} +\newcommand{\describe}[2]{\rbox[araracolour]{#1}~% +\abox{#2}} +\newcommand{\describecontext}[3]{\rbox[araracolour]{#1}~% +\rbox{#2$\rightarrow$}~\abox{#3}} +\newcommand{\describecontextt}[4]{\rbox[araracolour]{#1}~% +\rbox[araracolour]{#2}~\rbox{#3$\rightarrow$}~\abox{#4}} +\newcommand{\describeconditional}[2]{\rbox[araracolour]% +{\normalfont\itshape\,\,#1\enspace}~\cdbox{#2}} +\newcommand{\describeop}[2]{\opbox{#1}~\opbox{{-}#2}} +\newcommand{\describeopp}[3]{\describeop{#1}{#2}~\prbox{#3}} +\newcommand{\describecf}[4]{\rbox[araracolour]{#1}~% +\rbox{\normalfont\itshape\,\,#2\enspace}~\abox{#3}% +\hfill{\normalfont\itshape default:} \rbox{#4}} +\newcommand{\describecfn}[3]{\rbox[araracolour]{#1}~% +\rbox{\normalfont\itshape\,\,#2\enspace}~\abox{#3}} +\newcommand{\rrbox}[1]{\rbox[araracolour]{$\triangle$\,#1}} +\newcommand{\ctbox}[1]{\rbox[cyan]{#1}} +\newcommand{\mdbox}[3]{\ctbox{#1}~\mtbox{#2}\hfill\rrbox{#3}} +\newcommand{\mddbox}[4]{\ctbox{#1}~\mdbox{#2}{#3}{#4}} + +\renewcommand{\secheadstyle}{\Large\normalfont\em} +\renewcommand{\subsecheadstyle}{\large\normalfont\em} +\renewcommand{\subsubsecheadstyle}{\normalsize\normalfont\em} +\renewcommand{\paraheadstyle}{\normalsize\normalfont\em} +\renewcommand{\subparaheadstyle}{\normalsize\normalfont\em} +\renewcommand{\partnumfont}{\Large\fontfamily{fco}\selectfont\bfseries} +\renewcommand{\partnamefont}{\Large\fontfamily{fco}\selectfont\bfseries} +\renewcommand{\parttitlefont}{\Huge\normalfont\em} +\renewcommand{\booktitlefont}{\huge\normalfont\em} +\renewcommand{\booknamefont}{\huge\normalfont\em} +\renewcommand{\booknumfont}{\huge\normalfont\em} +\renewcommand{\printpartname}{\centering\includegraphics[scale=.3]{../logos/bird.pdf}\par\partnamefont \textcolor{araracolour}{part}} +\renewcommand{\printpartnum}{\partnumfont\textcolor{araracolour}{\numtoname{\c@part}}} +\cftpagenumbersoff{part} +\renewcommand\partnumberline[1]{\hfil\hspace\@tocrmarg {\normalfont\normalsize\adforn{16}}\quad#1\hspace{0.5em}---\hspace{0.5em}} +\renewcommand*{\cftpartafterpnum}{\quad\adforn{44}} +\setlength\cftchapternumwidth{2em} +\setlength\cftsectionnumwidth{3em} + +\renewcommand{\midpartskip}{\par\vskip 3.0\onelineskip} + +\makechapterstyle{araraheadings}{% + \setlength{\beforechapskip}{2\onelineskip}% + \setlength{\afterchapskip}{1.5\onelineskip% + \@plus .1\onelineskip% + \@minus 0.167\onelineskip}% + \renewcommand*{\chapnamefont}{\normalfont}% + \renewcommand*{\printchaptername}{% + \centering\includegraphics[scale=.15]{../logos/bird.pdf}\par}% + \renewcommand*{\chapnumfont}{\fontfamily{fco}\selectfont\bfseries}% + \renewcommand*{\printchapternum}{\centering \chapnumfont \ifanappendix + \thechapter \else \textcolor{araracolour}{\numtoname{\c@chapter}}\fi}% + \renewcommand*{\chaptitlefont}{\normalfont\itshape\huge\centering}% + \renewcommand*{\printchapternonum}{% + \centering\includegraphics[scale=.15]{../logos/bird.pdf}\par% + \vskip\midchapskip}% +} + +\newcommand{\cbyes}[1]{% +\raisebox{#1pt}{\begin{tikzpicture}[ + y=0.80pt, + x=0.80pt, + yscale=-1.000000, + xscale=1.000000, + inner sep=0pt, + outer sep=0pt, + scale=.11 +] + \begin{scope}[ + shift={(-23.18884,-26.87932)} + ] + \path[line width=0.212pt,fill=araracolour] (56.2485,74.7821) -- (46.8029,84.2278) -- + (77.1638,114.5887) -- (144.6326,47.1199) -- (135.1870,37.6743) -- + (77.1638,95.6974) -- cycle(131.1388,134.8293) -- (36.6826,134.8293) -- + (36.6826,40.3731) -- (104.1513,40.3731) -- (104.1513,26.8793) -- + (36.6826,26.8793) .. controls (29.2610,26.8793) and (23.1888,32.9515) .. + (23.1888,40.3731) -- (23.1888,134.8293) .. controls (23.1888,142.2509) and + (29.2610,148.3231) .. (36.6826,148.3231) -- (131.1388,148.3231) .. controls + (138.5604,148.3231) and (144.6326,142.2509) .. (144.6326,134.8293) -- + (144.6326,80.8543) -- (131.1388,80.8543) -- cycle; + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \end{scope} +\end{tikzpicture}}} + +\newcommand{\cbno}[1]{% +\raisebox{#1pt}{\begin{tikzpicture}[ + y=0.80pt, + x=0.80pt, + yscale=-1.000000, + xscale=1.000000, + inner sep=0pt, + outer sep=0pt, + scale=.11 +] + \begin{scope}[ + shift={(-23.18884,-26.87932)} + ] + \path[line width=0.212pt, fill=warningcolour] (131.1388,134.8293) -- (36.6826,134.8293) -- + (36.6826,40.3731) -- (104.1513,40.3731) -- (104.1513,26.8793) -- + (36.6826,26.8793) .. controls (29.2610,26.8793) and (23.1888,32.9515) .. + (23.1888,40.3731) -- (23.1888,134.8293) .. controls (23.1888,142.2509) and + (29.2610,148.3231) .. (36.6826,148.3231) -- (131.1388,148.3231) .. controls + (138.5604,148.3231) and (144.6326,142.2509) .. (144.6326,134.8293) -- + (144.6326,80.8543) -- (131.1388,80.8543) -- cycle; + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(23.18884,26.87932)}} + ] + \end{scope} + \end{scope} +\end{tikzpicture}}} + +\newcommand{\uierror}[1]{% +\begin{tikzpicture}[ + y=0.80pt, + x=0.80pt, + yscale=-1.000000, + xscale=1.000000, + inner sep=0pt, + outer sep=0pt, + scale=2.5 +] + \begin{scope}[shift={(-8.53676,-270.7608)}] + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(8.53458,270.7608)}} + ] + \path [fill=#1] + (46.1330,20.6880) .. controls (45.3520,19.9070) and (44.0860,19.9070) .. + (43.3050,20.6880) -- (33.4060,30.5870) -- (23.5060,20.6880) .. controls + (22.7250,19.9070) and (21.4590,19.9070) .. (20.6780,20.6880) .. controls + (19.8970,21.4690) and (19.8970,22.7350) .. (20.6780,23.5160) -- + (30.5780,33.4150) -- (20.6780,43.3140) .. controls (19.8970,44.0950) and + (19.8970,45.3610) .. (20.6780,46.1420) .. controls (21.0690,46.5330) and + (21.5800,46.7280) .. (22.0920,46.7280) .. controls (22.6040,46.7280) and + (23.1150,46.5330) .. (23.5060,46.1420) -- (33.4060,36.2430) -- + (43.3050,46.1420) .. controls (43.6960,46.5330) and (44.2070,46.7280) .. + (44.7190,46.7280) .. controls (45.2310,46.7280) and (45.7420,46.5330) .. + (46.1330,46.1420) .. controls (46.9140,45.3610) and (46.9140,44.0950) .. + (46.1330,43.3140) -- (36.2340,33.4150) -- (46.1330,23.5160) .. controls + (46.9140,22.7350) and (46.9140,21.4680) .. (46.1330,20.6880) -- cycle; + \path [fill=#1] + (57.1070,9.8000) .. controls (50.7880,3.4810) and (42.3860,0.0000) .. + (33.4490,0.0000) .. controls (24.5120,0.0000) and (16.1120,3.4800) .. + (9.7920,9.8000) .. controls (-3.2530,22.8450) and (-3.2530,44.0710) .. + (9.7920,57.1150) .. controls (16.1100,63.4340) and (24.5130,66.9150) .. + (33.4490,66.9150) .. controls (42.3870,66.9150) and (50.7890,63.4350) .. + (57.1080,57.1150) .. controls (63.4270,50.7970) and (66.9070,42.3940) .. + (66.9070,33.4570) .. controls (66.9060,24.5210) and (63.4260,16.1190) .. + (57.1070,9.8000) -- cycle(54.2810,54.2870) .. controls (48.7170,59.8500) and + (41.3190,62.9150) .. (33.4500,62.9150) .. controls (25.5820,62.9150) and + (18.1840,59.8510) .. (12.6210,54.2870) .. controls (1.1360,42.8020) and + (1.1360,24.1130) .. (12.6210,12.6280) .. controls (18.1850,7.0640) and + (25.5810,4.0000) .. (33.4490,4.0000) .. controls (41.3170,4.0000) and + (48.7150,7.0640) .. (54.2780,12.6270) .. controls (59.8410,18.1900) and + (62.9060,25.5880) .. (62.9070,33.4570) .. controls (62.9070,41.3260) and + (59.8440,48.7240) .. (54.2810,54.2870) -- cycle; + \end{scope} + \end{scope} +\end{tikzpicture}} + +\newcommand{\uiwarning}[1]{% +\begin{tikzpicture}[ + y=0.80pt, + x=0.80pt, + yscale=-1.000000, + xscale=1.000000, + inner sep=0pt, + outer sep=0pt, + scale=2.55 +] + \begin{scope}[ + shift={(-8.53676,-270.7608)} + ] + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(8.78795,271.01414)}} + ] + \path [fill=#1] + (32.5000,65.0000) .. controls (50.4200,65.0000) and (65.0000,50.4210) .. + (65.0000,32.5000) .. controls (65.0000,14.5790) and (50.4200,0.0000) .. + (32.5000,0.0000) .. controls (14.5800,0.0000) and (0.0000,14.5790) .. + (0.0000,32.5000) .. controls (0.0000,50.4210) and (14.5800,65.0000) .. + (32.5000,65.0000) -- cycle(32.5000,4.0000) .. controls (48.2150,4.0000) and + (61.0000,16.7850) .. (61.0000,32.5000) .. controls (61.0000,48.2150) and + (48.2150,61.0000) .. (32.5000,61.0000) .. controls (16.7850,61.0000) and + (4.0000,48.2150) .. (4.0000,32.5000) .. controls (4.0000,16.7850) and + (16.7850,4.0000) .. (32.5000,4.0000) -- cycle; + \path [fill=#1] (33.0180,43.6550) circle (0.0944cm); + \path [fill=#1] + (32.3320,35.3420) .. controls (33.4360,35.3420) and (34.3320,34.4460) .. + (34.3320,33.3420) -- (34.3320,16.3420) .. controls (34.3320,15.2380) and + (33.4360,14.3420) .. (32.3320,14.3420) .. controls (31.2280,14.3420) and + (30.3320,15.2380) .. (30.3320,16.3420) -- (30.3320,33.3420) .. controls + (30.3320,34.4460) and (31.2280,35.3420) .. (32.3320,35.3420) -- cycle; + \end{scope} + \end{scope} +\end{tikzpicture}} + +\newcommand{\uiinfo}[1]{% +\begin{tikzpicture}[ + y=0.80pt, + x=0.80pt, + yscale=-1.000000, + xscale=1.000000, + inner sep=0pt, + outer sep=0pt, + scale=2.55] + \begin{scope}[ + shift={(-8.53676,-270.7608)} + ] + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(8.78795,271.01414)}} + ] + \path [fill=#1] + (32.5000,0.0000) .. controls (14.5800,0.0000) and (0.0000,14.5790) .. + (0.0000,32.5000) .. controls (0.0000,50.4210) and (14.5800,65.0000) .. + (32.5000,65.0000) .. controls (50.4200,65.0000) and (65.0000,50.4210) .. + (65.0000,32.5000) .. controls (65.0000,14.5790) and (50.4200,0.0000) .. + (32.5000,0.0000) -- cycle(32.5000,61.0000) .. controls (16.7850,61.0000) and + (4.0000,48.2150) .. (4.0000,32.5000) .. controls (4.0000,16.7850) and + (16.7850,4.0000) .. (32.5000,4.0000) .. controls (48.2150,4.0000) and + (61.0000,16.7850) .. (61.0000,32.5000) .. controls (61.0000,48.2150) and + (48.2150,61.0000) .. (32.5000,61.0000) -- cycle; + \path [fill=#1] (33.0180,19.5410) circle (0.0944cm); + \path [fill=#1] + (32.1370,28.3420) .. controls (31.0330,28.3420) and (30.1370,29.2380) .. + (30.1370,30.3420) -- (30.1370,47.3420) .. controls (30.1370,48.4460) and + (31.0330,49.3420) .. (32.1370,49.3420) .. controls (33.2410,49.3420) and + (34.1370,48.4460) .. (34.1370,47.3420) -- (34.1370,30.3420) .. controls + (34.1370,29.2370) and (33.2410,28.3420) .. (32.1370,28.3420) -- cycle; + \end{scope} + \end{scope} +\end{tikzpicture}} + +\newcommand{\uiplain}[1]{% +\begin{tikzpicture}[ + y=0.80pt, + x=0.80pt, + yscale=-1.000000, + xscale=1.000000, + inner sep=0pt, + outer sep=0pt, + scale=2.55] + \begin{scope}[ + shift={(-8.53676,-270.7608)} + ] + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(8.78795,271.01414)}} + ] + \path [fill=#1] + (32.5000,65.0000) .. controls (50.4200,65.0000) and (65.0000,50.4210) .. + (65.0000,32.5000) .. controls (65.0000,14.5790) and (50.4200,0.0000) .. + (32.5000,0.0000) .. controls (14.5800,0.0000) and (0.0000,14.5790) .. + (0.0000,32.5000) .. controls (0.0000,50.4210) and (14.5800,65.0000) .. + (32.5000,65.0000) -- cycle(32.5000,4.0000) .. controls (48.2150,4.0000) and + (61.0000,16.7850) .. (61.0000,32.5000) .. controls (61.0000,48.2150) and + (48.2150,61.0000) .. (32.5000,61.0000) .. controls (16.7850,61.0000) and + (4.0000,48.2150) .. (4.0000,32.5000) .. controls (4.0000,16.7850) and + (16.7850,4.0000) .. (32.5000,4.0000) -- cycle; + \end{scope} + \begin{scope}[cm={{0.26458,0.0,0.0,0.26458,(8.78795,271.01414)}}] + \end{scope} + \begin{scope}[cm={{0.26458,0.0,0.0,0.26458,(8.78795,271.01414)}}] + \end{scope} + \begin{scope}[cm={{0.26458,0.0,0.0,0.26458,(8.78795,271.01414)}}] + \end{scope} + \begin{scope}[cm={{0.26458,0.0,0.0,0.26458,(8.78795,271.01414)}}] + \end{scope} + \begin{scope}[cm={{0.26458,0.0,0.0,0.26458,(8.78795,271.01414)}}] + \end{scope} + \begin{scope}[cm={{0.26458,0.0,0.0,0.26458,(8.78795,271.01414)}}] + \end{scope} + \begin{scope}[cm={{0.26458,0.0,0.0,0.26458,(8.78795,271.01414)}}] + \end{scope} + \begin{scope}[cm={{0.26458,0.0,0.0,0.26458,(8.78795,271.01414)}}] + \end{scope} + \begin{scope}[cm={{0.26458,0.0,0.0,0.26458,(8.78795,271.01414)}}] + \end{scope} + \begin{scope}[cm={{0.26458,0.0,0.0,0.26458,(8.78795,271.01414)}}] + \end{scope} + \begin{scope}[cm={{0.26458,0.0,0.0,0.26458,(8.78795,271.01414)}}] + \end{scope} + \begin{scope}[cm={{0.26458,0.0,0.0,0.26458,(8.78795,271.01414)}}] + \end{scope} + \begin{scope}[cm={{0.26458,0.0,0.0,0.26458,(8.78795,271.01414)}}] + \end{scope} + \begin{scope}[cm={{0.26458,0.0,0.0,0.26458,(8.78795,271.01414)}}] + \end{scope} + \begin{scope}[cm={{0.26458,0.0,0.0,0.26458,(8.78795,271.01414)}}] + \end{scope} + \end{scope} +\end{tikzpicture}} + +\newcommand{\uiquestion}[1]{% +\begin{tikzpicture}[ + y=0.80pt, + x=0.80pt, + yscale=-1.000000, + xscale=1.000000, + inner sep=0pt, + outer sep=0pt, + scale=2.55 +] + \begin{scope}[ + shift={(-8.53676,-270.7608)} + ] + \begin{scope}[ + cm={{0.26458,0.0,0.0,0.26458,(8.78795,271.01414)}} + ] + \path [fill=#1] + (32.5000,0.0000) .. controls (14.5790,0.0000) and (0.0000,14.5790) .. + (0.0000,32.5000) .. controls (0.0000,50.4210) and (14.5790,65.0000) .. + (32.5000,65.0000) .. controls (50.4210,65.0000) and (65.0000,50.4210) .. + (65.0000,32.5000) .. controls (65.0000,14.5790) and (50.4210,0.0000) .. + (32.5000,0.0000) -- cycle(32.5000,61.0000) .. controls (16.7850,61.0000) and + (4.0000,48.2150) .. (4.0000,32.5000) .. controls (4.0000,16.7850) and + (16.7850,4.0000) .. (32.5000,4.0000) .. controls (48.2150,4.0000) and + (61.0000,16.7850) .. (61.0000,32.5000) .. controls (61.0000,48.2150) and + (48.2150,61.0000) .. (32.5000,61.0000) -- cycle; + \path [fill=#1] (33.0170,49.5410) circle (0.0944cm); + \path [fill=#1] + (32.3850,12.7890) .. controls (29.3180,12.7890) and (26.3630,14.0890) .. + (24.0650,16.4490) .. controls (23.2940,17.2410) and (23.3110,18.5070) .. + (24.1020,19.2770) .. controls (24.8930,20.0480) and (26.1610,20.0310) .. + (26.9300,19.2400) .. controls (28.4690,17.6590) and (30.4070,16.7890) .. + (32.3850,16.7890) .. controls (36.7110,16.7890) and (40.2310,20.2300) .. + (40.2310,24.4600) .. controls (40.2310,28.5450) and (36.4230,32.1280) .. + (32.3690,32.1280) .. controls (31.2650,32.1280) and (30.1190,33.0240) .. + (30.1190,34.1280) -- (30.1190,41.3420) .. controls (30.1190,42.4460) and + (31.0150,43.3420) .. (32.1190,43.3420) .. controls (33.2230,43.3420) and + (34.1190,42.4460) .. (34.1190,41.3420) -- (34.1190,35.9460) .. controls + (40.1190,34.9620) and (43.9810,30.1010) .. (43.9810,24.4600) .. controls + (43.9800,18.0240) and (38.9170,12.7890) .. (32.3850,12.7890) -- cycle; + \end{scope} + \end{scope} +\end{tikzpicture}} + +\newcommand{\uimethod}[1]{\begin{minipage}{1\textwidth} +\vspace*{.5em} +\hspace{1em}\includegraphics[scale=1.9]{figures/#1.pdf} +\vspace{.5em} +\end{minipage}} + +\newcommand{\rulebox}[2]{\rbox{#1}% +\hfill{\normalfont\em#2}} +\newcommand{\rpbox}[2]{\abox{#1}\hfill% +{\normalfont\itshape default:} \rbox[cyan]{#2}} +\newcommand{\rpsbox}[1]{\abox{#1}~% +\rbox[araracolour]{S}} + +\newcommand{\povalue}[1]{\rbox[cyan]{#1}} +\newcommand{\rqbox}{\rbox[araracolour]{R}} + +\newcommand{\fpemail}[1]{% +\begin{tikzpicture}[ + y=0.80pt, + x=0.80pt, + yscale=-1.000000, + xscale=1.000000, + inner sep=0pt, + outer sep=0pt, + scale=#1] +\begin{scope}[shift={(-45.96191,-71.72619)}] + \path[cm={{0.26458,0.0,0.0,0.26458,(45.96191,71.72619)}},fill=araracolour,line + width=0.800pt] (138.0000,0.0000) .. controls (61.8000,0.0000) and + (0.0000,61.8000) .. (0.0000,138.0000) -- (0.0000,374.0000) .. controls + (0.0000,450.2000) and (61.8000,512.0000) .. (138.0000,512.0000) -- + (374.0000,512.0000) .. controls (450.2000,512.0000) and (512.0000,450.2000) .. + (512.0000,374.0000) -- (512.0000,138.0000) .. controls (512.0000,61.8000) and + (450.2000,0.0000) .. (374.0000,0.0000) -- (138.0000,0.0000) -- + cycle(105.3535,154.1797) -- (406.6426,154.1797) .. controls + (407.1626,154.1797) and (407.6487,154.4501) .. (407.9355,154.8457) -- + (269.4844,269.0977) -- (263.6836,273.8984) .. controls (263.5691,273.9744) and + (263.4561,274.0383) .. (263.3477,274.1094) -- (262.8496,274.4277) .. controls + (261.0136,275.6408) and (258.7436,276.3086) .. (256.4473,276.3086) -- + (256.3828,276.3086) .. controls (253.6418,276.3086) and (251.0365,275.4472) .. + (249.2109,273.9355) -- (104.3555,154.5410) .. controls (104.6316,154.3135) and + (104.9799,154.1797) .. (105.3535,154.1797) -- cycle(103.7441,170.3691) -- + (207.5117,255.9004) -- (103.7441,339.7246) -- (103.7441,170.3691) -- + cycle(408.2559,170.9316) -- (408.2559,339.7695) -- (304.5957,256.4688) -- + (408.2559,170.9316) -- cycle(217.4394,264.0840) -- (241.2070,283.6836) .. + controls (245.3284,287.0581) and (250.7281,288.9160) .. (256.4258,288.9160) .. + controls (262.1020,288.9160) and (267.5064,287.0487) .. (271.6387,283.6582) -- + (294.6582,264.6582) -- (408.2559,355.9316) -- (408.2559,356.2012) .. controls + (408.2559,357.0788) and (407.5127,357.8203) .. (406.6465,357.8203) -- + (105.3750,357.8203) .. controls (104.4923,357.8203) and (103.7441,357.0793) .. + (103.7441,356.2070) -- (103.7441,355.9141) -- (217.4394,264.0840) -- cycle; + \begin{scope}[cm={{0.13993,0.0,0.0,0.13993,(71.62036,95.57808)}},fill=white] + \end{scope} + \begin{scope}[cm={{0.13993,0.0,0.0,0.13993,(71.62036,95.57808)}},fill=white] + \end{scope} + \begin{scope}[cm={{0.13993,0.0,0.0,0.13993,(71.62036,95.57808)}},fill=white] + \end{scope} + \begin{scope}[cm={{0.13993,0.0,0.0,0.13993,(71.62036,95.57808)}},fill=white] + \end{scope} + \begin{scope}[cm={{0.13993,0.0,0.0,0.13993,(71.62036,95.57808)}},fill=white] + \end{scope} + \begin{scope}[cm={{0.13993,0.0,0.0,0.13993,(71.62036,95.57808)}},fill=white] + \end{scope} + \begin{scope}[cm={{0.13993,0.0,0.0,0.13993,(71.62036,95.57808)}},fill=white] + \end{scope} + \begin{scope}[cm={{0.13993,0.0,0.0,0.13993,(71.62036,95.57808)}},fill=white] + \end{scope} + \begin{scope}[cm={{0.13993,0.0,0.0,0.13993,(71.62036,95.57808)}},fill=white] + \end{scope} + \begin{scope}[cm={{0.13993,0.0,0.0,0.13993,(71.62036,95.57808)}},fill=white] + \end{scope} + \begin{scope}[cm={{0.13993,0.0,0.0,0.13993,(71.62036,95.57808)}},fill=white] + \end{scope} + \begin{scope}[cm={{0.13993,0.0,0.0,0.13993,(71.62036,95.57808)}},fill=white] + \end{scope} + \begin{scope}[cm={{0.13993,0.0,0.0,0.13993,(71.62036,95.57808)}},fill=white] + \end{scope} + \begin{scope}[cm={{0.13993,0.0,0.0,0.13993,(71.62036,95.57808)}},fill=white] + \end{scope} + \begin{scope}[cm={{0.13993,0.0,0.0,0.13993,(71.62036,95.57808)}},fill=white] + \end{scope} +\end{scope} +\end{tikzpicture}} + +\newcommand{\fptwitter}[1]{% +\begin{tikzpicture}[ + y=0.80pt, + x=0.80pt, + yscale=-1.000000, + xscale=1.000000, + inner sep=0pt, + outer sep=0pt, + scale=#1] +\begin{scope}[shift={(-45.96191,-71.72619)}] + \path[fill=araracolour,line width=0.212pt] (144.9161,71.7262) -- (82.4744,71.7262) .. + controls (62.3132,71.7262) and (45.9619,88.0774) .. (45.9619,108.2387) -- + (45.9619,170.6804) .. controls (45.9619,190.8416) and (62.3132,207.1929) .. + (82.4744,207.1929) -- (144.9161,207.1929) .. controls (165.0773,207.1929) and + (181.4286,190.8416) .. (181.4286,170.6804) -- (181.4286,108.2387) .. controls + (181.4286,88.0774) and (165.0773,71.7262) .. (144.9161,71.7262) -- + cycle(146.6623,124.7222) -- (146.7152,126.7066) .. controls + (146.7152,147.0795) and (131.2106,170.5745) .. (102.8473,170.5745) .. controls + (94.1425,170.5745) and (86.0463,168.0081) .. (79.2200,163.6424) .. controls + (80.4371,163.7747) and (81.6542,163.8541) .. (82.8977,163.8541) .. controls + (90.1208,163.8541) and (96.7883,161.3935) .. (102.0536,157.2660) .. controls + (95.3067,157.1337) and (89.6181,152.6622) .. (87.6602,146.5504) .. controls + (88.6127,146.7356) and (89.5652,146.8414) .. (90.5706,146.8414) .. controls + (91.9994,146.8414) and (93.3091,146.6562) .. (94.6055,146.3122) .. controls + (87.5676,144.9099) and (82.2098,138.6658) .. (82.2098,131.2045) -- + (82.2098,131.0193) .. controls (84.3265,132.1835) and (86.7209,132.8714) .. + (89.2345,132.9508) .. controls (85.1070,130.1991) and (82.4016,125.4631) .. + (82.4016,120.1185) .. controls (82.4016,117.2874) and (83.1787,114.6416) .. + (84.5016,112.3662) .. controls (92.0952,121.7060) and (103.4773,127.8443) .. + (116.2831,128.4793) .. controls (116.0185,127.3416) and (115.8886,126.1774) .. + (115.8886,124.9604) .. controls (115.8886,116.4408) and (122.7956,109.5351) .. + (131.3151,109.5351) .. controls (135.7337,109.5351) and (139.7559,111.4137) .. + (142.5605,114.4035) .. controls (146.0794,113.7156) and (149.3605,112.4456) .. + (152.3503,110.6729) .. controls (151.1861,114.2712) and (148.7522,117.2874) .. + (145.5772,119.1924) .. controls (148.6993,118.8220) and (151.6627,117.9754) .. + (154.4408,116.7583) .. controls (152.3773,119.8539) and (149.7579,122.5791) .. + (146.6623,124.7222) -- cycle; +\end{scope} +\end{tikzpicture}} + +\newcommand{\fpgithub}[1]{% +\begin{tikzpicture}[ + y=0.80pt, + x=0.80pt, + yscale=-1.000000, + xscale=1.000000, + inner sep=0pt, + outer sep=0pt, + scale=#1] +\begin{scope}[shift={(69.24524,-3.99286)}] + \path[fill=araracolour,line width=0.212pt] (29.7089,3.9929) -- (-32.7327,3.9929) .. + controls (-52.8940,3.9929) and (-69.2452,20.3441) .. (-69.2452,40.5054) -- + (-69.2452,102.9470) .. controls (-69.2452,123.1083) and (-52.8940,139.4595) .. + (-32.7327,139.4595) -- (29.7089,139.4595) .. controls (49.8702,139.4595) and + (66.2214,123.1083) .. (66.2214,102.9470) -- (66.2214,40.5054) .. controls + (66.2214,20.3441) and (49.8702,3.9929) .. (29.7089,3.9929) -- + cycle(32.5929,74.8218) .. controls (32.3283,81.0660) and (31.0583,86.9397) .. + (27.0102,91.9404) .. controls (24.2056,95.3799) and (20.5808,97.5760) .. + (16.4004,98.9518) .. controls (12.2200,100.3012) and (7.9073,100.6981) .. + (3.5416,100.6716) .. controls (-0.8240,100.6451) and (-5.1632,100.7774) .. + (-9.5288,100.6187) .. controls (-14.3707,100.4600) and (-19.0802,99.5604) .. + (-23.4194,97.2850) .. controls (-28.6846,94.5068) and (-32.2036,90.2206) .. + (-34.0027,84.5320) .. controls (-35.1934,80.8279) and (-35.7225,77.0443) .. + (-35.6432,73.1550) .. controls (-35.5638,68.6041) and (-34.2938,64.4502) .. + (-31.4892,60.8518) .. controls (-30.6690,59.7670) and (-30.2457,58.8410) .. + (-30.3515,57.3064) .. controls (-30.5367,54.8723) and (-30.1663,52.3587) .. + (-29.7694,49.9245) .. controls (-29.4254,47.8873) and (-28.7640,45.9029) .. + (-28.1819,43.8920) .. controls (-28.1290,43.6804) and (-28.0232,43.4687) .. + (-27.8909,43.2835) .. controls (-27.7057,42.9660) and (-26.8854,42.8602) .. + (-26.0917,43.0718) .. controls (-20.8265,44.4741) and (-16.1434,46.9612) .. + (-11.6454,49.8716) .. controls (-11.1957,50.1627) and (-10.4813,50.2685) .. + (-9.9257,50.1627) .. controls (-5.9834,49.4748) and (-2.0411,49.3689) .. + (1.9277,49.5541) .. controls (3.5416,49.6335) and (5.1027,50.0304) .. + (6.7166,50.1362) .. controls (7.4046,50.1891) and (8.1983,50.0568) .. + (8.7539,49.7129) .. controls (12.8814,47.1200) and (17.1941,44.8975) .. + (21.8243,43.3629) .. controls (22.2477,43.2041) and (22.7239,43.0983) .. + (23.2266,42.9925) .. controls (24.0204,42.8337) and (24.8671,43.3100) .. + (25.1581,44.0773) .. controls (25.5285,45.0827) and (25.9254,46.1145) .. + (26.1106,47.1993) .. controls (26.6662,50.3214) and (27.3541,53.4964) .. + (27.3012,56.6185) .. controls (27.2748,58.7087) and (27.9098,60.0581) .. + (29.0210,61.6720) .. controls (31.8256,65.5879) and (32.8046,70.0593) .. + (32.5929,74.8218) -- cycle; + \path[fill=araracolour,line width=0.212pt] (17.7233,72.0172) .. controls + (15.7918,71.1441) and (13.5164,70.7472) .. (11.3733,70.6149) .. controls + (9.0185,70.4826) and (6.6108,71.0383) .. (4.2296,71.0118) .. controls + (-0.9827,70.9589) and (-6.1950,70.6943) .. (-11.4073,70.6414) .. controls + (-13.4975,70.6149) and (-15.5613,70.8795) .. (-17.6250,71.0118) .. controls + (-19.5036,71.1176) and (-21.0911,71.8849) .. (-22.5198,73.1020) .. controls + (-28.1025,77.8381) and (-27.2559,86.5164) .. (-23.8692,91.0672) .. controls + (-21.7525,93.9247) and (-18.7098,95.2476) .. (-15.3761,96.0414) .. controls + (-10.8517,97.1262) and (-6.2744,97.4172) .. (-1.6177,97.2056) .. controls + (3.0918,97.4172) and (7.7750,97.1526) .. (12.3787,96.0414) .. controls + (14.7335,95.4858) and (17.0089,94.7185) .. (18.8875,93.1045) .. controls + (22.9885,89.5591) and (24.0468,84.9289) .. (23.2531,79.7960) .. controls + (22.7239,76.3829) and (20.9777,73.4460) .. (17.7233,72.0172) -- + cycle(-13.3388,89.8237) .. controls (-16.0859,89.8237) and (-18.3129,86.8503) + .. (-18.3129,83.1826) .. controls (-18.3129,79.5150) and (-16.0859,76.5416) .. + (-13.3388,76.5416) .. controls (-10.5916,76.5416) and (-8.3646,79.5150) .. + (-8.3646,83.1826) .. controls (-8.3646,86.8503) and (-10.5916,89.8237) .. + (-13.3388,89.8237) -- cycle(10.3943,89.8237) .. controls (7.6472,89.8237) and + (5.4202,86.8503) .. (5.4202,83.1826) .. controls (5.4202,79.5150) and + (7.6472,76.5416) .. (10.3943,76.5416) .. controls (13.1415,76.5416) and + (15.3685,79.5150) .. (15.3685,83.1826) .. controls (15.3685,86.8503) and + (13.1415,89.8237) .. (10.3943,89.8237) -- cycle; +\end{scope} \end{tikzpicture}} -% -------------------------------------------------
\ No newline at end of file diff --git a/Master/texmf-dist/doc/support/arara/arararc.yaml b/Master/texmf-dist/doc/support/arara/arararc.yaml new file mode 100644 index 00000000000..ad3389c9c9b --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/arararc.yaml @@ -0,0 +1,4 @@ +!config +paths: +- 'rules/' +header: true diff --git a/Master/texmf-dist/doc/support/arara/chapters/building.tex b/Master/texmf-dist/doc/support/arara/chapters/building.tex new file mode 100644 index 00000000000..8400a433dcd --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/chapters/building.tex @@ -0,0 +1,155 @@ +% !TeX root = ../arara-manual.tex +\chapter{Building from source} +\label{chap:buildingfromsource} + +\arara\ is a Java application licensed under the \href{http://www.opensource.org/licenses/bsd-license.php}{New BSD License}, a verified GPL-compatible free software license, and the source code is available in the project repository at \href{https://github.com/cereda/arara}{GitHub}. This chapter provides detailed instructions on how to build our tool from source. + +\section{Requirements} +\label{sec:requirements} + +In order to build our tool from source, we need to ensure that our development environment has the minimum requirements for a proper compilation. Make sure the following items are available: + +\begin{itemize}[label={\cbyes{-2}}] +\item On account of our project being hosted at \href{https://github.com}{GitHub}, an online source code repository, we highly recommend the installation of \rbox{git}, a version control system for tracking changes in computer files and coordinating work on those files among multiple people. Alternatively, you can directly obtain the source code by requesting a \href{https://github.com/cereda/arara/archive/master.zip}{source code download} in the repository. In order to check if \rbox{git} is available in your operating system, run the following command in the terminal (version numbers might vary): + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ git --version +git version 2.17.1 +\end{codebox} + +Please refer to the \rbox{git} \href{https://git-scm.com/}{project website} in order to obtain specific installation instructions for your operating system. In general, most recent Unix systems have \rbox{git} installed out of the shelf. + +\item Our tool is written in the Java programming language, so we need a proper Java Development Kit, a collection of programming tools for the Java platform. Our source code is known to be compliant with several vendors, including Oracle, OpenJDK, and Azul Systems. In order to check if your operating system has the proper tools, run the following command in the terminal (version numbers might vary): + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ javac -version +javac 1.8.0_171 +\end{codebox} + +The previous command, as the name suggests, refers to the \rbox{javac} tool, which is the Java compiler itself. The most common Java Development Kit out there is from \href{http://www.oracle.com/technetwork/java/javase/downloads/index.html}{Oracle}. However, several Linux distributions (as well as some developers, yours truly included) favour the OpenJDK vendor, so your mileage may vary. Please refer to the corresponding website of the vendor of your choice in order to obtain specific installation instructions for your operating system. + +\item As a means to provide a straightforward and simplified compilation workflow, \arara\ relies on Apache Maven, a software project management and comprehension tool. Based on the concept of a project object model, Maven can manage builds, reporting and documentation from a central piece of information. In order to check if \rbox{mvn}, the Maven binary, is available in your operating system, run the following command in the terminal (version numbers might vary): + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ mvn --version +Apache Maven 3.5.2 (Red Hat 3.5.2-5) +Maven home: /usr/share/maven +Java version: 1.8.0_171, vendor: Oracle Corporation +Java home: /usr/lib/jvm/java-1.8.0-openjdk- + 1.8.0.171-4.b10.fc28.x86_64/jre +Default locale: pt_BR, platform encoding: UTF-8 +OS name: "linux", version: "4.16.16-300.fc28.x86_64", + arch: "amd64", family: "unix" +\end{codebox} + +Please refer to the Maven \href{https://maven.apache.org/}{project website} in order to obtain specific installation instructions for your operating system. In general, most recent Linux distributions have the Maven binary, as well the proper associated dependencies, available in their corresponding repositories. + +\item For a proper repository cloning, as well as the first Maven build, an active Internet connection is required. In particular, Maven dynamically downloads Java libraries and plug-ins from one or more online repositories and stores them in a local cache. Be mindful that subsequent builds can occur offline, provided that the local Maven cache exists. +\end{itemize} + +\arara\ can be easily built from source, provided that the aforementioned requirements are available. The next section presents the compilation details, from repository cloning to a proper Java archive generation. + +\begin{messagebox}{One tool to rule them all}{araracolour}{\icok}{white} +\setlength{\parskip}{1em} +For the brave, there is the \href{https://sdkman.io/}{Software Development Kit Manager}, an interesting tool for managing parallel versions of multiple software development kits on most Unix based systems. In particular, this tool provides off the shelf support for several Java Development Kit vendors and versions, as well as most recent versions Apache Maven. + +Personally, I prefer the packaged versions provided by my favourite Linux distribution (Fedora), but this tool is a very interesting alternative to set up a development environment with little to no effort. +\end{messagebox} + +\section{Compiling the tool} +\label{sec:compilingthetool} + +First and foremost, we need to clone the project repository into our development environment, so we can build our tool from source. The cloning will create a directory named \abox[araracolour]{arara/} within the current working directory, so remember to first ensure that you are in the appropriate directory. For example: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ mkdir git-projects +$ cd git-projects +\end{codebox} + +Run the following command in the terminal to clone the \arara\ project: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ git clone https://github.com/cereda/arara +\end{codebox} + +Wait a couple of seconds (or minutes, depending on your Internet connection) while the previous command clones the project repository hosted at GitHub. Be mindful that this operation pulls down every version of every file for the history of the project. Fortunately, the version control system has the notion of a \emph{shallow clone}, which is a more succinctly meaningful way of describing a local repository with history truncated to a particular depth during the clone operation. If you want to get only the latest revision of everything in our repository, run the following command in the terminal: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ git clone https://github.com/cereda/arara --depth 1 +\end{codebox} + +This operation is way faster than the previous one, for obvious reasons. Unix terminals typically start at \abox[araracolour]{USER\_HOME} as working directory, so, if you did not \rbox{cd} to another directory (as in the earlier example), the newly cloned \abox[araracolour]{arara/} directory is almost certain to be accessible from that level. Now, we need to navigate to a directory named \abox[araracolour]{application/} inside our project structure, where the source code and the corresponding build file are located. Run the following command in the terminal: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ cd arara/application +\end{codebox} + +The previous command should take us inside the \abox[araracolour]{application/} directory of our project, where the source code and the corresponding build file are located. Let us make sure we are in the correct location by running the following command in the terminal: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ ls +pom.xml src +\end{codebox} + +Great, we are in the correct location! From the previous output, let us inspect the directory contents. The \abox[araracolour]{src/} directory, as the name suggests, contains the source code organized in an established package structure, whereas \rbox{pom.xml} is the corresponding build file written in the Project Object Model format, a special XML file that contains information about the project and configuration details used by Apache Maven to build the project. In order to build our tool, run the following command in the terminal: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ mvn compile assembly:single +\end{codebox} + +Apache Maven is based around the central concept of a build life cycle. The \rbox{compile} phase, as the name suggests, compiles the source code of the project using the underlying Java compiler. From the previous command, bound to this particular build phase, note that there is an \rbox{assembly:single} plug-in goal which aggregates the project output along with its dependencies and other files into a single distributable archive. An \emph{assembly} is a group of files, directories and dependencies that are assembled into an archive format and distributed. In our case, the resulting file will be a typical Java archive file, with the \rbox{jar} extension. The first Maven build will take a couple of seconds (or minutes, depending on your Internet connection), as the tool will download all dependencies and required plug-ins for proper compilation and packaging. Subsequent builds will be significantly faster. Finally, after some time, Maven will output the following message as result (please note that the entire compilation and packaging only took 10 seconds on my development machine due to an existing local cache): + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +[INFO] --------------------------------------------------------- +[INFO] BUILD SUCCESS +[INFO] --------------------------------------------------------- +[INFO] Total time: 10.371 s +[INFO] Finished at: 2018-06-22T18:38:02-03:00 +[INFO] Final Memory: 39M/184M +[INFO] --------------------------------------------------------- +\end{codebox} + +On account of a successful build in our previous interaction, there is now a newly created \abox[araracolour]{target/} directory containing compiled classes, a established package structure and, at last but not least, our assembly. Now, let us move the resulting Java archive file from that particular directory to \abox[araracolour]{application/} which is our current directory. It is important to note that the aforementioned assembly plug-in adds the \rbox{jar-with-dependencies} reference to the file name in order to differentiate a proper assembly from a typical Java archive file. Run the following command in the terminal (please note that the Java archive file was also renamed during the move operation): + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ mv target/arara-4.0-jar-with-dependencies.jar arara.jar +\end{codebox} + +Now, our current directory contains the final \rbox{arara.jar} Java archive file properly built from source. This file can be safely distributed and deployed, as seen later on, in Chapter~\ref{chap:deployingthetool}, on page~\pageref{chap:deployingthetool}. You can also test the resulting file by running the following command in the terminal: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ java -jar arara.jar + __ _ _ __ __ _ _ __ __ _ + / _` | '__/ _` | '__/ _` | +| (_| | | | (_| | | | (_| | + \__,_|_| \__,_|_| \__,_| + +arara 4.0 (revision 1) +Copyright (c) 2012-2018, Paulo Roberto Massa Cereda +All rights reserved + +usage: arara [file [--dry-run] [--log] [--verbose | --silent] + [--timeout N] [--max-loops N] [--language L] + [ --preamble P ] [--header] | --help | --version] + -h,--help print the help message + -H,--header extract directives only in the file header + -l,--log generate a log output + -L,--language <code> set the application language + -m,--max-loops <number> set the maximum number of loops + -n,--dry-run go through all the motions of running a + command, but with no actual calls + -p,--preamble <name> set the file preamble based on the + configuration file + -s,--silent hide the command output + -t,--timeout <number> set the execution timeout (in milliseconds) + -V,--version print the application version + -v,--verbose print the command output +\end{codebox} + +The following optional Maven phase is used to handle the project cleaning, including the complete removal of the \abox[araracolour]{target/} directory. As a result, the project is then restored to the initial state without any generated Java bytecode. Run the following command in the terminal: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ mvn clean +\end{codebox} + +This section covered the compilation details for building \arara\ from source. The aforementioned steps are straightforward and can be automated in order to generate snapshots and daily builds. If you run into any issue, please let us know. Happy compilation! diff --git a/Master/texmf-dist/doc/support/arara/chapters/cli.tex b/Master/texmf-dist/doc/support/arara/chapters/cli.tex new file mode 100644 index 00000000000..ddf318bc67e --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/chapters/cli.tex @@ -0,0 +1,407 @@ +% !TeX root = ../arara-manual.tex +\chapter{Command line} +\label{chap:commandline} + +\arara\ is a command line tool. It can be used in a plethora of command interpreter implementations, from bash to a Windows prompt, provided that the Java runtime environment is accessible within the current session. This chapter covers the user interface design, as well as options (also known as flags or switches) that modify the underlying application behaviour. + +\section{User interface design} +\label{sec:userinterfacedesign} + +The goal of a user interface design is to make the interaction as simple and efficient as possible. Good user interface design facilitates finishing the task at hand without drawing unnecessary attention to itself. For \arara\ 4.0, we redesigned the interface in order to look more pleasant to the eye, after all, we work with \TeX\ and friends: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} + __ _ _ __ __ _ _ __ __ _ + / _` | '__/ _` | '__/ _` | +| (_| | | | (_| | | | (_| | + \__,_|_| \__,_|_| \__,_| + +Processing 'doc5.tex' (size: 307 bytes, last modified: 05/29/2018 +08:57:30), please wait. + +(PDFLaTeX) PDFLaTeX engine .............................. SUCCESS +(BibTeX) The BibTeX reference management software ....... SUCCESS +(PDFLaTeX) PDFLaTeX engine .............................. SUCCESS +(PDFLaTeX) PDFLaTeX engine .............................. SUCCESS + +Total: 1.45 seconds +\end{codebox} + +First of all, we have the nice application logo, displayed using ASCII art. The entire layout is based on monospaced font spacing, usually used in terminal prompts. Hopefully you follow the conventional use of a monospaced font in your terminal, otherwise the visual effect will not be so pleasant. First and foremost, \arara\ displays details about the file being processed, including size and modification status: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +Processing 'doc5.tex' (size: 307 bytes, last modified: 05/29/2018 +08:57:30), please wait. +\end{codebox} + +The list of tasks was also redesigned to be fully justified, and each entry displays both task and subtask names (the former being displayed enclosed in parentheses), besides of course the usual execution result: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +(PDFLaTeX) PDFLaTeX engine .............................. SUCCESS +(BibTeX) The BibTeX reference management software ....... SUCCESS +(PDFLaTeX) PDFLaTeX engine .............................. SUCCESS +(PDFLaTeX) PDFLaTeX engine .............................. SUCCESS +\end{codebox} + +As previously mentioned in Section~\ref{sec:rule}, on page~\pageref{sec:rule}, if a task fails, \arara\ will halt the entire execution at once and immediately report back to the user. This is an example of how a failed task looks like: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +(PDFLaTeX) PDFLaTeX engine .............................. FAILURE +\end{codebox} + +Also, observe that our tool displays the execution time before terminating, in seconds. The execution time has a very simple precision, as it is meant to be easily readable, and should not be considered for command profiling. + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +Total: 1.45 seconds +\end{codebox} + +The tool has two execution modes: \emph{silent}, which is the default, and \emph{verbose}, which prints as much information about tasks as possible. When in silent mode, \arara\ will simply display the task and subtask names, as well as the execution result. Nothing more is added to the output. For instance: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +(BibTeX) The BibTeX reference management software ....... SUCCESS +\end{codebox} + +When executed in verbose mode, \arara\ will display the underlying system command output as well, when applied. In version 4.0 of our tool, this mode was also entirely redesigned in order to avoid unnecessary clutter, so it would be easier to spot each task. For instance: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +----------------------------------------------------------------- +(BibTeX) The BibTeX reference management software +----------------------------------------------------------------- +This is BibTeX, Version 0.99d (TeX Live 2017) +The top-level auxiliary file: doc5.aux +The style file: plain.bst +Database file #1: mybib.bib + +--------------------------------------------------------- SUCCESS +\end{codebox} + +It is important to observe that, when in verbose mode, \arara\ can offer proper interaction if the system command requires user intervention. However, when in silent mode, the tool will simply discard this requirement and the command will almost surely fail. + +\section{Options} +\label{sec:options} + +In order to run \arara\ on your \TeX\ file, the simplest possible way is to provide the file name to the tool in your favourite command interpreter session, provided that the file has at least one directive: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ arara doc6.tex +\end{codebox} + +The tool has a set of command line options (also known as flags or switches) that modify the underlying execution behaviour or enhance the execution workflow. If you do not provide any parameters, \arara\ will display the tool usage and the available options: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ arara + __ _ _ __ __ _ _ __ __ _ + / _` | '__/ _` | '__/ _` | +| (_| | | | (_| | | | (_| | + \__,_|_| \__,_|_| \__,_| + +arara 4.0 (revision 1) +Copyright (c) 2012-2017, Paulo Roberto Massa Cereda +All rights reserved + +usage: arara [file [--dry-run] [--log] [--verbose | --silent] + [--timeout N] [--max-loops N] [--language L] + [ --preamble P ] [--header] | --help | --version] + -h,--help print the help message + -H,--header extract directives only in the file header + -l,--log generate a log output + -L,--language <code> set the application language + -m,--max-loops <number> set the maximum number of loops + -n,--dry-run go through all the motions of running a + command, but with no actual calls + -p,--preamble <name> set the file preamble based on the + configuration file + -s,--silent hide the command output + -t,--timeout <number> set the execution timeout (in milliseconds) + -V,--version print the application version + -v,--verbose print the command output +\end{codebox} + +The available options for our tool are detailed as follows. Each option contains short and long variations, which are denoted by \opbox{o} and \opbox{{-}option} in the command line, respectively. Additionally, when a parameter is required by the current option, it will be denoted by \prbox{parameter} in the description. + +\begin{description} +\item[\describeop{h}{help}] As the name indicates, this option prints the help message containing the tool usage and the list of all available options. The tool exits afterwards. When running \arara\ without any options or a file to be processed, this is the default behaviour. This option has the highest priority over the others. + +\item[\describeop{H}{header}] This option changes the mechanics of how \arara\ extracts the directives from the code. The tool always reads the entire file and extracts every single directive found throughout the code. However, by activating this switch, \arara\ will extract all directives from the beginning of the file until it reaches a line that is not empty and it is not a comment (hence the option name). Consider the following example: + +\begin{ncodebox}{Source file}{teal}{\icnote}{white}{doc7.tex} +% arara: pdftex +Hello world. +\bye + +% arara: pdftex +\end{ncodebox} + +When running \arara\ without this option, two directives will be extracted (the ones found in lines 1 and 5). However, if executed with \opbox{{-}header}, the tool will only extract one directive (from line 1), as it will stop the extraction process as soon as it reaches line 2. This option can also be activated by default in the configuration file (see Section~\ref{sec:basicstructure}, on page~\pageref{sec:basicstructure}). + +\item[\describeop{l}{log}] This option enables the logging feature of our tool. All streams from all system commands will be logged and, at the end of the execution, a consolidated log file named \rbox{arara.log} will be generated. This option can also be activated by default in the configuration file (see Section~\ref{sec:basicstructure}, on page~\pageref{sec:basicstructure}). Refer to Chapter~\ref{chap:logging}, on page~\pageref{chap:logging}, for more details on the logging feature. + +\item[\describeopp{L}{language}{code}] This option sets the language of the current execution of \arara\ according to the language code identified by the \prbox{code} value provided as the parameter. The language code tries to follow the ISO 639 norm, standardized nomenclature used to classify languages. For example, this is our tool speaking Dutch: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ arara -L nl doc5.tex + __ _ _ __ __ _ _ __ __ _ + / _` | '__/ _` | '__/ _` | +| (_| | | | (_| | | | (_| | + \__,_|_| \__,_|_| \__,_| + +Verwerken van 'doc5.tex' (grootte: 307 bytes, laatst gewijzigd: +05/29/2018 11:50:32), een ogenblik geduld. + +(PDFLaTeX) PDFLaTeX engine ............................ SUCCESVOL +(BibTeX) The BibTeX reference management software ..... SUCCESVOL +(PDFLaTeX) PDFLaTeX engine ............................ SUCCESVOL +(PDFLaTeX) PDFLaTeX engine ............................ SUCCESVOL + +Totaal: 1,59 seconden +\end{codebox} + +\begin{messagebox}{Navis volitans mihi anguillis plena est}{araracolour}{\icok}{white} +At time of writing, \arara\ is able to speak English, German, Dutch, Italian and Brazilian Portuguese out of the box. There is also a special dialect named Broad Norfolk, spoken by those living in the county of Norfolk in England. + +\vspace{1em} + +{\centering +\def\arraystretch{1.5} +\setlength\tabcolsep{1em} +\begin{tabular}{lll} +\rbox[araracolour]{\hphantom{x}en\hphantom{x}} English & +\rbox[araracolour]{\hphantom{x}de\hphantom{x}} German & +\rbox[araracolour]{\hphantom{x}qn\hphantom{x}} Broad Norfolk \\ +\rbox[araracolour]{\hphantom{x}it\hphantom{x}} Italian & +\rbox[araracolour]{\hphantom{x}nl\hphantom{x}} Dutch & +\rbox[araracolour]{ptbr} Portuguese (BR) +\end{tabular}\par} + +\vspace{1.4em} + +Would you like to make \arara\ speak your own language? Splendid! We would love to have you in the team! Just send us an electronic mail, join our \href{https://gitter.im/cereda/arara}{dedicated chatroom} or \href{https://github.com/cereda/arara/issues}{open an issue} about it. The localization process is quite straightforward, we can help you. Any language is welcome! +\end{messagebox} + +This option can also be specified in the configuration file (see Section~\ref{sec:basicstructure}, on page~\pageref{sec:basicstructure}). However, one can always override this setting by running the tool with an explicit \opbox{L} option. + +\item[\describeopp{m}{max-loops}{number}] As a means to avoid infinite iterations, \arara\ has a predefined maximum number of loops, with the default set to 10, as a technical solution (seen in Section~\ref{sec:directives}, on page~\pageref{sec:directives}). For instance, consider the following directive: + +\begin{codebox}{A naughty directive}{teal}{\icnote}{white} +% arara: pdftex while true +\end{codebox} + +The \opbox{{-}max-loops} option is used to redefine the maximum number of loops our tool will allow for potentially infinite iterations. Any positive integer can be used as the \prbox{number} value for this option. An execution of the previous directive with a lower maximum number of loops is shown as follows: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ arara -m 2 doc8.tex + __ _ _ __ __ _ _ __ __ _ + / _` | '__/ _` | '__/ _` | +| (_| | | | (_| | | | (_| | + \__,_|_| \__,_|_| \__,_| + +Processing 'doc8.tex' (size: 45 bytes, last modified: 05/29/2018 +12:32:14), please wait. + +(PDFTeX) PDFTeX engine .................................. SUCCESS +(PDFTeX) PDFTeX engine .................................. SUCCESS + +Total: 0.58 seconds +\end{codebox} + +This option can also be specified in the configuration file (see Section~\ref{sec:basicstructure}, on page~\pageref{sec:basicstructure}). However, one can always override this setting by running the tool with an explicit \opbox{m} option. + +\item[\describeop{n}{dry-run}] This option makes \arara\ go through all the motions of running tasks and subtasks, but with no actual calls. It is a very useful feature for testing the sequence of underlying system commands to be performed on a file. For instance, consider the following execution: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ arara -n doc5.tex + __ _ _ __ __ _ _ __ __ _ + / _` | '__/ _` | '__/ _` | +| (_| | | | (_| | | | (_| | + \__,_|_| \__,_|_| \__,_| + +Processing 'doc5.tex' (size: 307 bytes, last modified: 05/29/2018 +11:50:32), please wait. + +[DR] (PDFLaTeX) PDFLaTeX engine +----------------------------------------------------------------- +Authors: Marco Daniel, Paulo Cereda +About to run: [ pdflatex, doc5.tex ] + +[DR] (BibTeX) The BibTeX reference management software +----------------------------------------------------------------- +Authors: Marco Daniel, Paulo Cereda +About to run: [ bibtex, doc5 ] + +[DR] (PDFLaTeX) PDFLaTeX engine +----------------------------------------------------------------- +Authors: Marco Daniel, Paulo Cereda +About to run: [ pdflatex, doc5.tex ] + +[DR] (PDFLaTeX) PDFLaTeX engine +----------------------------------------------------------------- +Authors: Marco Daniel, Paulo Cereda +About to run: [ pdflatex, doc5.tex ] + +Total: 0.27 seconds +\end{codebox} + +Note that the rule authors are displayed (so they can be blamed in case anything goes wrong), as well as the system command to be executed. It is an interesting approach to see everything that will happen to your document and in which order. + +\begin{messagebox}{Conditionals and boolean values}{attentioncolour}{\icattention}{black} +It is very important to observe that conditionals are not evaluated when our tool is executed in the \opbox{{-}dry-run} mode, although they are properly listed. Also, when a rule returns a boolean value, the code is executed regardless of this mode. +\end{messagebox} + +\item[\describeopp{p}{preamble}{name}] Some \TeX\ documents require the same automation steps, e.g, a set of articles. To this end, so as to avoid repeating the same preamble over and over in this specific scenario, \arara\ has the possibility of setting predefined preambles in a special section of the configuration file identified by a unique key for later use. This command line option prepends the predefined preamble referenced by the \prbox{name} key to the current document and then proceeds to extract directives, as usual. For instance: + +\begin{codebox}{Preamble}{teal}{\icnote}{white} +twopdftex: | + % arara: pdftex + % arara: pdftex +\end{codebox} + +\begin{ncodebox}{Source file}{teal}{\icnote}{white}{doc9.tex} +Hello world. +\bye +\end{ncodebox} + +In this example, we have a preamble named \abox{twopdftex} and a \TeX\ file named \rbox{doc9.tex} with no directives. Of course, our tool will complain about missing directives, unless we deliberately inject the two directives from the predefined preamble into the current execution: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ arara -p twopdftex doc9.tex + __ _ _ __ __ _ _ __ __ _ + / _` | '__/ _` | '__/ _` | +| (_| | | | (_| | | | (_| | + \__,_|_| \__,_|_| \__,_| + +Processing 'doc9.tex' (size: 18 bytes, last modified: 05/29/2018 +14:39:21), please wait. + +(PDFTeX) PDFTeX engine .................................. SUCCESS +(PDFTeX) PDFTeX engine .................................. SUCCESS + +Total: 0.96 seconds +\end{codebox} + +It is important to note that this is just a directive-based preamble and nothing else, so a line other than a directive is discarded. Line breaks and conditionals are supported. Trying to exploit this area for other purposes will not work. The preamble specification in the configuration file is detailed in Section~\ref{sec:basicstructure}, on page~\pageref{sec:basicstructure}. + +\item[\describeopp{t}{timeout}{number}] This option sets an execution timeout for every task, in milliseconds. If the timeout is reached before the task ends, \arara\ will kill it and halt the execution. Any positive integer can be used as the \prbox{number} value for this option. Of course, use a sensible value to allow proper time for a task to be executed. For instance, consider the following recursive call: + +\begin{ncodebox}{Source file}{teal}{\icnote}{white}{doc10.tex} +% arara: pdftex +\def\foo{\foo} +This will go \foo forever. +\bye +\end{ncodebox} + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ arara --timeout 3000 doc9.tex + __ _ _ __ __ _ _ __ __ _ + / _` | '__/ _` | '__/ _` | +| (_| | | | (_| | | | (_| | + \__,_|_| \__,_|_| \__,_| + +Processing 'doc10.tex' (size: 63 bytes, last modified: 05/29/2018 +15:24:06), please wait. + +(PDFTeX) PDFTeX engine ................................. ERROR + +The system command execution reached the provided timeout value +and was aborted. If the time was way too short, make sure to +provide a longer value. There are more details available on this +exception: + +DETAILS --------------------------------------------------------- +Timed out waiting for java.lang.UNIXProcess@6b53e23f to finish, +timeout: 3000 milliseconds, executed command [pdftex, doc10.tex] + +Total: 3.37 seconds +\end{codebox} + +If left unattended, this particular execution would never finish (and probably crash the engine at a certain point), as expected by the recursive calls without a proper fixed point. The \opbox{{-}timeout} option was set at 3000 milliseconds and the task was aborted when the time limit was reached. Note that the tool raised an error about it. + +\item[\describeop{V}{version}] This option, as the name indicates, prints the current version. It also prints the current revision and a list of libraries with their corresponding licenses. Finally, it simply exits the application. Note that this option has the second highest priority over the others. + +\item[\describeop{v}{verbose}] This option enables the verbose mode of \arara, as seen in Section~\ref{sec:userinterfacedesign}, on page~\pageref{sec:userinterfacedesign}. It also enables all streams to be flushed directly to the terminal, including potential user input interactions (the exact opposite of silent mode). This option can also be activated by default in the configuration file (see Section~\ref{sec:basicstructure}, on page~\pageref{sec:basicstructure}). + +\item[\describeop{s}{silent}] This option disables the verbose mode of \arara\ (thus activating the default silent mode), if previously enabled by a proper configuration file (see Chapter~\ref{chap:configurationfile}, on page~\pageref{chap:configurationfile}). It is important to note that this command line option has higher priority over the \opbox{{-}verbose} counterpart. +% It might be worth clarifying here that --silent doesn't completely stop all messages from being written to STDOUT, just the messages normally produced by the system commands called by the subtasks. The normal arara messages are still displayed. +\end{description} + +You can combine options, use long or short variations interchangeably and write them in any order, provided that a file name is given at some point in the command line, otherwise the usage will be printed. Use the provided features in order to enhance and optimize your automation workflow. + +\section{File name lookup} +\label{sec:filenamelookup} + +\arara, as a command line application, provides support for a restricted range of file types. In particular, the tool recognizes five file types based on their extensions. These types are presented as follows, as well as the lookup order. + +\vspace{1em} + +{\centering +\setlength\tabcolsep{1em} +\begin{tabular}{ccccc} +{\footnotesize\textit{attempt 1}} & +{\footnotesize\textit{attempt 2}} & +{\footnotesize\textit{attempt 3}} & +{\footnotesize\textit{attempt 4}} & +{\footnotesize\textit{attempt 5}} \\ +\rbox{\hphantom{xx}tex\hphantom{xx}} & +\rbox{\hphantom{xx}dtx\hphantom{xx}} & +\rbox{\hphantom{xx}ltx\hphantom{xx}} & +\rbox{\hphantom{xx}drv\hphantom{xx}} & +\rbox{\hphantom{xx}ins\hphantom{xx}} +\end{tabular}\par} + +\vspace{1.4em} + +Note that other extensions can be added through a proper mapping in the configuration file, as well as modifying the lookup order. This feature is detailed later on, in Section~\ref{sec:basicstructure}, on page~\pageref{sec:basicstructure}. \arara\ employs the following scheme for file name lookup: + +\begin{itemize}[label={--}] +\item First and foremost, if the provided file name already contains a valid extension, the tool attempts an exact match. If the file exists, it will be selected. This is the best approach if your working directory contains other files sharing the same base name. + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ arara doc11.tex + __ _ _ __ __ _ _ __ __ _ + / _` | '__/ _` | '__/ _` | +| (_| | | | (_| | | | (_| | + \__,_|_| \__,_|_| \__,_| + +Processing 'doc11.tex' (size: 34 bytes, last modified: 05/29/2018 +19:40:35), please wait. + +(PDFTeX) PDFTeX engine .................................. SUCCESS + +Total: 0.69 seconds +\end{codebox} + +\item If the provided file name has an unsupported extension or no extension at all, the tool iterates through the list of default extensions, appending the current element to the file name and attempting an exact match. If the file exists, it will be selected. + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ arara doc11 + __ _ _ __ __ _ _ __ __ _ + / _` | '__/ _` | '__/ _` | +| (_| | | | (_| | | | (_| | + \__,_|_| \__,_|_| \__,_| + +Processing 'doc11.tex' (size: 34 bytes, last modified: 05/29/2018 +19:40:35), please wait. + +(PDFTeX) PDFTeX engine .................................. SUCCESS + +Total: 0.69 seconds +\end{codebox} +\end{itemize} + +It is highly recommended to use complete file names with our tool, in order to ensure the correct file is being processed. If your command line interpreter features tab completion, you can use it to automatically fill partially typed file names from your working directory. + +\begin{messagebox}{Exit status support}{araracolour}{\icok}{white} +\arara\ follows the good practices of software development and provides three values for exit status, so our tool can be programmatically used in scripts and other complex workflows. + +\vspace{1em} + +{\centering +\def\arraystretch{1.5} +\begin{tabular}{ll} +\rbox[araracolour]{\hphantom{x}0\hphantom{x}} & Successful execution \\ +\rbox[araracolour]{\hphantom{x}1\hphantom{x}} & One of the rules failed \\ +\rbox[araracolour]{\hphantom{x}2\hphantom{x}} & An exception was raised +\end{tabular}\par} + +\vspace{1.4em} + +Please refer to the documentation of your favourite command line interpreter to learn more about exit status captures. Programming languages also offer methods for retrieving such information. +\end{messagebox} diff --git a/Master/texmf-dist/doc/support/arara/chapters/concepts.tex b/Master/texmf-dist/doc/support/arara/chapters/concepts.tex new file mode 100644 index 00000000000..0a8d168fe7c --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/chapters/concepts.tex @@ -0,0 +1,605 @@ +% !TeX root = ../arara-manual.tex +\chapter{Important concepts} +\label{chap:importantconcepts} + +Time for our first proper contact with \arara! I must stress that is very important to understand a few concepts in which \arara\ relies before we proceed to the usage itself. Do not worry, these concepts are easy to follow, yet they are vital to the comprehension of the application and the logic behind it. + +\section{Rules} +\label{sec:rule} + +A \emph{rule} is a formal description of how \arara\ handles a certain task. For instance, if we want to use \rbox{pdflatex} with our tool, we should have a rule for that. Directives are mapped to rules, so a call to a non-existent rule \rbox{foo}, for instance, will indeed raise an error: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} + __ _ _ __ __ _ _ __ __ _ + / _` | '__/ _` | '__/ _` | +| (_| | | | (_| | | | (_| | + \__,_|_| \__,_|_| \__,_| + +Processing 'doc1.tex' (size: 83 bytes, last modified: 05/03/2018 +12:10:33), please wait. + +I could not find a rule named 'foo' in the provided rule paths. +Perhaps a misspelled word? I was looking for a file named +'foo.yaml' in the following paths in order of priority: +(/opt/paulo/arara/rules) + +Total: 0.09 seconds +\end{codebox} + +Once a rule is defined, \arara\ automatically provides an access layer to that rule through directives in the source code, a concept to be formally introduced later on, in Section~\ref{sec:directives}. Observe that a directive reflects a particular instance of a rule of the same name (i.e, a \rbox{foo} directive in a certain source code is an instance of the \rbox{foo} rule). + +In short, a rule is a plain text file written in the \gls{YAML} format, described in Chapter~\ref{chap:yaml}, on page~\pageref{chap:yaml}. I opted for this format because back then it was cleaner and more intuitive to use than other markup languages such as \gls{XML}, besides of course being a data serialization standard for programming languages. + +\begin{messagebox}{Animal jokes}{araracolour}{\icok}{white} +As a bonus, the acronym \emph{YAML} rhymes with the word \emph{camel}, so \arara\ is heavily environmentally friendly. Speaking of camels, there is the programming reference as well, since this amusing animal is usually associated with Perl and friends. +\end{messagebox} + +The default rules, i.e, the rules shipped with \arara, are placed inside a special subdirectory named \abox[araracolour]{rules/} inside another special directory named \abox[araracolour]{ARARA\_HOME} (the place where our tool is installed). We will learn later on, in Section~\ref{sec:basicstructure}, on page~\pageref{sec:basicstructure}, that we can add an arbitrary number of paths for storing our own rules, in order of priority, so do not worry too much about the location of the default rules, although it is important to understand and acknowledge their existence. + +The following list describes the basic structure of an \arara\ rule by presenting the proper elements (or keys, if we consider the proper \gls{YAML} nomenclature). Observe that elements marked as \rbox[araracolour]{M} are mandatory (i.e, the rule \emph{has} to have them in order to work). Similarly, elements marked as \rbox[araracolour]{O} are optional, so you can safely ignore them when writing a rule for our tool. A key preceded by \rbox{context$\rightarrow$} indicates a context and should be properly defined inside it. + +\begin{description} +\item[\describe{M}{!config}] This keyword is mandatory and must be the first line of any \arara\ rule. It denotes the object mapping metadata to be internally used by the tool. Actually, the tool is not too demanding on using it (in fact, you could suppress it entirely and \arara\ will not complain), but it is considered good practice to start all rules with a \abox{!config} keyword regardless. + +\item[\describe{M}{identifier}] This key acts as a unique identifier for the rule (as expected). It is highly recommended to use lowercase letters without spaces, accents or punctuation symbols, as good practice (again). As a convention, if you have an identifier named \rbox{pdflatex}, the rule filename must be \rbox{pdflatex.yaml} (like our own instance). Please note that, although \rbox{yml} is known to be a valid \gls{YAML} extension as well, \arara\ only considers files ending with the \rbox{yaml} extension. This is a deliberate decision. + +\begin{codebox}{Example}{teal}{\icnote}{white} +identifier: pdflatex +\end{codebox} + +\item[\describe{M}{name}] This key holds the name of the \emph{task} (a rule instantiated through a directive) as a plain string. When running \arara, this value will be displayed in the output enclosed in parentheses. + +\begin{codebox}{Example}{teal}{\icnote}{white} +name: PDFLaTeX +\end{codebox} + +\item[\describe{O}{authors}] We do love blaming people, so \arara\ features a special key to name the rule authors (if any) so you can write stern electronic communications to them! This key holds a list of strings. If the rule has just one author, add it as the first (and only) element of the list. + +\begin{codebox}{Example}{teal}{\icnote}{white} +authors: +- Marco Daniel +- Paulo Cereda +\end{codebox} + +\item[\describe{M}{commands}] This key is introduced in version 4.0 of \arara\ and denotes a potential list of commands. From the user perspective, each command is called a \emph{subtask} within a task (rule and directive) context. A task may represent only a single command (a single subtask), as well as a sequence of commands (subtasks). For instance, the \rbox{frontespizio} rule requires at least two commands. So, as a means of normalizing the representation, a task composed of a single command (single subtask) is defined as the only element of the list, as opposed to previous versions of \arara, which had a specific key to hold just one command. + +\begin{messagebox}{Incompatibility with older versions}{attentioncolour}{\icerror}{black} +Dear reader, note that rules from version 4.0 are incompatible with older versions of \arara. If you are migrating from old versions to version 4.0, we need to replace \abox{command} by \abox{commands} and specify a contextual element, as seen in the following descriptions. Please refer to Section~\ref{sec:migrationguide}, on page~\pageref{sec:migrationguide}, for a comprehensible migration guide. +\end{messagebox} + +In order to properly set a subtask, the keys used in this specification are defined inside the \rbox{commands$\rightarrow$} context and presented as follows. + +\begin{description} +\item[\describecontext{O}{commands}{name}] This key holds the name of the subtask as a plain string. When running \arara, this value will be displayed in the output. Subtask names are displayed after the main task name. By the way, did you notice that this key is entirely optional? That means that a subtask can simply be unnamed, if you decide so. However, such practice is not recommended, as it's always good to have a visual description of what \arara\ is running at the moment, so name your subtasks properly. + +\item[\describecontext{M}{commands}{command}] This key holds the action to be performed, typically a system command. In previous versions, \arara\ would rely solely on a string. For this version on, as a means to enhance the user experience (and also fix serious blockers when handling spaces in file names, as seen in \href{https://github.com/cereda/arara/issues}{previous issues} reported in the repository), the tool offers four types of returned values: + +\begin{itemize}[label={--}] +\item A plain string: this is the default (and only) behaviour in older versions of \arara. The plain string is processed as it is by the underlying execution engine. However, automatic argument parsing is problematic, so this approach, although supported, is not recommended any more. + +\begin{codebox}{Example}{teal}{\icnote}{white} +command: 'ls' +\end{codebox} + +It is important to observe that you can use either a plain string directly or use an \gls{orb-tag} with an explicit \rbox{return} command (as seen in Section~\ref{sec:mvelbasicusage}, on page~\pageref{sec:mvelbasicusage}). Personally, I favour the explicit indication for a quick understanding. + +\item A \rbox{Command} object: \arara\ 4.0 features a new approach for handling system commands based on a high level structure with explicit argument parsing named \rbox{Command} (for our curious users, it is a plain Java object). In order to use this approach, we need to rely on \glspl{orb-tag} and use a helper method named \mtbox{getCommand} to obtain the desired result. We will detail this method later on, in Section~\ref{sec:commandsandtriggers}, on page~\pageref{sec:commandsandtriggers}. We highly recommend the adoption of this approach for rule writing instead of using plain strings. + +\begin{codebox}{Example}{teal}{\icnote}{white} +command: "@{ return getCommand('ls') }" +\end{codebox} + +\item A boolean value: it is also possible to exploit the expressive power of the underlying scripting language available in the rule context (see Chapter~\ref{chap:mvel}, on page~\pageref{chap:mvel}, for more details) for writing complex code. In this particular case, since the computation is being done by \arara\ itself and not the underlying operating system, there will not be a command to be executed, so simply return a boolean value -- either an explicit \rbox{true} or \rbox{false} value or a logical expression -- to indicate whether the computation was successful. + +\begin{codebox}{Example}{teal}{\icnote}{white} +command: "@{ return 1 == 1 }" +\end{codebox} + +\item A \rbox{Trigger} object: this is surely the least common type of returned value and it is mentioned here just for documentation purposes. In simple terms, a \rbox{Trigger} object constitutes a special command that changes the internal workings of \arara\ at runtime. We have not worked much on this concept, so there is only one trigger available, seen in action in the official \rbox{halt} rule. In order to use this approach, we need to rely on \glspl{orb-tag} and use a helper method named \mtbox{getTrigger} to obtain the desired result. +\end{itemize} + +It is also worth mentioning that \arara\ also supports lists of commands represented as plain strings, \rbox{Command} or \rbox{Trigger} objects, boolean values or a mix of them. This is useful if your rule has to decide whether more actions are required in order to accomplish a task. In this case, our tool will take care of the list and execute each element in the specified order. + +\begin{codebox}{Example}{teal}{\icnote}{white} +command: "@{ return [ 'ls', 'ls', 'ls' ] }" +\end{codebox} + +As an example, please refer to the official \rbox{clean} rule for a real scenario where a list of commands is successfully employed: for each provided extension, the rule creates a new cleaning command and adds it to a list of removals to be processed later. + +\begin{messagebox}{Plain string is deprecated}{attentioncolour}{\icattention}{black} +It took me a lot of effort to find out that handling plain strings and employing guesswork to parse arguments are the root of several issues reported by users. Therefore, this approach is being marked as \emph{deprecated} and will be removed in future versions. +\end{messagebox} + +There are at least two variables available in the \abox{command} context and are described as follows (note that \gls{MVEL} variables and \glspl{orb-tag} are discussed in Chapter~\ref{chap:mvel}). A variable will be denoted by \varbox{variable} in this list. For each rule argument (defined later on), there will be a corresponding variable in the \abox{command} context, directly accessed through its unique identifier. + +\begin{description} +\item[\varbox{file}] This variable holds the file name, without any path reference, as a plain string. It is usually composed from the base name and the extension. This variable is available since the first release of \arara. + +\item[\varbox{reference}] This variable is introduced in version 4.0 of \arara\ and holds the canonical, absolute path representation of the \varbox{file} variable as a \rbox{File} object. This is useful if it's necessary to know the hierarchical structure of a project. Since the reference is a Java object, we can use all methods available in the \rbox{File} class. +\end{description} + +\begin{messagebox}{Quote handling}{araracolour}{\icinfo}{white} +\setlength{\parskip}{1em} +The \gls{YAML} format disallows key values starting with \rbox{@} without proper quoting. This is the reason we had to use double quotes for the value and internally using single quotes for the command string. Also, we could use the other way around, or even using only one type and then escaping them when needed. This is excessively verbose but needed due to the format requirement. Thankfully, \arara\ offers two solutions for removing the quoting verbosity when writing commands. + +The first solution is used in previous versions and it still works like a charm in modern days. We need to precede our command with a special keyword \rbox{<arara>} which will be removed afterwards. This solution works on virtually every key in the rule context, so it is a bonus. The new code will look like this: + +\begin{codebox}{Example}{teal}{\icnote}{white} +command: <arara> @{ return getCommand('ls') } +\end{codebox} + +The second approach is more of a \gls{YAML} feature rather than a tool exclusive, although we have to do a couple of checks under the hood in order to ensure the correct execution. The idea here is to use the scalar content in folded style, as seen in Section~\ref{sec:yamlscalars}, on page~\pageref{sec:yamlscalars}. The new code will look like this: + +\begin{codebox}{Example}{teal}{\icnote}{white} +command: > + @{ + return getCommand('ls') + } +\end{codebox} + +Mind the indentation, as \gls{YAML} requires it to properly identify blocks. I personally recommend this approach for longer code, as it provides a better visual representation. You will see the second solution all around the default rules, but feel free to use the one you feel more comfortable with. +\end{messagebox} + +\item[\describecontext{O}{commands}{exit}] This key holds a special purpose in \arara\ 4.0, as it represents a custom exit status evaluation for the corresponding command. In general, a successful execution has zero as an exit status, but sometimes we end up with tools or situations where we need to override this check for whatever reason. For this purpose, simply write a \gls{MVEL} expression \emph{without \glspl{orb-tag}} as plain string and use the special variable \varbox{value} if you need the actual exit status returned by the command, available at runtime. For example, if the command returns a non-zero value indicating a successful execution, we can write this key as: + +\begin{codebox}{Example}{teal}{\icnote}{white} +exit: value > 0 +\end{codebox} + +If the execution should be marked as successful by \arara\ regardless of the actual exit status, you can simply write \rbox{true} as the key value and this rule will never fail, for obvious reasons. +\end{description} + +For instance, consider a full example of the \abox{commands} key, defined with only one command, presented as follows. The hyphen denotes a list element, so mind the indentation for correctly specifying the component keys. Also, note that, in this case, the \abox{exit} key was completely optional, as it does the default checking, and it was included for didactic purposes. + +\begin{codebox}{Example}{teal}{\icnote}{white} +commands: +- name: The PDFLaTeX engine + command: > + @{ + return getCommand('pdflatex', file) + } + exit: value == 0 +\end{codebox} + +\item[\describe{M}{arguments}] This key holds a list of arguments for the current rule, if any. The arguments specified in this list will be available to the user later on for potential completion through directives. Once instantiated, they will become proper variables in the \abox{command} contexts. This key is mandatory, so even if your rule does not have arguments, you need to specify a list regardless. In this case, use the empty list notation: + +\begin{codebox}{Example}{teal}{\icnote}{white} +arguments: [] +\end{codebox} + +In order to properly set an argument, the keys used in this specification are defined inside the \rbox{arguments$\rightarrow$} context and presented as follows. + +\begin{description} +\item[\describecontext{M}{arguments}{identifier}] This key acts as a unique identifier for the argument. It is highly recommended to use lowercase letters without spaces, accents or punctuation symbols, as a good practice. This key will be used later on to set the corresponding value in the directive context. + +\begin{codebox}{Example}{teal}{\icnote}{white} +identifier: shell +\end{codebox} + +It is important to mention that not all names are valid as argument identifiers. \arara\ has restrictions on three names, described as follows, which cannot be used. + +\begin{messagebox}{Reserved names for rule arguments}{attentioncolour}{\icattention}{black} +Our tool has three names reserved for internal use: \abox{file}, \abox{files}, and \abox{reference}. Do not use them as argument identifiers! +\end{messagebox} + +\item[\describecontext{O}{arguments}{flag}] This key holds a plain string and is evaluated when the corresponding argument is defined in the directive context. After being evaluated, the result will be stored in a variable of the same name to be later accessed in the \abox{command} context. In the scenario where the argument is not defined in the directive, the variable will hold an empty string. + +\begin{codebox}{Example}{teal}{\icnote}{white} +flag: > + @{ + isTrue(parameters.shell, '--shell-escape', + '--no-shell-escape') + } +\end{codebox} + +There are three variables available in the \abox{flag} context, described as follows. Note that are also several helper methods available in the rule context (for instance, \mtbox{isTrue} presented in the previous example) which provide interesting features for rule writing. They are detailed later on, in Chapter~\ref{chap:methods}, on page~\pageref{chap:methods}. + +\begin{description} +\item[\varbox{parameters}] This variable holds a map of directive parameters available at runtime. For each argument identifier listed in the \abox{arguments} list in the rule context, there will be an entry in this variable. This is useful to get the actual values provided during execution and take proper actions. If a parameter is not set in the directive context, the reference will still exist in the map, but it will be mapped to an empty string. + +\item[\varbox{file}] This variable holds the file name, without any path reference, as a plain string. It is usually composed from the base name and the extension. This variable is available since the first release of \arara. + +\item[\varbox{reference}] This variable is introduced in version 4.0 of \arara\ and holds the canonical, absolute path representation of the \varbox{file} variable as a \rbox{File} object. This is useful if it's necessary to know the hierarchical structure of a project. Since the reference is a Java object, we can use all methods available in the \rbox{File} class. +\end{description} + +In the previous example, observe that the \gls{MVEL} expression defined in the \abox{flag} key checks if the user provided an affirmative value regarding shell escape, through comparing \varbox{parameters.shell} with a set of predefined affirmative values. In any case, the corresponding command flag is defined as result of such evaluation. + +\item[\describecontext{O}{arguments}{default}] As default behaviour, if a parameter is not set in the directive context, the reference will be mapped to an empty string. This key exists for the exact purpose of overriding such behaviour. + +\begin{codebox}{Example}{teal}{\icnote}{white} +default: '' +\end{codebox} + +There are three variables available in the \abox{default} context, described as follows. Note that are also several helper methods available in the rule context (for instance, \mtbox{isTrue} presented in the previous example) which provide interesting features for rule writing. They are detailed later on, in Chapter~\ref{chap:methods}, on page~\pageref{chap:methods}. + +\begin{description} +\item[\varbox{parameters}] This variable holds a map of directive parameters available at runtime. For each argument identifier listed in the \abox{arguments} list in the rule context, there will be an entry in this variable. This is useful to get the actual values provided during execution and take proper actions. If a parameter is not set in the directive context, the reference will still exist in the map, but it will be mapped to an empty string. + +\item[\varbox{file}] This variable holds the file name, without any path reference, as a plain string. It is usually composed from the base name and the extension. This variable is available since the first release of \arara. + +\item[\varbox{reference}] This variable is introduced in version 4.0 of \arara\ and holds the canonical, absolute path representation of the \varbox{file} variable as a \rbox{File} object. This is useful if it's necessary to know the hierarchical structure of a project. Since the reference is a Java object, we can use all methods available in the \rbox{File} class. +\end{description} + +\item[\describecontext{O}{arguments}{required}] There might be certain scenarios in which a rule could make use of required arguments (for instance, a copy operation in which source and target must be provided). The \abox{required} key acts as a boolean switch to indicate whether the corresponding argument should be mandatory. In this case, set the key value to \rbox{true} and the argument becomes required. Later on at runtime, \arara\ will throw an error if a required parameter is missing in the directive. + +\begin{codebox}{Example}{teal}{\icnote}{white} +required: false +\end{codebox} + +Note that setting the \abox{required} key value to \rbox{false} corresponds to omitting the key completely in the rule context, which resorts to the default behaviour (i.e, all arguments are optional). +\end{description} + +\begin{messagebox}{Note on argument keys}{attentioncolour}{\icattention}{black} +As seen previously, both \abox{flag} and \abox{default} are marked as optional, but at least one of them must occur in the argument specification, otherwise \arara\ will throw an error, as it makes no sense to have no argument handling at all. Please make sure to specify at least one of them for a consistent behaviour! +\end{messagebox} + +For instance, consider a full example of the \abox{arguments} key, defined with only one argument, presented as follows. The hyphen denotes a list element, so mind the indentation for correctly specifying the component keys. Also, note that, in this case, keys \abox{required} and \abox{default} were completely optional, and they were included for didactic purposes. + +\begin{codebox}{Example}{teal}{\icnote}{white} +arguments: +- identifier: shell + flag: > + @{ + isTrue(parameters.shell, + '--shell-escape', + '--no-shell-escape') + } + required: false + default: '' +\end{codebox} +\end{description} + +This is the rule structure in the \gls{YAML} format used by \arara. Keep in mind that all subtasks in a rule are checked against their corresponding exit status. If an abnormal execution is detected, the tool will instantly halt and the rule will fail. Even \arara\ itself will return an exit code different than zero when this situation happens (detailed in Chapter~\ref{chap:commandline}, on page~\pageref{chap:commandline}). + +\section{Directives} +\label{sec:directives} + +A \emph{directive} is a special comment inserted in the source file in which you indicate how \arara\ should behave. You can insert as many directives as you want and in any position of the file. The tool will read the whole file and extract the directives. + +\begin{messagebox}{New features in version 4.0}{araracolour}{\icinfo}{white} +\setlength{\parskip}{1em} +\textbf{Partial directive extraction} -- From version 4.0 of \arara\ on, it is now possible to extract directives only available in the file preamble, i.e, all lines from the beginning that are comments until reaching the first line that is not a comment (excluding blank lines). To this end, a new command line flag is introduced in Section~\ref{sec:basicstructure}, on page~\pageref{sec:basicstructure}. + +\textbf{Predefined preambles} -- Common preambles can be predefined and used with files that require the same automation steps, then \arara\ can be invoked based on such specifications. This feature is covered in Section~\ref{sec:basicstructure}, on page~\pageref{sec:basicstructure}. +\end{messagebox} + + +There are two types of directives in \arara\ which determine the way the corresponding rules will be instantiated. They are listed as follows. Note that directives are always preceded by the \rbox{arara:} pattern. + +\begin{description} +\item[empty directive] This type of directive has already been mentioned in Chapter~\ref{chap:introduction}, on page~\pageref{chap:introduction}, it has only the rule name (which refers to the \abox{identifier} key from the rule of the same name). All rule arguments are mapped to empty strings, except the ones with \abox{default} values. + +\begin{codebox}{Empty directive}{teal}{\icnote}{white} +% arara: pdflatex +\end{codebox} + +\item[parametrized directive] This type of directive also has the rule name (which refers to the \abox{identifier} key from the rule of the same name), and also contains a map of parameters in order to provide additional information to the corresponding rule. This map is defined in the \gls{YAML} format, based on the inline style. + +\begin{codebox}{Parametrized directive}{teal}{\icnote}{white} +% arara: pdflatex: { shell: yes } +\end{codebox} + +Observe that \arara\ relies on named parameters, so they are mapped by their corresponding argument identifiers and not by their positions. The syntax for a parameter is described as follows. Please refer to the map definition in Section~\ref{sec:yamlcollections}, on page~\pageref{sec:yamlcollections}. + +\begin{codebox}{Parameter syntax}{teal}{\icnote}{white} +key : value +\end{codebox} + +Note that virtually any type of data can be used as parameter value, so lists, integers, booleans, sets and other maps are available as well. However, there must be the correct handling of such types in the rule context. +\end{description} + +When handling parametrized directives, \arara\ always checks if directive parameters and rule arguments match. If we try to inject a non-existent parameter in a parametrized directive, the tool will raise an error about it: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} + __ _ _ __ __ _ _ __ __ _ + / _` | '__/ _` | '__/ _` | +| (_| | | | (_| | | | (_| | + \__,_|_| \__,_|_| \__,_| + +Processing 'hello.tex' (size: 103 bytes, last modified: +05/03/2018 15:40:16), please wait. + +I have spotted an error in rule 'pdflatex' located at +'/opt/paulo/arara/rules'. I found these unknown keys +in the directive: (foo). This should be an easy fix, +just remove them from your map. + +Total: 0.21 seconds +\end{codebox} + +As the message suggests, we need to remove the unknown parameter key from our directive or rewrite the rule in order to include it as an argument. The first option is, of course, easier. + +\begin{messagebox}{New feature in version 4.0}{araracolour}{\icinfo}{white} +\textbf{Helpful messages} -- It is a staple of \arara\ to have friendly and helpful messages. From version 4.0 on, we decided to make messages even friendlier and include suggestions for correcting errors or improving usage. So, whenever possible, make sure to read all messages our tool provides, they will help you! +\end{messagebox} + +Sometimes, directives can span several columns of a line, particularly the ones with several parameters. From \arara\ 4.0 on, we can split a directive into multiple lines by using the \rbox{arara: {-}{-}>} mark (also known as \emph{arrow notation} during development) to each line which should compose the directive. We call it a \emph{multiline directive}. Let us see an example: + +\begin{codebox}{Multiline directive}{teal}{\icnote}{white} +% arara: pdflatex: { +% arara: --> shell: yes, +% arara: --> synctex: yes +% arara: --> } +\end{codebox} + +It is important to observe that there is no need of them to be in contiguous lines, i.e, provided that the syntax for parametrized directives hold for the line composition, lines can be distributed all over the code. In fact, the log file (when enabled) will contain a list of all line numbers that compose a directive. This feature is discussed later on, in Section~\ref{sec:directiveextraction}, on page~\pageref{sec:directiveextraction}. + +\begin{messagebox}{Keep lines together}{araracolour}{\icinfo}{white} +Although it is possible to spread lines of a multiline directive all over the code, it is considered good practice to keep them together for easier reading and editing. In any case, you can always see which lines compose a directive by inspecting the log file. +\end{messagebox} + +\arara\ 4.0 provides logical expressions, written in the \gls{MVEL} language, and special operators processed at runtime in order to determine whether and how a directive should be processed. This feature is named \emph{directive conditional}, or simply \emph{conditional} as an abbreviation. The following list describes all conditional operators available in the directive context. + +\begin{description} +\item[\describeconditional{a priori}{if}] The associated \gls{MVEL} expression is evaluated beforehand, and the directive is interpreted if, and only if, the result of such evaluation is true. This directive, when the conditional holds true, is executed at most once. + +\begin{codebox}{Conditional}{teal}{\icnote}{white} +% arara: pdflatex if missing('pdf') || changed('tex') +\end{codebox} + +\item[\describeconditional{a posteriori}{until}] The directive is interpreted the first time, then the associated \gls{MVEL} expression evaluation is done. While the result holds false, the directive is interpreted again and again. There are no guarantees of proper halting. + +\begin{codebox}{Conditional}{teal}{\icnote}{white} +% arara: pdflatex until !found('log', 'undefined references') +\end{codebox} + +\item[\describeconditional{a priori}{unless}] Technically an inverted \cdbox{if} conditional, the associated \gls{MVEL} expression is evaluated beforehand, and the directive is interpreted if, and only if, the result is false. This directive, when the conditional holds false, is executed at most once. + +\begin{codebox}{Conditional}{teal}{\icnote}{white} +% arara: pdflatex unless unchanged('tex') && exists('pdf') +\end{codebox} + +\item[\describeconditional{a priori}{while}] The associated \gls{MVEL} expression is evaluated beforehand, the directive is interpreted if, and only if, the result is true, and the process is repeated while the result still holds true. There are no guarantees of proper halting. + +\begin{codebox}{Conditional}{teal}{\icnote}{white} +% arara: pdflatex while missing('pdf') || +% arara: --> found('log', 'undefined references') +\end{codebox} +\end{description} + +Several methods are available in the directive context in order to ease the writing of conditionals, such as \mtbox{missing}, \mtbox{changed}, \mtbox{found}, \mtbox{unchanged}, and \mtbox{exists} featured in the previous examples. They will be properly detailed later on, in Section~\ref{sec:files}, on page~\pageref{sec:files}. + +\begin{messagebox}{No infinite loops}{araracolour}{\icinfo}{white} +Although there are no conceptual guarantees for proper halting of unbounded loops, we have provided a technical solution for potentially infinite iterations: \arara\ has a predefined maximum number of loops. The default value is set to 10, but it can be overridden either in the configuration file or with a command line flag. We discuss this feature later on, in Sections~\ref{sec:options} and~\ref{sec:basicstructure}, on pages~\pageref{sec:options} and~\pageref{sec:basicstructure}, respectively. +\end{messagebox} + +All directives, regardless of their type, are internally mapped with both \abox{file} and \abox{reference} parameters, discussed earlier on, in Section~\ref{sec:coreconcepts}, on page~\pageref{sec:coreconcepts}, as special variables in the rule context. When inspecting the log file, you will find all map keys and values for each extracted directive (actually, there is an entire log section devoted to detailing directives found in the code). This feature is covered in Section~\ref{sec:directivenormalization}, on page~\pageref{sec:directivenormalization}. See, for instance, the report of the directive extraction and normalization process performed by \arara\ when inspecting \rbox{doc2.tex}, available in the log file. Note that timestamps were deliberately removed in order to declutter the output, and line breaks were included in order to easily spot the log entries. + +\begin{ncodebox}{Source file}{teal}{\icnote}{white}{doc2.tex} +% arara: pdflatex +% arara: pdflatex: { shell: yes } +\documentclass{article} + +\begin{document} +Hello world. +\end{document} +\end{ncodebox} + +\begin{codebox}{An excerpt of the log file (directive section)}{teal}{\icnote}{white} +Directive: { identifier: pdflatex, parameters: +{reference=/home/paulo/doc2.tex, file=doc2.tex}, +conditional: { NONE }, lines: [1] } + +Directive: { identifier: pdflatex, parameters: +{shell=yes, file=doc2.tex, reference=/home/paulo/doc2.tex}, +conditional: { NONE }, lines: [2] } +\end{codebox} + +The directive context also features another special parameter named \abox{files} which expects a non-empty list of file names as plain string values. For each element of this list, \arara\ will replicate the current directive and point the element being iterated as current \abox{file} and \abox{reference} values (being the latter resolved to a proper absolute, canonical path of the former). See, for instance, the report of the directive extraction and normalization process performed by \arara\ when inspecting \rbox{doc3.tex}, available in the log file. + +\begin{ncodebox}{Source file}{teal}{\icnote}{white}{doc3.tex} +% arara: pdflatex: { files: [ doc1.tex, doc2.tex ] } +Hello world. +\bye +\end{ncodebox} + +\begin{codebox}{An excerpt of the log file (directive section)}{teal}{\icnote}{white} +Directive: { identifier: pdflatex, parameters: +{reference=/home/paulo/doc1.tex, file=doc1.tex}, +conditional: { NONE }, lines: [1] } + +Directive: { identifier: pdflatex, parameters: +{reference=/home/paulo/doc2.tex, file=doc2.tex}, +conditional: { NONE }, lines: [1] } +\end{codebox} + +It is important to observe that, in this case, \rbox{doc3.tex} is a plain \TeX\ file, but \rbox{pdflatex} is actually being called on two \LaTeX\ documents, first \rbox{doc1.tex} and then, at last, \rbox{doc2.tex}. + +Even when a directive is interpreted with a file other than the one being processed by \arara\ (through the magic of the \abox{files} parameter), it is possible to use helper methods in the rule context to get access to the original file and reference. Such methods are detailed later on, in Section~\ref{sec:files}, on page~\pageref{sec:files}. + +\section{Migration guide} +\label{sec:migrationguide} + +\begin{messagebox}{A note to users}{araracolour}{\icattention}{white} +If this is your first time using \arara\ or you do not have custom rules in the old format, you can safely ignore this section. All rules shipped with our tool are already written in the new format. +\end{messagebox} + +As previously discussed in Section~\ref{sec:rule}, on page~\pageref{sec:rule}, version 4.0 of \arara\ introduces a new rule format. As a result, user-defined rules in the old format are incompatible with the new version of our tool and thus have to be updated. In short, we need to replace \abox{command} by \abox{commands} and specify a contextual element. As an example, consider the following hypothetical rule \rbox{ls} written in the old format: + +\begin{codebox}{A rule in the old format}{teal}{\icnote}{white} +!config +identifier: ls +name: LS +command: ls @{details} +arguments: +- identifier: details + flag: '@{ isTrue(parameters.details, "-l", "") }' +\end{codebox} + +This rule does nothing too important, it simply runs the system command \rbox{ls} which lists the contents of the current directory. However, when we try to run \arara\ on a file which contains a directive referencing this rule, we get the following error in the terminal: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} + __ _ _ __ __ _ _ __ __ _ + / _` | '__/ _` | '__/ _` | +| (_| | | | (_| | | | (_| | + \__,_|_| \__,_|_| \__,_| + +Processing 'doc4.tex' (size: 31 bytes, last modified: 05/27/2018 +21:05:57), please wait. + +I have spotted an error in rule 'ls' located at '/home/paulo'. I +could not parse the rule, something bad happened. Apparently, the +provided YAML file is invalid. I will do my best to help you in +any way I can. There are more details available on this +exception: + +DETAILS --------------------------------------------------------- +Cannot create property=command for +JavaBean=com.github.cereda.arara.model.Rule@29774679 + in +'reader', line 1, column 1: + !config + ^ +Unable to find +property 'command' on class: com.github.cereda.arara.model.Rule + +in 'reader', line 4, column 10: + command: ls @{details} + + ^ + + +Total: 0.03 seconds +\end{codebox} + +The above terminal output shows the usual error \arara\ raises when a rule in the old format is used, and thus the corresponding \gls{YAML} file is considered invalid. In order to fix the rule, we need to move the \abox{command} key inside a \rbox{commands$\rightarrow$} context as a list element, as seen as follows. + +\begin{codebox}{A rule converted into the new format}{teal}{\icnote}{white} +!config +identifier: ls +name: LS +commands: +- command: ls @{details} +arguments: +- identifier: details + flag: '@{ isTrue(parameters.details, "-l", "") }' +\end{codebox} + +Note that this fix is sufficient to make the rule valid in the new format. Also, it is interesting to observe that the subtask will be unnamed during the execution, as there is no corresponding \abox{name} key in the list element. + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +(LS) Unnamed task ....................................... SUCCESS +\end{codebox} + +Now, let us consider an example containing a list of commands, also based on the old format. The \rbox{ls} rule was updated to include two runs of the system command of the same name in the current directory: + +\begin{codebox}{A rule in the old format}{teal}{\icnote}{white} +!config +identifier: ls +name: LS +commands: +- ls @{details} +- ls @{details} +arguments: +- identifier: details + flag: '@{ isTrue(parameters.details, "-l", "") }' +\end{codebox} + +Observe that the old format directly represents commands as a list of plain strings. When trying to run \arara\ on a file which contains a directive referencing the updated \rbox{ls} rule, we get the following error in the terminal: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} + __ _ _ __ __ _ _ __ __ _ + / _` | '__/ _` | '__/ _` | +| (_| | | | (_| | | | (_| | + \__,_|_| \__,_|_| \__,_| + +Processing 'doc4.tex' (size: 31 bytes, last modified: 05/27/2018 +21:05:57), please wait. + +I have spotted an error in rule 'ls' located at '/home/paulo'. I +could not parse the rule, something bad happened. Apparently, the +provided YAML file is invalid. I will do my best to help you in +any way I can. There are more details available on this +exception: + +DETAILS --------------------------------------------------------- +Cannot create property=commands for +JavaBean=com.github.cereda.arara.model.Rule@91161c7 + in 'reader', +line 1, column 1: + !config + ^ +No single argument +constructor found for class +com.github.cereda.arara.model.RuleCommand + in 'reader', line 5, +column 1: + - ls @{details} + ^ + + +Total: 0.02 seconds +\end{codebox} + +The above terminal output shows a slightly different message, but the error is practically the same to the one \arara\ raised before when a rule in the old format was used. The difference relies on the missing rule property being set at the moment, but the idea remains the same. In order to fix the rule, we need to precede every list element in the \rbox{commands$\rightarrow$} context with the \abox{command} key, as seen as follows. + +\begin{codebox}{A rule converted into the new format}{teal}{\icnote}{white} +!config +identifier: ls +name: LS +commands: +- command: ls @{details} +- command: ls @{details} +arguments: +- identifier: details + flag: '@{ isTrue(parameters.details, "-l", "") }' +\end{codebox} + +This fix is sufficient to make the rule valid in the new format. Also, as mentioned before, it is interesting to observe that the subtasks will be unnamed during the execution, as there are no corresponding \abox{name} keys in the list elements. + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +(LS) Unnamed task ....................................... SUCCESS +(LS) Unnamed task ....................................... SUCCESS +\end{codebox} + +There is a helper tool available in the \href{https://github.com/cereda/arara/releases/tag/4.0}{release section} of our project repository that attempts to automatically convert rules in the old format to the new one. If you want to try it, download the \rbox{rc.jar} file from the repository and put it in the same directory where the old rules are located. You can also provide a full path instead. It is important to note that, although the tool might indicate a successful conversion, there are no guarantees that the resulting rule is fully compliant with the new format, due to potential changes in the internal workings of \arara, so your mileage may vary. In general, it should work. The rule converter is written in Java and requires a virtual machine to run. The tool has a straightforward workflow and takes just one parameter referring to the rule to be converted. The entire process should happen without intervention. When invoked without the file name, this is the expected output: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ java -jar rc.jar + _ _ + ___ _ _| |___ ___ ___ ___ _ _ ___ ___| |_ ___ ___ +| _| | | | -_| | _| . | | | | -_| _| _| -_| _| +|_| |___|_|___| |___|___|_|_|\_/|___|_| |_| |___|_| + +version 1.0 (rules < 4.0) + +OH NO! ----------------------------------------------------- +This tool expects the YAML rule from previous versions of +arara. Please, provide a proper YAML file containing the old +rule as a parameter and try again. I will do my best to +convert the rule to the new version 4.0 format. +\end{codebox} + +Let us invoke the tool with the first version of our hypothetical \rbox{ls} rule, still in the old format. The tool removes all comments from the original file, if any, and constructs a new file with a \rbox{\_v4} suffix attached to the name. The original file is preserved. Just keep in mind that the new rule must be renamed afterwards, as the base name and the corresponding \abox{identifier} key must match. The output is presented as follows. + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ java -jar rc.jar ls.yaml + _ _ + ___ _ _| |___ ___ ___ ___ _ _ ___ ___| |_ ___ ___ +| _| | | | -_| | _| . | | | | -_| _| _| -_| _| +|_| |___|_|___| |___|___|_|_|\_/|___|_| |_| |___|_| + +version 1.0 (rules < 4.0) + +The provided YAML rule looks OK. I will try my best to +convert it to the new version 4.0 format adopted by arara. +The new rule name will be written in the same directory of +the original one and will have a '_v4' suffix to it. Keep in +mind that the base name must match the identifier! + +YAY! ------------------------------------------------------- +Good news, everybody! The provided YAML rule was updated +successfully to the new version 4.0 format of arara! Of +course, there are no guarantees this new rule will work out +of the box, so fingers crossed! Take a closer look at the +manual and update your rule to use the new enhancements of +arara. Have a great time! +\end{codebox} + +The resulting rule is identical to the one manually converted in this section. Just note that, when creating the file, the resulting \gls{YAML} file might write the keys in alphabetical order. That means that, although both files semantically represent the same rule, the positions of the keys differ. However, that poses no issue at all, as long as the keys are correctly defined. Also, it is important to note that, due to a conversion policy of the underlying \gls{YAML} library, folded scalars in the old format are transcribed as literal scalars in the new format. We could force a folded style as default, but the resulting rule would be unnecessarily verbose, so we opted for the simpler, cleaner solution. As a direct consequence, we strongly recommend a subsequent verification and potential fix of existing literal scalars into folded ones, if any. Please refer to Section~\ref{sec:yamlscalars}, on page~\pageref{sec:yamlscalars}, for more details on scalars. + +\begin{messagebox}{Replace plain strings in commands}{araracolour}{\icattention}{white} +As plain strings are known to be problematic when defining commands, they are marked as deprecated in version 4.0 of \arara\ and will likely be removed in future releases. Since you are migrating from an old format to a new one, please consider replacing plain strings in command by proper \rbox{Command} objects. The helper methods available in the rule context, including the indispensable \mtbox{getCommand} method, for obvious reasons, are detailed in Section~\ref{sec:commandsandtriggers}, on page~\pageref{sec:commandsandtriggers}. It is highly advisable to update your rules on this regard, if applicable. +\end{messagebox} + +This section pretty much covered the basics for correctly migrating rules in the old format to the new one. Of course, it is highly advisable to make use of the new features available in \arara\ 4.0 for achieving better results. If you need any help, please do not hesitating in contacting us. See Section~\ref{sec:support}, on page~\pageref{sec:support}, for more details on how to get help. diff --git a/Master/texmf-dist/doc/support/arara/chapters/configuration.tex b/Master/texmf-dist/doc/support/arara/chapters/configuration.tex new file mode 100644 index 00000000000..35553378d2d --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/chapters/configuration.tex @@ -0,0 +1,253 @@ +% !TeX root = ../arara-manual.tex +\chapter{Configuration file} +\label{chap:configurationfile} + +\arara\ provides a persistent model of modifying the underlying execution behaviour or enhancing the execution workflow through the concept of a configuration file. This chapter provides the basic structure of that file, as well as details on the file lookup in the operating system. + +\section{File lookup} +\label{sec:filelookup} + +Our tool looks for the presence of at least one of four very specific files before execution. These files are presented as follows. Observe that the directories must have the correct permissions for proper lookup and access. The lookup order is also presented. + +\vspace{1em} + +{\centering +\begin{tabular}{cccc} +{\footnotesize\textit{attempt 1}} & +{\footnotesize\textit{attempt 2}} & +{\footnotesize\textit{attempt 3}} & +{\footnotesize\textit{attempt 4}} \\ +\rbox{.araraconfig.yaml} & +\rbox{araraconfig.yaml} & +\rbox{.arararc.yaml} & +\rbox{arararc.yaml} +\end{tabular} +\par} + +\vspace{1.4em} + +From version 4.0 on, \arara\ provides two approaches regarding the location of a configuration file. They dictate how the execution should behave and happen from a user perspective, and are described as follows. + +\begin{description} +\item[global configuration file] For this approach, the configuration file should be located at \abox[araracolour]{USER\_HOME} which is the home directory of the current user. All subsequent executions of \arara\ will read this configuration file and apply the specified settings accordingly. However, it is important to note that this approach has the lowest lookup priority, which means that a local configuration, presented as follows, will always supersede a global counterpart. + +\item[local configuration file] For this approach, the configuration file should be located at \abox[araracolour]{USER\_DIR} which is the working directory associated with the current execution. This directory can also be interpreted as the one relative to the processed file. This approach offers a project-based solution for complex workflows, e.g, a thesis or a book. However, \arara\ must be executed within the working directory, or the local configuration file lookup will fail. Observe that this approach has the highest lookup priority, which means that it will always supersede a global configuration. +\end{description} + +\begin{messagebox}{Beware of empty configuration files}{attentioncolour}{\icattention}{black} +A configuration file should never be empty, otherwise \arara\ will complain about it. Make sure to populate it with at least one key, or do not write a configuration file at all. The available keys are described in Section~\ref{sec:basicstructure}, on page~\pageref{sec:basicstructure}. +\end{messagebox} + +If the logging feature is properly enabled, \arara\ will indicate in the corresponding \rbox{arara.log} file whether a configuration file was used during the execution and, if so, the corresponding canonical, absolute path. Logging is detailed later on, in Chapter~\ref{chap:logging}, on page~\pageref{chap:logging}. + +\section{Basic structure} +\label{sec:basicstructure} + +The following list describes the basic structure of an \arara\ configuration file by presenting the proper elements (or keys, if we consider the proper \gls{YAML} nomenclature). Observe that elements marked as \rbox[araracolour]{M} are mandatory (i.e, the configuration file \emph{has} to have them in order to work). Similarly, elements marked as \rbox[araracolour]{O} are optional, so you can safely ignore them when writing a configuration file for our tool. + +\begin{description} +\item[\describe{M}{!config}] This keyword is mandatory and must be the first line of a configuration file. It denotes the object mapping metadata to be internally used by the tool. Actually, the tool is not too demanding on using it (in fact, you could suppress it entirely and \arara\ will not complain), but it is considered good practice to start a configuration file with a \abox{!config} keyword regardless. + +\item[\describecfn{O}{string list}{paths}] When looking for rules, \arara\ always searches the default rule path, which consists of a special subdirectory named \abox[araracolour]{rules/} inside another special directory named \abox[araracolour]{ARARA\_HOME} (the place where our tool is installed). If no rule is found, the execution halts with an error. The \abox{paths} key specifies a list of directories, represented as plain strings, in which our tool should search for rules. The default path is appended to the list. Then the search happens from the first to the last element, in order. + +\begin{codebox}{Example}{teal}{\icnote}{white} +paths: +- '/home/paulo/rules' +- '/opt/paulo/rules' +\end{codebox} + +There are three variables available in the \abox{paths} context and are described as follows (note that \gls{MVEL} variables and \glspl{orb-tag} are discussed in Chapter~\ref{sec:mvelbasicusage}). A variable will be denoted by \varbox{variable} in this list. + +\begin{description} +\item[\varbox{user.home}] This variable, as the name implies, holds the value of the absolute, canonical path of \abox[araracolour]{USER\_HOME} which is the home directory of the current user, as plain string. Note that the specifics of the home directory (such as name and location) are defined by the operating system involved. + +\begin{codebox}{Example}{teal}{\icnote}{white} +paths: +- '@{user.home}/rules' +\end{codebox} + +\item[\varbox{user.dir}] This variable, as the name implies, holds the value of the absolute, canonical path of \abox[araracolour]{USER\_DIR} which is the working directory associated with the current execution, as plain string. Note that the working directory approach requires a user execution strategy to ensure the correct path value. + +\begin{codebox}{Example}{teal}{\icnote}{white} +paths: +- '@{user.dir}/rules' +\end{codebox} + +\item[\varbox{user.name}] This variable, as the name implies, holds the value of the current user account name, as plain string. On certain operating systems, this value is used to build the home directory structure. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +paths: +- '/home/@{user.name}/rules' +\end{codebox} + +Observe that the \varbox{user} variable actually holds a map containing three keys (resulting in a map within a map). However, for didactic purposes, it is easier to use the property navigation feature of \gls{MVEL}, detailed in Section~\ref{sec:propertynavigation}, on page~\pageref{sec:propertynavigation}, and consider the map references as three independent variables. You can use property navigation styles interchangeably. Note that you can also precede the path with the special keyword \rbox{<arara>} and save some quotes (see Section~\ref{sec:rule}, on page~\pageref{sec:rule}). In this specific scenario, the special keyword will be automatically removed afterwards. + +\begin{messagebox}{Avoid folded and literal styles for scalars in a path}{attentioncolour}{\icattention}{black} +Do not use folded or literal styles for scalars in a path! The \gls{orb-tag} resolution for a path in plain string should be kept as simple as possible, so \emph{always} use the inline style. +\end{messagebox} + +\item[\describecf{O}{string}{language}{en}] This key sets the language of all subsequent executions of \arara\ according to the provided language code value, as plain string. The default language is set to English. Also, it is very important to observe that the \opbox{{-}language} command line option can override this setting. + +\begin{codebox}{Example}{teal}{\icnote}{white} +language: nl +\end{codebox} + +\item[\describecf{O}{integer}{loops}{10}] This key redefines the maximum number of loops \arara\ will allow for potentially infinite iterations. Any positive integer can be used as the value for this variable. Also, it is very important to observe that the \opbox{{-}max-loops} command line option can override this setting. + +\begin{codebox}{Example}{teal}{\icnote}{white} +loops: 30 +\end{codebox} + +\item[\describecf{O}{boolean}{verbose}{false}] This key activates or deactivates the verbose mode of \arara\ as default mode, according to the associated boolean value. Also, it is very important to observe that the \opbox{{-}verbose} command line option can override this setting if, and only if, this variable holds \rbox{false} as the value. Similarly, the \opbox{{-}silent} command line option can override this setting if, and only if, this variable holds \rbox{true} as the value. + +\begin{codebox}{Example}{teal}{\icnote}{white} +verbose: true +\end{codebox} + +\item[\describecf{O}{boolean}{logging}{false}] This key activates or deactivates the logging feature of \arara\ as the default behaviour, according to the associated boolean value. Also, it is very important to observe that the \opbox{{-}log} command line option can override this setting if, and only if, this variable holds \rbox{false} as the value. + +\begin{codebox}{Example}{teal}{\icnote}{white} +logging: true +\end{codebox} + +\item[\describecf{O}{boolean}{header}{false}] This key modifies the directive extraction, according to the associated boolean value. If enabled, \arara\ will extract all directives from the beginning of the file until it reaches a line that is not empty and it is not a comment. Otherwise, the tool will resort to the default behaviour and extract all directives from the entire file. It is very important to observe that the \opbox{{-}header} command line option can override this setting if, and only if, this variable holds \rbox{false} as the value. + +\begin{codebox}{Example}{teal}{\icnote}{white} +header: false +\end{codebox} + +\item[\describecf{O}{string}{logname}{arara}] This key modifies the default log file name, according to the associated plain string value, plus the \rbox{log} extension. The value cannot be empty or contain invalid characters. There is no \gls{orb-tag} evaluation in this specific context, only a plain string value. The log file will be written by our tool if, and only if, the \opbox{{-}log} command line option is used. + +\begin{codebox}{Example}{teal}{\icnote}{white} +logname: mylog +\end{codebox} + +\item[\describecf{O}{string}{dbname}{arara}] This key modifies the default \gls{XML} database file name, according to the associated plain string value, plus the \rbox{xml} extension. The value cannot be empty or contain invalid characters. There is no \gls{orb-tag} evaluation in this specific context, only a plain string value. This database is used by file hashing operations, detailed in Section~\ref{sec:files}, on page~\pageref{sec:files}. + +\begin{codebox}{Example}{teal}{\icnote}{white} +dbname: mydb +\end{codebox} + +\item[\describecf{O}{string}{laf}{none}] This key modifies the default look and feel class reference, i.e, the appearance of \gls{GUI} widgets provided by our tool, according to the associated plain string value. The value cannot be empty or contain invalid characters. There is no \gls{orb-tag} evaluation in this specific context, only a plain string value. This look and feel setting is used by UI methods, detailed in Section~\ref{sec:dialogboxes}, on page~\pageref{sec:dialogboxes}. Note that this value is used by the underlying Java runtime environment, so a full qualified class name is expected. + +\begin{codebox}{Example}{teal}{\icnote}{white} +laf: 'javax.swing.plaf.nimbus.NimbusLookAndFeel' +\end{codebox} + +\begin{messagebox}{Special keywords for the look and feel setting}{araracolour}{\icok}{white} +Look and feel values other than the default provided by Java offer a more pleasant visual experience to the user, so if your rules or directives employ UI methods (detailed in Section~\ref{sec:dialogboxes}, on page~\pageref{sec:dialogboxes}), it might be interesting to provide a value to the \rbox{laf} key. At the time of writing, \arara\ provides two special keywords that are translated to the corresponding fully qualified Java class names: + +\vspace{1em} + +{\centering +\def\arraystretch{1.5} +\begin{tabular}{ll} +\rbox[araracolour]{\hphantom{xx}none\hphantom{xx}} & Default look and feel\\ +\rbox[araracolour]{\hphantom{x}system\hphantom{x}} & System look and feel\\ +\end{tabular}\par} + +\vspace{1.4em} + +The system look and feel, of course, offers the best option of all since it mimics the native appearance of graphical applications in the underlying system. However, some systems might encounter slow rendering times when this option is used, so your mileage might vary. +\end{messagebox} + +\item[\describecfn{O}{string map}{preambles}] This key holds a string map containing predefined preambles for later use with the \opbox{{-}preamble} option (see Section~\ref{sec:options}, on page~\pageref{sec:options}). Note that each map key must be unique. Additionally, it it is highly recommended to use lowercase letters without spaces, accents or punctuation symbols, as key values. Only directives, line breaks and conditionals are recognized. + +\begin{codebox}{Example}{teal}{\icnote}{white} +preambles: + twopdftex: | + % arara: pdftex + % arara: pdftex +\end{codebox} + +\begin{messagebox}{Literal style when defining a preamble}{attentioncolour}{\icattention}{black} +When defining preambles in the configuration file, \emph{always} use the literal style for scalar blocks. The reason for this requirement is the proper retention of line breaks, which are significant when parsing the strings into proper directive lines. Using the folded style in this particular scenario will almost surely be problematic. +\end{messagebox} + +\item[\describecfn{O}{file type list}{filetypes}] This key holds a list of file types supported by \arara\ when searching for a file name, as well as their corresponding directive lookup patterns. In order to properly set a file type, the keys used in this specification are defined inside the \rbox{filetypes$\rightarrow$} context and presented as follows. + +\begin{description} +\item[\describecontext{M}{filetypes}{extension}] This key, as the name implies, holds the file extension, represented as a plain string and without the leading dot (unless it is part of the extension). An extension is an identifier specified as a suffix to the file name and indicates a characteristic of the corresponding content or intended use. Observe that this key is mandatory when specifying a file type, as our tool does not support files without a proper extension. + +\begin{codebox}{Example}{teal}{\icnote}{white} +extension: c +\end{codebox} + +\item[\describecontextt{M}{O}{filetypes}{pattern}] This key holds the directive lookup pattern as a regular expression (which is, of course, represented as a plain string). When introducing a new file type, \arara\ must know how to interpret each line and how to properly find and extract directives, hence this key. Observe that this key is marked as optional and mandatory. The reason for such an unusual indication highly depends on the current scenario and is illustrated as follows. + +\begin{itemize}[label={--}] +\item The \abox{pattern} key is entirely \emph{optional} for known file types (presented in Section~\ref{sec:filenamelookup}, on page~\pageref{sec:filenamelookup}, and henceforth named \emph{default} file types), in case you just want to modify the file name lookup order. It is important to observe that default file types already have their directive lookup patterns set, which incidentally are the same, presented as follows. + +\begin{codebox}{Default regular expression pattern for known file types}{teal}{\icnote}{white} +^\s*%\s+ +\end{codebox} + +\item The \abox{pattern} key is \emph{mandatory} for new file types and for overriding existing patterns for default file types. Make sure to provide a valid regular expression as key value. It is very important to note that, regardless of the underlying pattern (default or provided through this key), the special \rbox{arara:} keyword is immutable and thus included by our tool in every directive lookup pattern. + +\begin{codebox}{Example}{teal}{\icnote}{white} +pattern: ^\s*//\s* +\end{codebox} +\end{itemize} +\end{description} + +For instance, let us reverse the default file name lookup order presented in Section~\ref{sec:filenamelookup}, on page~\pageref{sec:filenamelookup}. Since the default lookup patterns will be preserved, the corresponding \abox{pattern} keys can be safely omitted. Now it is just a matter of rearranging the entries in the desired order, presented as follows. + +\begin{codebox}{Example}{teal}{\icnote}{white} +filetypes: +- extension: ins +- extension: drv +- extension: ltx +- extension: dtx +- extension: tex +\end{codebox} + +If a default file type is included in the \abox{filetypes} list but others from the same tier are left out, these file types not on the list will implicitly have the lowest priority over the explicit list element during the file name lookup, although still respecting their original lookup order modulo the specified file type. For instance, consider the following list: + +\begin{codebox}{Example}{teal}{\icnote}{white} +filetypes: +- extension: ins +- extension: drv +\end{codebox} + +According to the previous example, three out of five default file types were deliberately left out of the \abox{filetypes} list. As expected, the two default file types provided to this list will have the highest priority during the file name lookup. It is important to note that \arara\ will always honour the original lookup order for omitted default file types, yet favouring the explicit elements. The following list is semantically equivalent to the previous example. + +\begin{codebox}{Example}{teal}{\icnote}{white} +filetypes: +- extension: ins +- extension: drv +- extension: tex +- extension: dtx +- extension: ltx +\end{codebox} + +The following example introduces the definition of a new file type to support \rbox{c} files. Observe that, for this specific scenario, the \abox{pattern} key is mandatory, as previously discussed. The resulting list is presented as follows, including the corresponding regular expression pattern. + +\begin{codebox}{Example}{teal}{\icnote}{white} +filetypes: +- extension: c + pattern: ^\s*//\s* +\end{codebox} + +It is important to note that, if no default file type is explicitly specified, as seen in previous example, the original list of default file types will have the highest priority over the \abox{filetypes} values during the file name lookup. The following list is semantically equivalent to the previous example. + +\begin{codebox}{Example}{teal}{\icnote}{white} +filetypes: +- extension: tex +- extension: dtx +- extension: ltx +- extension: drv +- extension: ins +- extension: c + pattern: ^\s*//\s* +\end{codebox} + +\begin{messagebox}{Do not escape backslashes}{attentioncolour}{\icattention}{black} +\setlength{\parskip}{1em} +When writing a file type pattern, there is no need for escaping backslashes as one does for strings in a typical programming language (including \gls{MVEL} expressions). In this specific scenario, key values are represented as plain, literal strings. + +However, please note that character escaping might be required by the underlying regular expression in some scenarios (i.e, a literal dot in the pattern). It is highly recommended to consult a proper regular expression documentation for a comprehensive overview. +\end{messagebox} +\end{description} + +Since \arara\ allows four different names for configuration files, as well as global and local approaches, it is highly advisable to run our tool with the \opbox{{-}log} command line option enabled, in order to easily identify which file was considered for that specific execution. The logging feature is discussed later on, in Chapter~\ref{chap:logging}, on page~\pageref{chap:logging}. diff --git a/Master/texmf-dist/doc/support/arara/chapters/deploying.tex b/Master/texmf-dist/doc/support/arara/chapters/deploying.tex new file mode 100644 index 00000000000..533b883ee2b --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/chapters/deploying.tex @@ -0,0 +1,223 @@ +% !TeX root = ../arara-manual.tex +\chapter{Deploying the tool} +\label{chap:deployingthetool} + +As previously mentioned, \arara\ runs on top of a Java virtual machine, available on all major operating systems -- in some cases, you might need to install the proper virtual machine. This chapter provides detailed instructions on how to properly deploy the tool in your computer from either the official package available in our project repository or a personal build generated from source (as seen in Section~\ref{sec:compilingthetool}, on page~\pageref{sec:compilingthetool}). + +\begin{messagebox}{No more installers}{araracolour}{\icok}{white} +Be mindful that, from version 4.0 on, the team decided to not release cross-platform installers any more. Our tool is available off the shelf on all major \TeX\ distributions, including \TeX\ Live and MiK\TeX, which makes manual installation unnecessary given the significant coverage of such distributions. Chances are you already have \arara\ in your system! +\end{messagebox} + +\section{Directory structure} +\label{sec:directorystructure} + +From the early development stages, our tool employs a very straightforward directory structure. In short, we provide the \abox[araracolour]{ARARA\_HOME} alias to the directory path in which the \rbox[araracolour]{arara.jar} Java archive file is located. This particular file is the heart and soul of our tool and dictates the default rule search path, which is a special directory named \abox[araracolour]{rules/} available from the same level. This directory contains all rules specified in the \gls{YAML} format, as seen in Section~\ref{sec:rule}, on page~\pageref{sec:rule}. The structure overview is presented as follows. + +\vspace{1em} + +{\centering\begin{forest} +for tree={ + grow'=0, + edge={araracolour}, + anchor=base west +}, +forked edges, +[{\abox[araracolour]{ARARA\_HOME}} + [{\rbox[araracolour]{arara.jar}}] + [{\abox[araracolour]{rules/}},s sep=1mm + [{\rbox[araracolour]{animate.yaml}}] + [{\rbox[araracolour]{bib2gls.yaml}}] + [{\color{araracolour}\ldots},no edge] + [{\rbox[araracolour]{xetex.yaml}}] + [{\rbox[araracolour]{xindy.yaml}}] + ] +] +\end{forest}\par} + +\vspace{1.4em} + +Provided that this specific directory structure is honoured, the tool is ready for use off the shelf. In fact, the official \arara\ package available in the \href{https://github.com/cereda/arara/releases}{release section} of our project repository, as well as the \href{https://bintray.com/cereda/arara}{Bintray} software distribution service, exactly mirrors this structure. Once the package is properly downloaded, we simply need to extract it into a proper \abox[araracolour]{ARARA\_HOME} location. + +\section{Defining a location} +\label{sec:definingalocation} + +First and foremost, we need to obtain \rbox{arara-4.0.zip} from either our project repository at GitHub or at the Bintray service mirror. As the name indicates, this is a compressed file format, so we need to extract it into a proper location. Run the following command in the terminal: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ unzip arara-4.0.zip +\end{codebox} + +As a result of the previous command, we obtained a directory named \abox[araracolour]{arara} with the exact structure presented in Section~\ref{sec:directorystructure} in our working directory. Now we need to decide where \arara\ should reside in our system. For example, I usually deploy my tools inside the \abox[araracolour]{/opt/paulo} path, so I need to run the following command in the terminal (please note that my personal directory already has the proper permissions, so I do not need superuser privileges): + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ mv arara /opt/paulo/ +\end{codebox} + +The tool has found a comfortable home inside my system! Observe that the full path of the \abox[araracolour]{ARARA\_HOME} reference points out to \abox[araracolour]{/opt/paulo/arara} since this is my deployment location of choice. The resulting structure overview, from the root directory, is presented as follows: + +\vspace{1em} + +{\centering\begin{forest} +for tree={ + grow'=0, + edge={araracolour}, + anchor=base west +}, +forked edges, +[{\abox[araracolour]{/}},s sep=1mm + [{\abox[araracolour]{bin/}}] + [{\abox[araracolour]{boot/}}] + [{\color{araracolour}\ldots},no edge] + [{\abox[araracolour]{opt/}},s sep=1mm + [{\abox[araracolour]{paulo/}} + [{\abox[araracolour]{arara/}} + [{\rbox[araracolour]{arara.jar}}] + [{\abox[araracolour]{rules/}},s sep=1mm + [{\rbox[araracolour]{animate.yaml}}] + [{\rbox[araracolour]{bib2gls.yaml}}] + [{\color{araracolour}\ldots},no edge] + [{\rbox[araracolour]{xetex.yaml}}] + [{\rbox[araracolour]{xindy.yaml}}] + ] + ] + ] + [{\color{araracolour}\ldots},no edge] + [{\abox[araracolour]{texbin/}}] + ] + [{\color{araracolour}\ldots},no edge] + [{\abox[araracolour]{usr/}}] + [{\abox[araracolour]{var/}}] +] +\end{forest}\par} + +\vspace{1.4em} + +If the tool was built from source (as indicated in Section~\ref{sec:compilingthetool}, on page~\pageref{sec:compilingthetool}), make sure to construct the provided directory structure previously presented. We can test the deployment by running the following command in the terminal (please note the full path): + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ java -jar /opt/paulo/arara/arara.jar + __ _ _ __ __ _ _ __ __ _ + / _` | '__/ _` | '__/ _` | +| (_| | | | (_| | | | (_| | + \__,_|_| \__,_|_| \__,_| + +arara 4.0 (revision 1) +Copyright (c) 2012-2018, Paulo Roberto Massa Cereda +All rights reserved + +usage: arara [file [--dry-run] [--log] [--verbose | --silent] + [--timeout N] [--max-loops N] [--language L] + [ --preamble P ] [--header] | --help | --version] + -h,--help print the help message + -H,--header extract directives only in the file header + -l,--log generate a log output + -L,--language <code> set the application language + -m,--max-loops <number> set the maximum number of loops + -n,--dry-run go through all the motions of running a + command, but with no actual calls + -p,--preamble <name> set the file preamble based on the + configuration file + -s,--silent hide the command output + -t,--timeout <number> set the execution timeout (in milliseconds) + -V,--version print the application version + -v,--verbose print the command output +\end{codebox} + +Please observe that, provided that the underlying operating system has an appropriate Java virtual machine installed, \arara\ can be used as a portable, standalone application. Portable applications can be stored on any data storage device, including external devices such as USB drives and floppy disks. + +\section{Tool wrapping} +\label{sec:toolwrapping} + +\arara\ is now properly deployed in our system, but we still need to provide the full path of \rbox{arara.jar} to the Java virtual machine in order to make our tool work. This section provides three approaches regarding the creation of a \emph{wrapper}, a shell feature that embeds a system command or utility, that accepts and passes a set of parameters to that command. + +\begin{description} +\item[shell alias] An \emph{alias} is a command available in various shells which enables a replacement of a word by another string. It is mainly used for abbreviating a system command, or for adding default arguments to a regularly used command. In order to create a shell alias for our tool, open \rbox{.bashrc} (a script that is executed whenever a new terminal session starts in interactive mode) in your favourite editor and add the following line, preferably at the end: + +\begin{codebox}{Source code}{teal}{\icnote}{white} +alias arara='java -jar /opt/paulo/arara/arara.jar' +\end{codebox} + +Save the file and restart your terminal. It is important to observe that the given full path must be properly quoted if it contains spaces. There is no need to provide explicit parameters, as an alias simply acts as an inline string replacement. + +\item[shell function] A \emph{shell function} is, as the name suggests, a subroutine, a code block that implements a set of operations as a means to performs a specified task. In order to create a shell function for our tool, open \rbox{.bashrc} (a script that is executed whenever a new terminal session starts in interactive mode) in your favourite editor and add the following line, preferably at the end: + +\begin{codebox}{Source code}{teal}{\icnote}{white} +arara() { + java -jar /opt/paulo/arara/arara.jar "$@" +} +\end{codebox} + +Save the file and restart your terminal. It is important to observe that the given full path must be properly quoted if it contains spaces. Note that the \rbox{\$@} symbol used in the function body represents a special shell variable that stores all the actual parameters in a list of strings. + +\begin{messagebox}{Alias or function?}{attentioncolour}{\icattention}{black} +In general, an alias should effectively not do more than change the default options of a command, as it constitutes a mere string replacement. A function should be used when you need to do something more complex than an alias. In our particular case, as the underlying logic is pretty straightforward, both approaches are valid. +\end{messagebox} + +\item[script file] A \emph{script} is a computer program designed to be run by an interpreter. In our context, the script merely sets up the environment and runs a system command. In order to provide a script for our tool, open your favourite editor and create the following file called \rbox{arara} (no extension): + +\begin{ncodebox}{Source file}{teal}{\icnote}{white}{arara} +#!/bin/bash +jarpath=/opt/paulo/arara/arara.jar +java -jar "$jarpath" "$@" +\end{ncodebox} + +It is important to observe that the given full path must be properly quoted if it contains spaces. Note that the \rbox{\$@} symbol used in the script body represents a special shell variable that stores all the actual parameters in a list of strings. This script file will act as the entry point for our tool. Now, we need to make it executable (i.e, set the corresponding execute permission) by running the following command in the terminal: + +\begin{codebox}{Source code}{teal}{\icnote}{white} +$ chmod +x arara +\end{codebox} + +Now we need to move this newly executable script file to one of the directories set forth in the \abox[araracolour]{PATH} environment variable, where executable commands are located. For illustrative purposes only, let us move the script file to the \abox[araracolour]{/usr/local/bin/} directory, a location originally designed for programs that a normal user may run. Run the following command in the terminal (note the need for superuser privileges): + +\begin{codebox}{Source code}{teal}{\icnote}{white} +$ sudo mv arara /usr/local/bin/ +\end{codebox} + +Alternatively, the script can be placed inside a special directory named \abox[araracolour]{bin/} from the home directory of the current user, which is usually added by default to the system path. Observe that, in this particular case, superuser privileges are not required, as the operation is kept at the current user level. Run the following command in the terminal instead (please note that the \rbox{\textasciitilde} symbol is a shell feature called \href{http://www.gnu.org/software/bash/manual/html_node/Tilde-Expansion.html}{tilde expansion} and refers to the home directory of the current user): + +\begin{codebox}{Source code}{teal}{\icnote}{white} +$ mv arara ~/bin/ +\end{codebox} + +There is no need to restart your terminal, as the reference becomes available as soon as it is moved to the new location. Note that a shell script can provide a convenient variation of a system command where special environment settings, command options, or post-processing apply automatically, but in a way that allows the new script to still act as a fully normal Unix command. +\end{description} + +Regardless of the adopted approach, there should be an \rbox{arara} wrapper available as an actual Unix command in your shell session. In order to test the wrapper, run the following command in the terminal: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ arara + __ _ _ __ __ _ _ __ __ _ + / _` | '__/ _` | '__/ _` | +| (_| | | | (_| | | | (_| | + \__,_|_| \__,_|_| \__,_| + +arara 4.0 (revision 1) +Copyright (c) 2012-2018, Paulo Roberto Massa Cereda +All rights reserved + +usage: arara [file [--dry-run] [--log] [--verbose | --silent] + [--timeout N] [--max-loops N] [--language L] + [ --preamble P ] [--header] | --help | --version] + -h,--help print the help message + -H,--header extract directives only in the file header + -l,--log generate a log output + -L,--language <code> set the application language + -m,--max-loops <number> set the maximum number of loops + -n,--dry-run go through all the motions of running a + command, but with no actual calls + -p,--preamble <name> set the file preamble based on the + configuration file + -s,--silent hide the command output + -t,--timeout <number> set the execution timeout (in milliseconds) + -V,--version print the application version + -v,--verbose print the command output +\end{codebox} + +It is important to observe that the wrapper initiative presented in this section might cause a potential name clash with existing \TeX\ Live or MiK\TeX\ binaries and symbolic links. In this particular scenario, make sure to inspect the command location as a means to ensure a correct execution. To this end, run the following command in the terminal: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ which arara +/usr/local/bin/arara +\end{codebox} + +The \rbox{which} command shows the full path of the executable name provided as parameter. This particular utility does this by searching for an executable or script in the directories listed in the \abox[araracolour]{PATH} environment variable. Be mindful that aliases and shell functions are listed as well.
\ No newline at end of file diff --git a/Master/texmf-dist/doc/support/arara/chapters/foreword.tex b/Master/texmf-dist/doc/support/arara/chapters/foreword.tex new file mode 100644 index 00000000000..bbf5073c8ad --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/chapters/foreword.tex @@ -0,0 +1,22 @@ +% !TeX root = ../arara-manual.tex +\chapter*{Foreword} +\label{chap:foreword} + +\epigraph{That deserves no less than a ``Holy guacamole!''.}{\textsc{Gonzalo Medina}} + +{\setlength{\parskip}{1em} +Creating a PDF from \LaTeX\ code can be quite tiresome. Suppose I am using \TeX works and I have a document that has a bibliography, glossary and index, then I need to select the \rbox{pdflatex} tool and click on the typeset button, then select the \rbox{bibtex} tool and click on the typeset button, then select the \rbox{makeindex} tool and click on the typeset button, then select the \rbox{makeglossaries} tool (which I may need to add first) and click on the typeset button, then select the \rbox{pdflatex} tool and click on the typeset button, and once more to ensure all the cross-references are up to date. Then I edit the document and have to go through that whole process all over again! + +Automation makes life so much simpler. Instead of all those tools that I need to keep selecting, I just need one tool, in this case \arara, which will do all the necessary work for me behind the scenes. + +Some automation tools try to be clever, but there are invariably exceptions that trip them up. \arara\ does not try to be clever; it just does what it is told to do. The instructions are provided as special comments in the source code that \TeX\ ignores, but they are human-readable and can also provide a hint to non-\arara\ co-authors as to what tools are required in order to complete the document build. + +The new improved \arara\ version 4.0 now comes with some exciting features, such as the ability to use conditionals, and it definitely ranks as my favourite automation tool for document creation. Paulo has done a great job, and I would like to take this opportunity to thank +him for his patience in dealing with my many feature requests!} + +\vfill + +\begin{flushright} +Nicola Louise Cecilia Talbot\\ +\emph{on behalf of the \arara\ team} +\end{flushright} diff --git a/Master/texmf-dist/doc/support/arara/chapters/introduction.tex b/Master/texmf-dist/doc/support/arara/chapters/introduction.tex new file mode 100644 index 00000000000..10f7af82084 --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/chapters/introduction.tex @@ -0,0 +1,157 @@ +% !TeX root = ../arara-manual.tex +\chapter{Introduction} +\label{chap:introduction} + +Hello there, welcome to \arara, the cool \TeX\ automation tool! This chapter is actually a quick introduction to what you can (and cannot) expect from \arara. For now, concepts will be informally presented and will be detailed later on, in the next chapters. + +\section{What is this tool?} +\label{sec:whatisthistool} + +Good question! \arara\ is a \TeX\ automation tool based on rules and directives. It is, in some aspects, similar to other well-known tools like \rbox{latexmk} and \rbox{rubber}. The key difference (and probably the selling point) might be the fact that \arara\ aims at explicit instructions in the source code (in the form of comments) in order to determine what to do instead of relying on other resources, such as log file analysis. It is a different approach for an automation tool, and we have both advantages and disadvantages of such design. Let us use the following file \rbox{hello.tex} as an example: + +\begin{ncodebox}{Source file}{teal}{\icnote}{white}{hello.tex} +\documentclass{article} + +\begin{document} +Hello world! +\end{document} +\end{ncodebox} + +How would one successfully compile \rbox{hello.tex} with \rbox{latexmk} and \rbox{rubber}, for instance? It is quite straightforward: it is just a matter of providing the file to the tool and letting it do the hard work: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ latexmk -pdf mydoc.tex +$ rubber --pdf mydoc.tex +\end{codebox} + +The mentioned tools perform an analysis on the file and decide what has to be done. However, if one tries to invoke \rbox{arara} on \rbox{hello.tex}, I am afraid \emph{nothing} will be generated; the truth is, \arara\ does not know what to do with your file, and the tool will even raise an error message complaining about this issue: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ arara hello.tex + __ _ _ __ __ _ _ __ __ _ + / _` | '__/ _` | '__/ _` | +| (_| | | | (_| | | | (_| | + \__,_|_| \__,_|_| \__,_| + +Processing 'hello.tex' (size: 86 bytes, last modified: 05/03/2018 +07:28:30), please wait. + +It looks like no directives were found in the provided file. Make +sure to include at least one directive and try again. + +Total: 0.00 seconds +\end{codebox} + +Quite surprising. However, this behaviour is not wrong at all, it is completely by design: \arara\ needs to know what you want. And for that purpose, you need to tell the tool what to do. + +\begin{messagebox}{A very important concept}{attentioncolour}{\icattention}{black} +That is the major difference of \arara\ when compared to other tools: \emph{it is not an automatic process and the tool does not employ any guesswork on its own}. You are in control of your documents; \arara\ will not do anything unless you \emph{teach it how to do a task and explicitly tell it to execute the task}. +\end{messagebox} + +Now, how does one tell \arara\ to do a task? That is the actually the easy part, provided that you have everything up and running. We accomplish the task by adding a special comment line, hereafter known as \emph{directive}, somewhere in our \rbox{hello.tex} file (preferably in the first lines): + +\begin{ncodebox}{Source file}{teal}{\icnote}{white}{hello.tex} +% arara: pdflatex +\documentclass{article} + +\begin{document} +Hello world! +\end{document} +\end{ncodebox} + +For now, do not worry too much about the terms, we will come back to them later on, in Chapter~\ref{chap:importantconcepts}, on page~\pageref{chap:importantconcepts}. It suffices to say that \arara\ expects \emph{you} to provide a list of tasks, and this is done by inserting special comments in the source file. Let us see how \arara\ behaves with this updated code: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ arara hello.tex + __ _ _ __ __ _ _ __ __ _ + / _` | '__/ _` | '__/ _` | +| (_| | | | (_| | | | (_| | + \__,_|_| \__,_|_| \__,_| + +Processing 'hello.tex' (size: 86 bytes, last modified: 05/03/2018 +07:28:30), please wait. + +(PDFLaTeX) PDFLaTeX engine .............................. SUCCESS + +Total: 0.73 seconds +\end{codebox} + +Hurrah, we finally got our document properly compiled with a \TeX\ engine by the inner workings of our beloved tool, resulting in an expected \rbox{hello.pdf} file created using the very same system call that typical automation tools like \rbox{latexmk} and \rbox{rubber} use. Observe that \arara\ works practically on other side of the spectrum: you need to tell it how and when to do a task. + +\section{Core concepts} +\label{sec:coreconcepts} + +When adding a directive in our source code, we are explicitly telling the tool what we want it to do, but I am afraid that is not sufficient at all. So far, \arara\ knows \emph{what} to do, but now it needs to know \emph{how} the task should be done. If we want \arara\ to run \rbox{pdflatex} on \rbox{hello.tex}, we need to have instructions telling our tool how to run that specific application. This particular sequence of instructions is referred as a \emph{rule} in our context. + +\begin{messagebox}{Note on rules}{attentioncolour}{\icattention}{black} +Although the core team provides a lot of rules shipped with \arara\ out of the box, with the possibility of extending the set by adding more rules, some users might find this decision rather annoying, since other tools have most of their rules hard-coded, making the automation process even more transparent. However, since \arara\ does not rely on a specific automation or compilation scheme, it becomes more extensible. The use of directives in the source code make the automation steps more fluent, which allows the specification of complex workflows very easy. +% "very easy" -> "much easier" perhaps? +\end{messagebox} + +Despite the inherited verbosity of automation steps not being suitable for small documents, \arara\ really shines when you have a document which needs full control of the automation process (for instance, a thesis or a manual). Complex workflows are easily tackled by our tool. + +Rules and directives are the core concepts of \arara: the first dictates how a task is done, and the latter is the proper instance of the associated rule on the current document, i.e, when and where the commands must be executed. + +\begin{messagebox}{The name}{araracolour}{\icok}{white} +\begin{minipage}{0.45\textwidth} +\vspace{.8em} +{\centering\includegraphics[width=0.9\textwidth]{figures/arara.png}\par} + +\vspace{.7em} + +\em Do you like araras? We do, specially our tool which shares the same name of this colorful bird. +\end{minipage}\hspace{1em} +\begin{minipage}{0.5\textwidth} +The tool name was chosen as an homage to a Brazilian bird of the same name, which is a macaw. The word \emph{arara} comes from the Tupian word \emph{a'rara}, which means \emph{big bird} (much to my chagrin, Sesame Street's iconic character Big Bird is not a macaw; according to some sources, he claims to be a golden condor). Araras are colorful, noisy, naughty and very funny. Everybody loves araras. The name seemed catchy for a tool and, in the blink of an eye, \arara\ was quickly spread to the whole \TeX\ world. +\end{minipage} +\end{messagebox} + +Now that we informally introduced rules and directives, let us take a look on how \arara\ actually works given those two elements. The whole idea is pretty straightforward, and I promise to revisit these concepts later on in this manual for a comprehensive explanation (more precisely, in Chapter~\ref{chap:importantconcepts}). + +First and foremost, we need to add at least one instruction in the source code to tell \arara\ what to do. This instruction is named a \emph{directive} and it will be parsed during the preparation phase. Observe that \arara\ will tell you if no directive was found in a file, as seen in our first interaction with the tool. + +An \arara\ directive is usually defined in a line of its own, started with a comment (denoted by a percent sign in \TeX\ and friends), followed by the word \rbox{arara:} and task name: + +\begin{codebox}{A typical directive}{teal}{\icnote}{white} +% arara: pdflatex +\documentclass{article} +... +\end{codebox} + +Our example has one directive, referencing \rbox{pdflatex}. It is important to observe that the \rbox{pdflatex} identifier \emph{does not represent the command to be executed}, but \emph{the name of the rule associated with that directive}. + +\begin{messagebox}{New feature in version 4.0}{araracolour}{\icinfo}{white} +\textbf{Multiline directives} -- Later on, in Section~\ref{sec:directives}, on page~\pageref{sec:directives}, we will discover that a directive can also span several lines in order to provide a better code organization. For now, let us assume a typical directive occupies only one line. +\end{messagebox} + +Once \arara\ finds a directive, it will look for the associated \emph{rule}. In our example, it will look for a rule named \rbox{pdflatex} which will evidently run the \rbox{pdflatex} command line application. Rules are \gls{YAML} files named according to their identifiers followed by the \rbox{yaml} extension and follow a strict structure. This concept is covered in Section~\ref{sec:rule}, on page~\pageref{sec:rule}. + +\begin{messagebox}{New feature in version 4.0}{araracolour}{\icattention}{white} +\textbf{\gls{REPL} workflow} -- \arara\ now employs a \gls{REPL} workflow for rules and directives. In previous versions, directives were extracted, their corresponding rules were analized, commands were built and added to a queue before any proper execution or evaluation. I decided to change this workflow, so now \arara\ evaluates each rule on demand, i.e, there is no \emph{a priori} checking. A rule will \emph{always} reflect the current state, including potential side effects from previous executed rules. +\end{messagebox} + +Now, we have a queue of pairs $(\textit{directive}, \textit{rule})$ to process. For each pair, \arara\ will map the directive to its corresponding rule, evaluate it and run the proper command. The execution chain requires that command $i$ was successfully executed to then proceed to command $i+1$, and so forth. This is also by design: \arara\ will halt the execution if any of the commands in the queue had raised an error. How does one know if a command was successfully executed? \arara\ checks the corresponding \emph{exit status} available after a command execution. In general, a successful execution yields 0 as its exit status. + +\begin{messagebox}{New feature in version 4.0}{araracolour}{\icinfo}{white} +\textbf{Custom exit status checking} -- In previous versions, there was no way of customizing the exit status checking of a command. A command was successful if, and only if, its resulting exit status was 0 and no other value. From now on, we can define any value, or even forget about it and make it always return a valid status regardless of execution (for instance, in a rule that always is successful -- see, for instance, the \rbox{clean} rule). +\end{messagebox} + +That is pretty much how \arara\ works: directives in the source code are mapped to rules. These pairs are added to a queue. The queue is then executed and the status is reported. More details about the expansion process are presented in Chapter~\ref{chap:importantconcepts}, on page~\pageref{chap:importantconcepts}. In short, we teach \arara\ to do a task by providing a rule, and tell it to execute it through directives in the source code. + +\section{Operating system remarks} +\label{sec:operatingsystemremarks} + +The application is written using the Java language, so \arara\ runs on top of a Java virtual machine, available on all the major operating systems~--~in some cases, you might need to install the proper virtual machine. We tried very hard to keep both code and libraries compatible with older virtual machines or from other vendors. Currently, \arara\ is known to run on Oracle's Java 5 to 10, and OpenJDK 5 to 10. We also have reports of users successfully using the tool with virtual machines provided by Azul Systems, so your mileage might vary greatly. + +\begin{messagebox}{Outdated Java virtual machines}{attentioncolour}{\icerror}{black} +Dear reader, beware of outdated software, mainly Java virtual machines! Although \arara\ offers support for older virtual machines, try your best to keep your software updated as frequently as possible. The legacy support exists only for historical reasons, and also due to the sheer fact that we know some people that still runs \arara\ on very old hardware. If you are not in this particular scenario, get the latest virtual machine. +\end{messagebox} + +In Chapter~\ref{chap:buildingfromsource}, on page~\pageref{chap:buildingfromsource}, we provide instructions on how to build \arara\ from sources using Apache Maven. Even if you use multiple operating systems, \arara\ should behave the same, including the rules. There are helper functions available in order to provide support for system-specific rules based on the underlying operating system. + +\section{Support} +\label{sec:support} + +If you run into any issue with \arara, please let us know. We all have very active profiles in the \href{https://tex.stackexchange.com/}{\TeX\ community at StackExchange}, so just use the \rbox[araracolour]{arara} tag in your question and we will help you the best we can (also, take a look at their \href{https://tex.meta.stackexchange.com/q/1436}{starter guide}). We also have a \href{https://gitter.im/cereda/arara}{Gitter chat room}, in which we occasionally hang out. Also, if you think the report is worthy of an issue, open one in our \href{https://github.com/cereda/arara/issues}{GitHub repository}. And last, but not least, feel free to poke us by good old electronic mail (please try the other approaches first). + +We really hope you like our humble contribution to the \TeX\ community. Let \arara\ enhance your \TeX\ experience, it will help you when you will need it the most. Enjoy the manual. diff --git a/Master/texmf-dist/doc/support/arara/chapters/license.tex b/Master/texmf-dist/doc/support/arara/chapters/license.tex new file mode 100644 index 00000000000..f562c377d1d --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/chapters/license.tex @@ -0,0 +1,29 @@ +% !TeX root = ../arara-manual.tex +\chapter*{License} +\label{chap:license} + +\epigraph{Anything that prevents you from being friendly, a good neighbour, is a terror tactic.}{\textsc{Richard Stallman}} + +\arara\ is licensed under the \href{http://www.opensource.org/licenses/bsd-license.php}{New BSD License}. It is important to observe that the New BSD License has been verified as a GPL-compatible free software license by the \href{http://www.fsf.org/}{Free Software Foundation}, and has been vetted as an open source license by the \href{http://www.opensource.org/}{Open Source Initiative}. + +\vfill + +\begin{messagebox}{New BSD License}{araracolour}{\icinfo}{white} +\footnotesize +\includegraphics[scale=0.25]{../logos/logo1.pdf} + +Copyright \textcopyright\ 2012--2018, Paulo Roberto Massa Cereda\\ +All rights reserved. + +\vspace{1em} + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +\begin{itemize} +\item Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +\item Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +\end{itemize} + +This software is provided by the copyright holders and contributors ``as is'' and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright holder or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. +\end{messagebox} diff --git a/Master/texmf-dist/doc/support/arara/chapters/logging.tex b/Master/texmf-dist/doc/support/arara/chapters/logging.tex new file mode 100644 index 00000000000..e13c6e314cc --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/chapters/logging.tex @@ -0,0 +1,162 @@ +% !TeX root = ../arara-manual.tex +\chapter{Logging} +\label{chap:logging} + +The logging feature of \arara, as discussed earlier on, is activated through either the \opbox{{-}log} command line option (Section~\ref{sec:options}, on page~\pageref{sec:options}) or the equivalent key in the configuration file (Section~\ref{sec:basicstructure}, on page~\pageref{sec:basicstructure}). This chapter covers the basic structure of a typical log file provided by our tool, including the important blocks that can be used to identify potential issues. The following example is used to illustrate this feature: + +\begin{ncodebox}{Source file}{teal}{\icnote}{white}{doc12.tex} +% arara: pdftex +% arara: clean: { extensions: [ log ] } +Hello world. +\bye +\end{ncodebox} + +When running our tool on the previous example with the \opbox{{-}log} command line option (otherwise, the logging framework will not provide a file at all), we will obtain the expected \rbox{arara.log} log file containing the most significant events that happened during this particular execution, as well as details regarding the underlying operating system. The contents of this file are discussed below. Note that timestamps were deliberated removed from the log entries in order to declutter the output, and line breaks were included in order to easily spot each entry. + +\section{System information} +\label{sec:systeminformation} + +The very first entry to appear in the log file is the current version of \arara\ followed by a revision number. The revision number acts as a counter for the last review on the major version. The counter starts at 1 to denote the first release in the version 4.0 series. The revision number is also important to indicate possible new features introduced later on, in the application. + +\begin{codebox}{Log file}{teal}{\icnote}{white} +Welcome to arara 4.0 (revision 1)! +\end{codebox} + +The following entries in the log file are the absolute path of the current deployment of \arara\ (line 1), details about the current Java virtual machine (namely, vendor and absolute path, in lines 2 and 3, respectively), the underlying operating system information (namely, system name, architecture and eventually the kernel version, in line 4), home and working directories (lines 5 and 6, respectively), and the absolute path of the applied configuration file, if any (line 7). This block is very important to help with tracking possible issues related to the underlying operating system and the tool configuration itself. + +\begin{codebox}{Log file}{teal}{\icnote}{white} +::: arara @ /opt/paulo/arara +::: Java 1.8.0_171, Oracle Corporation +::: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-4.b10.fc28.x86_64/jre +::: Linux, amd64, 4.16.12-300.fc28.x86_64 +::: user.home @ /home/paulo +::: user.dir @ /home/paulo/Documents +::: CF @ [none] +\end{codebox} + +\begin{messagebox}{A privacy note}{araracolour}{\icok}{white} +\setlength{\parskip}{1em} +I understand that the previous entries containing information about the underlying operating system might pose as a privacy threat to some users. However, it is worth noting that \arara\ does not share any sensitive information about your system, as entries are listed in the log file for debugging purposes only, locally in your computer. + +From experience, these entries greatly help our users to track down errors in the execution, as well as learning more about the underlying operating system. However, be mindful of sharing your log file! Since the log file contains structured blocks, it is highly advisable to selectively choose the ones relevant to the current discussion. +\end{messagebox} + +It is important to observe that localized messages are also applied to the log file. If a language other than English is selected, either through the \opbox{{-}language} command line option or the equivalent key in the configuration file, the logging framework will honour the current setting and entries will be available in the specified language. Having a log file in your own language might mitigate the traumatic experience of error tracking for \TeX\ newbies. + +\section{Directive extraction} +\label{sec:directiveextraction} + +The following block in the log file refers to file information and directive extraction. First, as with the terminal output counterpart, the tool will display details about the file being processed, including size and modification status: + +\begin{codebox}{Log file}{teal}{\icnote}{white} +Processing 'doc12.tex' (size: 74 bytes, last modified: +06/02/2018 05:36:40), please wait. +\end{codebox} + +The next entries refer to finding potential directive patterns in the code, including multiline support. All matching patterns contain the corresponding line numbers. Note that these numbers might refer to incorrect lines in the code if the \opbox{{-}preamble} command line option is used. + +\begin{codebox}{Log file}{teal}{\icnote}{white} +I found a potential pattern in line 1: pdftex +I found a potential pattern in line 2: clean: { extensions: [ log ] } +\end{codebox} + +When all matching patterns are collected from the code in the previous phase, \arara\ composes the directives accordingly, including potential parameters and conditionals. Observe that all directives have an associated list of line numbers from which they were originally composed. This phase is known as \emph{directive extraction}. + +\begin{codebox}{Log file}{teal}{\icnote}{white} +I found a potential directive: Directive: { identifier: pdftex, +parameters: {}, conditional: { NONE }, lines: [1] } +I found a potential directive: Directive: { identifier: clean, +parameters: {extensions=[log]}, conditional: { NONE }, lines: [2] } +\end{codebox} + +In this phase, directives are correctly extracted and composed, but are yet to be validated regarding invalid or reserved parameter keys. The tool then proceeds to validate parameters and normalize such directives. + +\section{Directive normalization} +\label{sec:directivenormalization} + +Once all directives are properly composed, the tool checks for potential inconsistencies, such as invalid or reserved parameter keys. Then all directives are validated and internally mapped with special parameters, as previously described in Section~\ref{sec:directivenormalization}, on page~\pageref{sec:directivenormalization}. + +\begin{codebox}{Log file}{teal}{\icnote}{white} +All directives were validated. We are good to go. +\end{codebox} + +After validation, all directives are listed in a special block in the log file, including potential parameters and conditionals. This phase is known as \emph{directive normalization}. Note that the special parameters are already included, regardless of the directive type. This particular block can be used specially for debugging purposes, since it contains all details regarding directives. + +\begin{codebox}{Log file}{teal}{\icnote}{white} +-------------------------- DIRECTIVES --------------------------- +Directive: { identifier: pdftex, parameters: +{reference=/home/paulo/Documents/doc12.tex, +file=doc12.tex}, conditional: { NONE }, lines: [1] } +Directive: { identifier: clean, parameters: {extensions=[log], +file=doc12.tex, reference=/home/paulo/Documents/doc12.tex}, +conditional: { NONE }, lines: [2] } +----------------------------------------------------------------- +\end{codebox} + +Note, however, that potential errors in directive conditionals, as well as similar inconsistencies in the corresponding rules, can only be caught at runtime. The next phase covers proper interpretation based on the provided directives. + +\section{Rule interpretation} +\label{sec:ruleinterpretation} + +Once all directives are normalized, \arara\ proceeds to interpret the potential conditionals, if any, and the corresponding rules. Note that, when available, the conditional type dictates whether the rule should be interpreted first or not. For each rule, the tool informs the identifier and the absolute path of the corresponding \gls{YAML} file. In this specific scenario, the rule is part of the default rule pack released with our tool: + +\begin{codebox}{Log file}{teal}{\icnote}{white} +I am ready to interpret rule 'pdftex'. +Rule location: '/opt/paulo/arara/rules' +\end{codebox} + +For each task (or subtask, as it is part of a rule task) defined in the rule context, \arara\ will interpret it and return the corresponding system command. The return types can be found in Section~\ref{sec:rule}, on page~\pageref{sec:rule}. In this specific scenario, there is just one task associated with the \rbox{pdftex} rule. Both task name and system command are shown: + +\begin{codebox}{Log file}{teal}{\icnote}{white} +I am ready to interpret task 'PDFTeX engine' from rule 'PDFTeX'. +System command: [ pdftex, doc12.tex ] +\end{codebox} + +After proper task interpretation, the underlying execution library of \arara\ executes the provided system command and includes the output from both output and error streams in an \emph{output buffer} block inside the log file. + +\begin{codebox}{Log file}{teal}{\icnote}{white} +---------------------- BEGIN OUTPUT BUFFER ---------------------- +This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) +(preloaded format=pdftex) + restricted \write18 enabled. +entering extended mode +(./doc12.tex [1{/usr/local/texlive/2018/texmf-var/fonts/map/ +pdftex/updmap/pdfte +x.map}] )</usr/local/texlive/2018/texmf-dist/fonts/type1/ +public/amsfonts/cm/cmr +10.pfb> +Output written on doc12.pdf (1 page, 11849 bytes). +Transcript written on doc12.log. +----------------------- END OUTPUT BUFFER ----------------------- +\end{codebox} + +Observe that the above output buffer block contains the relevant information about the \rbox{pdftex} execution on the provided file. It is possible to write a shell script to extract these blocks from the log file, as a means to provide individual information on each execution. Finally, the task result is shown: + +\begin{codebox}{Log file}{teal}{\icnote}{white} +Task result: SUCCESS +\end{codebox} + +The execution proceeds to the next directive in the list and then interprets the \rbox{clean} rule. The same steps previously described are applied in this scenario. Also note that the output buffer block is deliberately empty due to the nature of the underlying system command, as removal commands such as \rbox{rm} do not provide output at all when successful. + +\begin{codebox}{Log file}{teal}{\icnote}{white} +I am ready to interpret rule 'clean'. +Rule location: '/opt/paulo/arara/rules' +I am ready to interpret task 'Cleaning feature' from rule 'Clean'. +System command: [ rm, -f, doc12.log ] +---------------------- BEGIN OUTPUT BUFFER ---------------------- + +----------------------- END OUTPUT BUFFER ----------------------- +Task result: SUCCESS +\end{codebox} + +\begin{messagebox}{Empty output buffer}{attentioncolour}{\icattention}{black} +If the system command is simply a boolean value, the corresponding block will remain empty. Also note that not all commands from the underlying operating system path provide proper stream output, so the output buffer block might be empty in certain corner scenarios. This is the case, for example, of the provided \rbox{clean} rule. +\end{messagebox} + +Finally, as the last entry in the log file, the tool shows the execution time, in seconds. As previously mentioned, the execution time has a very simple precision and should not be considered for command profiling. + +\begin{codebox}{Log file}{teal}{\icnote}{white} +Total: 0.33 seconds +\end{codebox} + +The logging feature provides a consistent framework for event recording. It is highly recommended to include at least the \opbox{{-}log} command line option (or enable it in the configuration file) in your typical automation workflow, as relevant information is gathered into a single consolidated report. diff --git a/Master/texmf-dist/doc/support/arara/chapters/methods.tex b/Master/texmf-dist/doc/support/arara/chapters/methods.tex new file mode 100644 index 00000000000..4570e01c7fc --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/chapters/methods.tex @@ -0,0 +1,1060 @@ +% !TeX root = ../arara-manual.tex +\chapter{Methods} +\label{chap:methods} + +\arara\ features several helper methods available in directive conditional and rule contexts which provide interesting features for enhancing the user experience, as well as improving the automation itself. This chapter provides a list of such methods. It is important to observe that virtually all classes from the Java runtime environment can be used within \gls{MVEL} expressions, so your mileage might vary. + +\begin{messagebox}{A note on writing code}{araracolour}{\icok}{white} +As seen in Chapter~\ref{chap:mvel}, on page~\pageref{chap:mvel}, Java and \gls{MVEL} code be used interchangeably within expressions and \glspl{orb-tag}, including instantiation of classes into objects and invocation of methods. However, be mindful of explicitly importing Java packages and classes through the classic \rbox{import} statement, as \gls{MVEL} does not automatically handle imports, or an exception will surely be raised. Alternatively, you can provide the full qualified name to classes as well. +\end{messagebox} + +Methods are listed with their complete signatures, including potential parameters and corresponding types. Also, the return type of a method is denoted by \rrbox{type} and refers to a typical Java data type (either class or primitive). Do not worry too much, as there are illustrative examples. A method available in the directive conditional context will be marked by \ctbox{C} next to the corresponding signature. Similarly, an entry marked by \ctbox{R} denotes that the corresponding method is available in the rule context. + +\section{Files} +\label{sec:files} + +This section introduces methods related to file handling, searching and hashing. It is important to observe that no exception is thrown in case of an anomalous method call. In this particular scenario, the methods return empty references, when applied. + +\begin{description} +\item[\mdbox{R}{getOriginalFile()}{String}] This method returns the original file name, as plain string, regardless of a potential override through the special \abox{files} parameter in the directive mapping, as seen in Section~\ref{sec:directives}, on page~\pageref{sec:directives}. + +\begin{codebox}{Example}{teal}{\icnote}{white} +if (file == getOriginalFile()) { + System.out.println("The 'file' variable + was not overridden."); +} +\end{codebox} + +\item[\mdbox{R}{getOriginalReference()}{File}] This method returns the original file reference, as a \rbox{File} object, regardless of a potential reference override indirectly through the special \abox{files} parameter in the directive mapping, as seen in Section~\ref{sec:directives}, on page~\pageref{sec:directives}. + +\begin{codebox}{Example}{teal}{\icnote}{white} +if (reference.equals(getOriginalFile())) { + System.out.println("The 'reference' variable + was not overridden."); +} +\end{codebox} + +\item[\mddbox{C}{R}{currentFile()}{File}] This method returns the file reference, as a \rbox{File} object, for the current directive. It is important to observe that, from version 4.0 on, \arara\ replicates the directive when the special \abox{files} parameter is detected amongst the parameters, so each instance will have a different reference. + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: pdflatex if currentFile().getName() == 'thesis.tex' +\end{codebox} + +\item[\mddbox{C}{R}{toFile(String reference)}{File}] This method returns a file (or directory) reference, as a \rbox{File} object, based on the provided string. Note that the string can refer to either a relative entry or a complete, absolute path. It is worth mentioning that, in Java, despite the curious name, a \rbox{File} object can be assigned to either a file or a directory. + +\begin{codebox}{Example}{teal}{\icnote}{white} +f = toFile('thesis.tex'); +\end{codebox} + +\item[\mdbox{R}{getBasename(File file)}{String}] This method returns the base name (i.e, the name without the associated extension) of the provided \rbox{File} reference, as a string. Observe that this method ignores a potential path reference when extracting the base name. For a complete base name extraction with full path support, please refer to the \mtbox{getFullBasename} methods. Also, this method will throw an exception if the provided reference is not a proper file. + +\begin{codebox}{Example}{teal}{\icnote}{white} +basename = getBasename(toFile('thesis.tex')); +\end{codebox} + +\item[\mdbox{R}{getBasename(String reference)}{String}] This method returns the base name (i.e, the name without the associated extension) of the provided \rbox{String} reference, as a string. Observe that this method ignores a potential path reference when extracting the base name. For a complete base name extraction with full path support, please refer to the \mtbox{getFullBasename} methods. + +\begin{codebox}{Example}{teal}{\icnote}{white} +basename = getBasename('thesis.tex'); +\end{codebox} + +\item[\mdbox{R}{getFullBasename(File file)}{String}] This method returns the full base name (i.e, the name without the associated extension, as well as the potential path reference) of the provided \rbox{File} reference, as a string. This method will throw an exception if the provided reference is not a proper file. + +\begin{codebox}{Example}{teal}{\icnote}{white} +basename = getFullBasename(toFile('/home/paulo/thesis.tex')); +\end{codebox} + +\item[\mdbox{R}{getFullBasename(String reference)}{String}] This method returns the full base name (i.e, the name without the associated extension, as well as the potential path reference) of the provided \rbox{String} reference, as a string. As the path discovery requires an underlying file conversion, this method will throw an exception if the provided reference is not a proper file. + +\begin{codebox}{Example}{teal}{\icnote}{white} +basename = getFullBasename('/home/paulo/thesis.tex'); +\end{codebox} + +\item[\mdbox{R}{getFiletype(File file)}{String}] This method returns the file type (i.e, the associated extension specified as a suffix to the name, typically delimited with a full stop) of the provided \rbox{File} reference, as a string. This method will throw an exception if the provided reference is not a proper file. An empty string is returned if, and only if, the provided file name has no associated extension. + +\begin{codebox}{Example}{teal}{\icnote}{white} +extension = getFiletype(toFile('thesis.pdf')); +\end{codebox} + +\item[\mdbox{R}{getFiletype(String reference)}{String}] This method returns the file type (i.e, the associated extension specified as a suffix to the name, typically delimited with a full stop) of the provided \rbox{String} reference, as a string. An empty string is returned if, and only if, the provided file name has no associated extension. + +\begin{codebox}{Example}{teal}{\icnote}{white} +extension = getFiletype('thesis.pdf'); +\end{codebox} + +\item[\mddbox{C}{R}{exists(File file)}{boolean}] This method, as the name implies, returns a boolean value according to whether the provided \rbox{File} reference exists. Observe that the provided reference can be either a file or a directory. + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: bibtex if exists(toFile('references.bib')) +\end{codebox} + +\item[\mddbox{C}{R}{exists(String extension)}{boolean}] This method returns a boolean value according to whether the base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string concatenated with the provided \rbox{String} extension exists. This method eases the checking of files which share the current file name modulo extension (e.g, log and auxiliary files). Note that the provided string refers to the extension, not the file name. + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: pdftex if exists('tex') +\end{codebox} + +\item[\mddbox{C}{R}{missing(File file)}{boolean}] This method, as the name implies, returns a boolean value according to whether the provided \rbox{File} reference does not exist. It is important to observe that the provided reference can be either a file or a directory. + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: pdftex if missing(toFile('thesis.pdf')) +\end{codebox} + +\item[\mddbox{C}{R}{missing(String extension)}{boolean}] This method returns a boolean value according to whether the base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string concatenated with the provided \rbox{String} extension does not exist. This method eases the checking of files which share the current file name modulo extension (e.g, log and auxiliary files). Note that the provided string refers to the extension, not the file name. + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: pdftex if missing('pdf') +\end{codebox} + +\item[\mddbox{C}{R}{changed(File file)}{boolean}] This method returns a boolean value according to whether the provided \rbox{File} reference has changed since last verification, based on a traditional cyclic redundancy check. The file reference, as well as the associated hash, is stored in a \gls{XML} database file named \rbox{arara.xml} located in the same directory as the current file (the database name can be overridden in the configuration file, as discussed in Section~\ref{sec:basicstructure}, on page~\pageref{sec:basicstructure}). The method semantics (including the return values) is presented as follows. + +\vspace{1em} + +{\centering\small +\setlength\tabcolsep{0.8em} +\begin{tabular}{@{}ccccc@{}} +\toprule +\emph{file exists?} & \emph{entry exists?} & +\emph{has changed?} & \emph{DB action} & +\emph{result} \\ +\midrule +\cbyes{-2} & \cbyes{-2} & \cbyes{-2} & update & \cbyes{-2} \\ +\cbyes{-2} & \cbyes{-2} & \cbno{-2} & --- & \cbno{-2} \\ +\cbyes{-2} & \cbno{-2} & --- & insert & \cbyes{-2} \\ +\cbno{-2} & \cbno{-2} & --- & --- & \cbno{-2} \\ +\cbno{-2} & \cbyes{-2} & --- & remove & \cbyes{-2} \\ +\bottomrule +\end{tabular}\par} + +\vspace{1.4em} + +It is important to observe that this method \emph{always} performs a database operation, either an insertion, removal or update on the corresponding entry. When using \mtbox{changed} within a logical expression, make sure the evaluation order is correct, specially regarding the use of short-circuiting operations. In some scenarios, order does matter. + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: pdflatex if changed(toFile('thesis.tex')) +\end{codebox} + +\begin{messagebox}{Short-circuit evaluation}{araracolour}{\icok}{white} +According to the \href{https://en.wikipedia.org/wiki/Short-circuit_evaluation}{Wikipedia entry}, a \emph{short-circuit evaluation} is the semantics of some boolean operators in some programming languages in which the second argument is executed or evaluated only if the first argument does not suffice to determine the value of the expression. In Java (and consequently \gls{MVEL}), both short-circuit and standard boolean operators are available. +\end{messagebox} + +\begin{messagebox}{CRC as a hashing algorithm}{attentioncolour}{\icattention}{black} +\arara\ internally relies on a CRC32 implementation for file hashing. This particular choice, although not designed for hashing, offers an interesting trade-off between speed and quality. Besides, since it is not computationally expensive as strong algorithms such as MD5 and SHA1, CRC32 can be used for hashing typical \TeX\ documents and plain text files with little to no collisions. +\end{messagebox} + +\item[\mddbox{C}{R}{changed(String extension)}{boolean}] This method returns a boolean value according to whether the base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string concatenated with the provided \rbox{String} extension has changed since last verification, based on a traditional cyclic redundancy check. The file reference, as well as the associated hash, is stored in a \gls{XML} database file named \rbox{arara.xml} located in the same directory as the current file (the database name can be overridden in the configuration file, as discussed in Section~\ref{sec:basicstructure}, on page~\pageref{sec:basicstructure}). The method semantics (including the return values) is presented as follows. + +\vspace{1em} + +{\centering\small +\setlength\tabcolsep{0.8em} +\begin{tabular}{@{}ccccc@{}} +\toprule +\emph{file exists?} & \emph{entry exists?} & +\emph{has changed?} & \emph{DB action} & +\emph{result} \\ +\midrule +\cbyes{-2} & \cbyes{-2} & \cbyes{-2} & update & \cbyes{-2} \\ +\cbyes{-2} & \cbyes{-2} & \cbno{-2} & --- & \cbno{-2} \\ +\cbyes{-2} & \cbno{-2} & --- & insert & \cbyes{-2} \\ +\cbno{-2} & \cbno{-2} & --- & --- & \cbno{-2} \\ +\cbno{-2} & \cbyes{-2} & --- & remove & \cbyes{-2} \\ +\bottomrule +\end{tabular}\par} + +\vspace{1.4em} + +It is important to observe that this method \emph{always} performs a database operation, either an insertion, removal or update on the corresponding entry. When using \mtbox{changed} within a logical expression, make sure the evaluation order is correct, specially regarding the use of short-circuiting operations. In some scenarios, order does matter. + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: pdflatex if changed('tex') +\end{codebox} + +\item[\mddbox{C}{R}{unchanged(File file)}{boolean}] This method returns a boolean value according to whether the provided \rbox{File} reference has not changed since last verification, based on a traditional cyclic redundancy check. The file reference, as well as the associated hash, is stored in a \gls{XML} database file named \rbox{arara.xml} located in the same directory as the current file (the database name can be overridden in the configuration file, as discussed in Section~\ref{sec:basicstructure}, on page~\pageref{sec:basicstructure}). The method semantics (including the return values) is presented as follows. + +\vspace{1em} + +{\centering\small +\setlength\tabcolsep{0.8em} +\begin{tabular}{@{}ccccc@{}} +\toprule +\emph{file exists?} & \emph{entry exists?} & +\emph{has changed?} & \emph{DB action} & +\emph{result} \\ +\midrule +\cbyes{-2} & \cbyes{-2} & \cbyes{-2} & update & \cbno{-2} \\ +\cbyes{-2} & \cbyes{-2} & \cbno{-2} & --- & \cbyes{-2} \\ +\cbyes{-2} & \cbno{-2} & --- & insert & \cbno{-2} \\ +\cbno{-2} & \cbno{-2} & --- & --- & \cbyes{-2} \\ +\cbno{-2} & \cbyes{-2} & --- & remove & \cbno{-2} \\ +\bottomrule +\end{tabular}\par} + +\vspace{1.4em} + +It is important to observe that this method \emph{always} performs a database operation, either an insertion, removal or update on the corresponding entry. When using \mtbox{unchanged} within a logical expression, make sure the evaluation order is correct, specially regarding the use of short-circuiting operations. In some scenarios, order does matter. + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: pdflatex if !unchanged(toFile('thesis.tex')) +\end{codebox} + +\item[\mddbox{C}{R}{unchanged(String extension)}{boolean}] This method returns a boolean value according to whether the base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string concatenated with the provided \rbox{String} extension has not changed since last verification, based on a traditional cyclic redundancy check. The file reference, as well as the associated hash, is stored in a \gls{XML} database file named \rbox{arara.xml} located in the same directory as the current file (the database name can be overridden in the configuration file, as discussed in Section~\ref{sec:basicstructure}, on page~\pageref{sec:basicstructure}). The method semantics (including the return values) is presented as follows. + +\vspace{1em} + +{\centering\small +\setlength\tabcolsep{0.8em} +\begin{tabular}{@{}ccccc@{}} +\toprule +\emph{file exists?} & \emph{entry exists?} & +\emph{has changed?} & \emph{DB action} & +\emph{result} \\ +\midrule +\cbyes{-2} & \cbyes{-2} & \cbyes{-2} & update & \cbno{-2} \\ +\cbyes{-2} & \cbyes{-2} & \cbno{-2} & --- & \cbyes{-2} \\ +\cbyes{-2} & \cbno{-2} & --- & insert & \cbno{-2} \\ +\cbno{-2} & \cbno{-2} & --- & --- & \cbyes{-2} \\ +\cbno{-2} & \cbyes{-2} & --- & remove & \cbno{-2} \\ +\bottomrule +\end{tabular}\par} + +\vspace{1.4em} + +It is important to observe that this method \emph{always} performs a database operation, either an insertion, removal or update on the corresponding entry. When using \mtbox{unchanged} within a logical expression, make sure the evaluation order is correct, specially regarding the use of short-circuiting operations. In some scenarios, order does matter. + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: pdflatex if !unchanged('tex') +\end{codebox} + +\item[\mdbox{R}{writeToFile(File file, String text, boolean append)}{boolean}] This method performs a write operation based on the provided parameters. In this case, the method writes the \rbox{String} text to the \rbox{File} reference and returns a boolean value according to whether the operation was successful. The third parameter holds a \rbox{boolean} value and acts as a switch indicating whether the text should be appended to the existing content of the provided file. Keep in mind that the existing content of a file is always overwritten if this switch is disabled. Also, note that the switch has no effect if the file is being created at that moment. It is important to observe that this method does not raise any exception. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = writeToFile(toFile('foo.txt'), 'hello world', false); +\end{codebox} + +\begin{messagebox}{Read and write operations in Unicode}{attentioncolour}{\icattention}{black} +\arara\ \emph{always} uses Unicode as the encoding format for read and write operations. This decision is deliberate as a means to offer a consistent representation and handling of text. Unicode can be implemented by different character encodings. In our case, the tool relies on UTF-8, which uses one byte for the first 128 code points, and up to 4 bytes for other characters. The first 128 Unicode code points are the ASCII characters, which means that any ASCII text is also UTF-8 text. +\end{messagebox} + +\begin{messagebox}{File system permissions}{attentioncolour}{\icattention}{black} +Most file systems have methods to assign permissions or access rights to specific users and groups of users. These permissions control the ability of the users to view, change, navigate, and execute the contents of the file system. Keep in mind that read and write operations depend on such permissions. +\end{messagebox} + +\item[\mdbox{R}{writeToFile(String reference, String text, boolean append)}{boolean}] This method performs a write operation based on the provided parameters. In this case, the method writes the \rbox{String} text to the \rbox{String} reference and returns a boolean value according to whether the operation was successful. The third parameter holds a \rbox{boolean} value and acts as a switch indicating whether the text should be appended to the existing content of the provided file. Keep in mind that the existing content of a file is always overwritten if this switch is disabled. Also, note that the switch has no effect if the file is being created at that moment. It is important to observe that this method does not raise any exception. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = writeToFile('foo.txt', 'hello world', false); +\end{codebox} + +\item[\mdbox{R}{writeToFile(File file, List<String> lines, boolean append)}{boolean}] This method performs a write operation based on the provided parameters. In this case, the method writes the \rbox{List<String>} lines to the \rbox{File} reference and returns a boolean value according to whether the operation was successful. The third parameter holds a \rbox{boolean} value and acts as a switch indicating whether the text should be appended to the existing content of the provided file. Keep in mind that the existing content of a file is always overwritten if this switch is disabled. Also, note that the switch has no effect if the file is being created at that moment. It is important to observe that this method does not raise any exception. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = writeToFile(toFile('foo.txt'), + [ 'hello world', 'how are you?' ], false); +\end{codebox} + +\item[\mdbox{R}{\parbox{0.51\textwidth}{writeToFile(String reference,\\\hspace*{1em} List<String> lines, boolean append)}}{boolean}] This method performs a write operation based on the provided parameters. In this case, the method writes the \rbox{List<String>} lines to the \rbox{String} reference and returns a boolean value according to whether the operation was successful. The third parameter holds a \rbox{boolean} value and acts as a switch indicating whether the text should be appended to the existing content of the provided file. Keep in mind that the existing content of a file is always overwritten if this switch is disabled. Also, note that the switch has no effect if the file is being created at that moment. It is important to observe that this method does not raise any exception. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = writeToFile('foo.txt', [ 'hello world', + 'how are you?' ], false); +\end{codebox} + +\item[\mdbox{R}{readFromFile(File file)}{List<String>}] This method performs a read operation based on the provided parameter. In this case, the method reads the content from the \rbox{File} reference and returns a \rbox{List<String>} object representing the lines as a list of strings. If the reference does not exist or an exception is raised due to access permission constraints, the \mtbox{readFromFile} method returns an empty list. Keep in mind that, as a design decision, UTF-8 is \emph{always} used as character encoding for read operations. + +\begin{codebox}{Example}{teal}{\icnote}{white} +lines = readFromFile(toFile('foo.txt')); +\end{codebox} + +\item[\mdbox{R}{readFromFile(String reference)}{List<String>}] This method performs a read operation based on the provided parameter. In this case, the method reads the content from the \rbox{String} reference and returns a \rbox{List<String>} object representing the lines as a list of strings. If the reference does not exist or an exception is raised due to access permission constraints, the \mtbox{readFromFile} method returns an empty list. Keep in mind that, as a design decision, UTF-8 is \emph{always} used as character encoding for read operations. + +\begin{codebox}{Example}{teal}{\icnote}{white} +lines = readFromFile('foo.txt'); +\end{codebox} + +\item[\mdbox{R}{\parbox{0.61\textwidth}{listFilesByExtensions(File file,\\\hspace*{1em} List<String> extensions, boolean recursive)}}{List<File>}] This method performs a file search operation based on the provided parameters. In this case, the method list all files from the provided \rbox{File} reference according to the \rbox{List<String>} extensions as a list of strings, and returns a \rbox{List<File>} object representing all matching files. The leading full stop in each extension must be omitted, unless it is part of the search pattern. The third parameter holds a \rbox{boolean} value and acts as a switch indicating whether the search must be recursive, i.e, whether all subdirectories must be searched as well. If the reference is not a proper directory or an exception is raised due to access permission constraints, the \mtbox{listFilesByExtensions} method returns an empty list. + +\begin{codebox}{Example}{teal}{\icnote}{white} +files = listFilesByExtensions(toFile('/home/paulo/Documents'), + [ 'aux', 'log' ], false); +\end{codebox} + +\item[\mdbox{R}{\parbox{0.61\textwidth}{listFilesByExtensions(String reference,\\\hspace*{1em} List<String> extensions, boolean recursive)}}{List<File>}] This method performs a file search operation based on the provided parameters. In this case, the method list all files from the provided \rbox{String} reference according to the \rbox{List<String>} extensions as a list of strings, and returns a \rbox{List<File>} object representing all matching files. The leading full stop in each extension must be omitted, unless it is part of the search pattern. The third parameter holds a \rbox{boolean} value and acts as a switch indicating whether the search must be recursive, i.e, whether all subdirectories must be searched as well. If the reference is not a proper directory or an exception is raised due to access permission constraints, the \mtbox{listFilesByExtensions} method returns an empty list. + +\begin{codebox}{Example}{teal}{\icnote}{white} +files = listFilesByExtensions('/home/paulo/Documents', + [ 'aux', 'log' ], false); +\end{codebox} + +\item[\mdbox{R}{\parbox{0.59\textwidth}{listFilesByPatterns(File file,\\\hspace*{1em} List<String> patterns, boolean recursive)}}{List<File>}] This method performs a file search operation based on the provided parameters. In this case, the method lists all files from the provided \rbox{File} reference according to the \rbox{List<String>} patterns as a list of strings, and returns a \rbox{List<File>} object representing all matching files. The pattern specification is described below. The third parameter holds a \rbox{boolean} value and acts as a switch indicating whether the search must be recursive, i.e, whether all subdirectories must be searched as well. If the reference is not a proper directory or an exception is raised due to access permission constraints, the \mtbox{listFilesByPatterns} method returns an empty list. It is very important to observe that this file search operation might be slow depending on the provided directory. It is highly advisable to not rely on recursive searches whenever possible. + +\begin{messagebox}{Patterns for file search operations}{araracolour}{\icattention}{white} +\arara\ employs wildcard filters as patterns for file search operations. Testing is case sensitive by default. The wildcard matcher uses the characters \rbox[araracolour]{?} and \rbox[araracolour]{*} to represent a single or multiple wildcard characters. This is the same as often found on typical terminals. +\end{messagebox} + +\begin{codebox}{Example}{teal}{\icnote}{white} +files = listFilesByPatterns(toFile('/home/paulo/Documents'), + [ '*.tex', 'foo?.txt' ], false); +\end{codebox} + + +\item[\mdbox{R}{\parbox{0.59\textwidth}{listFilesByPatterns(String reference,\\\hspace*{1em} List<String> patterns, boolean recursive)}}{List<File>}] This method performs a file search operation based on the provided parameters. In this case, the method lists all files from the provided \rbox{String} reference according to the \rbox{List<String>} patterns as a list of strings, and returns a \rbox{List<File>} object representing all matching files. The pattern specification follows a wildcard filter. The third parameter holds a \rbox{boolean} value and acts as a switch indicating whether the search must be recursive, i.e, whether all subdirectories must be searched as well. If the reference is not a proper directory or an exception is raised due to access permission constraints, the \mtbox{listFilesByPatterns} method returns an empty list. It is very important to observe that this file search operation might be slow depending on the provided directory. It is highly advisable to not rely on recursive searches whenever possible. + +\begin{codebox}{Example}{teal}{\icnote}{white} +files = listFilesByPatterns('/home/paulo/Documents', + [ '*.tex', 'foo?.txt' ], false); +\end{codebox} +\end{description} + +As the methods presented in this section have transparent error handling, the writing of rules and conditionals becomes more fluent and not too complex for the typical user. + +\section{Conditional flow} +\label{sec:conditionalflow} + +This section introduces methods related to conditional flow based on \emph{natural boolean values}, i.e, words that semantically represent truth and falsehood signs. Such concept provides a friendly representation of boolean values and eases the use of switches in directive parameters. The tool relies on the following set of natural boolean values: + +\vspace{1em} + +{\centering +\setlength\tabcolsep{0.2em} +\begin{tabular}{ccccccccccc} +\cbyes{-2} & +\rbox[araracolour]{\hphantom{w}yes\hphantom{w}} & +\rbox[araracolour]{\hphantom{w}true\hphantom{w}} & +\rbox[araracolour]{\hphantom{w}1\hphantom{w}} & +\rbox[araracolour]{\hphantom{w}on\hphantom{w}} & +\hspace{2em} & +\cbno{-2} & +\rbox[warningcolour]{\hphantom{w}no\hphantom{w}} & +\rbox[warningcolour]{\hphantom{w}false\hphantom{w}} & +\rbox[warningcolour]{\hphantom{w}0\hphantom{w}} & +\rbox[warningcolour]{\hphantom{w}off\hphantom{w}} +\end{tabular}\par} + +\vspace{1.4em} + +All elements from the provided set of natural boolean values can be used interchangeably in directive parameters. It is important to observe that, from version 4.0 on, \arara\ throws an exception if a value absent from the set is provided to the methods described in this section. + +\begin{description} +\item[\mdbox{R}{isTrue(String string)}{boolean}] This method returns a boolean value according to whether the provided \rbox{String} value is contained in the sub-set of natural true boolean values. It is worth mentioning that the verification is case insensitive, i.e, upper case and lower case symbols are treated as equivalent. If the provided value is an empty string, the method returns false. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isTrue('yes'); +\end{codebox} + +\item[\mdbox{R}{isFalse(String string)}{boolean}] This method returns a boolean value according to whether the provided \rbox{String} value is contained in the sub-set of natural false boolean values. It is worth mentioning that the verification is case insensitive, i.e, upper case and lower case symbols are treated as equivalent. If the provided value is an empty string, the method returns false. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isFalse('off'); +\end{codebox} + +\item[\mdbox{R}{isTrue(String string, Object yes)}{Object}] This method checks if the first parameter is contained in the sub-set of natural true boolean values. If the result holds true, the second parameter is returned. Otherwise, an empty string is returned. It is worth mentioning that the verification is case insensitive, i.e, upper case and lower case symbols are treated as equivalent. If the first parameter is an empty string, the method returns an empty string. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isTrue('on', [ 'ls', '-la' ]); +\end{codebox} + +\item[\mdbox{R}{isFalse(String string, Object yes)}{Object}] This method checks if the first parameter is contained in the sub-set of natural false boolean values. If the result holds true, the second parameter is returned. Otherwise, an empty string is returned. It is worth mentioning that the verification is case insensitive, i.e, upper case and lower case symbols are treated as equivalent. If the first parameter is an empty string, the method returns an empty string. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isFalse('0', 'pwd'); +\end{codebox} + +\item[\mdbox{R}{isTrue(String string, Object yes, Object no)}{Object}] This method checks if the first parameter is contained in the sub-set of natural true boolean values. If the result holds true, the second parameter is returned. Otherwise, the third parameter is returned. It is worth mentioning that the verification is case insensitive, i.e, upper case and lower case symbols are treated as equivalent. If the first parameter is an empty string, the method returns the third parameter. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isTrue('on', [ 'ls', '-la' ], 'pwd'); +\end{codebox} + +\item[\mdbox{R}{isFalse(String string, Object yes, Object no)}{Object}] This method checks if the first parameter is contained in the sub-set of natural false boolean values. If the result holds true, the second parameter is returned. Otherwise, the third parameter is returned. It is worth mentioning that the verification is case insensitive, i.e, upper case and lower case symbols are treated as equivalent. If the first parameter is an empty string, the method returns the third parameter. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isFalse('0', 'pwd', 'ps'); +\end{codebox} + +\item[\mdbox{R}{\parbox{0.45\textwidth}{isTrue(String string, Object yes,\\\hspace*{1em} Object no, Object fallback)}}{Object}] This method checks if the first parameter is contained in the sub-set of natural true boolean values. If the result holds true, the second parameter is returned. Otherwise, the third parameter is returned. It is worth mentioning that the verification is case insensitive, i.e, upper case and lower case symbols are treated as equivalent. If the first parameter is an empty string, the method returns the fourth parameter as default value. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isTrue('on', 'ls', 'pwd', 'who'); +\end{codebox} + +\item[\mdbox{R}{\parbox{0.46\textwidth}{isFalse(String string, Object yes,\\\hspace*{1em} Object no, Object fallback)}}{Object}] This method checks if the first parameter is contained in the sub-set of natural false boolean values. If the result holds true, the second parameter is returned. Otherwise, the third parameter is returned. It is worth mentioning that the verification is case insensitive, i.e, upper case and lower case symbols are treated as equivalent. If the first parameter is an empty string, the method returns the fourth parameter as default value. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isFalse('0', 'pwd', 'ps', 'ls'); +\end{codebox} + +\item[\mdbox{R}{isTrue(boolean value, Object yes)}{Object}] This method evaluates the first parameter as a boolean expression. If the result holds true, the second parameter is returned. Otherwise, an empty string is returned. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isTrue(1 == 1, 'yes'); +\end{codebox} + +\item[\mdbox{R}{isFalse(boolean value, Object yes)}{Object}] This method evaluates the first parameter as a boolean expression. If the result holds false, the second parameter is returned. Otherwise, an empty string is returned. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isFalse(1 != 1, 'yes'); +\end{codebox} + +\item[\mdbox{R}{isTrue(boolean value, Object yes, Object no)}{Object}] This method evaluates the first parameter as a boolean expression. If the result holds true, the second parameter is returned. Otherwise, the third parameter is returned. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isTrue(1 == 1, 'yes', 'no'); +\end{codebox} + +\item[\mdbox{R}{isFalse(boolean value, Object yes, Object no)}{Object}] This method evaluates the first parameter as a boolean expression. If the result holds false, the second parameter is returned. Otherwise, the third parameter is returned. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isFalse(1 != 1, 'yes', 'no'); +\end{codebox} +\end{description} + +Supported by the concept of natural boolean values, the methods presented in this section ease the use of switches in directive parameters and can be adopted as valid alternatives for traditional conditional flows, when applied. + +\section{Strings} +\label{sec:strings} + +String manipulation constitutes one of the foundations of rule interpretation in our tool. This section introduces methods for handling such types, as a means to offer high level constructs for users. + +\begin{description} +\item[\mdbox{R}{isEmpty(String string)}{boolean}] This method returns a boolean value according to whether the provided \rbox{String} value is empty, i.e, the string length is equal to zero. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isEmpty('not empty'); +\end{codebox} + +\item[\mdbox{R}{isNotEmpty(String string)}{boolean}] This method returns a boolean value according to whether the provided \rbox{String} value is not empty, i.e, the string length is greater than zero. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isNotEmpty('not empty'); +\end{codebox} + +\item[\mdbox{R}{isEmpty(String string, Object yes)}{boolean}] This method checks if the first parameter is empty, i.e, if the string length is equal to zero. If the result holds true, the second parameter is returned. Otherwise, an empty string is returned. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isEmpty('not empty', 'ps'); +\end{codebox} + +\item[\mdbox{R}{isNotEmpty(String string, Object yes)}{boolean}] This method checks if the first parameter is not empty, i.e, if the string length is greater than zero. If the result holds true, the second parameter is returned. Otherwise, an empty string is returned. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isNotEmpty('not empty', 'ls'); +\end{codebox} + +\item[\mdbox{R}{isEmpty(String string, Object yes, Object no)}{boolean}] This method checks if the first parameter is empty, i.e, if the string length is equal to zero. If the result holds true, the second parameter is returned. Otherwise, the third parameter is returned. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isEmpty('not empty', 'ps', 'ls'); +\end{codebox} + +\item[\mdbox{R}{isNotEmpty(String string, Object yes, Object no)}{boolean}] This method checks if the first parameter is not empty, i.e, if the string length is greater than zero. If the result holds true, the second parameter is returned. Otherwise, the third parameter is returned. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isNotEmpty('not empty', 'ls', 'ps'); +\end{codebox} + +\item[\mdbox{R}{buildString(Object... objects)}{String}] This method returns a string based on the provided array of objects, separating each element by one blank space. It is important to observe that empty values are not considered. Also, note that the object array is denoted by a comma-separated sequence of elements in the actual method call, resulting in a variable number of parameters. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = buildString('a', 'b', 'c', 'd'); +\end{codebox} + +\item[\mdbox{R}{trimSpaces(String string)}{String}] This method trims spaces from the provided parameter, i.e, leading and trailing spaces in the \rbox{String} reference are removed, and returns the resulting string. It is important to observe that non-boundary spaces inside the string are not removed at all. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = trimSpaces(' hello world '); +\end{codebox} + +\item[\mdbox{R}{addQuotes(String string)}{String}] This method returns the provided parameter enclosed in double quotes, as a plain string. It is important to observe that there is no automatic quote handling. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = addQuotes('to be or not to be'); +\end{codebox} + +\item[\mdbox{R}{replicatePattern(String pattern, List<Object> values)}{List<Object>}] This method replicates the provided pattern to each element of the second parameter and returns the resulting list. The pattern must contain exactly one placeholder. For instance, \rbox{\%s} denotes a string representation of the provided argument. Please refer to the \rbox{Formatter} class reference in the \href{https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html}{Java documentation} for more information on placeholders. This method raises an exception if an invalid pattern is applied. + +\begin{codebox}{Example}{teal}{\icnote}{white} +names = replicatePattern('My name is %s', [ 'Brent', 'Nicola' ]); +\end{codebox} + +\item[\mddbox{C}{R}{found(File file, String regex)}{boolean}] This method returns a boolean value according to whether the content of the provided \rbox{File} reference contains at least one match of the provided \rbox{String} regular expression. It is important to observe that this method raises an exception if an invalid regular expression is provided as the parameter or if the provided file reference does not exist. + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: pdflatex while found(toFile('article.log'), +% arara: --> 'undefined references') +\end{codebox} + +\item[\mddbox{C}{R}{found(String extension, String regex)}{boolean}] This method returns a boolean value according to whether the content of the base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string concatenated with the provided \rbox{String} extension contains at least one match of the provided \rbox{String} regular expression. It is important to observe that this method raises an exception if an invalid regular expression is provided as the parameter or if the provided file reference does not exist. + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: pdflatex while found('log', 'undefined references') +\end{codebox} +\end{description} + +The string manipulation methods presented in this section constitute an interesting and straightforward approach to handling directive parameters without the usual verbosity in writing typical Java constructs. + +\section{Operating systems} +\label{sec:operatingsystems} + +This section introduces methods related to the underlying operating system detection, as a means of providing a straightforward approach to writing cross-platform rules. + +\begin{description} +\item[\mdbox{R}{isWindows()}{boolean}] This method returns a boolean value according to whether the underlying operating system vendor is Microsoft Windows. + +\begin{codebox}{Example}{teal}{\icnote}{white} +if (isWindows()) { System.out.println('Running Windows.'); } +\end{codebox} + +\item[\mdbox{R}{isLinux()}{boolean}] This method returns a boolean value according to whether the underlying operating system vendor is a Linux instance. + +\begin{codebox}{Example}{teal}{\icnote}{white} +if (isLinux()) { System.out.println('Running Linux.'); } +\end{codebox} + +\item[\mdbox{R}{isMac()}{boolean}] This method returns a boolean value according to whether the underlying operating system vendor is Apple Mac OS. + +\begin{codebox}{Example}{teal}{\icnote}{white} +if (isMac()) { System.out.println('Running Mac OS.'); } +\end{codebox} + +\item[\mdbox{R}{isUnix()}{boolean}] This method returns a boolean value according to whether the underlying operating system vendor is any Unix variation. + +\begin{codebox}{Example}{teal}{\icnote}{white} +if (isUnix()) { System.out.println('Running Unix.'); } +\end{codebox} + +\item[\mdbox{R}{isAIX()}{boolean}] This method returns a boolean value according to whether the underlying operating system vendor is IBM AIX. + +\begin{codebox}{Example}{teal}{\icnote}{white} +if (isAIX()) { System.out.println('Running AIX.'); } +\end{codebox} + +\item[\mdbox{R}{isIrix()}{boolean}] This method returns a boolean value according to whether the underlying operating system vendor is Silicon Graphics Irix. + +\begin{codebox}{Example}{teal}{\icnote}{white} +if (isIrix()) { System.out.println('Running Irix.'); } +\end{codebox} + +\item[\mdbox{R}{isOS2()}{boolean}] This method returns a boolean value according to whether the underlying operating system vendor is IBM OS/2 Warp. + +\begin{codebox}{Example}{teal}{\icnote}{white} +if (isOS2()) { System.out.println('Running OS/2 Warp.'); } +\end{codebox} + +\item[\mdbox{R}{isSolaris()}{boolean}] This method returns a boolean value according to whether the underlying operating system vendor is Oracle Solaris. + +\begin{codebox}{Example}{teal}{\icnote}{white} +if (isSolaris()) { System.out.println('Running Solaris.'); } +\end{codebox} + +\item[\mdbox{R}{isCygwin()}{boolean}] This method returns a boolean value according to whether the underlying operating system vendor is Microsoft Windows and \arara\ is being executed inside a Cygwin environment. + +\begin{codebox}{Example}{teal}{\icnote}{white} +if (isCygwin()) { System.out.println('Running Cygwin.'); } +\end{codebox} + +\item[\mdbox{R}{isWindows(Object yes, Object no)}{Object}] This method checks if the underlying operating system vendor is Microsoft Windows. If the result holds true, the first parameter is returned. Otherwise, the second parameter is returned. + +\begin{codebox}{Example}{teal}{\icnote}{white} +command = isWindows('del', 'rm'); +\end{codebox} + +\item[\mdbox{R}{isLinux(Object yes, Object no)}{Object}] This method checks if the underlying operating system vendor is a Linux instance. If the result holds true, the first parameter is returned. Otherwise, the second parameter is returned. + +\begin{codebox}{Example}{teal}{\icnote}{white} +command = isLinux('rm', 'del'); +\end{codebox} + +\item[\mdbox{R}{isMac(Object yes, Object no)}{Object}] This method checks if the underlying operating system vendor is Apple Mac OS. If the result holds true, the first parameter is returned. Otherwise, the second parameter is returned. + +\begin{codebox}{Example}{teal}{\icnote}{white} +command = isMac('ls', 'dir'); +\end{codebox} + +\item[\mdbox{R}{isUnix(Object yes, Object no)}{Object}] This method checks if the underlying operating system vendor is any Unix variation. If the result holds true, the first parameter is returned. Otherwise, the second parameter is returned. + +\begin{codebox}{Example}{teal}{\icnote}{white} +command = isUnix('tree', 'dir'); +\end{codebox} + +\item[\mdbox{R}{isAIX(Object yes, Object no)}{Object}] This method checks if the underlying operating system vendor is IBM AIX. If the result holds true, the first parameter is returned. Otherwise, the second parameter is returned. + +\begin{codebox}{Example}{teal}{\icnote}{white} +command = isAIX('pwd', 'ls'); +\end{codebox} + +\item[\mdbox{R}{isIrix(Object yes, Object no)}{Object}] This method checks if the underlying operating system vendor is Silicon Graphics Irix. If the result holds true, the first parameter is returned. Otherwise, the second parameter is returned. + +\begin{codebox}{Example}{teal}{\icnote}{white} +command = isIrix('ls', 'pwd'); +\end{codebox} + +\item[\mdbox{R}{isOS2(Object yes, Object no)}{Object}] This method checks if the underlying operating system vendor is IBM OS/2 Warp. If the result holds true, the first parameter is returned. Otherwise, the second parameter is returned. + +\begin{codebox}{Example}{teal}{\icnote}{white} +command = isOS2('ls', 'cd'); +\end{codebox} + +\item[\mdbox{R}{isSolaris(Object yes, Object no)}{Object}] This method checks if the underlying operating system vendor is Oracle Solaris. If the result holds true, the first parameter is returned. Otherwise, the second parameter is returned. + +\begin{codebox}{Example}{teal}{\icnote}{white} +command = isSolaris('ls', 'cat'); +\end{codebox} + +\item[\mdbox{R}{isCygwin(Object yes, Object no)}{Object}] This method checks if the underlying operating system vendor is Microsoft Windows and if \arara\ is being executed inside a Cygwin environment. If the result holds true, the first parameter is returned. Otherwise, the second parameter is returned. + +\begin{codebox}{Example}{teal}{\icnote}{white} +command = isCygwin('ls', 'dir'); +\end{codebox} +\end{description} + +The methods presented in the section provide useful information to help users write cross-platform rules and thus enhance the automation experience based on specific features of the underlying operating system. + +\section{Type checking} +\label{sec:typechecking} + +In certain scenarios, a plain string representation of directive parameters might be inadequate or insufficient given the rule requirements. To this end, this section introduces methods related to type checking as a means to provide support and verification for common data types. + +\begin{description} +\item[\mdbox{R}{isString(Object object)}{boolean}] This method returns a boolean value according to whether the provided \rbox{Object} object is a string or any extended type. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isString('foo'); +\end{codebox} + +\item[\mdbox{R}{isList(Object object)}{boolean}] This method returns a boolean value according to whether the provided \rbox{Object} object is a list or any extended type. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isList([ 1, 2, 3 ]); +\end{codebox} + +\item[\mdbox{R}{isMap(Object object)}{boolean}] This method returns a boolean value according to whether the provided \rbox{Object} object is a map or any extended type. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isMap([ 'Paulo' : 'Palmeiras', 'Carla' : 'Inter' ]); +\end{codebox} + +\item[\mdbox{R}{isBoolean(Object object)}{boolean}] This method returns a boolean value according to whether the provided \rbox{Object} object is a boolean or any extended type. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isBoolean(false); +\end{codebox} + +\item[\mdbox{R}{checkClass(Class clazz, Object object)}{boolean}] This method returns a boolean value according to whether the provided \rbox{Object} object is an instance or a subtype of the provided \rbox{Class} class. It is interesting to note that all methods presented in this section internally rely on \mtbox{checkClass} for type checking. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = checkClass(List.class, [ 'a', 'b' ]); +\end{codebox} +\end{description} + +The methods presented in this section cover the most common types used in directive parameters and should suffice for expressing the rule requirements. If a general approach is needed, please refer to the \mtbox{checkClass} method for checking virtually any type available in the Java environment. + +\section{Classes and objects} +\label{sec:classesandobjects} + +From version 4.0 on, \arara\ can be extended at runtime with code from \gls{JVM} languages, such as Groovy, Scala, Clojure and Kotlin. The tool can load classes from \rbox{class} and \rbox{jar} files and even instantiate them. This section introduces methods related to class loading and object instantiation. + +\begin{messagebox}{Ordered pairs}{araracolour}{\icok}{white} +According to the \href{https://en.wikipedia.org/wiki/Ordered_pair}{Wikipedia entry}, in mathematics, an \emph{ordered pair} $(a, b)$ is a pair of objects. The order in which the objects appear in the pair is significant: the ordered pair $(a, b)$ is different from the ordered pair $(b, a)$ unless $a = b$. In the ordered pair $(a, b)$, the object $a$ is called the \emph{first} entry, and the object $b$ the \emph{second} entry of the pair. \arara\ relies on this concept with the helper \rbox{Pair<A, B>} class, in which \rbox{A} and \rbox{B} denote the component classes, i.e, the types associated to the pair elements. In order to access the pair entries, the class provides two methods: + +\begin{description} +\item[\mtbox{first()}\hfill\rrbox{A}] This method, as the name implies, returns the first entry of the ordered pair, as an \rbox{A} object. It is important to observe that, from the \gls{MVEL} context, as the method constitutes a property accessor (namely, a getter), the parentheses can be safely omitted. + +\item[\mtbox{second()}\hfill\rrbox{B}] This method, as the name implies, returns the second entry of the ordered pair, as a \rbox{B} object. It is important to observe that, from the \gls{MVEL} context, as the method constitutes a property accessor (namely, a getter), the parentheses can be safely omitted. +\end{description} + +Keep in mind that the entries in the \rbox{Pair} class, once defined, cannot be modified to other values. The initial values are set during instantiation and, therefore, only entry getters are available to the user during the object life cycle. +\end{messagebox} + +\begin{messagebox}{Status for class loading and instantiation}{araracolour}{\icok}{white} +The class loading and instantiation methods provided by \arara\ typically return a pair composed of an integer value and a class or object reference. This integer value acts as a status of the underlying operation itself and might indicate potential issues. The possible values are: + +\vspace{1em} + +{\centering +\def\arraystretch{1.5} +\begin{tabular}{lllll} +\rbox[araracolour]{\hphantom{x}0\hphantom{x}} & Successful execution & \hspace{1.5em} & +\rbox[araracolour]{\hphantom{x}3\hphantom{x}} & Class was not found \\ +\rbox[araracolour]{\hphantom{x}1\hphantom{x}} & File does not exist & & +\rbox[araracolour]{\hphantom{x}4\hphantom{x}} & Access policy violation \\ +\rbox[araracolour]{\hphantom{x}2\hphantom{x}} & File URL is incorrect & & +\rbox[araracolour]{\hphantom{x}5\hphantom{x}} & Instantiation exception +\end{tabular}\par} + +\vspace{1.4em} + +Please make sure to \emph{always} check the returned integer status when using class loading and instantiation methods in directive and rule contexts. This feature is quite powerful yet tricky and subtle! +\end{messagebox} + +\begin{description} +\item[\mddbox{C}{R}{loadClass(File file, String name)}{Pair<Integer, Class>}] This method loads a class based on the canonical name from the provided \rbox{File} reference and returns an ordered pair containing the status and the class reference itself. The file must contain the Java bytecode, either directly accessible from a \rbox{class} file or packaged inside a \rbox{jar} file. If an exception is raised, this method returns the \rbox{Object} class reference as second entry of the pair. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = loadClass(toFile('mymath.jar'), + 'com.github.cereda.mymath.Arithmetic'); +\end{codebox} + +\item[\mddbox{C}{R}{loadClass(String reference, String name)}{Pair<Integer, Class>}] This method loads a class based on the canonical name from the provided \rbox{String} reference and returns an ordered pair containing the status and the class reference itself. The file must contain the Java bytecode, either directly accessible from a \rbox{class} file or packaged inside a \rbox{jar} file. If an exception is raised, this method returns the \rbox{Object} class reference as second entry of the pair. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = loadClass('mymath.jar', + 'com.github.cereda.mymath.Arithmetic'); +\end{codebox} + +\item[\mddbox{C}{R}{loadObject(File file, String name)}{Pair<Integer, Object>}] This method loads a class based on the canonical name from the provided \rbox{File} reference and returns an ordered pair containing the status and a proper corresponding object instantiation. The file must contain the Java bytecode, either directly accessible from a \rbox{class} file or packaged inside a \rbox{jar} file. If an exception is raised, this method returns an \rbox{Object} object as second entry of the pair. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = loadObject(toFile('mymath.jar'), + 'com.github.cereda.mymath.Trigonometric'); +\end{codebox} + +\item[\mddbox{C}{R}{loadObject(String reference, String name)}{Pair<Integer, Object>}] This method loads a class based on the canonical name from the provided \rbox{String} reference and returns an ordered pair containing the status and a proper corresponding object instantiation. The file must contain the Java bytecode, either directly accessible from a \rbox{class} file or packaged inside a \rbox{jar} file. If an exception is raised, this method returns an \rbox{Object} object as second entry of the pair. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = loadObject('mymath.jar', + 'com.github.cereda.mymath.Trigonometric'); +\end{codebox} +\end{description} + +This section presented class loading and instantiation methods which may significantly enhance the expressiveness of rules and directives. However, make sure to use such feature with great care and attention. + +\section{Dialog boxes} +\label{sec:dialogboxes} + +A \emph{dialog box} is a graphical control element, typically a small window, that communicates information to the user and prompts them for a response. This section introduces UI methods related to such interactions. + +\begin{messagebox}{UI elements}{araracolour}{\icok}{white} +The graphical elements are provided by the Swing toolkit from the Java runtime environment. Note that the default look and feel class reference can be modified through a key in the configuration file, as seen in Section~\ref{sec:basicstructure}, on page~\pageref{sec:basicstructure}. It is important to observe that the methods presented in this section require a graphical interface. If \arara\ is being executed in a headless environment (i.e, an environment with no graphical display available), an exception will be thrown when trying to use such UI methods in either directive or rule contexts. +\end{messagebox} + +Each dialog box provided by the UI methods of \arara\ requires the specification of an associated icon. An \emph{icon} is a pictogram displayed on a computer screen in order to help the user quickly identify the message by conveying its meaning through a visual resemblance to a physical object. Our tool features five icons, illustrated below, to be used with dialog boxes. Observe that each icon is associated with a unique integer value which is provided later on to the actual method call. Also, it is worth mentioning that the visual appearance of such icons is based on the underlying Java virtual machine and the current look and feel, so your mileage might vary. + +\vspace{1em} + +{\centering +\begin{tabularx}{0.8\textwidth}{YYYYY} +\uierror{cyan} & +\uiinfo{cyan} & +\uiwarning{cyan} & +\uiquestion{cyan} & +\uiplain{cyan} \\ +{\footnotesize\emph{error}} & +{\footnotesize\emph{information}} & +{\footnotesize\emph{attention}} & +{\footnotesize\emph{question}} & +{\footnotesize\emph{plain}} \\ +\rbox[cyan]{\hphantom{ww}1\hphantom{ww}} & +\rbox[cyan]{\hphantom{ww}2\hphantom{ww}} & +\rbox[cyan]{\hphantom{ww}3\hphantom{ww}} & +\rbox[cyan]{\hphantom{ww}4\hphantom{ww}} & +\rbox[cyan]{\hphantom{ww}5\hphantom{ww}} +\end{tabularx}\par} + +\vspace{1.4em} + +As good practice, make sure to provide descriptive messages to be placed in dialog boxes in order to ease and enhance the user experience. It is also highly advisable to always provide an associated icon, so avoid the plain option whenever possible. + +\begin{messagebox}{Message text width}{araracolour}{\icok}{white} +\arara\ sets the default message text width to 250 pixels. Feel free to override this value according to your needs. Please refer to the appropriate method signatures for specifying a new width. +\end{messagebox} + +The UI method signatures are followed by a visual representation of the provided dialog box. For the sake of simplicity, each parameter index refers to the associated number in the figure. + +\begin{description} +\item[\mdbox{R}{showMessage(int width, int icon, String title, String text)}{void}]\uimethod{messagebox1} + +This method shows a message box according to the provided parameters. The dialog box is disposed when the user either presses the confirmation button or closes the window. It is important to observe that \arara\ temporarily interrupts the execution and waits for the dialog box disposal. Also note that the total time includes the idle period as well. + +\begin{codebox}{Example}{teal}{\icnote}{white} +showMessage(250, 2, 'My title', 'My message'); +\end{codebox} + +\item[\mdbox{R}{showMessage(int icon, String title, String text)}{void}]\uimethod{messagebox2} + +This method shows a message box according to the provided parameters. The dialog box is disposed when the user either presses the confirmation button or closes the window. It is important to observe that \arara\ temporarily interrupts the execution and waits for the dialog box disposal. Also note that the total time includes the idle period as well. + +\begin{codebox}{Example}{teal}{\icnote}{white} +showMessage(2, 'My title', 'My message'); +\end{codebox} + +\item[\mddbox{C}{R}{\parbox{0.62\textwidth}{showOptions(int width, int icon, String title,\\\hspace*{1em} String text, Object... options)}}{int}]\uimethod{optionbox1} + +This method shows a message box according to the provided parameters, including options represented as an array of \rbox{Object} objects. This array is portrayed in the dialog box as a list of buttons. The dialog box is disposed when the user either presses one of the buttons or closes the window. The method returns the natural index of the selected button, starting from \rbox{1}. If no button is pressed (e.g, the window is closed), \rbox{0} is returned. Note that the object array is denoted by a comma-separated sequence of elements in the actual method call, resulting in a variable number of parameters. It is important to observe that \arara\ temporarily interrupts the execution and waits for the dialog box disposal. Also note that the total time includes the idle period as well. + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: pdflatex if showOptions(250, 4, 'Important!', +% arara: --> 'Do you like ice cream?', 'Yes!', 'No!') == 1 +\end{codebox} + +\begin{messagebox}{Button orientation}{attentioncolour}{\icattention}{black} +Keep in mind that your window manager might render the button orientation differently than the original arrangement specified in your array of objects. For instance, I had a window manager that rendered the buttons in the reverse order. However, note that the visual appearance should not interfere with the programming logic! The indices shall remain the same, pristine as ever, regardless of the actual rendering. Trust your code, not your eyes. +\end{messagebox} + +\item[\mddbox{C}{R}{\parbox{0.49\textwidth}{showOptions(int icon, String title,\\\hspace*{1em} String text, Object... options)}}{int}]\uimethod{optionbox2} + +This method shows a message box according to the provided parameters, including options represented as an array of \rbox{Object} objects. This array is portrayed in the dialog box as a list of buttons. The dialog box is disposed when the user either presses one of the buttons or closes the window. The method returns the natural index of the selected button, starting from \rbox{1}. If no button is pressed (e.g, the window is closed), \rbox{0} is returned. Note that the object array is denoted by a comma-separated sequence of elements in the actual method call, resulting in a variable number of parameters. It is important to observe that \arara\ temporarily interrupts the execution and waits for the dialog box disposal. Also note that the total time includes the idle period as well. + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: pdflatex if showOptions(4, 'Important!', +% arara: --> 'Do you like ice cream?', 'Yes!', 'No!') == 1 +\end{codebox} + +\item[\mddbox{C}{R}{\parbox{0.62\textwidth}{showDropdown(int width, int icon, String title,\\\hspace*{1em} String text, Object... options)}}{int}]\uimethod{dropdown1} + +This method shows a dialog box according to the provided parameters, including options represented as an array of \rbox{Object} objects. This array is portrayed in the dialog box as a dropdown list. The first element from the array is automatically selected. The dialog box is disposed when the user either presses one of the buttons or closes the window. The method returns the natural index of the selected item, starting from \rbox{1}. If the user cancels the dialog or closes the window, \rbox{0} is returned. Note that the object array is denoted by a comma-separated sequence of elements in the actual method call, resulting in a variable number of parameters. It is important to observe that \arara\ temporarily interrupts the execution and waits for the dialog box disposal. Also note that the total time includes the idle period as well. + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: pdflatex if showDropdown(250, 4, 'Important!', +% arara: --> 'Who deserves the tick?', 'David Carlisle', +% arara: --> 'Enrico Gregorio', 'Joseph Wright', +% arara: --> 'Heiko Oberdiek') == 2 +\end{codebox} + +\begin{messagebox}{Combo boxes and dropdown lists}{attentioncolour}{\icattention}{black} +According to the \href{https://en.wikipedia.org/wiki/Combo_box}{Wikipedia entry}, a \emph{combo box} is a combination of a dropdown list or list box and a single line editable textbox, allowing the user to either type a value directly or select a value from the list. The term is sometimes used to mean a dropdown list, but in Java, the term is definitely not a synonym! A dropdown list is sometimes clarified with terms such as non-editable combo box to distinguish it from the original definition of a combo box. +\end{messagebox} + +\item[\mddbox{C}{R}{\parbox{0.49\textwidth}{showDropdown(int icon, String title,\\\hspace*{1em} String text, Object... options)}}{int}]\uimethod{dropdown2} + +This method shows a dialog box according to the provided parameters, including options represented as an array of \rbox{Object} objects. This array is portrayed in the dialog box as a dropdown list. The first element from the array is automatically selected. The dialog box is disposed when the user either presses one of the buttons or closes the window. The method returns the natural index of the selected item, starting from \rbox{1}. If the user cancels the dialog or closes the window, \rbox{0} is returned. Note that the object array is denoted by a comma-separated sequence of elements in the actual method call, resulting in a variable number of parameters. It is important to observe that \arara\ temporarily interrupts the execution and waits for the dialog box disposal. Also note that the total time includes the idle period as well. + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: pdflatex if showDropdown(4, 'Important!', +% arara: --> 'Who deserves the tick?', 'David Carlisle', +% arara: --> 'Enrico Gregorio', 'Joseph Wright', +% arara: --> 'Heiko Oberdiek') == 2 +\end{codebox} + +\begin{messagebox}{Swing toolkit}{araracolour}{\icok}{white} +According to the \href{https://en.wikipedia.org/wiki/Swing_(Java)}{Wikipedia entry}, the Swing toolkit was developed to provide a more sophisticated set of \gls{GUI} components than the earlier AWT widget system. Swing provides a look and feel that emulates the look and feel of several platforms, and also supports a pluggable look and feel that allows applications to have a look and feel unrelated to the underlying platform. It has more powerful and flexible components than AWT. In addition to familiar components such as buttons, check boxes and labels, Swing provides several advanced components, such as scroll panes, trees, tables, and lists. +\end{messagebox} + +\item[\mddbox{C}{R}{showInput(int width, int icon, String title, String text)}{String}]\uimethod{inputbox1} + +This method shows an input dialog box according to the provided parameters. The dialog box is disposed when the user either presses one of the buttons or closes the window. The method returns the content of the input text field, as a trimmed \rbox{String} object. If the user cancels the dialog or closes the window, an empty string is returned. It is important to observe that \arara\ temporarily interrupts the execution and waits for the dialog box disposal. Also note that the total time includes the idle period as well. + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: pdflatex if showInput(250, 4, 'Important!', +% arara: --> 'Who wrote arara?') == 'Paulo' +\end{codebox} + +\item[\mddbox{C}{R}{showInput(int icon, String title, String text)}{String}]\uimethod{inputbox2} + +This method shows an input dialog box according to the provided parameters. The dialog box is disposed when the user either presses one of the buttons or closes the window. The method returns the content of the input text field, as a trimmed \rbox{String} object. If the user cancels the dialog or closes the window, an empty string is returned. It is important to observe that \arara\ temporarily interrupts the execution and waits for the dialog box disposal. Also note that the total time includes the idle period as well. + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: pdflatex if showInput(4, 'Important!', +% arara: --> 'Who wrote arara?') == 'Paulo' +\end{codebox} +\end{description} + +The UI methods presented in this section can be used for writing \TeX\ tutorials and assisted compilation workflows based on user interactions, including visual input and feedback through dialog boxes. + +\section{Commands and triggers} +\label{sec:commandsandtriggers} + +From version 4.0 on, \arara\ features the \rbox{Command} object, a new approach for handling system commands based on a high level structure with explicit argument parsing. Similarly, there is also the mystical \rbox{Trigger} object that constitutes a very special command that changes the inner workings of our tool at runtime. This section introduces methods for generating such objects. + +\begin{messagebox}{The anatomy of a command}{araracolour}{\icok}{white} +\setlength{\parskip}{1em} +From the user perspective, a \rbox{Command} object is simply a good old list of \rbox{Object} objects, in which the list head (i.e, the first element) is the underlying system command, and the list tail (i.e, the remaining elements), if any, contains the associated command line arguments. For instance: + +{\centering +\setlength\tabcolsep{0.2em} +\begin{tabular}{cccc} +{\footnotesize\em head} & +\multicolumn{3}{c}{\footnotesize\em tail (associated command line arguments)} \\ +\rbox[cyan]{pdflatex} & +\rbox[araracolour]{{-}-shell-escape} & +\rbox[araracolour]{{-}-synctex=1} & +\rbox[araracolour]{thesis.tex} +\end{tabular}\par} + +\vspace{0.4em} + +From the previous example, it is important to observe that a potential file name quoting is not necessary. The underlying system command execution library handles the provided arguments accordingly. + +Behind the scenes, however, \arara\ employs a different workflow when constructing a \rbox{Command} object. The tool sets the working directory path for the current command to \abox[araracolour]{USER\_DIR} which is based on the current execution. The working directory path can be explicitly set through specific method calls, described later on in this section. + +The list of objects is then completely flattened and all elements are mapped to their string representations through corresponding \mtbox{toString} calls. Finally, the proper \rbox{Command} object is constructed. Keep in mind that, although a command takes a list (or even an array) of objects, which can be of any type, the internal representation is \emph{always} a list of strings. +\end{messagebox} + +A list of objects might contain nested lists, i.e, a list within another list. As previously mentioned, \arara\ employs \emph{list flattening} when handling a list of objects during a \rbox{Command} object instantiation. As a means to illustrate this handy feature, consider the following list of integers: + +\begin{codebox}{A list with nested lists}{teal}{\icnote}{white} +[ 1, 2, [ 3, 4 ], 5, [ [ 6, 7 ], 8 ], 9, [ [ 10 ] ] +\end{codebox} + +Note that the above list of integers contains nested lists. When applying list flattening, \arara\ recursively adds the elements of nested lists to the original list and then removes the nested occurrences. Please refer to the source code for implementation details. The new flattened list is presented as follows. + +\begin{codebox}{A flattened list}{teal}{\icnote}{white} +[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] +\end{codebox} + +List flattening and string mapping confer expressiveness and flexibility to the \rbox{Command} object construction, as users can virtually use any data type to describe the underlying rule logic and yet obtain a consistent representation. + +\begin{messagebox}{The anatomy of a trigger}{araracolour}{\icok}{white} +\setlength{\parskip}{1em} +A \rbox{Trigger} object constitutes a special command that changes the internal workings of \arara\ at runtime. It is a highly experimental feature. A trigger is basically a function call defined in terms of a \rbox{String} reference representing the actual function name followed by an optional list of \rbox{Object} arguments. For instance, consider this hypothetical trigger that multiplies an arbitrary number of integer terms: + +{\centering +\setlength\tabcolsep{0.2em} +\begin{tabular}{cccc} +{\footnotesize\em name} & +\multicolumn{3}{c}{\footnotesize\em list of arguments} \\ +\rbox[cyan]{multiply} & +\rbox[araracolour]{\hphantom{w}12\hphantom{w}} & +\rbox[araracolour]{\hphantom{w}34\hphantom{w}} & +\rbox[araracolour]{\hphantom{w}65\hphantom{w}} +\end{tabular}\par} + +\vspace{0.4em} + +This description is, in some aspects, very much like a typical \rbox{Command} construction. However, a trigger is less forgiving on data types and does not apply transformations on the provided list of arguments. Therefore, the argument types \emph{must match} the trigger signature. + +So far, the tool provides only one trigger, seen in action in one of the official rules, under the name \rbox{halt} and with no parameters. This particular trigger halts the current interpretation workflow, such that subsequent directives are ignored. We have not worked much on triggers yet, and the concept is mentioned here for documentation purposes only. +\end{messagebox} + +\begin{description} +\item[\mdbox{R}{getCommand(List<String> elements)}{Command}] This method, as the name implies, returns a \rbox{Command} object according to the provided list of \rbox{String} elements. If the list is empty, the tool will ignore the execution. + +\begin{codebox}{Example}{teal}{\icnote}{white} +return getCommand([ 'ls', '-l' ]); +\end{codebox} + +\item[\mdbox{R}{getCommand(Object... elements)}{Command}] This method, as the name implies, returns a \rbox{Command} object according to the provided array of \rbox{Object} elements. If the array is empty, the tool will ignore the execution. Note that the object array is denoted by a comma-separated sequence of elements in the actual method call, resulting in a variable number of parameters. + +\begin{codebox}{Example}{teal}{\icnote}{white} +return getCommand('pdflatex', '--shell-escape', 'thesis.tex'); +\end{codebox} + +\item[\mdbox{R}{getTrigger(String name)}{Trigger}] This method, as the name implies, returns a \rbox{Trigger} object according to the provided \rbox{String} reference as function name. It is important to observe that this particular trigger instance does not have parameters. + +\begin{codebox}{Example}{teal}{\icnote}{white} +return getTrigger('halt'); +\end{codebox} + +\item[\mdbox{R}{getTrigger(String name, Object... parameters)}{Trigger}] This method, as the name implies, returns a proper \rbox{Trigger} object according to the provided \rbox{String} reference as function name and the \rbox{Object} array as associated parameters. Note that the object array is denoted by a comma-separated sequence of elements in the actual method call, resulting in a variable number of parameters. + +\begin{codebox}{Example}{teal}{\icnote}{white} +return getTrigger('multiply', 12, 34, 65); +\end{codebox} + +\item[\mdbox{R}{\parbox{0.62\textwidth}{getCommandWithWorkingDirectory(File directory,\\\hspace*{1em} List<String> elements)}}{Command}] This method, as the name implies, sets the working directory based on the provided \rbox{File} reference and returns a proper \rbox{Command} object according to the provided list of \rbox{String} elements. If the list is empty, the tool will ignore the execution. + +\begin{codebox}{Example}{teal}{\icnote}{white} +return getCommandWithWorkingDirectory(toFile('/home/paulo'), + [ 'ls', '-l' ]); +\end{codebox} + +\item[\mdbox{R}{\parbox{0.58\textwidth}{getCommandWithWorkingDirectory(String path,\\\hspace*{1em} List<String> elements)}}{Command}] This method, as the name implies, sets the working directory based on the provided \rbox{String} reference and returns a proper \rbox{Command} object according to the provided list of \rbox{String} elements. If the list is empty, the tool will ignore the execution. + +\begin{codebox}{Example}{teal}{\icnote}{white} +return getCommandWithWorkingDirectory('/home/paulo', + [ 'ls', '-l' ]); +\end{codebox} + +\item[\mdbox{R}{\parbox{0.62\textwidth}{getCommandWithWorkingDirectory(File directory,\\\hspace*{1em} Object... elements)}}{Command}] This method, as the name implies, sets the working directory based on the provided \rbox{File} reference and returns a proper \rbox{Command} object according to the provided array of \rbox{Object} elements. If the array is empty, the tool will ignore the execution. Note that the object array is denoted by a comma-separated sequence of elements in the actual method call, resulting in a variable number of parameters. + +\begin{codebox}{Example}{teal}{\icnote}{white} +return getCommandWithWorkingDirectory(toFile('/home/paulo'), + 'pdflatex', '--shell-escape', 'thesis.tex'); +\end{codebox} + +\item[\mdbox{R}{\parbox{0.58\textwidth}{getCommandWithWorkingDirectory(String path,\\\hspace*{1em} Object... elements)}}{Command}] This method, as the name implies, sets the working directory based on the provided \rbox{String} reference and returns a proper \rbox{Command} object according to the provided array of \rbox{Object} elements. If the array is empty, the tool will ignore the execution. Note that the object array is denoted by a comma-separated sequence of elements in the actual method call, resulting in a variable number of parameters. + +\begin{codebox}{Example}{teal}{\icnote}{white} +return getCommandWithWorkingDirectory('/home/paulo', + 'pdflatex', '--shell-escape', 'thesis.tex'); +\end{codebox} +\end{description} + +The methods presented in this section constitute the foundations of underlying system command execution. In particular, whenever possible, it is highly advisable to use \rbox{Command} objects through proper \mtbox{getCommand} method calls, as the plain string approach used in previous versions of our tool is marked as deprecated and will be removed in future versions. + +\section{Others} +\label{sec:others} + +This section introduces assorted methods provided by \arara\ as a means to improve the automation itself with expressive rules and enhance the user experience. Such methods are properly described as follows. + +\begin{messagebox}{Session}{araracolour}{\icok}{white} +Rules are designed under the \emph{encapsulation} notion, such that the direct access to internal workings of such structures is restricted. However, as a means to support framework awareness, \arara\ provides a mechanism for data sharing across rule contexts, implemented as a \rbox{Session} object. In practical terms, this particular object is a global, persistent map composed of \rbox{String} keys and \rbox{Object} values available throughout the entire execution. The public methods are described as follows: + +\begin{description} +\item[\mtbox{insert(String key, Object value)}\hfill\rrbox{void}] This method, as the name implies, inserts an object into the session, indexed by the provided key. Observe that, if the session previously contained a mapping for the provided key, the old value is replaced by the specified value. + +\item[\mtbox{remove(String key)}\hfill\rrbox{void}] This method, as the name implies, removes the mapping for the provided key from the session. Be mindful that an attempt to remove a mapping for a nonexistent key will raise an exception. + +\item[\mtbox{exists(String key)}\hfill\rrbox{boolean}] This method, as the name implies, returns a boolean value according to whether the session contains a mapping for the provided key. It is highly advisable to use this method before attempting to remove a mapping from the session. + +\item[\mtbox{obtain(String key)}\hfill\rrbox{Object}] This method, as the name implies, returns the object value to which the specified key is mapped. Be mindful that an attempt to return a value for a nonexistent key will raise an exception. + +\item[\mtbox{forget()}\hfill\rrbox{void}] This method, as the name implies, removes all of the existing mappings from the session. The session object will be effectively empty after this call returns. +\end{description} + +It is important to observe that the \rbox{Session} object provided by our tool follows the \emph{singleton} pattern, i.e, a software design pattern that restricts the instantiation of a class to one object. Therefore, the same session is consistently shared across rule contexts. +\end{messagebox} + +\begin{description} +\item[\mdbox{R}{getSession()}{Session}] This method, as the name implies, returns the \rbox{Session} object for data sharing across rule contexts. Keep in mind that a session cannot contain duplicate keys. Each key can map to at most one value. + +\begin{codebox}{Example}{teal}{\icnote}{white} +name = getSession().obtain('name'); +\end{codebox} + +\item[\mdbox{R}{throwError(String message)}{void}] This method deliberately throws an error to be intercepted later on during execution. Consider using such method for an explicit notification about unexpected or unsought scenarios, e.g, wrong parameter types or values. The raised error has an associated message which is displayed in the terminal and added to the log file. + +\begin{codebox}{Example}{teal}{\icnote}{white} +options = 'not a list'; +if (!isList(options)) { + throwError('I was expecting a list.'); +} +\end{codebox} + +\item[\mdbox{R}{isVerboseMode()}{boolean}] This method, as the name implies, returns a boolean value according to whether \arara\ is being executed in verbose mode, enabled through either the \opbox{{-}verbose} command line option or the corresponding key in the configuration file (detailed in Sections~\ref{sec:options} and~\ref{sec:basicstructure}, respectively). Note that the logical negation of such method indicates whether the tool is being executed in silent mode. + +\begin{codebox}{Example}{teal}{\icnote}{white} +verbose = isVerboseMode(); +\end{codebox} + +\item[\mdbox{R}{isOnPath(String name)}{boolean}] This method, as the name implies, returns a boolean value according to whether the provided \rbox{String} reference representing a command name is reachable from the system path. For portability reasons, there is no need to provide extensions to Microsoft Windows command names, as \arara\ will look for common patterns. This behaviour is expected and by design. However, be mindful that the search is case sensitive. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = isOnPath('pdftex'); +\end{codebox} + +\begin{messagebox}{Path inspection}{araracolour}{\icok}{white} +According to the \href{https://en.wikipedia.org/wiki/PATH_(variable)}{Wikipedia entry}, \abox[araracolour]{PATH} is an environment variable on Unix-like operating systems and Microsoft Windows, specifying a set of directories where executable programs are located. \arara\ performs a file search operation based on all directories specified in the system path, filtering files by name (and extensions, when in Microsoft Windows). When an exact match is found, the search is concluded. Notwithstanding the great effort, it is very important to note that there is no guarantee that our tool will be able to correctly reach the command in all scenarios. +\end{messagebox} + +\item[\mdbox{R}{unsafelyExecuteSystemCommand(Command command)}{Pair<Integer, String>}] This method, which has a very spooky name, unsafely executes the provided \rbox{Command} reference and returns an ordered pair containing the exit status and the command output. Note that, if an exception is raised during the command execution, \rbox{-99} is assigned as exit status and an empty string is defined as command output. Please make sure to always check the returned integer status when using this method. + +\begin{codebox}{Example}{teal}{\icnote}{white} +result = unsafelyExecuteSystemCommand(getCommand('ls')); +\end{codebox} + +\begin{messagebox}{Hic sunt leones}{attentioncolour}{\icattention}{black} +Please \emph{do not abuse} this method! Keep in mind that this particular feature is included for very specific scenarios in which the command streams are needed ahead of time for proper decision making. +\end{messagebox} + +\item[\mdbox{R}{\parbox{0.62\textwidth}{mergeVelocityTemplate(File input, File output,\\\hspace*{1em} Map<String, Object> map)}}{void}] This method, as the name implies, merges the provided \rbox{File} template reference written in the Velocity Template Language 1.7 specification with the \rbox{Map} data object in order to produce a corresponding \rbox{File} output. It is important to observe that this method will raise an exception if the provided input file does not exist or if there is an error with the underlying template language. + +\begin{ncodebox}{Source file}{teal}{\icnote}{white}{input.txt} +Hello, my name is ${name} and +I am from ${country}! +\end{ncodebox} + +\begin{codebox}{Example}{teal}{\icnote}{white} +mergeVelocityTemplate(toFile('input.txt'), toFile('output.txt'), + [ 'name' : 'Paulo', 'country' : 'Brazil' ]) +\end{codebox} + +\begin{messagebox}{Velocity Template Language 1.7}{attentioncolour}{\icattention}{black} +\setlength{\parskip}{1em} +As of 2017, the Apache Foundation has released the new 2.0 version for the Velocity Template Language. However, this particular version introduces behavioural and syntactic changes that may cause problems with older versions. + +In order to maintain compatibility with older Java virtual machines, \arara\ works with the \href{http://velocity.apache.org/engine/1.7/vtl-reference.html}{VTL 1.7 specification}, so it is highly recommended to strictly adhere to this reference when writing templates for the corresponding method or the official \rbox{velocity} rule. +\end{messagebox} +\end{description} + +The methods presented in this section provide interesting features for persistent data sharing, error handling, early command execution, and templating. It is important to note that more classes, objects and methods can be incorporated into \arara\ through class loading and object instantiation, extending the features and enhancing the overall user experience. diff --git a/Master/texmf-dist/doc/support/arara/chapters/mvel.tex b/Master/texmf-dist/doc/support/arara/chapters/mvel.tex new file mode 100644 index 00000000000..7dd9564576e --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/chapters/mvel.tex @@ -0,0 +1,242 @@ +% !TeX root = ../arara-manual.tex +\chapter{MVEL} +\label{chap:mvel} + +According to the \href{https://en.wikipedia.org/wiki/MVEL}{Wikipedia entry}, the MVFLEX Expression Language (hereafter referred as \gls{MVEL}) is a hybrid, dynamic, statically typed, embeddable expression language and runtime for the Java platform. Originally started as a utility language for an application framework, the project is now developed completely independently. \arara\ relies on this scripting language in two circumstances: + +\begin{enumerate} +\item\emph{Rules}, as nominal attributes gathered from directives are used to build complex command invocations and additional computations. A rule follows a very strict model, detailed in Section~\ref{sec:rule}, on page~\pageref{sec:rule}. + +\item\emph{Conditionals}, as logical expressions must be evaluated in order to decide whether and how a directive should be interpreted. Conditionals are detailed in Section~\ref{sec:directives}, on page~\pageref{sec:directives}. +\end{enumerate} + +This chapter only covers the relevant parts of the \gls{MVEL} language for a consistent use with \arara. For advanced topics, I highly recommend the official language guide for \gls{MVEL} 2.0, available online. + +\section{Basic usage} +\label{sec:mvelbasicusage} + +The following primer is provided by the \href{https://mvel.documentnode.com/}{official language guide}, almost verbatim, with a few modifications to make it more adherent to our needs with \arara. Consider the following expression: + +\begin{codebox}{Simple property expression}{teal}{\icnote}{white} +user.name +\end{codebox} + +In this expression, we have a single identifier \rbox{user.name}, which by itself is a property expression, in that the only purpose of such an expression is to extract a property out of a variable or context object, namely \rbox{user}. Property expressions are widely used by \arara, as directive parameters are converted to a map inside the corresponding rule scope. For instance, a parameter \rbox{foo} in a directive will be mapped as \rbox{parameters.foo} inside a rule during interpretation. This topic is detailed in Section~\ref{sec:directives}, on page~\pageref{sec:directives}. The scripting language can also be used for evaluating a boolean expression: + +\begin{codebox}{Boolean expression evaluation}{teal}{\icnote}{white} +user.name == 'John Doe' +\end{codebox} + +This expression yields a boolean result, either \rbox{true} or \rbox{false} based on a comparison operation. Like a typical programming language, \gls{MVEL} supports the full gamut of operator precedence rules, including the ability to use bracketing to control execution order: + +\begin{codebox}{Execution order control through bracketing}{teal}{\icnote}{white} +(user.name == 'John Doe') && ((x * 2) - 1) > 20 +\end{codebox} + +You may write scripts with an arbitrary number of statements using a semicolon to denote the termination of a statement. This is required in all cases except in cases where there is only one statement, or for the last statement in a script: + +\begin{codebox}{Multiple statements}{teal}{\icnote}{white} +statement1; statement2; statement3 +\end{codebox} + +It is important to observe that \gls{MVEL} expressions use a \emph{last value out} principle. This means, that although \gls{MVEL} supports the \rbox{return} keyword, it can be safely omitted. For example: + +\begin{codebox}{Automatic return}{teal}{\icnote}{white} +foo = 10; +bar = (foo = foo * 2) + 10; +foo; +\end{codebox} + +In this particular example, the expression automatically returns the value of \rbox{foo} as it is the last value of the expression. It is functionally identical to: + +\begin{codebox}{Explicit return}{teal}{\icnote}{white} +foo = 10; +bar = (foo = foo * 2) + 10; +return foo; +\end{codebox} + +Personally, I like to explicitly add a \rbox{return} statement, as it provides a visual indication of the expression exit point. All rules released with \arara\ favour this writing style. However, feel free to choose any writing style you want, as long as the resulting code is consistent. + +The type coercion system of \gls{MVEL} is applied in cases where two incomparable types are presented by attempting to coerce the right value to that of the type of the left value, and then vice-versa. For example: + +\begin{codebox}{Type coercion}{teal}{\icnote}{white} +"123" == 123; +\end{codebox} + +Surprisingly, the evaluation of such expression holds \rbox{true} in \gls{MVEL} because the underlying type coercion system will coerce the untyped number \rbox{123} to a string \rbox{123} in order to perform the comparison. + +\section{Inline lists, maps and arrays} +\label{sec:mvelinlinelistsmapsandarrays} + +According to the documentation, \gls{MVEL} allows you to express lists, maps and arrays using simple elegant syntax. Lists are expressed in the following format: + +\begin{codebox}{Creating a list}{teal}{\icnote}{white} +[ "Jim", "Bob", "Smith" ] +\end{codebox} + +Note that lists are denoted by comma-separated values delimited by square brackets. Similarly, maps (sets of key/value attributes) are expressed in the following format: + +\begin{codebox}{Creating a map}{teal}{\icnote}{white} +[ "Foo" : "Bar", "Bar" : "Foo" ] +\end{codebox} + +Note that attributes are composed by a key, a colon and the corresponding value. A map is denoted by comma-separated attributes delimited by square brackets. Finally, arrays are expressed in the following format: + +\begin{codebox}{Creating an array}{teal}{\icnote}{white} +{ "Jim", "Bob", "Smith" } +\end{codebox} + +One important aspect about inline arrays is their special ability to be coerced to other array types. When you declare an inline array, it is untyped at first and later coerced to the type needed in context. For instance, consider the following code, in which \rbox{sum} takes an array of integers: + +\begin{codebox}{Array coercion}{teal}{\icnote}{white} +math.sum({ 1, 2, 3, 4 }); +\end{codebox} + +In this case, the scripting language will see that the target method accepts an integer array and automatically type the provided untyped array as such. This is an important feature exploited by \arara\ when calling methods within the rule or conditional scope. + +\section{Property navigation} +\label{sec:propertynavigation} + +\gls{MVEL} provides a single, unified syntax for accessing properties, static fields, maps and other structures. Lists are accessed the same as arrays. For example, these two constructs are equivalent (\gls{MVEL} and Java access styles for lists and arrays, respectively): + +\begin{codebox}{MVEL access style for lists and arrays}{teal}{\icnote}{white} +user[5] +\end{codebox} + +\begin{codebox}{Java access style for lists and arrays}{teal}{\icnote}{white} +user.get(5) +\end{codebox} + +Observe that \gls{MVEL} accepts plain Java methods as well. Maps are accessed in the same way as arrays except any object can be passed as the index value. For example, these two constructs are equivalent (\gls{MVEL} and Java access styles for maps, respectively): + +\begin{codebox}{MVEL access style for maps}{teal}{\icnote}{white} +user["foobar"] +user.foobar +\end{codebox} + +\begin{codebox}{Java access style for maps}{teal}{\icnote}{white} +user.get("foobar") +\end{codebox} + +It is advisable to favour such access styles over their Java counterparts when writing rules and conditionals for \arara. The clean syntax helps to ensure more readable code. + +\section{Flow control} +\label{sec:mvelflowcontrol} + +The expression language goes beyond simple evaluations. In fact, \gls{MVEL} supports an assortment of control flow operators (namely, conditionals and repetitions) which allows advanced scripting operations. Consider this conditional statement: + +\begin{codebox}{Conditional statement}{teal}{\icnote}{white} +if (var > 0) { + r = "greater than zero"; +} +else if (var == 0) { + r = "exactly zero"; +} +else { + r = "less than zero"; +} +\end{codebox} + +As seen in the previous code, the syntax is very similar to the ones found in typical programming languages. \gls{MVEL} also provides a shorter version, known as a ternary statement: + +\begin{codebox}{Ternary statement}{teal}{\icnote}{white} +answer == true ? "yes" : "no"; +\end{codebox} + +The \rbox{foreach} statement accepts two parameters separated by a colon, the first being the local variable holding the current element, and the second the collection or array to be iterated over. For example: + +\begin{codebox}{Iteration statement}{teal}{\icnote}{white} +foreach (name : people) { + System.out.println(name); +} +\end{codebox} + +As expected, \gls{MVEL} also implements the standard C \rbox{for} loop. Observe that newer versions of \gls{MVEL} allow an abbreviation of \rbox{foreach} to the usual \rbox{for} statement, as syntactic sugar. In order to explicitly indicate a collection iteration, we usually use \rbox{foreach} in the default rules for \arara, but both statements behave exactly the same from a semantic point of view. + +\begin{codebox}{Iteration statement}{teal}{\icnote}{white} +for (int i = 0; i < 100; i++) { + System.out.println(i); +} +\end{codebox} + +The scripting language also provides two versions of the \rbox{do} statement: one with \rbox{while} and one with \rbox{until} (the latter being the exact inverse of the former): + +\begin{codebox}{Iteration statement}{teal}{\icnote}{white} +do { + x = something(); +} while (x != null); +\end{codebox} + +\begin{codebox}{Iteration statement}{teal}{\icnote}{white} +do { + x = something(); +} until (x == null); +\end{codebox} + +Finally, \gls{MVEL} also implements the standard \rbox{while}, with the significant addition of an \rbox{until} counterpart (for inverted logic): + +\begin{codebox}{Iteration statement}{teal}{\icnote}{white} +while (isTrue()) { + doSomething(); +} +\end{codebox} + +\begin{codebox}{Iteration statement}{teal}{\icnote}{white} +until (isFalse()) { + doSomething(); +} +\end{codebox} + +Since \rbox{while} and \rbox{until} are unbounded (i.e, the number of iterations required to solve a problem may be unpredictable), we usually tend to avoid using such statements when writing rules for \arara. + +\section{Projections and folds} +\label{sec:mvelprojectionsandfolds} + +Projections are a way of representing collections. According to the official documentation, using a very simple syntax, one can inspect very complex object models inside collections in \gls{MVEL} using the \rbox{in} operator. For example: + +\begin{codebox}{Projection and fold}{teal}{\icnote}{white} +names = (user.name in users); +\end{codebox} + +As seen in the above code, \rbox{names} holds all values from the \rbox{name} property of each element, represented locally by a placeholder \rbox{user}, from the collection \rbox{users} being inspected. This feature can even perform nested operations. + +\section{Assignments} +\label{sec:mvelassignments} + +According to the official documentation, the scripting language allows variable assignment in expressions, either for extraction from the runtime, or for use inside the expression. As \gls{MVEL} is a dynamically typed language, there is no need to specify a type in order to declare a new variable. However, feel free to explicitly declare the type when desired. + +\begin{codebox}{Assignment}{teal}{\icnote}{white} +str = "My string"; +String str = "My string"; +\end{codebox} + +Unlike Java, however, the scripting language provides automatic type conversion (when possible) when assigning a value to a typed variable. In the following example, an integer value is assigned to a string: + +\begin{codebox}{Assignment}{teal}{\icnote}{white} +String num = 1; +\end{codebox} + +For dynamically typed variables, in order to perform a type conversion, it is just a matter of explicitly casting the value to the desired type. In the following example, an explicit string cast is assigned to the \rbox{num} variable: + +\begin{codebox}{Assignment}{teal}{\icnote}{white} +num = (String) 1; +\end{codebox} + +When writing rules for \arara, is advisable to keep variables to a minimum in order to avoid unnecessary assignments and a potential performance drop. However, make sure to favour readability over unmaintained code. + +\section{Basic templating} +\label{sec:mvelbasictemplating} + +\gls{MVEL} templates are comprised of \emph{orb} tags inside a plain text document. \Glspl{orb-tag} denote dynamic elements of the template which the engine will evaluate at runtime. \arara\ heavily relies on this concept for runtime evaluation of conditionals and rules. For rules, we use \glspl{orb-tag} to return either a string from a textual template or a proper command object. The former constituted the basis of command generation in previous versions of our tool; from version 4.0 on, we highly recommend the latter, detailed in Section~\ref{sec:rule}, on page~\ref{sec:rule}. Conditionals are in fact \glspl{orb-tag} in disguise, such that the expression (or a sequence of expressions) is properly evaluated at runtime. Consider the following example: + +\begin{codebox}{Template}{teal}{\icnote}{white} +My favourite team is @{ person.name == 'Enrico' +? 'Juventus' : 'Palmeiras' }! +\end{codebox} + +The above code features a basic form of \gls{orb-tag} named \emph{expression orb}. It contains an expression (or a sequence of expressions) which will be evaluated to a certain value, as seen earlier on, when discussing the \emph{last value out} principle. In the example, the value to be returned will be a string containing a football team name (the result is of course based on the comparison outcome). + +\section{Further reading} +\label{sec:mvelfurtherreading} + +This chapter does not cover all features of the \gls{MVEL} expression language, so further reading is advisable. I highly recommend the \href{http://mvel.documentnode.com/}{MVEL language guide} currently covering version 2.0 of the language. diff --git a/Master/texmf-dist/doc/support/arara/chapters/prologue.tex b/Master/texmf-dist/doc/support/arara/chapters/prologue.tex new file mode 100644 index 00000000000..ed776722378 --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/chapters/prologue.tex @@ -0,0 +1,27 @@ +% !TeX root = ../arara-manual.tex +\chapter*{Prologue} +\label{chap:prologue} + +\epigraph{Moral of the story: never read the +documentation, bad things happen.}{\textsc{David Carlisle}} + +{\setlength{\parskip}{1em} +Writing software is easy. Writing \emph{good} software is extremely difficult. When the counter stopped at version 3.0, Brent, Marco and I decided it was time for \arara\ to graduate and finally be released in \TeX\ Live. My life had changed. + +It was a success. A lot of people liked the idea of explicitly telling our tool how to compile their \TeX\ documents instead of relying on guesswork. It was indeed a cool concept! But then, the inevitable happened: a lot of bugs had emerged from the dark depths of my humble code. + +In all seriousness, \emph{I was about to give up}. My code was not awful, but there were a couple of critical and blocking bugs. Something very drastic had to be done in order to put \arara\ back on track. Then, walking on faith, I decided to rewrite the tool entirely from scratch. In order to achieve this goal, I created a \href{https://github.com/cereda/nightingale}{sandbox} and started working on the new code. + +It was my redemption. Nicola helped me with the new version, writing code, fixing bugs and suggesting new features. Soon, we all achieved a very pleasant result. It was like \arara\ was about to hatch again. Version 4.0 was definitely at our hands. Now, it is up to you. + +Surprisingly, this humble user manual is not the best resource for learning about our tool. If you really want to see \arara\ in action, I strongly recommend \href{https://www.dickimaw-books.com/latex/admin}{\LaTeX\ for administrative work}, an amazing book freely available for download. The author is, of course, Nicola herself! She explains how \LaTeX\ can be used for administrative work, such as writing correspondence, performing repetitive tasks or typesetting problem sheets on exam papers. And \arara\ is there! + +Enjoy the new version. Happy \TeX ing with \arara! +\par} + +\vfill + +\begin{flushright} +Paulo Roberto Massa Cereda\\ +\emph{on behalf of the \arara\ team} +\end{flushright} diff --git a/Master/texmf-dist/doc/support/arara/chapters/rules.tex b/Master/texmf-dist/doc/support/arara/chapters/rules.tex new file mode 100644 index 00000000000..f7a29b465ff --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/chapters/rules.tex @@ -0,0 +1,917 @@ +% !TeX root = ../arara-manual.tex +\chapter{The official rule pack} +\label{chap:theofficialrulepack} + +\arara\ ships with a pack of default rules, placed inside a special subdirectory named \abox[araracolour]{rules/} inside another special directory named \abox[araracolour]{ARARA\_HOME} (the place where our tool is installed). This chapter introduces the official rules, including proper listings and descriptions of associated parameters whenever applied. Note that such rules work off the shelf, without any special installation, configuration or modification. An option marked by \rbox[araracolour]{S} after the corresponding identifier indicates a natural boolean switch. Similarly, the occurrence of an \rqbox\ mark indicates that the corresponding option is required. + +\begin{messagebox}{Can my rule be distributed within the official pack?}{araracolour}{\icok}{white} +As seen in Section~\ref{sec:basicstructure}, on page~\pageref{sec:basicstructure}, the default rule path can be extended to include a list of directories in which our tool should search for rules. However, if you believe your rule is comprehensive enough and deserves to be in the official pack, please contact us! We will be more than happy to discuss the inclusion of your rule in forthcoming updates. +\end{messagebox} + +\begin{description} +\item[\rulebox{animate}{Chris Hughes, Paulo Cereda}] +This rule creates an animated \rbox{gif} file from the corresponding base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string concatenated with the \rbox{pdf} suffix, using the \rbox{convert} command line utility from the ImageMagick suite. + +\begin{description} +\item[\rpbox{delay}{10}] This option regulates the number of ticks before the display of the next image sequence, acting as a pause between still frames. + +\item[\rpbox{loop}{0}] This option regulates the number of repetitions for the animation. When set to zero, the animation repeats itself an infinite number of times. + +\item[\rpbox{density}{300}] This option specifies the horizontal and vertical canvas resolution while rendering vector formats into a proper raster image. + +\item[\rpbox{program}{convert}] This option specifies the command utility path as a means to avoid potential clashes with underlying operating system commands. + +\begin{messagebox}{Microsoft Windows woes}{attentioncolour}{\icattention}{black} +\setlength{\parskip}{1em} +According to the \href{http://www.imagemagick.org/Usage/windows/}{ImageMagick website}, the Windows installation routine adds the program directory to the system path, such that one can call command line tools directly from the command prompt, without providing a path name. However, \rbox{convert} is also the name of Windows system tool, located in the system directory, which converts file systems from one format to another. + +The best solution to avoid possible future name conflicts, according to the ImageMagick team, is to call such command line tools by their full path in any script. Therefore, the \rbox{convert} rule provides the \abox{program} option for this specific scenario. +\end{messagebox} + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: animate: { delay: 15, density: 150 } +\end{codebox} + +\item[\rulebox{bib2gls}{Nicola Talbot, Paulo Cereda}] This rule executes the \rbox{bib2gls} command line application which extracts glossary information stored in a \rbox{bib} file and converts it into glossary entry definitions in resource files. This rule passes the base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as the mandatory argument. + +\begin{description} +\item[\abox{dir}] This option sets the directory used for writing auxiliary files. Note that this option does not change the current working directory. + +\item[\abox{trans}] This option sets the extension of the transcript file created by \rbox{bib2gls}. The value should be just the file extension without the leading dot. The default is \rbox{glg}. + +\item[\abox{locale}] This option specifies the preferred language resource file. Please keep in mind that the provided value must be a valid \gls{IETF} language tag. If omitted, the default is obtained by \rbox{bib2gls} from the \gls{JVM}. + +\item[\rpsbox{group}] This option sets whether \rbox{bib2gls} will try to determine the letter group for each entry and add it to a new field called \rbox{group} when sorting. Be mindful that some \rbox{sort} options ignore this setting. The default value is off. + +\item[\rpsbox{interpret}] This option sets whether the interpreter mode of \rbox{bib2gls} is enabled. If the interpreter is on, \rbox{bib2gls} will attempt to convert any \LaTeX\ markup in the sort value to the closest matching Unicode characters. If the interpreter is off, the \rbox{log} file will not be parsed for recognised packages. The default value is on. + +\item[\rpsbox{breakspace}] This option sets whether the interpreter will treat a tilde character as a non-breaking space (as with \TeX) or a normal space. The default behaviour treats it as non-breakable. + +\item[\rpsbox{trimfields}] This option sets whether \rbox{bib2gls} will trim leading and trailing spaces from field values. The default behaviour does not trim spaces. + +\item[\rpsbox{recordcount}] This option sets whether the record counting will be enabled. If activated, \rbox{bib2gls} will add record count fields to entries. The default behaviour is off. + +\item[\rpsbox{recordcountunit}] This option sets whether \rbox{bib2gls} will add unit record count fields to entries. These fields can then be used with special commands. The default behaviour is off. + +\item[\rpsbox{cite}] This option sets whether \rbox{bib2gls} will treat citation instances found in the \rbox{aux} file as though it was actually an ignored record. The default behaviour is off. + +\item[\rpsbox{verbose}] This option sets whether \rbox{bib2gls} will be executed in verbose mode. When enabled, the application will write extra information to the terminal and transcript file. This option is unrelated to \arara's verbose mode. The default behaviour is off. + +\item[\rpsbox{merge}] This option sets whether the program will merge \rbox{wrglossary} counter records. If disabled, one may end up with duplicate page numbers in the list of entry locations, but linking to different parts of the page. The default is on. + +\item[\rpsbox{uniscript}] This option sets whether text superscript and subscript will use the corresponding Unicode characters if available. The default is on. + +\item[\abox{packages}] This option instructs the interpreter to assume the packages from the provided list have been used by the document. + +\item[\abox{ignore}] This option instructs \rbox{bib2gls} to skip the check for any package from the provided list when parsing the corresponding log file. + +\item[\abox{custom}] This option instructs the interpreter to parse the package files from the provided list. The package files need to be quite simple. + +\item[\abox{mapformats}] This option takes a list and sets up the rule of precedence for partial location matches. Each element from the provided list must be another list of exactly two entries representing a conflict resolution. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: bib2gls: { group: true } +% arara: --> if found('aux', 'glsxtr@resource') +\end{codebox} + +\item[\rulebox{biber}{Marco Daniel, Paulo Cereda}] This rule runs \rbox{biber}, the backend bibliography processor for \rbox{biblatex}, on the corresponding base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string. + +\begin{description} +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: biber: { options: [ '--wraplines' ] } +\end{codebox} + +\item[\rulebox{bibtex}{Marco Daniel, Paulo Cereda}] This rule runs the \rbox{bibtex} program, a reference management software, on the corresponding base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string. + +\begin{description} +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: bibtex: { options: [ '-terse' ] } +% arara: --> if exists(toFile('references.bib')) +\end{codebox} + +\item[\rulebox{bibtex8}{Marco Daniel, Paulo Cereda}] This rule runs \rbox{bibtex8}, an enhanced, portable C version of \rbox{bibtex}, on the corresponding base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string. It is important to note that this tool can read a character set file containing encoding details. + +\begin{description} +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: bibtex8: { options: [ '--trace', '--huge' ] } +\end{codebox} + +\item[\rulebox{bibtexu}{Marco Daniel, Paulo Cereda}] This rule runs the \rbox{bibtexu} program, an enhanced version of \rbox{bibtex} with Unicode support and language features, on the corresponding base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string. + +\begin{description} +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: bibtexu: { options: [ '--language', 'fr' ] } +\end{codebox} + +\item[\rulebox{clean}{Marco Daniel, Paulo Cereda}] This rule removes the provided file reference through the underlying system command, which can be \rbox{rm} in a Unix environment or \rbox{del} in Microsoft Windows. As a security lock, this rule will always throw an error if \mtbox{currentFile} is equal to \mtbox{getOriginalFile}, so the main file reference cannot be removed. It is highly recommended to use the special \abox{files} parameter to indicate removal candidates. Alternatively, a list of file extensions can be provided as well. Be mindful that the security lock also applies to file removals based on extensions. + +\begin{description} +\item[\abox{extensions}] This option, as the name indicates, takes a list of extensions and constructs a new list of removals commands according to the base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string concatenated with each extension from the original list as suffixes. Keep in mind that, if the special \abox{files} parameter is used with this option, the resulting list will contain the cartesian product of file base names and extensions. An error is thrown if any data structure other than a proper list is provided as the value. + +\begin{messagebox}{Better safe than sorry!}{attentioncolour}{\icattention}{black} +When in doubt, always remember that the \opbox{{-}dry-run} command line option is your friend! As seen in Section~\ref{sec:options}, on page~\pageref{sec:options}, this option makes \arara\ go through all the motions of running tasks and subtasks, but with no actual calls. It is a very useful feature for testing the sequence of removal commands without actually losing your files! Also, as good practice, always write plain, simple, understandable \rbox{clean} directives and use as many as needed in your \TeX\ documents. +\end{messagebox} +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: clean: { extensions: [ aux, log ] } +\end{codebox} + +\item[\rulebox{csplain}{Paulo Cereda}] This rule runs the \rbox{csplain} \TeX\ engine, a conservative extension of Knuth's plain \TeX\ with direct processing characters and hyphenation patterns for Czech and Slovak, on the provided \mtbox{currentFile} reference. + +\begin{description} +\item[\abox{interaction}] This option alters the underlying engine behaviour. When such option is omitted, \TeX\ will prompt the user for interaction in the event of an error. Possible values are, in order of increasing user interaction (courtesy of our master Enrico Gregorio): + +\begin{description} +\item[\povalue{batchmode}] In this mode, nothing is printed on the terminal, and errors are scrolled as if the \rbox{return} key is hit at every error. Missing files that \TeX\ tries to input or request from keyboard input cause the job to abort. + +\item[\povalue{nonstopmode}] In this mode, the diagnostic message will appear on the terminal, but there is no possibility of user interaction just like in batch mode, previously described. + +\item[\povalue{scrollmode}] In this mode, as the name indicates, \TeX\ will stop only for missing files to input or if proper keyboard input is necessary. \TeX\ fixes errors itself. + +\item[\povalue{errorstopmode}] In this mode, \TeX\ will stop at each error, asking for proper user intervention. This is the most user interactive mode available. +\end{description} + +\item[\rpsbox{shell}] This option sets whether the possibility of running underlying system commands from within \TeX\ is activated. + +\item[\rpsbox{synctex}] This option sets whether \rbox{synctex}, an input and output synchronization feature that allows navigation from source to typeset material and vice versa, available in most \TeX\ engines, is activated. + +\item[\rpsbox{draft}] This option sets whether the draft mode, i.e, a mode that produces no output, so the engine can check the syntax, is activated. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: csplain: { interaction: batchmode, shell: yes } +\end{codebox} + +\item[\rulebox{datatooltk}{Nicola Talbot, Paulo Cereda}] This rule runs \rbox{datatooltk}, an application that creates \rbox{datatool} databases in raw format from several structured data formats, in batch mode. This rule requires \abox{output} and one of the import options. + +\begin{description} +\item[\abox{output}~\rqbox] This option provides the database name to be saved as output. To guard against accidentally overwriting a document file, \rbox{datatooltk} now forbids the \rbox{tex} extension for output files. This option is required. + +\item[\abox{csv}] This option, as the name indicates, imports data from the \rbox{csv} file reference provided as a plain string value. + +\item[\abox{sep}] This option specifies the character used to separate values in the \rbox{csv} file. Defaults to a comma. + +\item[\abox{delim}] This option specifies the character used to delimit values in the \rbox{csv} file. Defaults to a double quote. + +\item[\abox{name}] This option, as the name indicates, sets the label reference of the newly created database according to the provided value. + +\item[\abox{sql}] This option imports data from an \gls{SQL} database where the provided value refers to a proper \rbox{select} \gls{SQL} statement. + +\item[\abox{sqldb}] This option, as the name indicates, sets the name of the \gls{SQL} database according to the provided value. + +\item[\abox{sqluser}] This option, as the name indicates, sets the name of the \gls{SQL} user according to the provided value. + +\item[\rpbox{noconsole}{gui}] This action dictates the password request action if such information was not provided earlier. If there is no console available, the action is determined by the following values: + +\begin{description} +\item[\povalue{error}] As the name indicates, this action issues an error when no password was previously provided through the proper option. + +\item[\povalue{stdin}] This action requests the password via the standard input stream, which is less secure than using a console. + +\item[\povalue{gui}] This action displays a dialog box in which the user can enter the password for the \gls{SQL} database. +\end{description} + +\item[\abox{probsoln}] This option, as the name indicates, imports data in the \rbox{probsoln} format from the file name provided as the value. + +\item[\abox{input}] This option, as the name indicates, imports data in the \rbox{datatool} format from the file name provided as the value. + +\item[\abox{sort}] This option, as the name indicates, sorts the database according to the column whose label is provided as the value. The value may be preceded by \rbox{+} or \rbox{-} to indicate ascending or descending order, respectively. If the sign is omitted, ascending is assumed. + +\item[\abox{sortlocale}] This option, as the name indicates, sorts the database according to alphabetical order rules of the locale provided as the value. If the value is set to \rbox{none} strings are sorted according to non-locale letter order. + +\item[\rpsbox{sortcase}] This option sets whether strings will be sorted using case-sensitive comparison for non-locale letter ordering. The default behaviour is case-insensitive. + +\item[\abox{seed}] This option, as the name indicates, sets the random generator seed to the provided value. The seed is cleared if an empty value is provided. + +\item[\rpsbox{shuffle}] This option sets whether the database will be properly shuffled. Shuffle is always performed after sort, regardless of the option order. + +\item[\rpsbox{csvheader}] This option sets whether the \rbox{csv} file has a header row. The +spreadsheet import functions also use this setting. + +\item[\rpsbox{debug}] This option, as the name indicates, sets whether the debug mode of \rbox{datatooltk} is activated. The debug mode is disabled by default. + +\item[\rpsbox{owneronly}] This option sets whether read and write permissions when saving \rbox{dbtex} files should be defined for the owner only. This option has no effect on some operating systems. + +\item[\rpsbox{maptex}] This option sets whether \TeX\ special characters will be properly mapped when importing data from \rbox{csv} files or \gls{SQL} databases. + +\item[\abox{xls}] This option, as the name indicates, imports data from a Microsoft Excel \rbox{xls} file reference provided as a plain string value. + +\item[\abox{ods}] This option, as the name indicates, imports data from an Open Document Spreadsheet \rbox{ods} file reference provided as a plain string value. + +\item[\abox{sheet}] This option specifies the sheet to select from the Excel workbook or Open Document Spreadsheet. This may either be an index or the name of the sheet. + +\item[\abox{filterop}] This option specifies the logical operator to be associated with a given filter. Filtering is always performed after sorting and shuffling. Possible values are: + +\begin{description} +\item[\povalue{or}\hfill\hphantom{w}] This value, as the name indicates, uses the logical \rbox{or} operator when filtering. This is the default behaviour. Note that this value has no effect if only one filter is supplied. + +\item[\povalue{and}] This value, as the name indicates, uses the logical \rbox{and} operator when filtering. Note that this value has no effect if only one filter is supplied. +\end{description} + +\item[\abox{filters}] This option takes a list and sets up a sequence of filters. Each element from the provided list must be another list of exactly three entries representing a key, an operator and a value, respectively. + +\item[\abox{truncate}] This option truncates the database to the number of rows provided as the value. Truncation is always performed after any sorting, shuffling and filtering, but before column removal. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: datatooltk: { +% arara: --> output: books.dbtex, +% arara: --> csv: booklist.csv } +\end{codebox} + +\item[\rulebox{dvipdfm}{Marco Daniel, Paulo Cereda}] This rule runs \rbox{dvipdfm}, a command line utility for file format translation, on the corresponding base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string concatenated with the \rbox{dvi} suffix, generating a Portable Document Format \rbox{pdf} file. + +\begin{description} +\item[\abox{output}] This option, as the name indicates, sets the output name for the generated \rbox{pdf} file. There is no need to provide an extension, as the value is always normalized with \mtbox{getBasename} such that only the name without the associated extension is used. The base name of the current file reference is used as the default value. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: dvipdfm: { output: thesis } +\end{codebox} + +\item[\rulebox{dvipdfmx}{Marco Daniel, Paulo Cereda}] This rule runs \rbox{dvipdfmx}, an extended version of \rbox{dvipdfm} created to support multibyte character encodings and large character sets for East Asian languages, on the corresponding base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string concatenated with the \rbox{dvi} suffix, generating a Portable Document Format \rbox{pdf} file. + +\begin{description} +\item[\abox{output}] This option, as the name indicates, sets the output name for the generated \rbox{pdf} file. There is no need to provide an extension, as the value is always normalized with \mtbox{getBasename} such that only the name without the associated extension is used. The base name of the current file reference is used as the default value. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: dvipdfmx: { options: [ '-K', '40' ] } +\end{codebox} + +\item[\rulebox{dvips}{Marco Daniel, Paulo Cereda}] This rule runs \rbox{dvips} on the corresponding base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string concatenated with the \rbox{dvi} suffix, generating a PostScript \rbox{ps} file. + +\begin{description} +\item[\abox{output}] This option, as the name indicates, sets the output name for the generated \rbox{ps} file. There is no need to provide an extension, as the value is always normalized with \mtbox{getBasename} such that only the name without the associated extension is used. The base name of the current file reference is used as the default value. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: dvips: { output: thesis } +\end{codebox} + +\item[\rulebox{dvipspdf}{Marco Daniel, Paulo Cereda}] This rule runs \rbox{dvips} in order to obtain a corresponding \rbox{ps} file from the initial \rbox{dvi} reference, and then runs \rbox{ps2pdf} on the previously generated \rbox{ps} file in order to obtain a \rbox{pdf} file. Note that all base names are acquired from the \mtbox{currentFile} reference (i.e, the name without the associated extension) and used to construct the resulting files. + +\begin{description} +\item[\abox{output}] This option, as the name indicates, sets the output name for the generated \rbox{pdf} file. There is no need to provide an extension, as the value is always normalized with \mtbox{getBasename} such that only the name without the associated extension is used. The base name of the current file reference is used as the default value. + +\item[\abox{options1}] This option, as the name indicates, takes a list of raw command line options and appends it to the \rbox{dvips} program call. An error is thrown if any data structure other than a proper list is provided as the value. + +\item[\abox{options2}] This option, as the name indicates, takes a list of raw command line options and appends it to the \rbox{ps2pdf} program call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: dvipspdf: { output: article } +\end{codebox} + +\item[\rulebox{etex}{Marco Daniel, Paulo Cereda, Nicola Talbot}] This rule runs the \rbox{etex} extended (plain) \TeX\ engine on the provided \mtbox{currentFile} reference, generating a corresponding file in a device independent format. + +\begin{description} +\item[\abox{interaction}] This option alters the underlying engine behaviour. If this option is omitted, \TeX\ will prompt the user for interaction in the event of an error. Possible values are, in order of increasing user interaction (courtesy of our master Enrico Gregorio): + +\begin{description} +\item[\povalue{batchmode}] In this mode, nothing is printed on the terminal, and errors are scrolled as if the \rbox{return} key is hit at every error. Missing files that \TeX\ tries to input or request from keyboard input cause the job to abort. + +\item[\povalue{nonstopmode}] In this mode, the diagnostic message will appear on the terminal, but there is no possibility of user interaction just like in batch mode, previously described. + +\item[\povalue{scrollmode}] In this mode, as the name indicates, \TeX\ will stop only for missing files to input or if proper keyboard input is necessary. \TeX\ fixes errors itself. + +\item[\povalue{errorstopmode}] In this mode, \TeX\ will stop at each error, asking for proper user intervention. This is the most user interactive mode available. +\end{description} + +\item[\rpsbox{shell}] This option sets whether the possibility of running underlying system commands from within \TeX\ is activated. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: etex: { shell: yes } +\end{codebox} + +\item[\rulebox{frontespizio}{Francesco Endrici, Enrico Gregorio, Paulo Cereda}] This rule automates the steps required by the \rbox{frontespizio} package in order to help Italian users generate the frontispiece to their thesis. First and foremost, the frontispiece is generated. If \rbox{latex} is used as the underlying engine, there is an additional intermediate conversion step to a proper \rbox{eps} file. Finally, the final document is compiled. + +\begin{description} +\item[\rpbox{engine}{pdflatex}] This option, as the name indicates, sets the underlying \TeX\ engine to be used for both compilations (the frontispiece and the document itself). Possible values are: + +\begin{description} +\item[\povalue{latex}] This value, as the name indicates, sets the underlying \TeX\ engine to \rbox{latex} for both compilations (frontispiece and document). + +\item[\povalue{pdflatex}] This value, as the name indicates, sets the underlying \TeX\ engine to \rbox{pdflatex} for both compilations (frontispiece and document). + +\item[\povalue{xelatex}] This value, as the name indicates, sets the underlying \TeX\ engine to \rbox{xelatex} for both compilations (frontispiece and document). + +\item[\povalue{lualatex}] This value, as the name indicates, sets the underlying \TeX\ engine to \rbox{lualatex} for both compilations (frontispiece and document). +\end{description} + +\item[\rpsbox{shell}] This option sets whether the possibility of running underlying system commands from within the selected \TeX\ engine is activated. + +\item[\abox{interaction}] This option alters the underlying engine behaviour. If this option is omitted, \TeX\ will prompt the user for interaction in the event of an error. Possible values are, in order of increasing user interaction (courtesy of our master Enrico Gregorio): + +\begin{description} +\item[\povalue{batchmode}] In this mode, nothing is printed on the terminal, and errors are scrolled as if the \rbox{return} key is hit at every error. Missing files that \TeX\ tries to input or request from keyboard input cause the job to abort. + +\item[\povalue{nonstopmode}] In this mode, the diagnostic message will appear on the terminal, but there is no possibility of user interaction just like in batch mode, previously described. + +\item[\povalue{scrollmode}] In this mode, as the name indicates, \TeX\ will stop only for missing files to input or if proper keyboard input is necessary. \TeX\ fixes errors itself. + +\item[\povalue{errorstopmode}] In this mode, \TeX\ will stop at each error, asking for proper user intervention. This is the most user interactive mode available. +\end{description} + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual \TeX\ engine call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: frontespizio: { engine: xelatex, +% arara: --> shell: yes, interaction: nonstopmode } +\end{codebox} + +\item[\rulebox{halt}{Heiko Oberdiek, Paulo Cereda}] This rule, as the name suggests, calls the \rbox{halt} trigger, which stops the current interpretation workflow, such that subsequent directives are ignored. This rule contains no associated options. Please refer to Section~\ref{sec:commandsandtriggers}, on page~\pageref{sec:commandsandtriggers}, for more information on triggers. + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: halt +\end{codebox} + +\item[\rulebox{indent}{Chris Hughes, Paulo Cereda}] This rule runs \rbox{latexindent}, a Perl script that indents \TeX\ files according to an indentation scheme, on the provided \mtbox{currentFile} reference. Environments, including those with alignment delimiters, and commands, including those that can split braces and brackets across lines, are usually handled correctly by the script. + +\begin{description} +\item[\rpsbox{silent}] This option, as the name indicates, sets whether the script will operate in silent mode, in which no output is given to the terminal. + +\item[\rpsbox{overwrite}] This option, as the name indicates, sets whether the \mtbox{currentFile} reference will be overwritten. If activated, a copy will be made before the actual indentation process. + +\item[\abox{trace}] This option, as the name indicates, enables the script tracing mode, such that a verbose output will be given to the \rbox{indent.log} log file. Possible values are: + +\begin{description} +\item[\povalue{default}] This value, as the name indicates, refers to the default tracing level. Note that, especially for large files, this value does affect performance of the script. + +\item[\povalue{complete}] This value, as the name indicates, refers to the detailed, complete tracing level. Note that, especially for large files, performance of the script will be significantly affected when this value is used. +\end{description} + +\item[\rpsbox{screenlog}] This option, as the name indicates, sets whether \rbox{latexindent} will output the log file to the screen, as well as to the specified log file. + +\item[\rpsbox{modifylinebreaks}] This option, as the name indicates, sets whether the script will modify line breaks, according to specifications written in a configuration file. + +\item[\abox{cruft}] This option sets the provided value as a cruft location in which the script will write backup and log files. The default behaviour sets the working directory as cruft location. + +\item[\abox{logfile}] This option, as the name indicates, sets the name of the log file generated by \rbox{latexindent} according to the provided value. + +\item[\abox{output}] This option, as the name indicates, sets the name of the output file. Please note that this option has higher priority over some switches, so options like \abox{overwrite} will be ignored by the underlying script. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual script call. An error is thrown if any data structure other than a proper list is provided as the value. + +\item[\abox{settings}] This option, as the name indicates, dictates the indentation settings to be applied in the current script execution. Two possible values are available: + +\begin{description} +\item[\povalue{local}] This value, as the name implies, acts a switch to indicate a local configuration. In this scenario, the script will look for a proper settings file in the same directory as the \mtbox{currentFile} reference and add the corresponding content to the indentation scheme. Optionally, a file location can be specified as well. Please refer to the \abox{where} option for more details on such feature. + +\item[\povalue{onlydefault}] This value, as the name indicates, ignores any local configuration, so the script will resort to the default indentation behaviour. +\end{description} + +\item[\abox{where}] This option, as the name indicates, sets the file location containing the indentation settings according to the provided value. This option can only be used if, and only if, \rbox[cyan]{local} is set as the value for the \abox{settings} option, otherwise the rule will throw an error. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: indent: { overwrite: yes } +\end{codebox} + +\item[\rulebox{latex}{Marco Daniel, Paulo Cereda}] This rule runs the \rbox{latex} \TeX\ engine on the provided \mtbox{currentFile} reference, generating a corresponding file in a device independent format. + +\begin{description} +\item[\abox{interaction}] This option alters the underlying engine behaviour. If this option is omitted, \TeX\ will prompt the user for interaction in the event of an error. Possible values are, in order of increasing user interaction (courtesy of our master Enrico Gregorio): + +\begin{description} +\item[\povalue{batchmode}] In this mode, nothing is printed on the terminal, and errors are scrolled as if the \rbox{return} key is hit at every error. Missing files that \TeX\ tries to input or request from keyboard input cause the job to abort. + +\item[\povalue{nonstopmode}] In this mode, the diagnostic message will appear on the terminal, but there is no possibility of user interaction just like in batch mode, previously described. + +\item[\povalue{scrollmode}] In this mode, as the name indicates, \TeX\ will stop only for missing files to input or if proper keyboard input is necessary. \TeX\ fixes errors itself. + +\item[\povalue{errorstopmode}] In this mode, \TeX\ will stop at each error, asking for proper user intervention. This is the most user interactive mode available. +\end{description} + +\item[\rpsbox{shell}] This option sets whether the possibility of running underlying system commands from within \TeX\ is activated. + +\item[\rpsbox{synctex}] This option sets whether \rbox{synctex}, an input and output synchronization feature that allows navigation from source to typeset material and vice versa, available in most \TeX\ engines, is activated. + +\item[\rpsbox{draft}] This option sets whether the draft mode, i.e, a mode that produces no output, so the engine can check the syntax, is activated. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: latex: { interaction: scrollmode, draft: yes } +\end{codebox} + +\item[\rulebox{latexmk}{Marco Daniel, Brent Longborough, Paulo Cereda}] This rule runs \rbox{latexmk}, a fantastic command line tool for fully automated \TeX\ document generation, on the provided \mtbox{currentFile} reference. + +\begin{description} +\item[\abox{clean}] This option, as the name indicates, removes all temporary files generated after a sequence of intermediate calls for document generation. Two possible values are available: + +\begin{description} +\item[\povalue{all}] This value, as the name indicates, removes all temporary, intermediate files, as well as resulting, final formats such as PostScript and Portable Document File. Only relevant source files are kept. + +\item[\povalue{partial}] This value, as the name indicates, removes all temporary, intermediate files and keeps the resulting, final formats such as PostScript and Portable Document File. +\end{description} + +\item[\abox{engine}] This option, as the name indicates, sets the underlying \TeX\ engine of \rbox{latexmk} to be used for the compilation sequence. Possible values are: + +\begin{description} +\item[\povalue{latex}] This value, as the name indicates, sets the underlying \TeX\ engine of the script to \rbox{latex} for the compilation sequence. + +\item[\povalue{pdflatex}] This value, as the name indicates, sets the underlying \TeX\ engine of the script to \rbox{pdflatex} for the compilation sequence. + +\item[\povalue{xelatex}] This value, as the name indicates, sets the underlying \TeX\ engine of the script to \rbox{xelatex} for the compilation sequence. + +\item[\povalue{lualatex}] This value, as the name indicates, sets the underlying \TeX\ engine of the script to \rbox{lualatex} for the compilation sequence. +\end{description} + +\item[\abox{program}] This option, as the name suggests, sets the \TeX\ engine according to the provided value. It is important to note that this option has higher priority over \abox{engine} values, so the latter will be discarded. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual script call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: latexmk: { engine: pdflatex } +\end{codebox} + +\item[\rulebox{lualatex}{Marco Daniel, Paulo Cereda}] This rule runs the new \rbox{lualatex} \TeX\ engine on the provided \mtbox{currentFile} reference, generating a corresponding file in the Portable Document File format, as expected. + +\begin{description} +\item[\abox{interaction}] This option alters the underlying engine behaviour. If this option is omitted, \TeX\ will prompt the user for interaction in the event of an error. Possible values are, in order of increasing user interaction (courtesy of our master Enrico Gregorio): + +\begin{description} +\item[\povalue{batchmode}] In this mode, nothing is printed on the terminal, and errors are scrolled as if the \rbox{return} key is hit at every error. Missing files that \TeX\ tries to input or request from keyboard input cause the job to abort. + +\item[\povalue{nonstopmode}] In this mode, the diagnostic message will appear on the terminal, but there is no possibility of user interaction just like in batch mode, previously described. + +\item[\povalue{scrollmode}] In this mode, as the name indicates, \TeX\ will stop only for missing files to input or if proper keyboard input is necessary. \TeX\ fixes errors itself. + +\item[\povalue{errorstopmode}] In this mode, \TeX\ will stop at each error, asking for proper user intervention. This is the most user interactive mode available. +\end{description} + +\item[\rpsbox{shell}] This option sets whether the possibility of running underlying system commands from within \TeX\ is activated. + +\item[\rpsbox{synctex}] This option sets whether \rbox{synctex}, an input and output synchronization feature that allows navigation from source to typeset material and vice versa, available in most \TeX\ engines, is activated. + +\item[\rpsbox{draft}] This option sets whether the draft mode, i.e, a mode that produces no output, so the engine can check the syntax, is activated. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: lualatex: { interaction: errorstopmode, +% arara: --> synctex: yes } +\end{codebox} + +\item[\rulebox{luatex}{Marco Daniel, Paulo Cereda}] This rule runs the \rbox{luatex} \TeX\ engine on the provided \mtbox{currentFile} reference, generating a corresponding file in the Portable Document File format, as expected. + +\begin{description} +\item[\abox{interaction}] This option alters the underlying engine behaviour. If this option is omitted, \TeX\ will prompt the user for interaction in the event of an error. Possible values are, in order of increasing user interaction (courtesy of our master Enrico Gregorio): + +\begin{description} +\item[\povalue{batchmode}] In this mode, nothing is printed on the terminal, and errors are scrolled as if the \rbox{return} key is hit at every error. Missing files that \TeX\ tries to input or request from keyboard input cause the job to abort. + +\item[\povalue{nonstopmode}] In this mode, the diagnostic message will appear on the terminal, but there is no possibility of user interaction just like in batch mode, previously described. + +\item[\povalue{scrollmode}] In this mode, as the name indicates, \TeX\ will stop only for missing files to input or if proper keyboard input is necessary. \TeX\ fixes errors itself. + +\item[\povalue{errorstopmode}] In this mode, \TeX\ will stop at each error, asking for proper user intervention. This is the most user interactive mode available. +\end{description} + +\item[\rpsbox{shell}] This option sets whether the possibility of running underlying system commands from within \TeX\ is activated. + +\item[\rpsbox{synctex}] This option sets whether \rbox{synctex}, an input and output synchronization feature that allows navigation from source to typeset material and vice versa, available in most \TeX\ engines, is activated. + +\item[\rpsbox{draft}] This option sets whether the draft mode, i.e, a mode that produces no output, so the engine can check the syntax, is activated. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: luatex: { interaction: batchmode, +% arara: --> shell: yes, draft: yes } +\end{codebox} + +\item[\rulebox{make}{Marco Daniel, Paulo Cereda}] This rule runs \rbox{make}, a build automation tool that automatically builds executable programs and libraries from source code, according to a special file which specifies how to derive the target program. + +\begin{description} +\item[\abox{targets}] This option takes a list of targets. Note that \rbox{make} updates a target if it depends on files that have been modified since the target was last modified, or if the target does not exist. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: make: { targets: [ compile, package ] } +\end{codebox} + +\item[\rulebox{makeglossaries}{Marco Daniel, Nicola Talbot, Paulo Cereda}] This rule runs \rbox{makeglossaries}, an efficient Perl script designed for use with \TeX\ documents that work with the \rbox{glossaries} package. All the information required to be passed to the relevant indexing application should also be contained in the auxiliary file. The script takes the corresponding base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as the mandatory argument. + +\begin{description} +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual script call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: makeglossaries if found('aux', '@istfilename') +\end{codebox} + +\item[\rulebox{makeglossarieslite}{Marco Daniel, Nicola Talbot, Paulo Cereda}] This rule runs \rbox{makeglossaries-lite}, a lightweight Lua script designed for use with \TeX\ documents that work with the \rbox{glossaries} package. All the information required to be passed to the relevant indexing application should also be contained in the auxiliary file. The script takes the corresponding base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as the mandatory argument. + +\begin{description} +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual script call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: makeglossarieslite if found('aux', '@istfilename') +\end{codebox} + +\item[\rulebox{makeindex}{Marco Daniel, Paulo Cereda}] This rule runs \rbox{makeindex}, a general purpose hierarchical index generator, on the corresponding base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string concatenated with the \rbox{idx} suffix, generating an index as a special \rbox{ind} file. + +\begin{description} +\item[\abox{style}] This option, as the name indicates, sets the underlying index style file. Make sure to provide a valid \rbox{ist} file when using this option. + +\item[\rpsbox{german}] This option, as the name indicates, sets whether German word ordering should be used when generating the index, according to the rules set forth in DIN 5007. + +\item[\abox{order}] This option, as the name indicates, sets the default ordering scheme for the \rbox{makeindex} program. Two possible values are available: + +\begin{description} +\item[\povalue{letter}] This value, as the name indicates, activates the letter ordering scheme. In such scheme, a blank space does not precede any letter in the alphabet. + +\item[\povalue{word}] This value, as the name indicates, activates the word ordering scheme. In such scheme, a blank space precedes any letter in the alphabet. +\end{description} + +\item[\rpbox{input}{idx}] This option, as the name indicates, sets the default extension for the input file, according to the provided value. Later, this value will be concatenated as a suffix for the base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension). + +\item[\rpbox{output}{ind}] This option, as the name indicates, sets the default extension for the output file, according to the provided value. Later, this value will be concatenated as a suffix for the base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension). + +\item[\rpbox{log}{ilg}] This option, as the name indicates, sets the default extension for the log file, according to the provided value. Later, this value will be concatenated as a suffix for the base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension). + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: makeindex: { style: book.ist } +\end{codebox} + +\item[\rulebox{nomencl}{Marco Daniel, Nicola Talbot, Paulo Cereda}] This rule runs \rbox{makeindex} in order to automatically generate a nomenclature list from \TeX\ documents that work with the \rbox{nomencl} package. The program itself is a general purpose hierarchical index generator and takes the corresponding base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string concatenated with the \rbox{nlo} suffix and a special style file in order to generate the nomenclature list as a special \rbox{nls} file. + +\begin{description} +\item[\rpbox{style}{nomencl.ist}] This option, as the name indicates, sets the underlying index style file. The default value is set to the one automatically provided by the \rbox{nomencl} package, so it is highly recommended to not override it. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: nomencl +\end{codebox} + +\item[\rulebox{pdfcsplain}{Paulo Cereda}] This rule runs the \rbox{pdfcsplain} \TeX\ engine, a conservative extension of Knuth's plain \TeX\ with direct processing characters and hyphenation patterns for Czech and Slovak, on the provided \mtbox{currentFile} reference. + +\begin{description} +\item[\abox{interaction}] This option alters the underlying engine behaviour. If this option is omitted, \TeX\ will prompt the user for interaction in the event of an error. Possible values are, in order of increasing user interaction (courtesy of our master Enrico Gregorio): + +\begin{description} +\item[\povalue{batchmode}] In this mode, nothing is printed on the terminal, and errors are scrolled as if the \rbox{return} key is hit at every error. Missing files that \TeX\ tries to input or request from keyboard input cause the job to abort. + +\item[\povalue{nonstopmode}] In this mode, the diagnostic message will appear on the terminal, but there is no possibility of user interaction just like in batch mode, previously described. + +\item[\povalue{scrollmode}] In this mode, as the name indicates, \TeX\ will stop only for missing files to input or if proper keyboard input is necessary. \TeX\ fixes errors itself. + +\item[\povalue{errorstopmode}] In this mode, \TeX\ will stop at each error, asking for proper user intervention. This is the most user interactive mode available. +\end{description} + +\item[\rpsbox{shell}] This option sets whether the possibility of running underlying system commands from within \TeX\ is activated. + +\item[\rpsbox{synctex}] This option sets whether \rbox{synctex}, an input and output synchronization feature that allows navigation from source to typeset material and vice versa, available in most \TeX\ engines, is activated. + +\item[\rpsbox{draft}] This option sets whether the draft mode, i.e, a mode that produces no output, so the engine can check the syntax, is activated. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: pdfcsplain: { shell: yes, synctex: yes } +\end{codebox} + +\item[\rulebox{pdflatex}{Marco Daniel, Paulo Cereda}] This rule runs the \rbox{pdflatex} \TeX\ engine on the provided \mtbox{currentFile} reference, generating a corresponding file in the Portable Document File format, as expected. + +\begin{description} +\item[\abox{interaction}] This option alters the underlying engine behaviour. If this option is omitted, \TeX\ will prompt the user for interaction in the event of an error. Possible values are, in order of increasing user interaction (courtesy of our master Enrico Gregorio): + +\begin{description} +\item[\povalue{batchmode}] In this mode, nothing is printed on the terminal, and errors are scrolled as if the \rbox{return} key is hit at every error. Missing files that \TeX\ tries to input or request from keyboard input cause the job to abort. + +\item[\povalue{nonstopmode}] In this mode, the diagnostic message will appear on the terminal, but there is no possibility of user interaction just like in batch mode, previously described. + +\item[\povalue{scrollmode}] In this mode, as the name indicates, \TeX\ will stop only for missing files to input or if proper keyboard input is necessary. \TeX\ fixes errors itself. + +\item[\povalue{errorstopmode}] In this mode, \TeX\ will stop at each error, asking for proper user intervention. This is the most user interactive mode available. +\end{description} + +\item[\rpsbox{shell}] This option sets whether the possibility of running underlying system commands from within \TeX\ is activated. + +\item[\rpsbox{synctex}] This option sets whether \rbox{synctex}, an input and output synchronization feature that allows navigation from source to typeset material and vice versa, available in most \TeX\ engines, is activated. + +\item[\rpsbox{draft}] This option sets whether the draft mode, i.e, a mode that produces no output, so the engine can check the syntax, is activated. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: pdflatex: { interaction: batchmode } +% arara: --> if missing('pdf') || changed('tex') +\end{codebox} + +\item[\rulebox{pdftex}{Marco Daniel, Paulo Cereda}] This rule runs the \rbox{pdftex} \TeX\ engine on the provided \mtbox{currentFile} reference, generating a corresponding file in the Portable Document File format, as expected. + +\begin{description} +\item[\abox{interaction}] This option alters the underlying engine behaviour. If this option is omitted, \TeX\ will prompt the user for interaction in the event of an error. Possible values are, in order of increasing user interaction (courtesy of our master Enrico Gregorio): + +\begin{description} +\item[\povalue{batchmode}] In this mode, nothing is printed on the terminal, and errors are scrolled as if the \rbox{return} key is hit at every error. Missing files that \TeX\ tries to input or request from keyboard input cause the job to abort. + +\item[\povalue{nonstopmode}] In this mode, the diagnostic message will appear on the terminal, but there is no possibility of user interaction just like in batch mode, previously described. + +\item[\povalue{scrollmode}] In this mode, as the name indicates, \TeX\ will stop only for missing files to input or if proper keyboard input is necessary. \TeX\ fixes errors itself. + +\item[\povalue{errorstopmode}] In this mode, \TeX\ will stop at each error, asking for proper user intervention. This is the most user interactive mode available. +\end{description} + +\item[\rpsbox{shell}] This option sets whether the possibility of running underlying system commands from within \TeX\ is activated. + +\item[\rpsbox{synctex}] This option sets whether \rbox{synctex}, an input and output synchronization feature that allows navigation from source to typeset material and vice versa, available in most \TeX\ engines, is activated. + +\item[\rpsbox{draft}] This option sets whether the draft mode, i.e, a mode that produces no output, so the engine can check the syntax, is activated. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: pdftex: { draft: yes } +\end{codebox} + +\item[\rulebox{pdftk}{Nicola Talbot, Paulo Cereda}] This rule runs \rbox{pdftk}, a command line tool for manipulating Portable Document Format documents, on the corresponding base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string concatenated with the \rbox{pdf} suffix. + +\begin{description} +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: pdftk: { options: [ burst ] } +\end{codebox} + +\item[\rulebox{ps2pdf}{Marco Daniel, Paulo Cereda}] This rule runs \rbox{ps2pdf}, a tool that converts PostScript to Portable Document File, on the corresponding base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string concatenated with the \rbox{ps} suffix. + +\begin{description} +\item[\abox{output}] This option, as the name indicates, sets the output name for the generated \rbox{pdf} file. There is no need to provide an extension, as the value is always normalized with \mtbox{getBasename} such that only the name without the associated extension is used. The base name of the current file reference is used as the default value. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: ps2pdf: { output: article } +\end{codebox} + +\item[\rulebox{sketch}{Sergey Ulyanov, Paulo Cereda}] This rule runs \rbox{sketch}, a system for producing line drawings of solid objects and scenes, on the corresponding base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string concatenated with the \rbox{sk} suffix. Note that one needs to add support for this particular file type, as seen in Section~\ref{sec:basicstructure}, on page~\pageref{sec:basicstructure}. + +\begin{description} +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: sketch +\end{codebox} + +\item[\rulebox{songidx}{Francesco Endrici, Paulo Cereda}] This rule runs \rbox{songidx}, a song index generation script for the \rbox{songs} package, on the file reference provided as parameter, generating a proper index as a special \rbox{sbx} file. It is very important to observe that, at the time of writing, this script is not available off the shelf in \TeX\ Live or MiK\TeX\ distributions, so a manual deployment is required. The script execution is performed by the underlying \rbox{texlua} interpreter. + +\begin{description} +\item[\abox{input}~\rqbox] This required option, as the name indicates, sets the input name for the song index file specified within the \TeX\ document. There is no need to provide an extension, as the value is always normalized with \mtbox{getBasename} such that only the name without the associated extension is used. + +\item[\rpbox{script}{songidx.lua}] This option, as the name indicates, sets the script path. The default value is set to the script name, so either make sure \rbox{songidx.lua} is located in the same directory of your \TeX\ document or provide the correct location (preferably a full path). + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual script call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: songidx: { input: songs } +\end{codebox} + +\item[\rulebox{tex}{Marco Daniel, Paulo Cereda}] This rule runs the \rbox{tex} \TeX\ engine on the provided \mtbox{currentFile} reference, generating a corresponding file in a device independent format. + +\begin{description} +\item[\abox{interaction}] This option alters the underlying engine behaviour. If this option is omitted, \TeX\ will prompt the user for interaction in the event of an error. Possible values are, in order of increasing user interaction (courtesy of our master Enrico Gregorio): + +\begin{description} +\item[\povalue{batchmode}] In this mode, nothing is printed on the terminal, and errors are scrolled as if the \rbox{return} key is hit at every error. Missing files that \TeX\ tries to input or request from keyboard input cause the job to abort. + +\item[\povalue{nonstopmode}] In this mode, the diagnostic message will appear on the terminal, but there is no possibility of user interaction just like in batch mode, previously described. + +\item[\povalue{scrollmode}] In this mode, as the name indicates, \TeX\ will stop only for missing files to input or if proper keyboard input is necessary. \TeX\ fixes errors itself. + +\item[\povalue{errorstopmode}] In this mode, \TeX\ will stop at each error, asking for proper user intervention. This is the most user interactive mode available. +\end{description} + +\item[\rpsbox{shell}] This option sets whether the possibility of running underlying system commands from within \TeX\ is activated. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: tex: { shell: yes } +\end{codebox} + +\item[\rulebox{texindy}{Nicola Talbot, Paulo Cereda}] This rule runs \rbox{texindy}, a variant of the \rbox{xindy} indexing system focused on \LaTeX\ documents, on the corresponding base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string concatenated with the \rbox{idx} suffix, generating an index as a special \rbox{ind} file. + +\begin{description} +\item[\rpsbox{quiet}] This option, as the name indicates, sets whether the tool will output progress messages. It is important to observe that \rbox{texindy} always outputs error messages, regardless of this option. + +\item[\abox{codepage}] This option, as the name indicates, specifies the encoding to be used for letter group headings. Additionally, it specifies the encoding used internally for sorting, but that does not matter for the final result. + +\item[\abox{language}] This option, as the name indicates, specifies the language that dictates the rules for index sorting. These rules are encoded in a module. + +\item[\abox{markup}] This option, as the name indicates, specifies the input markup for the raw index. The following values are available: + +\begin{description} +\item[\povalue{latex}] This value, as the name implies, is emitted by default from the \LaTeX\ kernel, and the raw input is encoded in the \LaTeX\ Internal Character Representation format. + +\item[\povalue{xelatex}] This value, as the name implies, acts like the previous \rbox[cyan]{latex} markup option, but without \rbox{inputenc} usage. Raw input is encoded in the UTF-8 format. + +\item[\povalue{omega}] This value, as the name implies, acts like the previous \rbox[cyan]{latex} markup option, but with Omega's special notation as encoding for characters not in the ASCII set. +\end{description} + +\item[\abox{modules}] This option, as the name indicates, takes a list of module names. Modules are searched in the usual application path. An error is thrown if any data structure other than a proper list is provided as the value. + +\item[\rpbox{input}{idx}] This option, as the name indicates, sets the default extension for the input file, according to the provided value. Later, this value will be concatenated as a suffix for the base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension). + +\item[\rpbox{output}{ind}] This option, as the name indicates, sets the default extension for the output file, according to the provided value. Later, this value will be concatenated as a suffix for the base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension). + +\item[\rpbox{log}{ilg}] This option, as the name indicates, sets the default extension for the log file, according to the provided value. Later, this value will be concatenated as a suffix for the base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension). + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: texindy: { markup: latex } +\end{codebox} + +\item[\rulebox{tikzmake}{Robbie Smith, Paulo Cereda}] This rule runs \rbox{make} on a very specific build file generated by the \rbox{tikzmake} package, as a means to simplify the externalization of Ti{\itshape k}Z pictures. This build file corresponds to the base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string concatenated with the \rbox{makefile} suffix. + +\begin{description} +\item[\rpsbox{force}] This option, as the name indicates, sets whether all targets specified in the corresponding build file should be unconditionally made. + +\item[\abox{jobs}] This option, as the name indicates, specifies the number of jobs (commands) to run simultaneously. Note that the provided value must be a positive integer. The default number of job slots is one, which means serial execution. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: tikzmake: { force: yes, jobs: 2 } +\end{codebox} + +\item[\rulebox{velocity}{Paulo Cereda}] This rule, as the name suggests, calls the \mtbox{mergeVelocityTemplate} method, merging an input template file written according to the Velocity Template Language 1.7 specification with the provided \rbox{Map} data object in order to produce a corresponding \rbox{File} output. Be mindful that this particular rule returns \rbox{true} if, and only if, the aforementioned method is successfully executed. Otherwise, an exception is raised. + +\begin{description} +\item[\abox{input}] This option, as the name indicates, sets the input template file, written according to the Velocity Template Language 1.7 specification, as a proper \rbox{File} reference. Please note that the \mtbox{currentFile} reference is used as default input when this option is not set. + +\item[\abox{output}~\rqbox] This required option, as the name indicates, sets the output \rbox{File} reference. Be mindful that, if the reference exists, it will be overwritten without any warning. + +\item[\abox{context}~\rqbox] This required option, as the name indicates, sets the \rbox{Map} data object to be used as context to the method call, according to the provided value. An error is thrown if any data structure other than a proper map is specified. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: velocity: { input: input.txt, output: output.txt, +% arara: --> context: { name: Paulo, country: Brazil } } +\end{codebox} + +\item[\rulebox{xdvipdfmx}{Marco Daniel, Paulo Cereda}] This rule runs \rbox{xdvipdfmx}, the back end for the \rbox{xetex} \TeX\ engine (and not intended to be invoked directly), on the corresponding base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string concatenated with the \rbox{dvi} suffix, generating a Portable Document Format \rbox{pdf} file. + +\begin{description} +\item[\abox{output}] This option, as the name indicates, sets the output name for the generated \rbox{pdf} file. There is no need to provide an extension, as the value is always normalized with \mtbox{getBasename} such that only the name without the associated extension is used. The base name of the current file reference is used as the default value. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: xdvipdfmx: { output: thesis } +\end{codebox} + +\item[\rulebox{xelatex}{Marco Daniel, Paulo Cereda}] This rule runs the new \rbox{xelatex} \TeX\ engine on the provided \mtbox{currentFile} reference, generating a corresponding file in the Portable Document File format, as expected. + +\begin{description} +\item[\abox{interaction}] This option alters the underlying engine behaviour. If this option is omitted, \TeX\ will prompt the user for interaction in the event of an error. Possible values are, in order of increasing user interaction (courtesy of our master Enrico Gregorio): + +\begin{description} +\item[\povalue{batchmode}] In this mode, nothing is printed on the terminal, and errors are scrolled as if the \rbox{return} key is hit at every error. Missing files that \TeX\ tries to input or request from keyboard input cause the job to abort. + +\item[\povalue{nonstopmode}] In this mode, the diagnostic message will appear on the terminal, but there is no possibility of user interaction just like in batch mode, previously described. + +\item[\povalue{scrollmode}] In this mode, as the name indicates, \TeX\ will stop only for missing files to input or if proper keyboard input is necessary. \TeX\ fixes errors itself. + +\item[\povalue{errorstopmode}] In this mode, \TeX\ will stop at each error, asking for proper user intervention. This is the most user interactive mode available. +\end{description} + +\item[\rpsbox{shell}] This option sets whether the possibility of running underlying system commands from within \TeX\ is activated. + +\item[\rpsbox{synctex}] This option sets whether \rbox{synctex}, an input and output synchronization feature that allows navigation from source to typeset material and vice versa, available in most \TeX\ engines, is activated. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: xelatex: { shell: yes, synctex: yes } +\end{codebox} + +\item[\rulebox{xetex}{Marco Daniel, Paulo Cereda}] This rule runs the \rbox{xetex} \TeX\ engine on the provided \mtbox{currentFile} reference, generating a corresponding file in the Portable Document File format, as expected. + +\begin{description} +\item[\abox{interaction}] This option alters the underlying engine behaviour. If this option is omitted, \TeX\ will prompt the user for interaction in the event of an error. Possible values are, in order of increasing user interaction (courtesy of our master Enrico Gregorio): + +\begin{description} +\item[\povalue{batchmode}] In this mode, nothing is printed on the terminal, and errors are scrolled as if the \rbox{return} key is hit at every error. Missing files that \TeX\ tries to input or request from keyboard input cause the job to abort. + +\item[\povalue{nonstopmode}] In this mode, the diagnostic message will appear on the terminal, but there is no possibility of user interaction just like in batch mode, previously described. + +\item[\povalue{scrollmode}] In this mode, as the name indicates, \TeX\ will stop only for missing files to input or if proper keyboard input is necessary. \TeX\ fixes errors itself. + +\item[\povalue{errorstopmode}] In this mode, \TeX\ will stop at each error, asking for proper user intervention. This is the most user interactive mode available. +\end{description} + +\item[\rpsbox{shell}] This option sets whether the possibility of running underlying system commands from within \TeX\ is activated. + +\item[\rpsbox{synctex}] This option sets whether \rbox{synctex}, an input and output synchronization feature that allows navigation from source to typeset material and vice versa, available in most \TeX\ engines, is activated. + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: xetex: { interaction: scrollmode, synctex: yes } +\end{codebox} + +\item[\rulebox{xindy}{Nicola Talbot, Paulo Cereda}] This rule runs \rbox{xindy}, a flexible and powerful indexing system, on the corresponding base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension) as a string concatenated with the \rbox{idx} suffix, generating an index as a special \rbox{ind} file. + +\begin{description} +\item[\rpsbox{quiet}] This option, as the name indicates, sets whether the tool will output progress messages. It is important to observe that \rbox{xindy} always outputs error messages, regardless of this option. + +\item[\abox{codepage}] This option, as the name indicates, specifies the encoding to be used for letter group headings. Additionally, it specifies the encoding used internally for sorting, but that does not matter for the final result. + +\item[\abox{language}] This option, as the name indicates, specifies the language that dictates the rules for index sorting. These rules are encoded in a module. + +\item[\abox{markup}] This option, as the name indicates, specifies the input markup for the raw index. The following values are available: + +\begin{description} +\item[\povalue{latex}] This value, as the name implies, is emitted by default from the \LaTeX\ kernel, and the raw input is encoded in the \LaTeX\ Internal Character Representation format. + +\item[\povalue{xelatex}] This value, as the name implies, acts like the previous \rbox[cyan]{latex} markup option, but without \rbox{inputenc} usage. Raw input is encoded in the UTF-8 format. + +\item[\povalue{omega}] This value, as the name implies, acts like the previous \rbox[cyan]{latex} markup option, but with Omega's special notation as encoding for characters not in the ASCII set. + +\item[\povalue{xindy}] This value, as the name implies, uses the \rbox{xindy} input markup as specified in the \rbox{xindy} manual. +\end{description} + +\item[\abox{modules}] This option, as the name indicates, takes a list of module names. Modules are searched in the usual application path. An error is thrown if any data structure other than a proper list is provided as the value. + +\item[\rpbox{input}{idx}] This option, as the name indicates, sets the default extension for the input file, according to the provided value. Later, this value will be concatenated as a suffix for the base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension). + +\item[\rpbox{output}{ind}] This option, as the name indicates, sets the default extension for the output file, according to the provided value. Later, this value will be concatenated as a suffix for the base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension). + +\item[\rpbox{log}{ilg}] This option, as the name indicates, sets the default extension for the log file, according to the provided value. Later, this value will be concatenated as a suffix for the base name of the \mtbox{currentFile} reference (i.e, the name without the associated extension). + +\item[\abox{options}] This option, as the name indicates, takes a list of raw command line options and appends it to the actual system call. An error is thrown if any data structure other than a proper list is provided as the value. +\end{description} + +\begin{codebox}{Example}{teal}{\icnote}{white} +% arara: xindy: { markup: xelatex } +\end{codebox} +\end{description} + +It is highly advisable to browse the relevant documentation about packages and tools described in this chapter as a means to learn more about features and corresponding advanced usage. For \TeX\ Live users, we recommend the use of \rbox{texdoc}, a command line program to find and view documentation. For example, this manual can be viewed through the following command: + +\begin{codebox}{Terminal}{teal}{\icnote}{white} +$ texdoc arara +\end{codebox} + +The primary function of the handy \rbox{texdoc} tool is to locate relevant documentation for a given keyword (typically, a package name) on your disk, and open it in an appropriate viewer. For MiK\TeX\ users, the distribution provides a similar tool named \rbox{mthelp} to find and view documentation. Make sure to use these tools whenever needed! diff --git a/Master/texmf-dist/doc/support/arara/chapters/yaml.tex b/Master/texmf-dist/doc/support/arara/chapters/yaml.tex new file mode 100644 index 00000000000..4078473829b --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/chapters/yaml.tex @@ -0,0 +1,105 @@ +% !TeX root = ../arara-manual.tex +\chapter{YAML} +\label{chap:yaml} + +According to the \href{http://yaml.org/spec/1.2/spec.html}{specification}, \gls{YAML} (a recursive acronym for \emph{YAML Ain't Markup Language}) is a human-friendly, cross language, Unicode-based data serialization language designed around the common native data type of programming languages. \arara\ uses this format in three circumstances: + +\begin{enumerate} +\item\emph{Parametrized directives}, as the set of attribute/value pairs (namely, argument name and corresponding value) is represented by a map. This particular type of directive is formally introduced in Section~\ref{sec:directives}, on page~\pageref{sec:directives}. + +\item\emph{Rules}, as their entire structure is represented by a set of specific keys and their corresponding values (a proper \gls{YAML} document). A rule follows a very strict model, detailed in Section~\ref{sec:rule}, on page~\pageref{sec:rule}. + +\item\emph{Configuration files}, as the general settings are represented by a set of specific keys and their corresponding values (a proper \gls{YAML} document). Configuration files are covered in Chapter~\ref{chap:configurationfile}, on page~\pageref{chap:configurationfile}. +\end{enumerate} + +This chapter only covers the relevant parts of the \gls{YAML} format for a consistent use with \arara. For advanced topics, I highly recommend the complete format specification, available online. + +\section{Collections} +\label{sec:yamlcollections} + +According to the specification, \gls{YAML}['s] block collections use indentation for scope and begin each entry on its own line. Block sequences indicate each entry with a dash and space. Mappings use a colon and space to mark each \emph{key: value} pair. Comments begin with an octothorpe \rbox{\#}. \arara\ relies solely on mappings and a few scalars to sequences at some point. Let us see an example of a sequence: + +\begin{codebox}{A sequence of scalars in YAML}{teal}{\icnote}{white} +team: +- Paulo Cereda +- Marco Daniel +- Brent Longborough +- Nicola Talbot +\end{codebox} + +It is quite straightforward: \abox{team} holds a sequence of four scalars. \gls{YAML} also has flow styles, using explicit indicators rather than indentation to denote scope. The flow sequence is written as a comma-separated list within square brackets: + +\begin{codebox}{A sequence of scalars in YAML}{teal}{\icnote}{white} +primes: [ 2, 3, 5, 7, 11 ] +\end{codebox} + +Attribute maps are easily represented by nesting entries, respecting indentation. For instance, consider a map \abox{developer} containing two keys, \abox{name} and \abox{country}. The \gls{YAML} representation is presented as follows: + +\begin{codebox}{An attribute map in YAML}{teal}{\icnote}{white} +developer: + name: Paulo + country: Brazil +\end{codebox} + +Similarly, the flow mapping uses curly braces. Observe that this is the form adopted by a parametrized directive (see syntax in Section~\ref{sec:directives}, on page~\pageref{sec:directives}): + +\begin{codebox}{An attribute map in YAML (flow mapping)}{teal}{\icnote}{white} +developer: { name: Paulo, country: Brazil } +\end{codebox} + +An attribute map can contain sequences as well. Consider the following code where \abox{developers} holds a list of two developers containing their names and countries: + +\begin{codebox}{An attribute map with sequences in YAML}{teal}{\icnote}{white} +developers: +- name: Paulo + country: Brazil +- name: Marco + country: Germany +\end{codebox} + +The previous code can be easily represented in flow style by using square and curly brackets to represent sequences and attribute maps. + +\section{Scalars} +\label{sec:yamlscalars} + +Scalar content can be written in block notation, using a literal style, indicated by a vertical bar, where \emph{all line breaks are significant}. Alternatively, they can be written with the folded style, denoted by a greater-than sign, where \emph{each line break is folded to a space} unless it ends an empty or a more-indented line. It is mportant to note that \arara\ intensively uses both styles (as seen in Section~\ref{sec:rule}, on page~\pageref{sec:rule}). Let us see an example: + +\begin{codebox}{Scalar content in literal and folded styles}{teal}{\icnote}{white} +logo: | + This is the arara logo + in its ASCII glory! + __ _ _ __ __ _ _ __ __ _ + / _` | '__/ _` | '__/ _` | + | (_| | | | (_| | | | (_| | + \__,_|_| \__,_|_| \__,_| +slogan: > + The cool TeX + automation tool +\end{codebox} + +As seen in the previous code, \abox{logo} holds the ASCII logo of our tool, respecting line breaks. Similarly, observe that the \abox{slogan} key holds the text with line breaks replaced by spaces (in the same fashion \TeX\ does with consecutive, non-empty lines). + +\begin{messagebox}{Block indentation indicator}{attentioncolour}{\icattention}{black} +\setlength{\parskip}{1em} +According to the \gls{YAML} specification, the indentation level of a block scalar is typically detected from its first non-empty line. It is an error for any of the leading empty lines to contain more spaces than the first non-empty line, hence the ASCII logo could not be represented, as it starts with a space. + +When detection would fail, \gls{YAML} requires that the indentation level for the content be given using an explicit indentation indicator. This level is specified as the integer number of the additional indentation spaces used for the content, relative to its parent node. It would be the case if we want to represent our logo without the preceding text. +\end{messagebox} + +\gls{YAML}['s] flow scalars include the plain style and two quoted styles. The double-quoted style provides escape sequences. The single-quoted style is useful when escaping is not needed. All flow scalars can span multiple lines. Note that line breaks are always folded. Since \arara\ uses \gls{MVEL} as its underlying scripting language (Chapter~\ref{chap:mvel}, on page~\pageref{chap:mvel}), it might be advisable to quote scalars when starting with forbidden symbols in \gls{YAML}. + +\section{Tags} +\label{sec:yamltags} + +According to the specification, in \gls{YAML}, untagged nodes are given a type depending on the application. The examples covered in this primer use the \rbox{seq}, \rbox{map} and \rbox{str} types from the fail safe schema. Explicit typing is denoted with a tag using the exclamation point symbol. Global tags are usually uniform resource identifiers and may be specified in a tag shorthand notation using a handle. Application-specific local tags may also be used. For \arara, there is a special schema used for both rules and configuration files, so in those cases, make sure to add \abox{!config} as global tag: + +\begin{codebox}{Global tag for rules and configuration files}{teal}{\icnote}{white} +!config +\end{codebox} + +In particular, rules and configuration files of \arara\ are properly covered in Section~\ref{sec:rule} and Chapter~\ref{chap:configurationfile}, on pages~\pageref{sec:rule} and~\pageref{chap:configurationfile}, respectively. For now, it suffices to say that the \abox{!config} global tag is necessary to provide the correct mapping of values inside our tool. + +\section{Further reading} +\label{sec:yamlfurtherreading} + +This chapter does not cover all features of the \gls{YAML} format, so further reading is advisable. I highly recommend the \href{http://yaml.org/spec/1.2/spec.html}{official YAML specification}, currently covering the third version of the format. diff --git a/Master/texmf-dist/doc/support/arara/figures/dropdown1.pdf b/Master/texmf-dist/doc/support/arara/figures/dropdown1.pdf Binary files differnew file mode 100644 index 00000000000..f529d8feb71 --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/figures/dropdown1.pdf diff --git a/Master/texmf-dist/doc/support/arara/figures/dropdown2.pdf b/Master/texmf-dist/doc/support/arara/figures/dropdown2.pdf Binary files differnew file mode 100644 index 00000000000..7e44c8493d9 --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/figures/dropdown2.pdf diff --git a/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-addcommand.png b/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-addcommand.png Binary files differdeleted file mode 100644 index dd077acdc60..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-addcommand.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-addcompiler.png b/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-addcompiler.png Binary files differdeleted file mode 100644 index a823794aed3..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-addcompiler.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-araramenu.png b/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-araramenu.png Binary files differdeleted file mode 100644 index b2d146fa668..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-araramenu.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-editcommands.png b/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-editcommands.png Binary files differdeleted file mode 100644 index 3a4973e701b..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-editcommands.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-listarara.png b/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-listarara.png Binary files differdeleted file mode 100644 index 122b94b8d71..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-listarara.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-newprofile.png b/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-newprofile.png Binary files differdeleted file mode 100644 index d33a4ba735d..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-newprofile.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-settings.png b/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-settings.png Binary files differdeleted file mode 100644 index 157b137d358..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/inlage/inlage-settings.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/inputbox1.pdf b/Master/texmf-dist/doc/support/arara/figures/inputbox1.pdf Binary files differnew file mode 100644 index 00000000000..29cd6b226d5 --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/figures/inputbox1.pdf diff --git a/Master/texmf-dist/doc/support/arara/figures/inputbox2.pdf b/Master/texmf-dist/doc/support/arara/figures/inputbox2.pdf Binary files differnew file mode 100644 index 00000000000..b83f4533dfe --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/figures/inputbox2.pdf diff --git a/Master/texmf-dist/doc/support/arara/figures/installer/install-finish.png b/Master/texmf-dist/doc/support/arara/figures/installer/install-finish.png Binary files differdeleted file mode 100644 index deb4d1a6dfd..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/installer/install-finish.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/installer/install-langsel.png b/Master/texmf-dist/doc/support/arara/figures/installer/install-langsel.png Binary files differdeleted file mode 100644 index 0d6812dfce2..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/installer/install-langsel.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/installer/install-license.png b/Master/texmf-dist/doc/support/arara/figures/installer/install-license.png Binary files differdeleted file mode 100644 index 443c73cb636..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/installer/install-license.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/installer/install-packs.png b/Master/texmf-dist/doc/support/arara/figures/installer/install-packs.png Binary files differdeleted file mode 100644 index 4afd50f6070..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/installer/install-packs.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/installer/install-path.png b/Master/texmf-dist/doc/support/arara/figures/installer/install-path.png Binary files differdeleted file mode 100644 index 01d36f6501b..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/installer/install-path.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/installer/install-pathwarning.png b/Master/texmf-dist/doc/support/arara/figures/installer/install-pathwarning.png Binary files differdeleted file mode 100644 index a4408a798ce..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/installer/install-pathwarning.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/installer/install-progress.png b/Master/texmf-dist/doc/support/arara/figures/installer/install-progress.png Binary files differdeleted file mode 100644 index d824341cbf7..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/installer/install-progress.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/installer/install-welcome.png b/Master/texmf-dist/doc/support/arara/figures/installer/install-welcome.png Binary files differdeleted file mode 100644 index 1d27725e9ac..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/installer/install-welcome.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/installer/uninstall-finish.png b/Master/texmf-dist/doc/support/arara/figures/installer/uninstall-finish.png Binary files differdeleted file mode 100644 index e9c60b2ebec..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/installer/uninstall-finish.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/installer/uninstall-welcome.png b/Master/texmf-dist/doc/support/arara/figures/installer/uninstall-welcome.png Binary files differdeleted file mode 100644 index 71f81c0b2d5..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/installer/uninstall-welcome.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/messagebox1.pdf b/Master/texmf-dist/doc/support/arara/figures/messagebox1.pdf Binary files differnew file mode 100644 index 00000000000..8235e932bc5 --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/figures/messagebox1.pdf diff --git a/Master/texmf-dist/doc/support/arara/figures/messagebox2.pdf b/Master/texmf-dist/doc/support/arara/figures/messagebox2.pdf Binary files differnew file mode 100644 index 00000000000..bb4537133d5 --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/figures/messagebox2.pdf diff --git a/Master/texmf-dist/doc/support/arara/figures/optionbox1.pdf b/Master/texmf-dist/doc/support/arara/figures/optionbox1.pdf Binary files differnew file mode 100644 index 00000000000..8668c65cfcf --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/figures/optionbox1.pdf diff --git a/Master/texmf-dist/doc/support/arara/figures/optionbox2.pdf b/Master/texmf-dist/doc/support/arara/figures/optionbox2.pdf Binary files differnew file mode 100644 index 00000000000..f20905f96b0 --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/figures/optionbox2.pdf diff --git a/Master/texmf-dist/doc/support/arara/figures/texniccenter/texniccenter-config.png b/Master/texmf-dist/doc/support/arara/figures/texniccenter/texniccenter-config.png Binary files differdeleted file mode 100644 index 154a46f74ca..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/texniccenter/texniccenter-config.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/texniccenter/texniccenter-newprofile.png b/Master/texmf-dist/doc/support/arara/figures/texniccenter/texniccenter-newprofile.png Binary files differdeleted file mode 100644 index 41b4dd61531..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/texniccenter/texniccenter-newprofile.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/texniccenter/texniccenter-profiles.png b/Master/texmf-dist/doc/support/arara/figures/texniccenter/texniccenter-profiles.png Binary files differdeleted file mode 100644 index ad61446e097..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/texniccenter/texniccenter-profiles.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/texshop/texshop-arara.png b/Master/texmf-dist/doc/support/arara/figures/texshop/texshop-arara.png Binary files differdeleted file mode 100644 index 320baacf278..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/texshop/texshop-arara.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/texworks/texworks-add.png b/Master/texmf-dist/doc/support/arara/figures/texworks/texworks-add.png Binary files differdeleted file mode 100644 index 317930ead31..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/texworks/texworks-add.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/texworks/texworks-arara.png b/Master/texmf-dist/doc/support/arara/figures/texworks/texworks-arara.png Binary files differdeleted file mode 100644 index d5da5656b9e..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/texworks/texworks-arara.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/texworks/texworks-prefs.png b/Master/texmf-dist/doc/support/arara/figures/texworks/texworks-prefs.png Binary files differdeleted file mode 100644 index d128a64eb25..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/texworks/texworks-prefs.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/texworks/texworks-profile.png b/Master/texmf-dist/doc/support/arara/figures/texworks/texworks-profile.png Binary files differdeleted file mode 100644 index 87ff763d8e9..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/texworks/texworks-profile.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/winedt/winedt-ararabutton.png b/Master/texmf-dist/doc/support/arara/figures/winedt/winedt-ararabutton.png Binary files differdeleted file mode 100644 index 1f765eb69e6..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/winedt/winedt-ararabutton.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/winedt/winedt-menu.png b/Master/texmf-dist/doc/support/arara/figures/winedt/winedt-menu.png Binary files differdeleted file mode 100644 index ddb46450ab6..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/winedt/winedt-menu.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/figures/winedt/winedt-optionsinterface.png b/Master/texmf-dist/doc/support/arara/figures/winedt/winedt-optionsinterface.png Binary files differdeleted file mode 100644 index 8b77e440c86..00000000000 --- a/Master/texmf-dist/doc/support/arara/figures/winedt/winedt-optionsinterface.png +++ /dev/null diff --git a/Master/texmf-dist/doc/support/arara/references.bib b/Master/texmf-dist/doc/support/arara/references.bib deleted file mode 100644 index 5b54e783efc..00000000000 --- a/Master/texmf-dist/doc/support/arara/references.bib +++ /dev/null @@ -1,237 +0,0 @@ -% This file was created with JabRef 2.8. -% Encoding: Cp1252 - -@MISC{sketch:2013, - author = {Eugene Ressler}, - title = {Sketch}, - note = {Sketch is a small, simple system for producing line drawings of two or three-dimensional objects and scenes.}, - owner = {Paulo}, - timestamp = {2013.01.30}, - url = {http://www.frontiernet.net/~eugene.ressler} -} - -@MISC{modpath:2012, - author = {Jared Breland}, - title = {Modify Path}, - year = {2012}, - note = {This tool in released under the GNU Lesser General Public License - (LGPL), version 3.}, - owner = {Paulo}, - timestamp = {2012.06.27}, - url = {http://legroom.net/software/modpath} -} - -@MISC{mvel:2012, - author = {Mike Brock}, - title = {MVEL, the MVFLEX Expression Language}, - note = {MVEL is a powerful expression language for Java-based applications.}, - owner = {Paulo}, - timestamp = {2012.06.28}, - url = {http://mvel.codehaus.org/} -} - -@MISC{cereda:2012, - author = {Paulo Roberto Massa Cereda}, - title = {Fun with \texttt{gnuplot} and \texttt{arara}}, - year = {2012}, - note = {This article was submitted to the \LaTeX\ and Graphics contest organized - by the \LaTeX\ community.}, - owner = {Paulo}, - timestamp = {2012.06.23}, - url = {http://latex-community.org/know-how/435-gnuplot-arara} -} - -@MISC{collins:2001, - author = {John Collins}, - title = {Latexmk}, - year = {2001}, - owner = {Paulo}, - timestamp = {2012.06.23}, - url = {http://www.phys.psu.edu/~collins/latexmk/} -} - -@MISC{texworks:2009, - author = {Jonathan Kew and Stefan L\"{o}ffler and Charlie Sharpsteen}, - title = {\TeX works: lowering the entry barrier to the \TeX\ world}, - year = {2009}, - owner = {Paulo}, - timestamp = {2012.06.23}, - url = {http://www.tug.org/texworks/} -} - -@MISC{launch4j:2005, - author = {Grzegorz Kowal}, - title = {Launch4J, a cross-platform Java executable wrapper}, - year = {2005}, - owner = {Paulo}, - timestamp = {2012.06.27}, - url = {http://launch4j.sourceforge.net/} -} - -@MISC{niederberger:2012, - author = {Clemens Niederberger}, - title = {\arara \ -- automate your \LaTeX\ with birds music}, - year = {2012}, - owner = {Paulo}, - timestamp = {2012.06.28}, - url = {http://www.mychemistry.eu/2012/06/arara-automate-latex-birds-music/} -} - -@MISC{osi:1998, - author = {Bruce Perens and Eric Steven Raymond}, - title = {Open Source Initiative}, - year = {1998}, - note = {Nonprofit corporation with global scope formed to educate about and - advocate for the benefits of open source and to build bridges among - different constituencies in the open source community.}, - owner = {Paulo}, - timestamp = {2012.06.26}, - url = {http://www.opensource.org/} -} - -@MISC{izpack:2001, - author = {Julien Ponge}, - title = {IzPack}, - year = {2001}, - note = {The project is developed by a community of benevolent contributors.}, - owner = {Paulo}, - timestamp = {2012.06.26}, - url = {http://izpack.org/} -} - -@MISC{fsf:1985, - author = {Richard Stallman}, - title = {Free Software Foundation}, - year = {1985}, - note = {Nonprofit organization with a worldwide mission to promote computer - user freedom and to defend the rights of all free software users.}, - owner = {Paulo}, - timestamp = {2012.06.26}, - url = {http://www.fsf.org/} -} - -@MISC{exec:2010, - author = {{The Apache Software Foundation}}, - title = {Apache Commons Exec}, - year = {2010}, - owner = {Paulo}, - timestamp = {2012.06.28}, - url = {http://commons.apache.org/exec/} -} - -@MISC{lang:2001, - author = {{The Apache Software Foundation}}, - title = {Apache Commons Lang}, - year = {2001}, - owner = {Paulo}, - timestamp = {2012.06.29}, - url = {http://commons.apache.org/lang/} -} - -@MISC{wright:2012, - author = {Joseph Wright}, - title = {\arara: making \LaTeX\ files your way}, - year = {2012}, - owner = {Paulo}, - timestamp = {2012.06.28}, - url = {http://www.texdev.net/2012/04/24/arara-making-latex-files-your-way/} -} - -@MISC{jcl:2012, - author = {Kamran Zafar}, - title = {Jar Class Loader}, - owner = {Paulo}, - timestamp = {2012.07.19}, - url = {http://sourceforge.net/projects/jcloader/} -} - -@MISC{bsd:2012, - title = {The New BSD License}, - owner = {Paulo}, - timestamp = {2012.06.26}, - url = {http://www.opensource.org/licenses/bsd-license.php} -} - -@MISC{maven:2012, - title = {Apache Maven}, - note = {Software project management and comprehension tool}, - owner = {Paulo}, - timestamp = {2012.07.19}, - url = {http://maven.apache.org/} -} - -@MISC{oracle:2012, - title = {Java Development Kit}, - owner = {Paulo}, - timestamp = {2012.07.19}, - url = {http://www.oracle.com/technetwork/java/javase/downloads/index.html} -} - -@MISC{snakeyaml:2012, - title = {SnakeYAML, a YAML parser and emitter for Java}, - owner = {Paulo}, - timestamp = {2012.07.05}, - url = {http://code.google.com/p/snakeyaml/} -} - -@MISC{streams:2012, - title = {Standard streams}, - note = {Wikipedia, the free encyclopedia}, - owner = {Paulo}, - timestamp = {2012.07.04}, - url = {http://en.wikipedia.org/wiki/Standard_streams} -} - -@MISC{tupi:2012, - title = {Tupi -- Portuguese Dictionary}, - owner = {Paulo}, - timestamp = {2012.06.23}, - url = {http://www.redebrasileira.com/tupi/vocabulario/a.asp} -} - -@MISC{vim:1991, - title = {Vim the editor}, - note = {Vim is a highly configurable text editor built to enable efficient - text editing.}, - owner = {Paulo}, - timestamp = {2012.07.05}, - url = {http://www.vim.org} -} - -@MISC{rubber:2009, - title = {Rubber}, - year = {2009}, - note = {The tool was originally developed by Emmanuel Beffara but the development - largely ceased after 2007. The current team was formed to help keep - the tool up to date.}, - owner = {Paulo}, - timestamp = {2012.06.23}, - url = {https://launchpad.net/rubber} -} - -@MISC{openjdk:2006, - title = {The OpenJDK Project}, - year = {2006}, - owner = {Paulo}, - timestamp = {2012.06.26}, - url = {http://openjdk.java.net/} -} - -@MISC{yaml:2001, - title = {YAML}, - year = {2001}, - owner = {Paulo}, - timestamp = {2012.06.23}, - url = {http://www.yaml.org/} -} - -@comment{jabref-meta: selector_review:} - -@comment{jabref-meta: selector_publisher:} - -@comment{jabref-meta: selector_author:} - -@comment{jabref-meta: selector_journal:} - -@comment{jabref-meta: selector_keywords:} - diff --git a/Master/texmf-dist/doc/support/arara/rules/manual.yaml b/Master/texmf-dist/doc/support/arara/rules/manual.yaml new file mode 100644 index 00000000000..d3000879d6a --- /dev/null +++ b/Master/texmf-dist/doc/support/arara/rules/manual.yaml @@ -0,0 +1,41 @@ +!config +identifier: manual +name: The arara manual +authors: +- Paulo Cereda +commands: +- name: The PDFLaTeX engine + command: > + @{ + return getCommand('pdflatex', file); + } +- name: The PDFLaTeX engine + command: > + @{ + return getCommand('pdflatex', file); + } +- name: File cleanup + command: > + @{ + matches = listFilesByExtensions('.', + [ 'aux' ], true); + prefix = []; + if (isUnix()) { + prefix = [ 'rm', '-f' ]; + } + else { + prefix = [ 'cmd', '/c', 'del' ]; + } + removals = []; + extensions = [ 'listing', 'log', 'toc', + 'out', 'synctex.gz' ]; + foreach (extension : extensions) { + removals.add(getCommand(prefix, getBasename(file) + .concat('.').concat(extension))); + } + foreach (match : matches) { + removals.add(getCommand(prefix, match.getCanonicalPath())); + } + return removals; + } +arguments: [] diff --git a/Master/texmf-dist/scripts/arara/arara.jar b/Master/texmf-dist/scripts/arara/arara.jar Binary files differindex 4303c351763..62fc8b58642 100644 --- a/Master/texmf-dist/scripts/arara/arara.jar +++ b/Master/texmf-dist/scripts/arara/arara.jar diff --git a/Master/texmf-dist/scripts/arara/arara.sh b/Master/texmf-dist/scripts/arara/arara.sh index d07f7e4bac4..e9a59c90b97 100755 --- a/Master/texmf-dist/scripts/arara/arara.sh +++ b/Master/texmf-dist/scripts/arara/arara.sh @@ -1,4 +1,3 @@ #!/bin/bash jarpath=`kpsewhich --progname=arara --format=texmfscripts arara.jar` java -jar "$jarpath" "$@" - diff --git a/Master/texmf-dist/scripts/arara/rules/animate.yaml b/Master/texmf-dist/scripts/arara/rules/animate.yaml new file mode 100644 index 00000000000..ac6dc347bbe --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/animate.yaml @@ -0,0 +1,62 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: animate +name: Animate +authors: +- Chris Hughes +- Paulo Cereda +commands: +- name: The Convert program + command: > + @{ + prefix = []; + input = getBasename(file).concat('.pdf'); + output = getBasename(file).concat('.gif'); + if (isUnix()) { + prefix = [ program ]; + } + else { + prefix = [ 'cmd', '/c', program ]; + } + return getCommand(prefix, '-delay', delay, '-loop', + loop, '-density', density, options, input, output); + } +arguments: +- identifier: delay + flag: > + @{ + parameters.delay + } + default: 10 +- identifier: loop + flag: > + @{ + parameters.loop + } + default: 0 +- identifier: density + flag: > + @{ + parameters.density + } + default: 300 +- identifier: program + flag: > + @{ + parameters.program + } + default: convert +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/bib2gls.yaml b/Master/texmf-dist/scripts/arara/rules/bib2gls.yaml new file mode 100644 index 00000000000..254a362096e --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/bib2gls.yaml @@ -0,0 +1,166 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: bib2gls +name: Bib2Gls +authors: +- Nicola Talbot +- Paulo Cereda +commands: +- name: The Bib2Gls software + command: > + @{ + return getCommand('bib2gls', dir, trans, group, interpret, + breakspace, trimfields, recordcount, recordcountunit, + cite, verbose, merge, locale, uniscript, packages, + ignore, custom, mapformats, options, getBasename(file)); + } +arguments: +- identifier: dir + flag: > + @{ + return ['--dir', parameters.dir] + } +- identifier: trans + flag: > + @{ + return ['--log-file', getBasename(file)+"."+parameters.trans] + } +- identifier: locale + flag: > + @{ + return ['--locale', parameters.locale] + } +- identifier: group + flag: > + @{ + isTrue(parameters.group, '--group', '--no-group') + } +- identifier: interpret + flag: > + @{ + isTrue(parameters.interpret, '--interpret', '--no-interpret') + } +- identifier: breakspace + flag: > + @{ + isTrue(parameters.breakspace, '--break-space', '--no-break-space') + } +- identifier: trimfields + flag: > + @{ + isTrue(parameters.trimfields, '--trim-fields', '--no-trim-fields') + } +- identifier: recordcount + flag: > + @{ + isTrue(parameters.recordcount, '--record-count', '--no-record-count') + } +- identifier: recordcountunit + flag: > + @{ + isTrue(parameters.recordcountunit, '--record-count-unit', + '--no-record-count-unit') + } +- identifier: cite + flag: > + @{ + isTrue(parameters.cite, '--cite-as-record', '--no-cite-as-record') + } +- identifier: verbose + flag: > + @{ + isTrue(parameters.verbose, '--verbose', '--no-verbose') + } +- identifier: merge + flag: > + @{ + isTrue(parameters.merge, '--merge-wrglossary-records', + '--no-merge-wrglossary-records') + } +- identifier: uniscript + flag: > + @{ + isTrue(parameters.uniscript, '--support-unicode-script', + '--no-support-unicode-script') + } +- identifier: packages + flag: > + @{ + if (isList(parameters.packages)) { + elements = []; + foreach (element : parameters.packages) { + elements.add('--packages'); + elements.add(element); + } + return elements; + } + else { + throwError('I was expecting a list of package names.'); + } + } +- identifier: ignore + flag: > + @{ + if (isList(parameters.ignore)) { + elements = []; + foreach (element : parameters.ignore) { + elements.add('--ignore-packages'); + elements.add(element); + } + return elements; + } + else { + throwError('I was expecting a list of package names.'); + } + } +- identifier: custom + flag: > + @{ + if (isList(parameters.custom)) { + elements = []; + foreach (element : parameters.custom) { + elements.add('--custom-packages'); + elements.add(element); + } + return elements; + } + else { + throwError('I was expecting a list of package names.'); + } + } +- identifier: mapformats + flag: > + @{ + if (isList(parameters.mapformats)) { + elements = []; + foreach (element : parameters.mapformats) { + if (isList(element) && element.size() == 2) { + elements.add('--map-format'); + elements.add(element.get(0) + ':' + element.get(1)); + } + else { + throwError('I was expecting a map ' + + 'format list [<key>, <value>] '); + } + } + return elements; + } + else { + throwError('I was expecting mapformats: [ [<key>, <value>], ' + + '..., [<key>, <value>] ].'); + } + } +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/biber.yaml b/Master/texmf-dist/scripts/arara/rules/biber.yaml index ad27377e8bf..9ba02bc6b20 100644 --- a/Master/texmf-dist/scripts/arara/rules/biber.yaml +++ b/Master/texmf-dist/scripts/arara/rules/biber.yaml @@ -1,10 +1,28 @@ !config -# Biber rule for arara -# author: Marco Daniel -# requires arara 3.0+ +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. identifier: biber name: Biber -command: <arara> biber @{options} "@{getBasename(file)}" -arguments: +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: The Biber reference management software + command: > + @{ + return getCommand('biber', options, getBasename(file)); + } +arguments: - identifier: options - flag: <arara> @{parameters.options} + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/bibtex.yaml b/Master/texmf-dist/scripts/arara/rules/bibtex.yaml index 055b60d47ea..5cbe5c17562 100644 --- a/Master/texmf-dist/scripts/arara/rules/bibtex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/bibtex.yaml @@ -1,10 +1,28 @@ !config -# BibTeX rule for arara -# author: Marco Daniel -# requires arara 3.0+ +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. identifier: bibtex name: BibTeX -command: <arara> bibtex @{options} "@{getBasename(file)}.aux" -arguments: +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: The BibTeX reference management software + command: > + @{ + return getCommand('bibtex', options, getBasename(file)) + } +arguments: - identifier: options - flag: <arara> @{parameters.options} + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/bibtex8.yaml b/Master/texmf-dist/scripts/arara/rules/bibtex8.yaml new file mode 100644 index 00000000000..8a4631ff779 --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/bibtex8.yaml @@ -0,0 +1,28 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: bibtex8 +name: BibTeX8 +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: An 8-bit implementation of BibTeX 0.99 with a very large capacity + command: > + @{ + return getCommand('bibtex8', options, getBasename(file)); + } +arguments: +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/bibtexu.yaml b/Master/texmf-dist/scripts/arara/rules/bibtexu.yaml new file mode 100644 index 00000000000..f580886d95e --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/bibtexu.yaml @@ -0,0 +1,28 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: bibtexu +name: BibTeXu +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: An 8-bit implementation of BibTeX 0.99 with a very large capacity + command: > + @{ + return getCommand('bibtexu', options, getBasename(file)); + } +arguments: +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/clean.yaml b/Master/texmf-dist/scripts/arara/rules/clean.yaml index c9542f7979e..1a39ed3f27a 100644 --- a/Master/texmf-dist/scripts/arara/rules/clean.yaml +++ b/Master/texmf-dist/scripts/arara/rules/clean.yaml @@ -1,11 +1,51 @@ !config -# Clean rule for arara -# author: Paulo Cereda -# requires arara 3.0+ +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. identifier: clean -name: CleaningTool -command: <arara> @{remove} +name: Clean +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: Cleaning feature + command: > + @{ + prefix = []; + if (isUnix()) { + prefix = [ 'rm', '-f' ]; + } + else { + prefix = [ 'cmd', '/c', 'del' ]; + } + if (extensions == '') { + if (getOriginalFile() == file) { + throwError('I cannot remove the main file reference.'); + } + return getCommand(prefix, file); + } + else { + base = getBasename(file); + removals = []; + foreach(extension : extensions) { + if (base.concat('.').concat(extension) == getOriginalFile()) { + throwError('I cannot remove the main file reference.'); + } + removals.add(getCommand(prefix, base.concat('.').concat(extension))); + } + return removals; + } + } arguments: -- identifier: remove - default: <arara> @{isFalse(file == getOriginalFile(), isWindows("cmd /c del", "rm -f").concat(' "').concat(file).concat('"'))} - +- identifier: extensions + flag: > + @{ + if (isList(parameters.extensions)) { + return parameters.extensions; + } + else { + throwError('I was expecting a list of extensions.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/csplain.yaml b/Master/texmf-dist/scripts/arara/rules/csplain.yaml new file mode 100644 index 00000000000..cfdcc954212 --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/csplain.yaml @@ -0,0 +1,54 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: csplain +name: CSplain +authors: +- Paulo Cereda +commands: +- name: CSplain engine + command: > + @{ + return getCommand('csplain', interaction, draft, + shell, synctex, options, file); + } +arguments: +- identifier: interaction + flag: > + @{ + if ([ 'batchmode', 'nonstopmode', 'scrollmode', + 'errorstopmode' ].contains(parameters.interaction)) { + return '--interaction='.concat(parameters.interaction); + } + else { + throwError('The provided interaction value is not valid.'); + } + } +- identifier: shell + flag: > + @{ + isTrue(parameters.shell, '--shell-escape', '--no-shell-escape') + } +- identifier: synctex + flag: > + @{ + isTrue(parameters.synctex, '--synctex=1', '--synctex=0') + } +- identifier: draft + flag: > + @{ + isTrue(parameters.draft, '--draftmode') + } +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/datatooltk.yaml b/Master/texmf-dist/scripts/arara/rules/datatooltk.yaml new file mode 100644 index 00000000000..0b80d15e753 --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/datatooltk.yaml @@ -0,0 +1,191 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: datatooltk +name: DatatoolTk +authors: +- Nicola Talbot +- Paulo Cereda +commands: +- name: The DatatoolTk software + command: > + @{ + return getCommand('datatooltk', options, output, csv, sql, input, + sqldb, sqluser, name, probsoln, sort, sortlocale, sortcase, + seed, shuffle, sep, delim, csvheader, noconsole, debug, + owneronly, maptex, xls, ods, sheet, filterop, filters, + truncate); + } +arguments: +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } +- identifier: output + flag: > + @{ + [ '--output', parameters.output ] + } + required: true +- identifier: csv + flag: > + @{ + [ '--csv', parameters.csv ] + } +- identifier: sep + flag: > + @{ + [ '--sep', parameters.sep ] + } +- identifier: delim + flag: > + @{ + [ '--delim', parameters.delim ] + } +- identifier: name + flag: > + @{ + [ '--name', parameters.name ] + } +- identifier: sql + flag: > + @{ + [ '--sql', parameters.sql ] + } +- identifier: sqldb + flag: > + @{ + [ '--sqldb', parameters.sqldb ] + } +- identifier: sqluser + flag: > + @{ + [ '--sqluser', parameters.sqluser ] + } +- identifier: noconsole + flag: > + @{ + [ '--noconsole-action', parameters.noconsole ] + } + default: > + @{ + [ '--noconsole-action', 'gui'] + } +- identifier: probsoln + flag: > + @{ + [ '--probsoln', parameters.probsoln ] + } +- identifier: input + flag: > + @{ + [ '--in', parameters.input ] + } +- identifier: sort + flag: > + @{ + [ '--sort', parameters.sort ] + } +- identifier: sortlocale + flag: > + @{ + [ '--sort-locale', parameters.sortlocale ] + } +- identifier: sortcase + flag: > + @{ + isTrue(parameters.sortcase, '--sort-case-sensitive', + '--sort-case-insensitive') + } +- identifier: seed + flag: > + @{ + [ '--seed', parameters.seed ] + } +- identifier: shuffle + flag: > + @{ + isTrue(parameters.shuffle, '--shuffle', '--noshuffle') + } +- identifier: csvheader + flag: > + @{ + isTrue(parameters.csvheader, '--csvheader', '--nocsvheader') + } +- identifier: debug + flag: > + @{ + isTrue(parameters.debug, '--debug', '--nodebug') + } +- identifier: owneronly + flag: > + @{ + isTrue(parameters.owneronly, '--owner-only', '--noowner-only') + } +- identifier: maptex + flag: > + @{ + isTrue(parameters.maptex, '--map-tex-specials', + '--nomap-tex-specials') + } +- identifier: xls + flag: > + @{ + [ '--xls', parameters.xls ] + } +- identifier: ods + flag: > + @{ + [ '--ods', parameters.ods ] + } +- identifier: sheet + flag: > + @{ + [ '--sheet', parameters.sheet ] + } +- identifier: filterop + flag: > + @{ + if (['and', 'or'].contains(parameters.filterop)) { + return "--filter-" + parameters.filterop; + } + else { + throwError('The provided filterop value is not valid.'); + } + } +- identifier: filters + flag: > + @{ + if (isList(parameters.filters)) { + elements = []; + foreach (element : parameters.filters) { + if (isList(element) && element.size() == 3) { + elements.add('--filter'); + elements.add(element); + } + else { + throwError('I was expecting a filter ' + + 'list [<label>, <op>, <value>]'); + } + } + return elements; + } + else { + throwError('I was expecting filters: [ [<label>, <op>, <value>], ' + + '..., [<label>, <op>, <value>] ].'); + } + } +- identifier: truncate + flag: > + @{ + [ '--truncate', parameters.truncate ] + } diff --git a/Master/texmf-dist/scripts/arara/rules/dvipdfm.yaml b/Master/texmf-dist/scripts/arara/rules/dvipdfm.yaml new file mode 100644 index 00000000000..d2dca0db363 --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/dvipdfm.yaml @@ -0,0 +1,39 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: dvipdfm +name: DVIPDFM +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: The DVIPDFM program + command: > + @{ + base = getBasename(file).concat('.dvi'); + out = getBasename(output).concat('.pdf'); + return getCommand('dvipdfm', base, '-o', out, options); + } +arguments: +- identifier: output + flag: > + @{ + parameters.output + } + default: > + @{ + file + } +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/dvipdfmx.yaml b/Master/texmf-dist/scripts/arara/rules/dvipdfmx.yaml new file mode 100644 index 00000000000..2feb9f0fe91 --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/dvipdfmx.yaml @@ -0,0 +1,39 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: dvipdfmx +name: DVIPDFMX +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: The DVIPDFMX program + command: > + @{ + base = getBasename(file).concat('.dvi'); + out = getBasename(output).concat('.pdf'); + return getCommand('dvipdfmx', base, '-o', out, options); + } +arguments: +- identifier: output + flag: > + @{ + parameters.output + } + default: > + @{ + file + } +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/dvips.yaml b/Master/texmf-dist/scripts/arara/rules/dvips.yaml index 48e9172e972..dd7a929bd0c 100644 --- a/Master/texmf-dist/scripts/arara/rules/dvips.yaml +++ b/Master/texmf-dist/scripts/arara/rules/dvips.yaml @@ -1,13 +1,39 @@ !config -# DVIPS rule for arara -# author: Marco Daniel -# requires arara 3.0+ +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. identifier: dvips name: DVIPS -command: <arara> dvips "@{getBasename(file)}.dvi" -o "@{output}.ps" @{options} +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: The DVIPS program + command: > + @{ + base = getBasename(file).concat('.dvi'); + out = getBasename(output).concat('.ps'); + return getCommand('dvips', base, '-o', out, options); + } arguments: - identifier: output - flag: <arara> @{parameters.output} - default: <arara> @{getBasename(file)} + flag: > + @{ + parameters.output + } + default: > + @{ + file + } - identifier: options - flag: <arara> @{parameters.options} + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/dvipspdf.yaml b/Master/texmf-dist/scripts/arara/rules/dvipspdf.yaml new file mode 100644 index 00000000000..4190b1869c9 --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/dvipspdf.yaml @@ -0,0 +1,56 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: dvipspdf +name: DVIPSPDF +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: The DVIPS program + command: > + @{ + base = getBasename(file).concat('.dvi'); + out = getBasename(file).concat('.ps'); + return getCommand('dvips', base, '-o', out, options1); + } +- name: The PS2PDF program + command: > + @{ + base = getBasename(file).concat('.ps'); + out = getBasename(output).concat('.pdf'); + return getCommand('ps2pdf', options2, base, '-o', out); + } +arguments: +- identifier: output + flag: > + @{ + parameters.output + } + default: > + @{ + file + } +- identifier: options1 + flag: > + @{ + if (isList(parameters.options1)) { + return parameters.options1; + } + else { + throwError('I was expecting a list of options.'); + } + } +- identifier: options2 + flag: > + @{ + if (isList(parameters.options2)) { + return parameters.options2; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/etex.yaml b/Master/texmf-dist/scripts/arara/rules/etex.yaml new file mode 100644 index 00000000000..15f8bf54126 --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/etex.yaml @@ -0,0 +1,45 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: etex +name: eTeX +authors: +- Marco Daniel +- Paulo Cereda +- Nicola Talbot +commands: +- name: Extended TeX engine + command: > + @{ + return getCommand('etex', interaction, shell, options, file); + } +arguments: +- identifier: interaction + flag: > + @{ + if ([ 'batchmode', 'nonstopmode', 'scrollmode', + 'errorstopmode' ].contains(parameters.interaction)) { + return '--interaction='.concat(parameters.interaction); + } + else { + throwError('The provided interaction value is not valid.'); + } + } +- identifier: shell + flag: > + @{ + isTrue(parameters.shell, '--shell-escape', '--no-shell-escape') + } +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/frontespizio.yaml b/Master/texmf-dist/scripts/arara/rules/frontespizio.yaml index 9387f32fa6d..45f3a4bf4f9 100644 --- a/Master/texmf-dist/scripts/arara/rules/frontespizio.yaml +++ b/Master/texmf-dist/scripts/arara/rules/frontespizio.yaml @@ -1,18 +1,76 @@ !config -# Frontespizio rule for arara -# author: Francesco Endrici -# author: Enrico Gregorio -# requires arara 3.0+ +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. identifier: frontespizio name: Frontespizio +authors: +- Francesco Endrici +- Enrico Gregorio +- Paulo Cereda commands: -- <arara> @{engine} "@{getBasename(file)}" -- <arara> @{engine} "@{getBasename(file)}-frn" -- <arara> @{dvips} -- <arara> @{engine} "@{getBasename(file)}" -arguments: +- name: The engine + command: > + @{ + return getCommand(engine, interaction, shell, options, file) + } +- name: The frontispiece + command: > + @{ + base = getBasename(file).concat('-frn'); + return getCommand(engine, interaction, shell, base); + } +- name: The DVIPS program + command: > + @{ + base = getBasename(file).concat('-frn'); + eps = base.concat('.eps'); + return isTrue(engine == 'latex', getCommand('dvips', '-o', + eps, base), ''); + } +- name: The engine + command: > + @{ + return getCommand(engine, interaction, shell, options, file); + } +arguments: - identifier: engine - flag: <arara> @{parameters.engine} + flag: > + @{ + if ([ 'pdflatex', 'latex', 'xelatex', + 'lualatex' ].contains(parameters.engine)) { + return parameters.engine; + } + else { + throwError('The provided engine is not valid'); + } + } default: pdflatex -- identifier: dvips - default: <arara> @{ isTrue(parameters.engine == 'latex', 'dvips -o "' + getBasename(file) + '-frn.eps" "'+ getBasename(file) + '-frn"') } +- identifier: shell + flag: > + @{ + isTrue(parameters.shell, '--shell-escape', '--no-shell-escape') + } +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } +- identifier: interaction + flag: > + @{ + if ([ 'batchmode', 'nonstopmode', 'scrollmode', + 'errorstopmode' ].contains(parameters.interaction)) { + return '--interaction='.concat(parameters.interaction); + } + else { + throwError('The provided interaction value is not valid.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/halt.yaml b/Master/texmf-dist/scripts/arara/rules/halt.yaml new file mode 100644 index 00000000000..9d8aaa8aef8 --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/halt.yaml @@ -0,0 +1,18 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: halt +name: Halt +authors: +- Heiko Oberdiek +- Paulo Cereda +commands: +- name: The halt trigger + command: > + @{ + return getTrigger('halt'); + } +arguments: [] diff --git a/Master/texmf-dist/scripts/arara/rules/indent.yaml b/Master/texmf-dist/scripts/arara/rules/indent.yaml new file mode 100644 index 00000000000..8390aa672e8 --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/indent.yaml @@ -0,0 +1,97 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: indent +name: Indent +authors: +- Chris Hughes +- Paulo Cereda +commands: +- name: The latexindent.pl script + command: > + @{ + return getCommand('latexindent', silent, trace, ttrace, screenlog, + settings, cruft, overwrite, output, file, modifylinebreaks, + options, logfile); + } +arguments: +- identifier: silent + flag: > + @{ + isTrue(parameters.silent, '-s') + } +- identifier: overwrite + flag: > + @{ + isTrue(parameters.overwrite, '-w') + } +- identifier: trace + flag: > + @{ + if ([ 'default', 'complete' ].contains(parameters.trace)) { + return isTrue(parameters.trace == 'default', '-t', '-tt'); + } + else { + throwError('You provided an invalid value for trace.'); + } + } +- identifier: screenlog + flag: > + @{ + isTrue(parameters.screenlog, '-sl') + } +- identifier: modifylinebreaks + flag: > + @{ + isTrue(parameters.modifylinebreaks, '-m') + } +- identifier: settings + flag: > + @{ + check = parameters.containsKey('where'); + location = check ? parameters.where : ''; + if ([ 'local', 'onlydefault' ].contains(parameters.settings)) { + return isTrue(parameters.settings == 'local', isTrue(check, + '-l='.concat(location), '-l'), '-d'); + } + else { + throwError('You provided an invalid value for settings.'); + } + } +- identifier: cruft + flag: > + @{ + '-c='.concat(parameters.cruft) + } +- identifier: logfile + flag: > + @{ + [ '-g', parameters.logfile ] + } +- identifier: output + flag: > + @{ + [ '-o', parameters.output ] + } +- identifier: where + flag: > + @{ + check = parameters.containsKey('settings'); + setting = check ? parameters.settings : ''; + if (setting != 'local') { + throwError('This key requires a local setting.'); + } + } +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/latex.yaml b/Master/texmf-dist/scripts/arara/rules/latex.yaml index 2a02cd5d41e..f1b9add4b33 100644 --- a/Master/texmf-dist/scripts/arara/rules/latex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/latex.yaml @@ -1,19 +1,55 @@ !config -# LaTeX rule for arara -# author: Marco Daniel -# last edited by: Paulo Cereda -# requires arara 3.0+ +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. identifier: latex name: LaTeX -command: <arara> latex @{action} @{draft} @{shell} @{synctex} @{options} "@{file}" +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: LaTeX engine + command: > + @{ + return getCommand('latex', interaction, draft, shell, + synctex, options, file); + } arguments: -- identifier: action - flag: <arara> --interaction=@{parameters.action} +- identifier: interaction + flag: > + @{ + if ([ 'batchmode', 'nonstopmode', 'scrollmode', + 'errorstopmode' ].contains(parameters.interaction)) { + return '--interaction='.concat(parameters.interaction); + } + else { + throwError('The provided interaction value is not valid.'); + } + } - identifier: shell - flag: <arara> @{isTrue(parameters.shell,"--shell-escape","--no-shell-escape")} + flag: > + @{ + isTrue(parameters.shell, '--shell-escape', '--no-shell-escape') + } - identifier: synctex - flag: <arara> @{isTrue(parameters.synctex,"--synctex=1","--synctex=0")} + flag: > + @{ + isTrue(parameters.synctex, '--synctex=1', '--synctex=0') + } - identifier: draft - flag: <arara> @{isTrue(parameters.draft,"--draftmode")} + flag: > + @{ + isTrue(parameters.draft, '--draftmode') + } - identifier: options - flag: <arara> @{parameters.options} + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/latexmk.yaml b/Master/texmf-dist/scripts/arara/rules/latexmk.yaml new file mode 100644 index 00000000000..452b116a2fc --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/latexmk.yaml @@ -0,0 +1,63 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: latexmk +name: LaTeXmk +authors: +- Marco Daniel +- Brent Longborough +- Paulo Cereda +commands: +- name: Tool LaTeXmk + command: > + @{ + if (isNotEmpty(clean)) { + return getCommand('latexmk', clean, options); + } + else { + return getCommand('latexmk', isEmpty(program, engine, + program), options, file); + } + } +arguments: +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } +- identifier: clean + flag: > + @{ + if ([ 'all', 'partial' ].contains(parameters.clean)) { + return isTrue(parameters.clean == 'all' , '-C', '-c'); + } + else { + throwError('The provided clean value is not valid.'); + } + } +- identifier: engine + flag: > + @{ + if ([ 'latex', 'pdflatex', 'xelatex', + 'lualatex' ].contains(parameters.engine)) { + flags = [ 'latex' : '-dvi', 'pdflatex' : '-pdf', + 'xelatex' : '-xelatex', 'lualatex' : '-lualatex' ]; + return flags[parameters.engine]; + } + else { + throwError('The provided engine value is not valid.'); + } + } +- identifier: program + flag: > + @{ + return '-latex='.concat(parameters.program) + } diff --git a/Master/texmf-dist/scripts/arara/rules/lmkclean.yaml b/Master/texmf-dist/scripts/arara/rules/lmkclean.yaml deleted file mode 100644 index 0dda56496f6..00000000000 --- a/Master/texmf-dist/scripts/arara/rules/lmkclean.yaml +++ /dev/null @@ -1,11 +0,0 @@ -!config -# Clean rule for arara, via latexmk -# author: Brent Longborough -# requires arara 3.0+ -identifier: lmkclean -name: LaTeXmKCleaner -command: <arara> latexmk @{include} "@{file}" -arguments: -- identifier: include - flag: <arara> @{isTrue(parameters.include.toLowerCase() == "all", "-C", "-c") } - default: <arara> -c diff --git a/Master/texmf-dist/scripts/arara/rules/lualatex.yaml b/Master/texmf-dist/scripts/arara/rules/lualatex.yaml index 06c7f60eef5..4c4628d2482 100644 --- a/Master/texmf-dist/scripts/arara/rules/lualatex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/lualatex.yaml @@ -1,19 +1,55 @@ !config -# LuaLaTeX rule for arara -# author: Marco Daniel -# last edited by: Paulo Cereda -# requires arara 3.0+ +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. identifier: lualatex name: LuaLaTeX -command: <arara> lualatex @{action} @{draft} @{shell} @{synctex} @{options} "@{file}" +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: LuaLaTeX engine + command: > + @{ + return getCommand('lualatex', interaction, draft, shell, + synctex, options, file); + } arguments: -- identifier: action - flag: <arara> --interaction=@{parameters.action} +- identifier: interaction + flag: > + @{ + if ([ 'batchmode', 'nonstopmode', 'scrollmode', + 'errorstopmode' ].contains(parameters.interaction)) { + return '--interaction='.concat(parameters.interaction); + } + else { + throwError('The provided interaction value is not valid.'); + } + } - identifier: shell - flag: <arara> @{isTrue(parameters.shell,"--shell-escape","--no-shell-escape")} + flag: > + @{ + isTrue(parameters.shell, '--shell-escape', '--no-shell-escape') + } - identifier: synctex - flag: <arara> @{isTrue(parameters.synctex,"--synctex=1","--synctex=0")} + flag: > + @{ + isTrue(parameters.synctex, '--synctex=1', '--synctex=0') + } - identifier: draft - flag: <arara> @{isTrue(parameters.draft,"--draftmode")} + flag: > + @{ + isTrue(parameters.draft, '--draftmode') + } - identifier: options - flag: <arara> @{parameters.options} + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/lualatexmk.yaml b/Master/texmf-dist/scripts/arara/rules/lualatexmk.yaml deleted file mode 100644 index 1c82b83aa4d..00000000000 --- a/Master/texmf-dist/scripts/arara/rules/lualatexmk.yaml +++ /dev/null @@ -1,19 +0,0 @@ -!config -# LaTeXmk with LuaLaTeX rule for arara -# author: Brent Longborough -# requires: arara 3.0+ -identifier: lualatexmk -name: luaLaTeXmK -command: <arara> latexmk -e '$pdflatex=q/lualatex%O%S/' @{action} @{synctex} @{shell} @{options} @{style} -pdf "@{file}" -arguments: -- identifier: action - flag: <arara> --interaction=@{parameters.action} -- identifier: shell - flag: <arara> @{isTrue(parameters.shell,"--shell-escape"," --no-shell-escape")} -- identifier: synctex - flag: <arara> @{isTrue(parameters.synctex,"--synctex=0","--synctex=1")} -- identifier: options - flag: <arara> @{parameters.options} -- identifier: style - flag: <arara> -e '$makeindex=q/makeindex %O -s @{parameters.style}.ist -o %D %S/' - diff --git a/Master/texmf-dist/scripts/arara/rules/luatex.yaml b/Master/texmf-dist/scripts/arara/rules/luatex.yaml index 359781f1703..78840f6d96d 100644 --- a/Master/texmf-dist/scripts/arara/rules/luatex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/luatex.yaml @@ -1,18 +1,55 @@ !config -# LuaTeX rule for arara -# author: Paulo Cereda -# requires arara 3.0+ +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. identifier: luatex name: LuaTeX -command: <arara> luatex @{action} @{draft} @{shell} @{synctex} @{options} "@{file}" +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: LuaTeX engine + command: > + @{ + return getCommand('luatex', interaction, draft, shell, + synctex, options, file); + } arguments: -- identifier: action - flag: <arara> --interaction=@{parameters.action} +- identifier: interaction + flag: > + @{ + if ([ 'batchmode', 'nonstopmode', 'scrollmode', + 'errorstopmode' ].contains(parameters.interaction)) { + return '--interaction='.concat(parameters.interaction); + } + else { + throwError('The provided interaction value is not valid.'); + } + } - identifier: shell - flag: <arara> @{isTrue(parameters.shell,"--shell-escape","--no-shell-escape")} + flag: > + @{ + isTrue(parameters.shell, '--shell-escape', '--no-shell-escape') + } - identifier: synctex - flag: <arara> @{isTrue(parameters.synctex,"--synctex=1","--synctex=0")} + flag: > + @{ + isTrue(parameters.synctex, '--synctex=1', '--synctex=0') + } - identifier: draft - flag: <arara> @{isTrue(parameters.draft,"--draftmode")} + flag: > + @{ + isTrue(parameters.draft, '--draftmode') + } - identifier: options - flag: <arara> @{parameters.options} + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/make.yaml b/Master/texmf-dist/scripts/arara/rules/make.yaml index ad3e565a443..07e619aa2df 100644 --- a/Master/texmf-dist/scripts/arara/rules/make.yaml +++ b/Master/texmf-dist/scripts/arara/rules/make.yaml @@ -1,12 +1,47 @@ !config -# Make rule for arara -# author: Marco Daniel -# last edited by: Paulo Cereda -# requires arara 3.0+ +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. identifier: make name: Make -command: <arara> make @{task} -arguments: -- identifier: task - flag: <arara> @{parameters.task} - +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: The Make program + command: > + @{ + if (isNotEmpty(targets)) { + tasks = []; + for (target : targets) { + tasks.add(getCommand('make', target, options)); + } + return tasks; + } + else { + return getCommand('make', options); + } + } +arguments: +- identifier: targets + flag: > + @{ + if (isList(parameters.targets)) { + return parameters.targets; + } + else { + throwError('I was expecting a list of targets.'); + } + } +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/makeglossaries.yaml b/Master/texmf-dist/scripts/arara/rules/makeglossaries.yaml index 1d2cd053101..4dee1e1567b 100644 --- a/Master/texmf-dist/scripts/arara/rules/makeglossaries.yaml +++ b/Master/texmf-dist/scripts/arara/rules/makeglossaries.yaml @@ -1,10 +1,29 @@ !config -# MakeGlossaries rule for arara -# author: Marco Daniel -# requres arara 3.0+ +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. identifier: makeglossaries name: MakeGlossaries -command: <arara> makeglossaries @{options} "@{getBasename(file)}" -arguments: +authors: +- Marco Daniel +- Nicola Talbot +- Paulo Cereda +commands: +- name: The MakeGlossaries software + command: > + @{ + return getCommand('makeglossaries', options, getBasename(file)); + } +arguments: - identifier: options - flag: <arara> @{parameters.options} + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/makeglossarieslite.yaml b/Master/texmf-dist/scripts/arara/rules/makeglossarieslite.yaml new file mode 100644 index 00000000000..fc48090c668 --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/makeglossarieslite.yaml @@ -0,0 +1,29 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: makeglossarieslite +name: MakeGlossariesLite +authors: +- Marco Daniel +- Nicola Talbot +- Paulo Cereda +commands: +- name: The MakeGlossariesLite software + command: > + @{ + return getCommand('makeglossaries-lite', options, getBasename(file)); + } +arguments: +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/makeindex.yaml b/Master/texmf-dist/scripts/arara/rules/makeindex.yaml index 7cb1f5c6a2c..83f7e286d02 100644 --- a/Master/texmf-dist/scripts/arara/rules/makeindex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/makeindex.yaml @@ -1,16 +1,68 @@ !config -# MakeIndex rule for arara -# author: Marco Daniel -# last edited by: Paulo Cereda -# requires arara 3.0+ +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. identifier: makeindex name: MakeIndex -command: <arara> makeindex @{german} @{style} @{options} "@{getBasename(file)}.idx" -arguments: -- identifier: style - flag: <arara> -s @{parameters.style} +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: The MakeIndex software + command: > + @{ + base = getBasename(file); + infile = base.concat('.').concat(input); + outfile = [ '-o', base.concat('.').concat(output) ]; + logfile = [ '-t', base.concat('.').concat(log) ]; + return getCommand('makeindex', german, style, order, options, + logfile, infile, outfile); + } +arguments: +- identifier: input + flag: > + @{ + parameters.input + } + default: idx +- identifier: output + flag: > + @{ + parameters.output + } + default: ind +- identifier: log + flag: > + @{ + parameters.log + } + default: ilg - identifier: german - flag: <arara> @{isTrue(parameters.german,"-g")} + flag: > + @{ + isTrue(parameters.german, '-g') + } +- identifier: order + flag: > + @{ + if ([ 'letter', 'word' ].contains(parameters.order)) { + return isTrue(parameters.order == 'letter', '-l', ''); + } + else { + throwError('The provided order is invalid.'); + } + } +- identifier: style + flag: "@{ [ '-s', parameters.style ] }" - identifier: options - flag: <arara> @{parameters.options} - + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/nomencl.yaml b/Master/texmf-dist/scripts/arara/rules/nomencl.yaml index ce939975d4d..2a563b62664 100644 --- a/Master/texmf-dist/scripts/arara/rules/nomencl.yaml +++ b/Master/texmf-dist/scripts/arara/rules/nomencl.yaml @@ -1,15 +1,40 @@ !config -# Nomencl rule for arara -# author: Marco Daniel -# last edited by: Paulo Cereda -# requires arara 3.0+ +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. identifier: nomencl name: Nomencl -command: <arara> makeindex @{options} "@{getBasename(file)}.nlo" -s "@{style}.ist" -o "@{getBasename(file)}.nls" -arguments: +authors: +- Marco Daniel +- Nicola Talbot +- Paulo Cereda +commands: +- name: The Nomenclature software + command: > + @{ + nlo = getBasename(file).concat('.nlo'); + nls = getBasename(file).concat('.nls'); + return getCommand('makeindex', options, nlo, style, '-o', nls); + } +arguments: - identifier: style - flag: <arara> @{parameters.style} - default: nomencl + flag: > + @{ + [ '-s', parameters.style ] + } + default: > + @{ + [ '-s', 'nomencl.ist' ] + } - identifier: options - flag: <arara> @{parameters.options} - + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/pdfcsplain.yaml b/Master/texmf-dist/scripts/arara/rules/pdfcsplain.yaml new file mode 100644 index 00000000000..db9bbdbec50 --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/pdfcsplain.yaml @@ -0,0 +1,54 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: pdfcsplain +name: PDFCSplain +authors: +- Paulo Cereda +commands: +- name: PDFCSplain engine + command: > + @{ + return getCommand('pdfcsplain', interaction, draft, shell, + synctex, options, file); + } +arguments: +- identifier: interaction + flag: > + @{ + if ([ 'batchmode', 'nonstopmode', 'scrollmode', + 'errorstopmode' ].contains(parameters.interaction)) { + return '--interaction='.concat(parameters.interaction); + } + else { + throwError('The provided interaction value is not valid.'); + } + } +- identifier: shell + flag: > + @{ + isTrue(parameters.shell, '--shell-escape', '--no-shell-escape') + } +- identifier: synctex + flag: > + @{ + isTrue(parameters.synctex, '--synctex=1', '--synctex=0') + } +- identifier: draft + flag: > + @{ + isTrue(parameters.draft, '--draftmode') + } +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/pdflatex.yaml b/Master/texmf-dist/scripts/arara/rules/pdflatex.yaml index 90e28ec0945..61b9b8d3560 100644 --- a/Master/texmf-dist/scripts/arara/rules/pdflatex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/pdflatex.yaml @@ -1,19 +1,55 @@ !config -# PDFLaTeX rule for arara -# author: Marco Daniel -# last edited by: Paulo Cereda -# requires arara 3.0+ +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. identifier: pdflatex name: PDFLaTeX -command: <arara> pdflatex @{action} @{draft} @{shell} @{synctex} @{options} "@{file}" +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: PDFLaTeX engine + command: > + @{ + return getCommand('pdflatex', interaction, draft, shell, + synctex, options, file); + } arguments: -- identifier: action - flag: <arara> --interaction=@{parameters.action} +- identifier: interaction + flag: > + @{ + if ([ 'batchmode', 'nonstopmode', 'scrollmode', + 'errorstopmode' ].contains(parameters.interaction)) { + return '--interaction='.concat(parameters.interaction); + } + else { + throwError('The provided interaction value is not valid.'); + } + } - identifier: shell - flag: <arara> @{isTrue(parameters.shell,"--shell-escape","--no-shell-escape")} + flag: > + @{ + isTrue(parameters.shell, '--shell-escape', '--no-shell-escape') + } - identifier: synctex - flag: <arara> @{isTrue(parameters.synctex,"--synctex=1","--synctex=0")} + flag: > + @{ + isTrue(parameters.synctex, '--synctex=1', '--synctex=0') + } - identifier: draft - flag: <arara> @{isTrue(parameters.draft,"--draftmode")} + flag: > + @{ + isTrue(parameters.draft, '--draftmode') + } - identifier: options - flag: <arara> @{parameters.options} + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/pdflatexmk.yaml b/Master/texmf-dist/scripts/arara/rules/pdflatexmk.yaml deleted file mode 100644 index b3cadf62889..00000000000 --- a/Master/texmf-dist/scripts/arara/rules/pdflatexmk.yaml +++ /dev/null @@ -1,18 +0,0 @@ -!config -# LaTeXmk with pdfLaTeX rule for arara -# author: Brent Longborough -# requires arara 3.0+ -identifier: pdflatexmk -name: pdfLaTeXmK -command: <arara> latexmk -e '$pdflatex=q/pdflatex%O%S/' @{action} @{synctex} @{shell} @{options}@{style} -pdf "@{file}" -arguments: -- identifier: action - flag: <arara> --interaction=@{parameters.action} -- identifier: shell - flag: <arara> @{isTrue(parameters.shell,"--shell-escape"," --no-shell-escape")} -- identifier: synctex - flag: <arara> @{isTrue(parameters.synctex,"--synctex=0","--synctex=1")} -- identifier: options - flag: <arara> @{parameters.options} -- identifier: style - flag: <arara> -e '$makeindex=q/makeindex %O -s @{parameters.style}.ist -o %D %S/' diff --git a/Master/texmf-dist/scripts/arara/rules/pdftex.yaml b/Master/texmf-dist/scripts/arara/rules/pdftex.yaml index db084597cbe..2e3126bbfdc 100644 --- a/Master/texmf-dist/scripts/arara/rules/pdftex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/pdftex.yaml @@ -1,19 +1,55 @@ !config -# PDFTeX rule for arara -# author: Paulo Cereda -# requires arara 3.0+ +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. identifier: pdftex name: PDFTeX -command: <arara> pdftex @{action} @{draft} @{shell} @{synctex} @{options} "@{file}" +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: PDFTeX engine + command: > + @{ + return getCommand('pdftex', interaction, draft, shell, + synctex, options, file); + } arguments: -arguments: -- identifier: action - flag: <arara> --interaction=@{parameters.action} +- identifier: interaction + flag: > + @{ + if ([ 'batchmode', 'nonstopmode', 'scrollmode', + 'errorstopmode' ].contains(parameters.interaction)) { + return '--interaction='.concat(parameters.interaction); + } + else { + throwError('The provided interaction value is not valid.'); + } + } - identifier: shell - flag: <arara> @{isTrue(parameters.shell,"--shell-escape","--no-shell-escape")} + flag: > + @{ + isTrue(parameters.shell, '--shell-escape', '--no-shell-escape') + } - identifier: synctex - flag: <arara> @{isTrue(parameters.synctex,"--synctex=1","--synctex=0")} + flag: > + @{ + isTrue(parameters.synctex, '--synctex=1', '--synctex=0') + } - identifier: draft - flag: <arara> @{isTrue(parameters.draft,"--draftmode")} + flag: > + @{ + isTrue(parameters.draft, '--draftmode') + } - identifier: options - flag: <arara> @{parameters.options} + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/pdftk.yaml b/Master/texmf-dist/scripts/arara/rules/pdftk.yaml new file mode 100644 index 00000000000..9bd3f460600 --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/pdftk.yaml @@ -0,0 +1,29 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: pdftk +name: PDFtk +authors: +- Nicola Talbot +- Paulo Cereda +commands: +- name: PDFtk + command: > + @{ + input = getBasename(file).concat('.pdf'); + return getCommand('pdftk', input, options); + } +arguments: +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/ps2pdf.yaml b/Master/texmf-dist/scripts/arara/rules/ps2pdf.yaml index a5e82d545e5..656f7e22c31 100644 --- a/Master/texmf-dist/scripts/arara/rules/ps2pdf.yaml +++ b/Master/texmf-dist/scripts/arara/rules/ps2pdf.yaml @@ -1,14 +1,39 @@ !config -# PS2PDF rule for arara -# author: Marco Daniel -# last edited by: Paulo Cereda -# requires arara 3.0+ +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. identifier: ps2pdf name: PS2PDF -command: <arara> ps2pdf @{options} "@{getBasename(file)}.ps" "@{output}.pdf" +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: The PS2PDF program + command: > + @{ + infile = getBasename(file).concat('.ps'); + outfile = getBasename(output).concat('.pdf'); + return getCommand('ps2pdf', options, infile, outfile); + } arguments: - identifier: output - flag: <arara> @{parameters.output} - default: <arara> @{getBasename(file)} + flag: > + @{ + parameters.output + } + default: > + @{ + file + } - identifier: options - flag: <arara> @{parameters.options} + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/sketch.yaml b/Master/texmf-dist/scripts/arara/rules/sketch.yaml index 3f98518a319..a170aa20f2d 100644 --- a/Master/texmf-dist/scripts/arara/rules/sketch.yaml +++ b/Master/texmf-dist/scripts/arara/rules/sketch.yaml @@ -1,10 +1,29 @@ !config -# Sketch rule for arara -# author: Sergey Ulyanov -# requires arara 3.0+ +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. identifier: sketch name: Sketch -command: <arara> sketch @{options} "@{file}" -o "@{getBasename(file)}.tex" +authors: +- Sergey Ulyanov +- Paulo Cereda +commands: +- name: The Sketch software + command: > + @{ + output = getBasename(file).concat('.tex'); + return getCommand('sketch', options, file, '-o', output); + } arguments: - identifier: options - flag: <arara> @{parameters.options} + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/songidx.yaml b/Master/texmf-dist/scripts/arara/rules/songidx.yaml index faa64e70d20..818c4333a77 100644 --- a/Master/texmf-dist/scripts/arara/rules/songidx.yaml +++ b/Master/texmf-dist/scripts/arara/rules/songidx.yaml @@ -1,11 +1,41 @@ - !config -# songidx rule for arara -# author: Francesco Endrici -# requires arara 3.0 +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. identifier: songidx name: SongIDX -command: <arara> songidx "@{input}.sxd" +authors: +- Francesco Endrici +- Paulo Cereda +commands: +- name: The SongIDX Lua script + command: > + @{ + infile = getBasename(input).concat('.sxd'); + return getCommand('texlua', script, options, infile); + } arguments: - identifier: input - flag: <arara> @{parameters.input} - + flag: > + @{ + parameters.input + } + required: true +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } +- identifier: script + flag: > + @{ + parameters.script + } + default: songidx.lua diff --git a/Master/texmf-dist/scripts/arara/rules/tex.yaml b/Master/texmf-dist/scripts/arara/rules/tex.yaml index 49f7cf73074..c0321b34dce 100644 --- a/Master/texmf-dist/scripts/arara/rules/tex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/tex.yaml @@ -1,16 +1,44 @@ !config -# TeX rule for arara -# author: Marco Daniel -# last edited by: Paulo Cereda -# requires arara 3.0+ +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. identifier: tex name: TeX -command: <arara> tex @{action} @{shell} @{options} "@{file}" +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: TeX engine + command: > + @{ + return getCommand('tex', interaction, shell, options, file); + } arguments: -arguments: -- identifier: action - flag: <arara> --interaction=@{parameters.action} +- identifier: interaction + flag: > + @{ + if ([ 'batchmode', 'nonstopmode', 'scrollmode', + 'errorstopmode' ].contains(parameters.interaction)) { + return '--interaction='.concat(parameters.interaction); + } + else { + throwError('The provided interaction value is not valid.'); + } + } - identifier: shell - flag: <arara> @{isTrue(parameters.shell,"--shell-escape","--no-shell-escape")} + flag: > + @{ + isTrue(parameters.shell, '--shell-escape', '--no-shell-escape') + } - identifier: options - flag: <arara> @{parameters.options} + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/texindy.yaml b/Master/texmf-dist/scripts/arara/rules/texindy.yaml new file mode 100644 index 00000000000..b0a9c93842e --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/texindy.yaml @@ -0,0 +1,91 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: texindy +name: TeXindy +authors: +- Nicola Talbot +- Paulo Cereda +commands: +- name: The TeXindy software + command: > + @{ + base = getBasename(file); + infile = base.concat('.').concat(input); + outfile = [ '-o', base.concat('.').concat(output) ]; + logfile = [ '-t', base.concat('.').concat(log) ]; + return getCommand('texindy', quiet, debug, markup, modules, + codepage, language, logfile, outfile, options, infile); + } +arguments: +- identifier: quiet + flag: > + @{ + isTrue(parameters.quiet, '-q') + } +- identifier: modules + flag: > + @{ + elements = []; + if (isList(parameters.modules)) { + foreach (module : parameters.modules) { + elements.add('-M'); + elements.add(module); + } + return elements; + } + else { + throwError('I was expecting a list of options.'); + } + } +- identifier: codepage + flag: > + @{ + [ '-C', parameters.codepage ] + } +- identifier: language + flag: > + @{ + [ '-L', parameters.language ] + } +- identifier: markup + flag: > + @{ + if ([ 'latex', 'xelatex', 'omega' ].contains(parameters.markup)) { + return [ '-I', parameters.markup ]; + } + else { + throwError('The provided markup is invalid.'); + } + } +- identifier: input + flag: > + @{ + parameters.input + } + default: idx +- identifier: output + flag: > + @{ + parameters.output + } + default: ind +- identifier: log + flag: > + @{ + parameters.log + } + default: ilg +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/tikzmake.yaml b/Master/texmf-dist/scripts/arara/rules/tikzmake.yaml new file mode 100644 index 00000000000..e6cb809a54e --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/tikzmake.yaml @@ -0,0 +1,39 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: tikzmake +name: TikZmake +authors: +- Robbie Smith +- Paulo Cereda +commands: +- name: TikZ list-and-make engine + command: > + @{ + makefile = getBasename(file).concat('.makefile'); + return getCommand('make', force, jobs, options, '-f', makefile); + } +arguments: +- identifier: force + flag: > + @{ + isTrue(parameters.force, '--always-make') + } +- identifier: jobs + flag: > + @{ + return '-j'.concat(parameters.jobs) + } +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/velocity.yaml b/Master/texmf-dist/scripts/arara/rules/velocity.yaml new file mode 100644 index 00000000000..0fd62a94650 --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/velocity.yaml @@ -0,0 +1,41 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: velocity +name: Velocity +authors: +- Paulo Cereda +commands: +- name: The Velocity engine + command: > + @{ + mergeVelocityTemplate(isEmpty(input, reference, toFile(input)), + toFile(output), context); + return true; + } +arguments: +- identifier: context + flag: > + @{ + if (isMap(parameters.context)) { + return parameters.context; + } + else { + throwError('I was expecting a context map.'); + } + } + required: true +- identifier: output + flag: > + @{ + return parameters.output; + } + required: true +- identifier: input + flag: > + @{ + return parameters.input; + } diff --git a/Master/texmf-dist/scripts/arara/rules/xdvipdfmx.yaml b/Master/texmf-dist/scripts/arara/rules/xdvipdfmx.yaml new file mode 100644 index 00000000000..b9433f8a939 --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/xdvipdfmx.yaml @@ -0,0 +1,39 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: xdvipdfmx +name: XDVIPDFMX +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: The XDVIPDFMX program + command: > + @{ + infile = getBasename(file).concat('.dvi'); + outfile = getBasename(output).concat('.pdf'); + return getCommand('xdvipdfmx', infile, '-o', outfile, options); + } +arguments: +- identifier: output + flag: > + @{ + parameters.output + } + default: > + @{ + file + } +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.') + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/xelatex.yaml b/Master/texmf-dist/scripts/arara/rules/xelatex.yaml index 0321f612447..e248ae2fe87 100644 --- a/Master/texmf-dist/scripts/arara/rules/xelatex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/xelatex.yaml @@ -1,17 +1,50 @@ !config -# XeLaTeX rule for arara -# author: Marco Daniel -# last edited by: Paulo Cereda -# requires arara 3.0+ +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. identifier: xelatex name: XeLaTeX -command: <arara> xelatex @{action} @{shell} @{synctex} @{options} "@{file}" +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: XeLaTeX engine + command: > + @{ + return getCommand('xelatex', interaction, shell, + synctex, options, file); + } arguments: -- identifier: action - flag: <arara> --interaction=@{parameters.action} +- identifier: interaction + flag: > + @{ + if ([ 'batchmode', 'nonstopmode', 'scrollmode', + 'errorstopmode' ].contains(parameters.interaction)) { + return '--interaction='.concat(parameters.interaction); + } + else { + throwError('The provided interaction value is not valid.'); + } + } - identifier: shell - flag: <arara> @{isTrue(parameters.shell,"--shell-escape","--no-shell-escape")} + flag: > + @{ + isTrue(parameters.shell, '--shell-escape', '--no-shell-escape') + } - identifier: synctex - flag: <arara> @{isTrue(parameters.synctex,"--synctex=1","--synctex=0")} + flag: > + @{ + isTrue(parameters.synctex, '--synctex=1', '--synctex=0') + } - identifier: options - flag: <arara> @{parameters.options} + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/xelatexmk.yaml b/Master/texmf-dist/scripts/arara/rules/xelatexmk.yaml deleted file mode 100644 index 149cf6cb860..00000000000 --- a/Master/texmf-dist/scripts/arara/rules/xelatexmk.yaml +++ /dev/null @@ -1,19 +0,0 @@ -!config -# LaTeXmk with XeLaTeX rule for arara -# author: Brent Longborough -# requires arara 3.0+ -identifier: xelatexmk -name: XeLaTeXmK -command: <arara> latexmk -e '$pdflatex=q/xelatex%O%S/' @{action} @{synctex} @{shell} @{options} @{style} -pdf "@{file}" -arguments: -- identifier: action - flag: <arara> --interaction=@{parameters.action} -- identifier: shell - flag: <arara> @{isTrue(parameters.shell,"--shell-escape"," --no-shell-escape")} -- identifier: synctex - flag: <arara> @{isTrue(parameters.synctex,"--synctex=0","--synctex=1")} -- identifier: options - flag: <arara> @{parameters.options} -- identifier: style - flag: <arara> -e '$makeindex=q/makeindex %O -s @{parameters.style}.ist -o %D %S/' - diff --git a/Master/texmf-dist/scripts/arara/rules/xetex.yaml b/Master/texmf-dist/scripts/arara/rules/xetex.yaml index 20cfca8511e..2a9369e0e87 100644 --- a/Master/texmf-dist/scripts/arara/rules/xetex.yaml +++ b/Master/texmf-dist/scripts/arara/rules/xetex.yaml @@ -1,16 +1,50 @@ !config -# XeLaTeX rule for arara -# author: Paulo Cereda -# requires arara 3.0+ +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. identifier: xetex name: XeTeX -command: <arara> xetex @{action} @{shell} @{synctex} @{options} "@{file}" +authors: +- Marco Daniel +- Paulo Cereda +commands: +- name: XeTeX engine + command: > + @{ + return getCommand('xetex', interaction, shell, + synctex, options, file); + } arguments: -- identifier: action - flag: <arara> --interaction=@{parameters.action} +- identifier: interaction + flag: > + @{ + if ([ 'batchmode', 'nonstopmode', 'scrollmode', + 'errorstopmode' ].contains(parameters.interaction)) { + return '--interaction='.concat(parameters.interaction); + } + else { + throwError('The provided interaction value is not valid.'); + } + } - identifier: shell - flag: <arara> @{isTrue(parameters.shell,"--shell-escape","--no-shell-escape")} + flag: > + @{ + isTrue(parameters.shell, '--shell-escape', '--no-shell-escape') + } - identifier: synctex - flag: <arara> @{isTrue(parameters.synctex,"--synctex=1","--synctex=0")} + flag: > + @{ + isTrue(parameters.synctex, '--synctex=1', '--synctex=0') + } - identifier: options - flag: <arara> @{parameters.options} + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/scripts/arara/rules/xindy.yaml b/Master/texmf-dist/scripts/arara/rules/xindy.yaml new file mode 100644 index 00000000000..a44dbbfd08c --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/xindy.yaml @@ -0,0 +1,91 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# This rule is part of arara. +identifier: xindy +name: Xindy +authors: +- Nicola Talbot +- Paulo Cereda +commands: +- name: The Xindy software + command: > + @{ + base = getBasename(file); + infile = base.concat('.').concat(input); + outfile = [ '-o', base.concat('.').concat(output) ]; + logfile = [ '-t', base.concat('.').concat(log) ]; + return getCommand('xindy', quiet, debug, markup, modules, + codepage, language, logfile, outfile, options, infile); + } +arguments: +- identifier: quiet + flag: > + @{ + isTrue(parameters.quiet, '-q') + } +- identifier: modules + flag: > + @{ + elements = []; + if (isList(parameters.modules)) { + foreach (module : parameters.modules) { + elements.add('-M'); + elements.add(module); + } + return elements; + } + else { + throwError('I was expecting a list of options.'); + } + } +- identifier: codepage + flag: > + @{ + [ '-C', parameters.codepage ] + } +- identifier: language + flag: > + @{ + [ '-L', parameters.language ] + } +- identifier: markup + flag: > + @{ + if ([ 'latex', 'xelatex', 'omega', 'xindy' ].contains(parameters.markup)) { + return [ '-I', parameters.markup ]; + } + else { + throwError('The provided markup is invalid.'); + } + } +- identifier: input + flag: > + @{ + parameters.input + } + default: idx +- identifier: output + flag: > + @{ + parameters.output + } + default: ind +- identifier: log + flag: > + @{ + parameters.log + } + default: ilg +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + } diff --git a/Master/texmf-dist/source/support/arara/pom.xml b/Master/texmf-dist/source/support/arara/pom.xml index 43147fde01b..bce2b7a9955 100644 --- a/Master/texmf-dist/source/support/arara/pom.xml +++ b/Master/texmf-dist/source/support/arara/pom.xml @@ -1,27 +1,63 @@ +<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> +<!-- + - Arara, the cool TeX automation tool + - Copyright (c) 2012, Paulo Roberto Massa Cereda + - All rights reserved. + - + - Redistribution and use in source and binary forms, with or without + - modification, are permitted provided that the following conditions + - are met: + - + - 1. Redistributions of source code must retain the above copyright + - notice, this list of conditions and the following disclaimer. + - + - 2. Redistributions in binary form must reproduce the above copyright + - notice, this list of conditions and the following disclaimer in the + - documentation and/or other materials provided with the distribution. + - + - 3. Neither the name of the project's author nor the names of its + - contributors may be used to endorse or promote products derived from + - this software without specific prior written permission. + - + - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + - FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + - COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + - WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + - POSSIBILITY OF SUCH DAMAGE. +--> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <groupId>com.github.arara</groupId> + <modelVersion>4.0.0</modelVersion> + <groupId>com.github.cereda</groupId> <artifactId>arara</artifactId> - <version>3.0a</version> + <version>4.0</version> <packaging>jar</packaging> <name>arara</name> - <url>http://cereda.github.com/arara</url> - <description>The cool TeX automation tool</description> + <url>https://github.com/cereda/arara</url> + <description>Arara is a TeX automation tool based on rules and directives.</description> <inceptionYear>2012</inceptionYear> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <maven.compiler.source>1.5</maven.compiler.source> + <maven.compiler.target>1.5</maven.compiler.target> </properties> - + <issueManagement> <system>GitHub</system> <url>https://github.com/cereda/arara/issues</url> </issueManagement> - + <licenses> <license> <name>New BSD License</name> @@ -29,25 +65,28 @@ <distribution>repo</distribution> <comments>New BSD License</comments> </license> - </licenses> - + </licenses> + <scm> <connection>scm:git:https://github.com/cereda/arara.git</connection> <developerConnection>scm:git:https://github.com/cereda/arara.git</developerConnection> <url>https://github.com/cereda/arara</url> </scm> - + <developers> + <developer> <name>Paulo Roberto Massa Cereda</name> <email>cereda@users.sf.net</email> <id>cereda</id> <url>http://tex.stackexchange.com/users/3094</url> <roles> - <role>Lead Developer</role> + <role>Lead developer</role> <role>Creator</role> + <role>Duck enthusiast</role> </roles> </developer> + <developer> <name>Marco Daniel</name> <email>marco.daniel@mada-nada.de</email> @@ -56,8 +95,10 @@ <roles> <role>Contributor</role> <role>Tester</role> + <role>Fast driver</role> </roles> </developer> + <developer> <name>Brent Longborough</name> <email>brent@longborough.org</email> @@ -67,114 +108,229 @@ <role>Developer</role> <role>Contributor</role> <role>Tester</role> + <role>Haskell fanatic</role> + </roles> + </developer> + + <developer> + <name>Nicola Talbot</name> + <email>nicola.lc.talbot@gmail.com</email> + <id>nlct</id> + <url>http://tex.stackexchange.com/users/19862</url> + <roles> + <role>Developer</role> + <role>Contributor</role> + <role>Tester</role> + <role>Hat enthusiast</role> </roles> </developer> + </developers> - - <dependencies> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.10</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.yaml</groupId> - <artifactId>snakeyaml</artifactId> - <version>1.11</version> - </dependency> - <dependency> - <groupId>org.mvel</groupId> - <artifactId>mvel2</artifactId> - <version>2.2.8.Final</version> - </dependency> - <dependency> - <groupId>commons-cli</groupId> - <artifactId>commons-cli</artifactId> - <version>1.2</version> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-lang3</artifactId> - <version>3.1</version> - </dependency> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-classic</artifactId> - <version>1.0.1</version> - </dependency> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-core</artifactId> - <version>1.0.1</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.6.4</version> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-exec</artifactId> - <version>1.1</version> - </dependency> - <dependency> - <groupId>commons-collections</groupId> - <artifactId>commons-collections</artifactId> - <version>3.2.1</version> - </dependency> - </dependencies> - <build> + <finalName>arara-${project.version}</finalName> + <plugins> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> - <version>2.5.1</version> + <version>3.5.1</version> <configuration> <source>1.5</source> <target>1.5</target> + <compilerArgument>-Xlint:unchecked</compilerArgument> </configuration> </plugin> + <plugin> <artifactId>maven-assembly-plugin</artifactId> - <version>2.3</version> + <version>2.6</version> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <archive> <manifest> - <mainClass>com.github.arara.Arara</mainClass> + <mainClass>com.github.cereda.arara.Arara</mainClass> </manifest> </archive> </configuration> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> - <version>2.7</version> + <version>2.10.4</version> <configuration> <show>public</show> + <defaultAuthor>Paulo Roberto Massa Cereda</defaultAuthor> + <defaultSince>${project.version}</defaultSince> + <defaultVersion>${project.version}</defaultVersion> + <level>private</level> </configuration> </plugin> - <plugin> + + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> - <version>2.4</version> + <version>3.0.1</version> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> <classpathPrefix>lib/</classpathPrefix> - <mainClass>com.github.arara.Arara</mainClass> + <mainClass>com.github.cereda.arara.Arara</mainClass> </manifest> </archive> </configuration> </plugin> - </plugins> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <version>2.10</version> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>copy-dependencies</goal> + </goals> + <configuration> + <includeScope>runtime</includeScope> + <outputDirectory>${project.build.directory}/lib</outputDirectory> + </configuration> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + <version>3.0.0</version> + </plugin> + + </plugins> + </build> - + + <dependencies> + + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.6</version> + </dependency> + + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>2.2</version> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>com.e-movimento.tinytools</groupId> + <artifactId>privilegedaccessor</artifactId> + <version>1.2.2</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.simpleframework</groupId> + <artifactId>simple-xml</artifactId> + <version>2.7.1</version> + </dependency> + + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-collections4</artifactId> + <version>4.0</version> + </dependency> + + <dependency> + <groupId>org.zeroturnaround</groupId> + <artifactId>zt-exec</artifactId> + <version>1.9</version> + <exclusions> + <exclusion> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>org.yaml</groupId> + <artifactId>snakeyaml</artifactId> + <version>1.17</version> + </dependency> + + <dependency> + <groupId>commons-cli</groupId> + <artifactId>commons-cli</artifactId> + <version>1.3.1</version> + </dependency> + + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-classic</artifactId> + <version>1.1.2</version> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-core</artifactId> + <version>1.1.2</version> + </dependency> + + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>1.7.7</version> + </dependency> + + <dependency> + <groupId>ch.qos.cal10n</groupId> + <artifactId>cal10n-api</artifactId> + <version>0.8.1</version> + </dependency> + + <dependency> + <groupId>org.mvel</groupId> + <artifactId>mvel2</artifactId> + <version>2.2.8.Final</version> + </dependency> + + <dependency> + <groupId>org.apache.velocity</groupId> + <artifactId>velocity</artifactId> + <version>1.7</version> + <exclusions> + <exclusion> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + </exclusion> + </exclusions> + </dependency> + + </dependencies> + </project> diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/Arara.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/Arara.java deleted file mode 100644 index 48335eaf879..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/Arara.java +++ /dev/null @@ -1,196 +0,0 @@ -/** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the project's author nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY - * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * Arara: The main class. Basically, this class will get the file name from the - * arguments list and call the proper methods from the other helper classes. - */ -// package definition -package com.github.arara; - -// needed imports -import com.github.arara.model.AraraDirective; -import com.github.arara.utils.*; -import java.io.File; -import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The main arara class. The code logic is encapsulated in the helper class, so - * if something goes wrong, the generic exception catch here will simply print - * it. I tried to make the code as easier as possible. - * - * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 1.0 - */ -public class Arara { - - // the logger - final static Logger logger = LoggerFactory.getLogger(Arara.class); - // the localization class - final static AraraLocalization localization = AraraLocalization.getInstance(); - - /** - * The main method. The idea is to provide to arara only the supported file - * name and let it handle. The application will remove the file extension - * (if any) and call the other helper classes. - * - * @param args The command line arguments. In fact, arara supports a lot of - * flags, all listed in the CommandLineAnalyzer. - */ - public static void main(String[] args) { - - // the application status, zero for a normal execution, - // or nonzero for an abnormal execution - int exitStatus; - - // trying to have a normal execution - try { - - // print the application header - AraraUtils.printHeader(); - - // create a configuration instance and load - // the proper settings, if any - ConfigurationLoader configuration = new ConfigurationLoader(); - configuration.load(); - - // create a new analyzer - CommandLineAnalyzer commandLine = new CommandLineAnalyzer(args, configuration); - - // if the minimum parameters are not satisfied or it's a simple - // help or version request - if (!commandLine.parse()) { - - // simply return - exitStatus = 0; - - // exit right now, good job - System.exit(exitStatus); - } - - // it's a normal workflow, let's define the main file - File file; - - // create a new file reference - file = new File(commandLine.getFile()); - - // welcome message - logger.info(localization.getMessage("Log_WelcomeMessage")); - - // process file - logger.info(localization.getMessage("Log_ProcessingFile", file.getName())); - - // file exists, let's proceed with the directive extractor - DirectiveExtractor dirExtractor = new DirectiveExtractor(file, configuration); - - // extract all directives from the file - dirExtractor.extract(); - - // get all directives found - List<AraraDirective> directives = dirExtractor.getDirectives(); - - // set the overall result flag - boolean overallResult = true; - - // check if any directive was found - if (!directives.isEmpty()) { - - // now let's parse the directives - DirectiveParser dirParser = new DirectiveParser(directives); - - // set the file - dirParser.setFile(file); - - // parse the directives - TaskDeployer taskDeployer = new TaskDeployer(dirParser.parse(), configuration); - - // deploy the tasks through a command trigger - CommandTrigger commandTrigger = new CommandTrigger(taskDeployer.deploy()); - - // set verbose option, if enabled - commandTrigger.setVerbose(commandLine.isVerbose()); - - // set an execution timeout, if set - commandTrigger.setExecutionTimeout(commandLine.getExecutionTimeout()); - - // execute the tasks - overallResult = commandTrigger.execute(); - } - else { - - // no directives found, add message to the log - logger.info(localization.getMessage("Log_NoDirectivesFound", file.getName())); - - // print message - System.out.println(AraraUtils.wrap(localization.getMessage("Msg_NoDirectivesFound", file.getName()))); - } - - // final message - logger.info(localization.getMessage("Log_Done")); - - // if everything was ok, that is, every command in the command list - // returned with an exit status of zero - if (overallResult) { - - // everything fine - exitStatus = 0; - - } else { - - // something wrong happened, so let's consider the whole - // execution as abnormal - exitStatus = 1; - } - - } catch (Exception exception) { - - // something bad happened, print the error message - System.out.println(AraraUtils.wrap(exception.getMessage())); - - // catch error in the log - logger.error(localization.getMessage("Log_ExceptionRaised")); - logger.error(exception.getMessage()); - - // error, set status to an abnormal execution - exitStatus = 1; - - } - - // send the exit code to the terminal, and we are done - System.exit(exitStatus); - } -} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/model/AraraConfiguration.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/model/AraraConfiguration.java deleted file mode 100644 index f65c36e447b..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/model/AraraConfiguration.java +++ /dev/null @@ -1,221 +0,0 @@ -/** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the project's author nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY - * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * AraraConfiguration: This class holds the model for the arara configuration - * file. - */ -// package definition -package com.github.arara.model; - -// needed imports -import com.github.arara.exception.AraraException; -import com.github.arara.utils.AraraUtils; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import org.apache.commons.lang3.SystemUtils; -import org.mvel2.templates.TemplateRuntime; - -/** - * Holds the model for the arara configuration file. - * - * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 3.0 - */ -public class AraraConfiguration { - - // the application language - private String language; - // the list of search paths - private List<String> paths; - // the list of filetypes - private List<AraraFilePattern> filetypes; - // the path runtime exception - private RuntimeException pathRuntimeException; - // the path IO exception - private IOException pathIOException; - - /** - * Getter for the search paths. - * - * @return The search paths. - */ - public List<String> getPaths() { - return paths; - } - - /** - * Getter for the language. - * - * @return The language. - */ - public String getLanguage() { - return language; - } - - /** - * Setter for the language. - * - * @param language The language. - */ - public void setLanguage(String language) { - this.language = language; - } - - /** - * Setter for the search paths. - * - * @param rules The search paths. - */ - public void setPaths(List<String> rules) throws AraraException, Exception { - this.paths = rules; - - // refresh paths - refreshPaths(); - } - - /** - * Getter for the filetypes. - * - * @return The filetypes. - */ - public List<AraraFilePattern> getFiletypes() { - return filetypes; - } - - /** - * Setter for the filetypes. - * - * @param filetypes The filetypes. - */ - public void setFiletypes(List<AraraFilePattern> filetypes) { - this.filetypes = filetypes; - } - - /** - * Constructor. - */ - public AraraConfiguration() { - - // creates both lists - paths = new ArrayList<String>(); - filetypes = new ArrayList<AraraFilePattern>(); - pathRuntimeException = null; - } - - /** - * Refreshes all paths, replacing possible variables in the template - */ - private void refreshPaths() throws AraraException, Exception { - - // create a map - HashMap map = new HashMap(); - - // add the variables - map.put("userhome", SystemUtils.USER_HOME); - - // for every path in the list - for (int i = 0; i < paths.size(); i++) { - - try { - - // remove the keyword - String fullPath = AraraUtils.removeKeyword(paths.get(i)); - - // apply the template - fullPath = (String) TemplateRuntime.eval(fullPath, map); - - try { - - // attempt to create a file reference and - // get the canonical path, if the operation - // succeeds, it's a valid path - File validFile = new File(fullPath); - validFile.getCanonicalPath(); - - // sanitize the path in order to be displayed correctly - fullPath = new File(new File(fullPath).toURI()).getPath(); - - // set the path in the list - paths.set(i, fullPath); - - } catch (IOException ioException) { - - // the path is terribly invalid, get the exception, - // if null - if (pathIOException == null) { - - // set the path IO exception - pathIOException = ioException; - } - } - - } catch (RuntimeException runtimeException) { - - // an error has occurred, register the exception for - // later access - - // if there isn't an exception yet - if (pathRuntimeException == null) { - - // set the exception - pathRuntimeException = runtimeException; - } - - } - } - } - - /** - * Getter for the path runtime exception. - * - * @return The path runtime exception. - */ - public RuntimeException getPathRuntimeException() { - return pathRuntimeException; - } - - /** - * Getter for the path IO exception. - * - * @return The path IO exception. - */ - public IOException getPathIOException() { - return pathIOException; - } -} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/model/AraraDirective.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/model/AraraDirective.java deleted file mode 100644 index 5dc8842456b..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/model/AraraDirective.java +++ /dev/null @@ -1,148 +0,0 @@ -/** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the project's author nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY - * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * AraraDirective: This class provides the model for representing the arara - * directives found in the source file. It's a plain old Java object. - */ -// package definition -package com.github.arara.model; - -// needed imports -import java.util.Map; - -/** - * Provides the model for representing the arara directives found in the source - * file. - * - * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 1.0 - */ -public class AraraDirective { - - // the directive name - private String name; - // the configuration - private Map config; - // the line number - private int lineNumber = 0; - - /** - * Constructor. - * - * @param name The directive name. - * @param config The configuration. - */ - public AraraDirective(String name, Map config) { - - // set the name - this.name = name; - - // set the configuration - this.config = config; - } - - /** - * Constructor. - */ - public AraraDirective() { - } - - /** - * Getter for configuration. - * - * @return The configuration. - */ - public Map getConfig() { - - // return it - return config; - } - - /** - * Setter for configuration. - * - * @param config The configuration. - */ - public void setConfig(Map config) { - - // set the configuration - this.config = config; - } - - /** - * Getter for the directive name. - * - * @return The directive name. - */ - public String getName() { - - // return it - return name; - } - - /** - * Setter for the directive name. - * - * @param name The directive name. - */ - public void setName(String name) { - - // set it - this.name = name; - } - - /** - * Getter for the line number. - * - * @return The line number. - */ - public int getLineNumber() { - - // return it - return lineNumber; - } - - /** - * Setter for the line number. - * - * @param lineNumber The line number. - */ - public void setLineNumber(int lineNumber) { - - // set it - this.lineNumber = lineNumber; - } -} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/model/AraraLanguage.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/model/AraraLanguage.java deleted file mode 100644 index b04e9850236..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/model/AraraLanguage.java +++ /dev/null @@ -1,137 +0,0 @@ -/** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the project's author nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY - * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * AraraLanguage: This class holds the data model for the arara language - * specification. - */ -// package definition. -package com.github.arara.model; - -// needed import -import java.util.Locale; - -/** - * Holds the data model for the arara language specification. - * - * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 3.0 - */ -public class AraraLanguage { - - // language name - private String name; - // language code - private String code; - // language locale - private Locale locale; - - /** - * Getter for the language name. - * - * @return The language name. - */ - public String getName() { - return name; - } - - /** - * Setter for the language name. - * - * @param name The language name. - */ - public void setName(String name) { - this.name = name; - } - - /** - * Getter for the language code. - * - * @return The language code. - */ - public String getCode() { - return code; - } - - /** - * Setter for the language code. - * - * @param code The language code. - */ - public void setCode(String code) { - this.code = code; - } - - /** - * Getter for the language locale. - * - * @return The language locale. - */ - public Locale getLocale() { - return locale; - } - - /** - * Setter for the language locale. - * - * @param locale The language locale. - */ - public void setLocale(Locale locale) { - this.locale = locale; - } - - /** - * Constructor. - * - * @param name The language name. - * @param code The language code. - * @param locale The language locale. - */ - public AraraLanguage(String name, String code, Locale locale) { - this.name = name; - this.code = code; - this.locale = locale; - } - - /** - * Returns a string representation of the object. - * - * @return The string representation of the object. - */ - @Override - public String toString() { - return name.concat(" [").concat(code).concat("]"); - } -} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/model/AraraRuleConfig.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/model/AraraRuleConfig.java deleted file mode 100644 index 5ebe9382bf0..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/model/AraraRuleConfig.java +++ /dev/null @@ -1,223 +0,0 @@ -/** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the project's author nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY - * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * PlainAraraRuleConfig: This class provides the model for representing a plain - * Arara rule configuration based on the YAML files. It's a plain old Java - * object. - */ -// package definition -package com.github.arara.model; - -// needed imports -import com.github.arara.utils.AraraUtils; -import java.util.ArrayList; -import java.util.List; - -/** - * Provides the model for representing a plain Arara rule configuration based on - * the YAML files. This class will be used to map YAML rules into Java objects. - * - * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 1.0 - */ -public class AraraRuleConfig { - - // the rule identifier - private String identifier; - // the rule name - private String name; - // the rule command - private String command; - // the rule commands - private List<String> commands; - // the arguments list - private List<AraraRuleArgument> arguments; - - public List<String> getCommands() { - return commands; - } - - /** - * Setter for the rule commands. - * - * @param commands A list containing the rule commands. - */ - public void setCommands(List<String> commands) { - this.commands = commands; - - // for every entry - for (int i = 0; i < commands.size(); i++) { - - // remove keyword and reinsert into the list - String currentCommand = AraraUtils.removeKeyword(commands.get(i)); - commands.set(i, currentCommand); - } - } - - /** - * Getter for the rule identifier. - * - * @return The rule identifier. - */ - public String getIdentifier() { - - // return it - return identifier; - } - - /** - * Setter for the rule identifier. - * - * @param identifier The rule identifier. - */ - public void setIdentifier(String identifier) { - - // set the identifier - this.identifier = identifier; - } - - /** - * Getter for the rule name. - * - * @return The rule name. - */ - public String getName() { - - // return it - return name; - } - - /** - * Setter for the rule name. - * - * @param name The rule name. - */ - public void setName(String name) { - - // set the rule name - this.name = name; - } - - /** - * Getter for the rule command. - * - * @return The rule command. - */ - public String getCommand() { - - // return it - return command; - } - - /** - * Setter for the rule command. - * - * @param command The rule command. - */ - public void setCommand(String command) { - - // set the command - this.command = AraraUtils.removeKeyword(command); - } - - /** - * Getter for the arguments list. - * - * @return The arguments list. - */ - public List<AraraRuleArgument> getArguments() { - - // return the list - return arguments; - } - - /** - * Setter for the arguments list. - * - * @param arguments The arguments list. - */ - public void setArguments(List<AraraRuleArgument> arguments) { - - // set the list - this.arguments = arguments; - } - - /** - * Returns a list containing all argument identifiers. - * - * @return A list containing all argument identifiers. - */ - public List<String> getIdentifiersList() { - - // create a new list - List<String> result = new ArrayList<String>(); - - // for every argument - for (AraraRuleArgument argument : getArguments()) { - - // add identifier - result.add(argument.getIdentifier()); - } - - // return list - return result; - } - - /** - * Returns the forbidden identifier, if any. - * - * @return The forbidden identifier, if any. - */ - public String checkForForbiddenIdentifiers() { - - // for every argument - for (AraraRuleArgument argument : getArguments()) { - - // get the current argument value - String value = argument.getIdentifier().toLowerCase(); - - // check if it's a forbidden argument identifier - if ((value.equals("file")) || (value.equals("files")) || (value.equals("item")) || (value.equals("items"))) { - - // return the value - return value; - } - } - - // nothing wrong was found - return null; - } -} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/AraraConstants.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/AraraConstants.java deleted file mode 100644 index 38a931f1119..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/AraraConstants.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the project's author nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY - * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * AraraConstants: This class contains all the constants used in the main - * application. - */ -// package definition -package com.github.arara.utils; - -/** - * Contains all the constants used in the main application. - * - * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 3.0 - */ -public class AraraConstants { - - /** - * The arara version. - */ - public static final String VERSION = "3.0a"; - /** - * The number of characters per line in messages. - */ - public static final int WRAPLENGTH = 65; - /** - * The name of the default configuration file. - */ - public static final String ARARACONFIG = "araraconfig.yaml"; - /** - * The directive prefix for the pattern matching method. - */ - public static final String DIRECTIVEPREFIX = "arara:\\s"; - /** - * The rule pattern for string reference. - */ - public static final String RULEPATTERN = "^(\\s)*<arara>\\s"; - /** - * The name of the log file generated by arara. - */ - public static final String LOGNAME = "arara"; - /** - * The copyright year. - */ - public static final String COPYRIGHTYEAR = "2012"; - /** - * The variable exception matching pattern. - */ - public static final String VAREXCEPTIONPATTERN = "^\\[Error: could not access: (.*);"; - /** - * The method exception matching pattern. - */ - public static final String METHODEXCEPTIONPATTERN = "^\\[Error: unable to access property \\((.*)\\): (.*)\\]"; - /** - * The full directive matching pattern. - */ - public static final String FULLDIRECTIVEPATTERN = "^\\s*(\\w+)\\s*:\\s*\\{.*\\}\\s*$"; - /** - * The empty directive matching pattern. - */ - public static final String EMPTYDIRECTIVEPATTERN = "^\\s*(\\w+)\\s*$"; - -} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/AraraLocalization.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/AraraLocalization.java deleted file mode 100644 index 1b3f093699f..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/AraraLocalization.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the project's author nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY - * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * AraraLocalization: This class contains a few helper methods in order to ease - * the localization process during the execution. This class is a singleton - * reference. - */ -// package definition -package com.github.arara.utils; - -// needed imports -import java.text.MessageFormat; -import java.util.Locale; -import java.util.ResourceBundle; - -/** - * Contains a few helper methods in order to ease the localization process - * during the execution. This class is a singleton reference. - * - * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 3.0 - */ -public class AraraLocalization { - - // the singleton reference - private static AraraLocalization selfRef; - // the resource bundle for the whole application - private ResourceBundle resources; - - /** - * Constructs the singleton instance. - */ - private AraraLocalization() { - - // set the self-reference - selfRef = this; - - // instead of relying in the default locale from the - // operating system, always fallback to english - Locale.setDefault(Locale.ENGLISH); - - // get the resource bundle - resources = ResourceBundle.getBundle("com.github.arara.localization.Messages"); - } - - /** - * Provides reference to the singleton object. - * - * @return The singleton instance. - */ - public static final AraraLocalization getInstance() { - - // if there's no current object, call the private constructor - if (selfRef == null) { - selfRef = new AraraLocalization(); - } - - // return the actual object - return selfRef; - } - - /** - * Returns a simple message from the resource bundle. - * - * @param message The message identifier. - * @return A string from the resource bundle. - */ - public String getMessage(String message) { - return resources.getString(message); - } - - /** - * Returns a message containing parameters from the resource bundle. - * - * @param message The message identifier. - * @param parameters A list of parameters to be replaced in the message. - * @return A string from the resource bundle, with the correct parameters. - */ - public String getMessage(String message, Object... parameters) { - return MessageFormat.format(resources.getString(message), parameters); - } - - /** - * Refresh the resource bundle reference, if by any chance, the application - * language is changed in runtime. - */ - public void refresh() { - - // clear cache and reload the resource bundle - // ResourceBundle.clearCache(); // not supported by Java 5 - resources = ResourceBundle.getBundle("com.github.arara.localization.Messages"); - } -} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/AraraLogging.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/AraraLogging.java deleted file mode 100644 index 3cbad2a970c..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/AraraLogging.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the project's author nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY - * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * AraraLogging: This class configures the logging features. - */ -// package definition -package com.github.arara.utils; - -// needed imports -import ch.qos.logback.classic.LoggerContext; -import ch.qos.logback.classic.joran.JoranConfigurator; -import ch.qos.logback.core.joran.spi.JoranException; -import org.slf4j.LoggerFactory; - -/** - * Configures the logging features. - * - * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 3.0 - */ -public class AraraLogging { - - public static void enableLogging(boolean enable) { - - // get the context - LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory(); - - try { - - // create a new configurator - JoranConfigurator configurator = new JoranConfigurator(); - - // set context and reset it - configurator.setContext(loggerContext); - loggerContext.reset(); - - // if logging should be enabled - if (enable) { - - // add the correct properties and load the XML file - loggerContext.putProperty("araraLogName", AraraConstants.LOGNAME); - configurator.doConfigure(AraraLogging.class.getResourceAsStream("/com/github/arara/conf/logback.xml")); - } - - } catch (JoranException joranException) { - // do nothing - } - } -} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/AraraMethods.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/AraraMethods.java deleted file mode 100644 index 239dd4bf7cf..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/AraraMethods.java +++ /dev/null @@ -1,481 +0,0 @@ -/** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the project's author nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY - * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * AraraMethods: This class contains methods for the MVEL expression language to - * be used in the rules. - */ -// package definition -package com.github.arara.utils; - -// needed import -import java.io.File; -import org.apache.commons.lang3.SystemUtils; - -/** - * Contains methods for the MVEL expression language to be used in the rules. - * - * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 3.0 - */ -public class AraraMethods { - - /** - * Holds the original filename. - */ - private static String originalFile; - - /** - * Setter for the original filename. - * - * @param originalFile The original filename. - */ - public static void setOriginalFile(String originalFile) { - AraraMethods.originalFile = originalFile; - } - - /** - * Getter for the original filename. - * - * @return A string containing the original filename. - */ - public static String getOriginalFile() { - return originalFile; - } - - /** - * Checks if string is empty. - * - * @param string The string. - * @return A logical value according to the condition. - */ - public static boolean isEmpty(String string) { - return "".equals(string); - } - - /** - * Checks if string is not empty. - * - * @param string The string. - * @return A logical value according to the condition. - */ - public static boolean isNotEmpty(String string) { - return !"".equals(string); - } - - /** - * Checks if string is empty. - * - * @param string The string. - * @param ifTrue Value if true. - * @return A string according the condition. - */ - public static String isEmpty(String string, String ifTrue) { - return ("".equals(string) ? ifTrue : string); - } - - /** - * Checks if string is not empty. - * - * @param string The string. - * @param ifTrue Value if true. - * @return A string according the condition. - */ - public static String isNotEmpty(String string, String ifTrue) { - return (!"".equals(string) ? ifTrue : string); - } - - /** - * Checks if string is empty. - * - * @param string The string. - * @param ifTrue Value if true. - * @param ifFalse Value if false. - * @return A string according the condition. - */ - public static String isEmpty(String string, String ifTrue, String ifFalse) { - return ("".equals(string) ? ifTrue : ifFalse); - } - - /** - * Checks if string is not empty. - * - * @param string The string. - * @param ifTrue Value if true. - * @param ifFalse Value if false. - * @return A string according the condition. - */ - public static String isNotEmpty(String string, String ifTrue, String ifFalse) { - return (!"".equals(string) ? ifTrue : ifFalse); - } - - /** - * Checks if string resolves to a logic value representing true. - * - * @param string The string. - * @return A string according the condition. - */ - public static boolean isTrue(String string) { - string = string.toLowerCase(); - if ((string.equals("yes")) || (string.equals("on")) || (string.equals("true")) || (string.equals("y")) || (string.equals("1"))) { - return true; - } else { - return false; - } - } - - /** - * Checks if string resolves to a logic value representing false. - * - * @param string The string. - * @return A string according the condition. - */ - public static boolean isFalse(String string) { - string = string.toLowerCase(); - if ((string.equals("no")) || (string.equals("off")) || (string.equals("false")) || (string.equals("n")) || (string.equals("0"))) { - return true; - } else { - return false; - } - } - - /** - * Checks if string resolves to a logic value representing true. - * - * @param string The string. - * @param ifTrue Value if true. - * @return A string according the condition. - */ - public static String isTrue(String string, String ifTrue) { - return (isTrue(string) ? ifTrue : ""); - } - - /** - * Checks if string resolves to a logic value representing false. - * - * @param string The string. - * @param ifTrue Value if true. - * @return A string according the condition. - */ - public static String isFalse(String string, String ifTrue) { - return (isFalse(string) ? ifTrue : ""); - } - - /** - * Checks if string resolves to a logic value representing true. - * - * @param string The string. - * @param ifTrue Value if true. - * @param ifFalse Value if false. - * @return A string according the condition. - */ - public static String isTrue(String string, String ifTrue, String ifFalse) { - return (isTrue(string) ? ifTrue : ifFalse); - } - - /** - * Checks if string resolves to a logic value representing false. - * - * @param string The string. - * @param ifTrue Value if true. - * @param ifFalse Value if false. - * @return A string according the condition. - */ - public static String isFalse(String string, String ifTrue, String ifFalse) { - return (isFalse(string) ? ifTrue : ifFalse); - } - - /** - * Checks if string resolves to a logic value representing true. - * - * @param string The string. - * @param ifTrue Value if true. - * @param ifFalse Value if false. - * @param defaultValue Value if the string is neither true or false. - * @return A string according the condition. - */ - public static String isTrue(String string, String ifTrue, String ifFalse, String defaultValue) { - if (isTrue(string)) { - return ifTrue; - } - if (isFalse(string)) { - return ifFalse; - } - return defaultValue; - } - - /** - * Checks if string resolves to a logic value representing false. - * - * @param string The string. - * @param ifTrue Value if true. - * @param ifFalse Value if false. - * @param defaultValue Value if the string is neither true or false. - * @return A string according the condition. - */ - public static String isFalse(String string, String ifTrue, String ifFalse, String defaultValue) { - if (isFalse(string)) { - return ifTrue; - } - if (isTrue(string)) { - return ifFalse; - } - return defaultValue; - } - - /** - * Trim spaces from the string. - * - * @param string The string. - * @return The string with the trailing and leading spaces trimmed. - */ - public static String trimSpaces(String string) { - return string.trim(); - } - - /** - * Returns the filename. - * - * @param f The string. - * @return The filename. - */ - public static String getFilename(String f) { - try { - return (new File(f)).getName(); - } catch (Exception exception) { - return ""; - } - } - - /** - * Returns the base name. - * - * @param f The string. - * @return The base name. - */ - public static String getBasename(String f) { - try { - f = (new File(f)).getName(); - int i = f.lastIndexOf(".") != -1 ? f.lastIndexOf(".") : f.length(); - return f.substring(0, i); - } catch (Exception exception) { - return ""; - } - } - - /** - * Returns the filetype. - * - * @param f The string. - * @return The filetype. - */ - public static String getFiletype(String f) { - try { - f = (new File(f)).getName(); - if (f.lastIndexOf(".") != -1) { - return f.substring(f.lastIndexOf(".") + 1, f.length()); - } - return ""; - } catch (Exception exception) { - return ""; - } - } - - /** - * Returns the directory name. - * - * @param f The string. - * @return The directory name. - */ - public static String getDirname(String f) { - try { - return (new File(f)).getParent(); - } catch (Exception exception) { - return ""; - } - } - - /** - * Checks if the string is a valid existing file. - * - * @param f The string. - * @return A logic value indicating if the string is a valid existing file. - */ - public static boolean isFile(String f) { - try { - return (new File(f)).isFile(); - } catch (Exception exception) { - return false; - } - } - - /** - * Checks if the string is a valid existing directory. - * - * @param f The string. - * @return A logic value indicating if the string is a valid existing - * directory. - */ - public static boolean isDir(String f) { - try { - return (new File(f)).isDirectory(); - } catch (Exception exception) { - return false; - } - } - - /** - * Checks if the operating system is Windows. - * - * @param ifTrue The value if true. - * @param ifFalse The value if false. - * @return A string according the condition. - */ - public static String isWindows(String ifTrue, String ifFalse) { - if (SystemUtils.IS_OS_WINDOWS) { - return ifTrue; - } - else { - return ifFalse; - } - } - - /** - * Checks if the operating system is Linux. - * - * @param ifTrue The value if true. - * @param ifFalse The value if false. - * @return A string according the condition. - */ - public static String isLinux(String ifTrue, String ifFalse) { - if (SystemUtils.IS_OS_LINUX) { - return ifTrue; - } - else { - return ifFalse; - } - } - - /** - * Checks if the operating system is Unix. - * - * @param ifTrue The value if true. - * @param ifFalse The value if false. - * @return A string according the condition. - */ - public static String isUnix(String ifTrue, String ifFalse) { - if (SystemUtils.IS_OS_UNIX) { - return ifTrue; - } - else { - return ifFalse; - } - } - - /** - * Checks if the operating system is Mac. - * - * @param ifTrue The value if true. - * @param ifFalse The value if false. - * @return A string according the condition. - */ - public static String isMac(String ifTrue, String ifFalse) { - if (SystemUtils.IS_OS_MAC) { - return ifTrue; - } - else { - return ifFalse; - } - } - - /** - * Checks if the logic condition is true. - * - * @param value Logic condition to be evaluated. - * @param ifTrue The value if true. - * @return A string according the condition. - */ - public static String isTrue(boolean value, String ifTrue) { - if (value) { - return ifTrue; - } - return ""; - } - - /** - * Checks if the logic condition is true. - * - * @param value Logic condition to be evaluated. - * @param ifTrue The value if true. - * @param ifFalse The value if false. - * @return A string according the condition. - */ - public static String isTrue(boolean value, String ifTrue, String ifFalse) { - if (value) { - return ifTrue; - } - return ifFalse; - } - - /** - * Checks if the logic condition is false. - * - * @param value Logic condition to be evaluated. - * @param ifTrue The value if true. - * @return A string according the condition. - */ - public static String isFalse(boolean value, String ifTrue) { - if (!value) { - return ifTrue; - } - return ""; - } - - /** - * Checks if the logic condition is false. - * - * @param value Logic condition to be evaluated. - * @param ifTrue The value if true. - * @param ifFalse The value if false. - * @return A string according the condition. - */ - public static String isFalse(boolean value, String ifTrue, String ifFalse) { - if (!value) { - return ifTrue; - } - return ifFalse; - } - -} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/AraraUtils.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/AraraUtils.java deleted file mode 100644 index 42eaa6c44a2..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/AraraUtils.java +++ /dev/null @@ -1,224 +0,0 @@ -/** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the project's author nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY - * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * AraraUtils: This class contains some helper methods used for general purpose. - */ -// package definition -package com.github.arara.utils; - -// needed imports -import java.util.StringTokenizer; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import org.apache.commons.lang3.text.WordUtils; -import org.yaml.snakeyaml.error.MarkedYAMLException; - -/** - * Contains some helper methods used for general purpose. - * - * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 3.0 - */ -public class AraraUtils { - - // the localization class - final static AraraLocalization localization = AraraLocalization.getInstance(); - - /** - * Removes the reserved keyword in the strings to be analyzed by the MVEL - * template engine. The keyword is set in AraraConstants. - * - * @param line The line to be analyzed. - * @return The new line without the keyword. - */ - public static String removeKeyword(String line) { - - // set a new pattern and matcher - Pattern pattern = Pattern.compile(AraraConstants.RULEPATTERN); - Matcher matcher = pattern.matcher(line); - - // if the keyword is found - if (matcher.find()) { - - // remove the keyword - line = (line.substring(matcher.end(), line.length())).trim(); - } - - // and return it - return line; - } - - /** - * Prints the arara ASCII header. - */ - public static void printHeader() { - - // print the ASCII art - System.out.println(" __ _ _ __ __ _ _ __ __ _ "); - System.out.println(" / _` | '__/ _` | '__/ _` |"); - System.out.println("| (_| | | | (_| | | | (_| |"); - System.out.println(" \\__,_|_| \\__,_|_| \\__,_|\n"); - - } - - /** - * Wraps the string to several lines, according to the wrap length set in - * the AraraConstants class. - * - * @param message The message to be wrapped. - * @return A new message. - */ - public static String wrap(String message) { - - // create a new tokenizer in order to allow line breaks, so - // every line is processed individually - StringTokenizer tokens = new StringTokenizer(message, "\n", true); - String result = ""; - - // iterate through tokens - while (tokens.hasMoreTokens()) { - - // wrap line according to the wrap length - result = result.concat(WordUtils.wrap(tokens.nextToken(), AraraConstants.WRAPLENGTH)); - } - - // return the result - return result; - } - - /** - * Gets the variable reference from a RuntimeException object. - * @param runtimeException The RuntimeException object. - * - * @return The variable reference name. - */ - public static String getVariableFromException(RuntimeException runtimeException) { - - // set pattern and matcher - Pattern pattern = Pattern.compile(AraraConstants.VAREXCEPTIONPATTERN); - Matcher matcher = pattern.matcher(runtimeException.getMessage()); - - // if the variable is found - if (matcher.find()) { - - // check if it's a valid reference - if (matcher.groupCount() != 0) { - - // return the variable name - return matcher.group(1); - } - - } else { - - // maybe it's a method call, let's investigate - pattern = Pattern.compile(AraraConstants.METHODEXCEPTIONPATTERN); - matcher = pattern.matcher(runtimeException.getMessage()); - - if (matcher.find()) { - - // check if it's a valid reference - if (matcher.groupCount() > 1) { - - // return the method name - return matcher.group(2); - } - - } - - } - - // nothing is found, so return an unknown reference - return "<unknown>"; - } - - /** - * Extracts information from a MarkedYAMLException object. - * - * @param yamlException The exception object. - * @return A string containing all the available information from the - * exception object. - */ - public static String extractInformationFromYAMLException(MarkedYAMLException yamlException) { - StringBuilder stringBuilder = new StringBuilder(); - if (yamlException.getContext() != null) { - stringBuilder.append(localization.getMessage("YamlError_Context", yamlException.getContext())).append("\n"); - } - if (yamlException.getProblem() != null) { - stringBuilder.append(localization.getMessage("YamlError_Problem", yamlException.getProblem())).append("\n"); - } - if (yamlException.getProblemMark() != null) { - stringBuilder.append(localization.getMessage("YamlError_ErrorLocation", yamlException.getProblemMark().getLine(), yamlException.getProblemMark().getColumn())).append("\n"); - } - if (yamlException.getProblemMark().get_snippet() != null) { - stringBuilder.append(yamlException.getProblemMark().get_snippet()); - } - return stringBuilder.toString(); - } - - /** - * Checks if the line contains a valid full directive. - * - * @param line The current line. - * @return A logic value indicating if a valid directive was found. - */ - public static boolean checkForFullDirective(String line) { - Pattern pattern = Pattern.compile(AraraConstants.FULLDIRECTIVEPATTERN); - Matcher m = pattern.matcher(line); - if (m.find()) { - return true; - } - else { - return false; - } - } - - /** - * Checks if the line contains a valid empty directive. - * - * @param line The current line. - * @return A logic value indicating if a valid directive was found. - */ - public static boolean checkForEmptyDirective(String line) { - Pattern pattern = Pattern.compile(AraraConstants.EMPTYDIRECTIVEPATTERN); - Matcher m = pattern.matcher(line); - if (m.find()) { - return true; - } - else { - return false; - } - } -} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/CommandLineAnalyzer.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/CommandLineAnalyzer.java deleted file mode 100644 index 8cf0d2e9122..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/CommandLineAnalyzer.java +++ /dev/null @@ -1,488 +0,0 @@ -/** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the project's author nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY - * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * CommandLineAnalyzer: This class implements a command line parser to provide - * better control of flags and files to process. - */ -// package definition -package com.github.arara.utils; - -// needed import -import java.io.File; -import org.apache.commons.cli.*; - -/** - * Implements a command line parser to provide better control of flags and files - * to process. - * - * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 1.0 - */ -public class CommandLineAnalyzer { - - // the file to process - private String theFile; - // the command line arguments - private String[] theArgs; - // the command line options - private Options commandLineOptions; - // the verbose option - private boolean showVerboseOutput; - // the execution timeout, - // in milliseconds - private long executionTimeout; - // the configuration - private ConfigurationLoader configuration; - // the localization class - final static AraraLocalization localization = AraraLocalization.getInstance(); - - /** - * Constructor. - * - * @param theArgs The command line arguments. - * @param configuration The current configuration. - */ - public CommandLineAnalyzer(String[] theArgs, ConfigurationLoader configuration) { - - // set the array - this.theArgs = theArgs; - - // set the configuration - this.configuration = configuration; - - // create new options - commandLineOptions = new Options(); - - // set the default value to the output - showVerboseOutput = false; - - } - - /** - * Parses the command line arguments and provides feedback to the main - * class. - * - * @return A boolean value if there is a file to be processed by Arara. - */ - public boolean parse() { - - // create the version option - Option optVersion = new Option("V", "version", false, localization.getMessage("Help_Version")); - - // create the help option - Option optHelp = new Option("h", "help", false, localization.getMessage("Help_Help")); - - // create the log option - Option optLog = new Option("l", "log", false, localization.getMessage("Help_Log")); - - // create the verbose option - Option optVerbose = new Option("v", "verbose", false, localization.getMessage("Help_Verbose")); - - // create the timeout option - Option optTimeout = new Option("t", "timeout", true, localization.getMessage("Help_Timeout")); - - // create the language option - Option optLanguage = new Option("L", "language", true, localization.getMessage("Help_Language")); - - // add version - commandLineOptions.addOption(optVersion); - - // add help - commandLineOptions.addOption(optHelp); - - // add log - commandLineOptions.addOption(optLog); - - // add verbose - commandLineOptions.addOption(optVerbose); - - // add timeout - commandLineOptions.addOption(optTimeout); - - // add language - commandLineOptions.addOption(optLanguage); - - // create a new basic parser - CommandLineParser parser = new BasicParser(); - - // lets try to parse everthing - try { - - // parse the arguments - CommandLine line = parser.parse(commandLineOptions, theArgs); - - // if -L or --language found - if (line.hasOption("language")) { - - // create a new language controler - LanguageController language = new LanguageController(); - - // if the attempt to set the language according to the command - // line has failed - if (!language.setLanguage(line.getOptionValue("language"))) { - - // print the list of available languages - language.printLanguageHelp(); - - // print the usage - printUsage(); - - // and simply return - return false; - } - else { - - // new language, refresh the options - optVersion.setDescription(localization.getMessage("Help_Version")); - optHelp.setDescription(localization.getMessage("Help_Help")); - optLog.setDescription(localization.getMessage("Help_Log")); - optVerbose.setDescription(localization.getMessage("Help_Verbose")); - optTimeout.setDescription(localization.getMessage("Help_Timeout")); - optLanguage.setDescription(localization.getMessage("Help_Language")); - } - } - - // if -h or --help found - if (line.hasOption("help")) { - - // print version - printVersion(); - - // and usage - printUsage(); - - // return - return false; - - } else { - - // if -v or --version found - if (line.hasOption("version")) { - - // print version - printVersion(); - - printSpecialThanks(); - - // and return - return false; - - } else { - - // get the list of files - String[] files = line.getArgs(); - - // we only expect one file - if (files.length != 1) { - - // print version - printVersion(); - - // usage - printUsage(); - - // and return - return false; - - } else { - - // if -t or --timeout found - if (line.hasOption("timeout")) { - - // try to convert the argument to a number - try { - - // parse the long value - executionTimeout = Long.parseLong(line.getOptionValue("timeout")); - - // if it's not a valid number - if (executionTimeout <= 0) { - - // print version - printVersion(); - - // usage - printUsage(); - - // and return - return false; - - } - } catch (NumberFormatException numberFormatException) { - - // we have a bad conversion - - // print version - printVersion(); - - // usage - printUsage(); - - // and return - return false; - } - } else { - - // fallback to the default value, that is, - // timeout is disabled - executionTimeout = 0; - } - - // active logging - AraraLogging.enableLogging(line.hasOption("log")); - - // set verbose flag - showVerboseOutput = line.hasOption("verbose"); - - // everything is fine, set - // the file - theFile = files[0]; - - // check if file exists - if (!checkFile(theFile, configuration.getValidExtensions())) { - - // file not found, return false - return false; - - } - - // and return - return true; - } - } - } - - } catch (ParseException parseException) { - - // something happened, in the last case print version - printVersion(); - - // and usage - printUsage(); - - // and simply return - return false; - - } - } - - /** - * Prints the usage message. - */ - private void printUsage() { - - // new formatter - HelpFormatter formatter = new HelpFormatter(); - - // add the text and print - formatter.printHelp("arara [file [--log] [--verbose] [--timeout N] [--language L] | --help | --version]", commandLineOptions); - } - - /** - * Prints the application version. - */ - private void printVersion() { - - // print the version - System.out.println("arara ".concat(AraraConstants.VERSION).concat(" - ").concat(localization.getMessage("Header_Slogan"))); - System.out.println("Copyright (c) ".concat(AraraConstants.COPYRIGHTYEAR).concat(", Paulo Roberto Massa Cereda")); - System.out.println(localization.getMessage("Header_AllRightsReserved").concat("\n")); - } - - /** - * Getter for file obtained from the command line. - * - * @return The file. - */ - public String getFile() { - - // return it - return theFile; - } - - /** - * Checks if file is valid. - * - * @param filename The file name. - * @param extensions A priority list of allowed extensions. - * @return A boolean value to determine if the file is valid. - */ - private boolean checkFile(String filename, String[] extensions) { - - // flag to indicate the file was found - boolean foundFile = false; - - // iterate through all the extensions - for (String currentExtension : extensions) { - - // check if the file has the current extension - if (filename.toLowerCase().endsWith(currentExtension)) { - - // set flag - foundFile = true; - - // set configuration - configuration.setChosenFilePattern(currentExtension); - - // break iteration - break; - } - } - - // create a new file status - File fileStatus = null; - - // check if a reference was found - if (foundFile) { - - // create new instance - fileStatus = new File(filename); - - // check if exists - if (fileStatus.exists()) { - - // add file - theFile = filename; - - // found it! - return true; - } else { - - // print message about it - System.out.println(localization.getMessage("Error_FileDoesNotExist", filename)); - - // not found - return false; - } - - } else { - - // there's no extension, we will add them and see if something - // is found - for (String currentExtension : extensions) { - - // new file with extension - fileStatus = new File(filename + currentExtension); - - // let's check it - if (fileStatus.exists()) { - - // add file - theFile = filename + currentExtension; - - // add reference - configuration.setChosenFilePattern(currentExtension); - - // found it! - return true; - - } - - } - - // print message about it - System.out.println(AraraUtils.wrap(localization.getMessage("Error_FileDoesNotExistWithExtensionsList", filename, getExtensionsList(extensions)))); - - // file not found - return false; - - } - - } - - /** - * Returns a string with the extensions list. - * - * @param extensions The extensions list. - * @return A string with the extensions list. - */ - private String getExtensionsList(String[] extensions) { - - // if it's an empty vector - if (extensions.length == 0) { - - // return an empty string - return ""; - - } else { - - // get first element - String result = "[".concat(extensions[0]); - - // iterate through the other values - for (int i = 1; i < extensions.length; i++) { - - // add the current extension - result = result.concat(", ").concat(extensions[i]); - } - - // close the list - result = result.concat("]"); - - // return it - return result; - } - } - - /** - * Checks if the output must be verbose. - * - * @return A boolean value. - */ - public boolean isVerbose() { - - // return it - return showVerboseOutput; - } - - /** - * Getter for the execution timeout. - * - * @return The execution timeout. - */ - public long getExecutionTimeout() { - - // return it - return executionTimeout; - } - - /** - * Prints the special thanks message. - */ - private void printSpecialThanks() { - System.out.println(AraraUtils.wrap(localization.getMessage("Msg_SpecialThanks"))); - } -} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/CommandTrigger.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/CommandTrigger.java deleted file mode 100644 index 67b4ff98e9f..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/CommandTrigger.java +++ /dev/null @@ -1,285 +0,0 @@ -/** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the project's author nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY - * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * CommandTrigger: This class is responsible for running the arara commands. - */ -// package definition -package com.github.arara.utils; - -// needed imports -import com.github.arara.exception.AraraException; -import com.github.arara.model.AraraCommand; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.util.List; -import org.apache.commons.exec.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Implements an environment for running the arara commands. - * - * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 3.0 - */ -public class CommandTrigger { - - // the logger - final static Logger logger = LoggerFactory.getLogger(CommandTrigger.class); - // the localization class - final static AraraLocalization localization = AraraLocalization.getInstance(); - // the commands list - private List<AraraCommand> commands; - // flag to determine verbose output - private boolean showVerboseOutput; - // value for the execution timeout - private long executionTimeout; - - /** - * Constructor. - * - * @param commands The commands list. - */ - public CommandTrigger(List<AraraCommand> commands) { - - // set the list - this.commands = commands; - } - - /** - * Setter for the execution timeout. - * - * @param executionTimeout The execution timeout. - */ - public void setExecutionTimeout(long executionTimeout) { - - // set the value - this.executionTimeout = executionTimeout; - } - - /** - * Setter for the verbose mode. - * - * @param verbose A flag to indicate the verbose mode. - */ - public void setVerbose(boolean verbose) { - - // set the flag - showVerboseOutput = verbose; - } - - /** - * Executes the arara commands provided in the list. - * - * @return A boolean value about the execution. To be honest, I don't think - * it's necessary to return an actual value, but I kept it for possible - * future use. - * @throws AraraException Raised when the command is not found in the - * underlying system. - */ - public boolean execute() throws AraraException { - - // log action - logger.info(localization.getMessage("Log_ReadyToRunCommands")); - - // for every command in the list - for (AraraCommand currentAraraCommand : commands) { - - // print a message - System.out.print(localization.getMessage("Msg_RunningCommand", currentAraraCommand.getName()).concat(" ")); - - // if verbose - if (showVerboseOutput) { - - // add two lines - System.out.println("\n"); - } - - // log action - logger.info(localization.getMessage("Log_CommandName", currentAraraCommand.getName())); - - // log command - logger.trace(localization.getMessage("Log_Command", currentAraraCommand.getCommand())); - - // if the execution was ok - //if (runCommand(currentAraraCommand)) { - if (runCommand(currentAraraCommand)) { - - // print a message - System.out.println(localization.getMessage("Msg_Success")); - - // log action - logger.info(localization.getMessage("Log_CommandSuccess", currentAraraCommand.getName())); - - } else { - - // something bad happened, print message - System.out.println(localization.getMessage("Msg_Failure")); - - // log action - logger.warn(localization.getMessage("Log_CommandFailure", currentAraraCommand.getName())); - - // and return false - return false; - - } - - // if verbose - if (showVerboseOutput) { - - // add one line to the output - System.out.println(""); - } - - } - - // log action - logger.info(localization.getMessage("Log_AllCommandsSuccess")); - - // everything went ok, simply return true - return true; - - } - - /** - * Run the arara command. - * - * @param command The Arara command. - * @return A boolean indicating if the execution was successful. - * @throws AraraException Throws an exception in case the command was not - * found. - */ - private boolean runCommand(AraraCommand command) throws AraraException { - - // create a new byte array for the output logger - ByteArrayOutputStream stringLogger = new ByteArrayOutputStream(); - - // let's try - try { - - // set a query - String query = command.getCommand(); - - // create a new command line from the query - CommandLine commandLine = CommandLine.parse(query); - - // create a new tee - TeeOutputStream tee; - - // create a new execution handler - PumpStreamHandler streamHandler; - - // if verbose - if (showVerboseOutput) { - - // the new tee should include the normal output - // and the log - tee = new TeeOutputStream(System.out, stringLogger); - - // verbose mode enables input mode as well - streamHandler = new PumpStreamHandler(tee, tee, System.in); - - } else { - - // no verbose, so include only the log output - tee = new TeeOutputStream(stringLogger); - - // define the handler only with the log output - streamHandler = new PumpStreamHandler(tee); - } - - // create a new executor - DefaultExecutor executor = new DefaultExecutor(); - - // set the handler - executor.setStreamHandler(streamHandler); - - // check if there should be an execution timeout - if (executionTimeout > 0) { - - // create a new watch dog - ExecuteWatchdog watchDog = new ExecuteWatchdog(executionTimeout); - - // add it to the execution - executor.setWatchdog(watchDog); - } - - // set the shutdown hook - ShutdownHookProcessDestroyer processDestroyer = new ShutdownHookProcessDestroyer(); - - // add it to the executor - executor.setProcessDestroyer(processDestroyer); - - // execute the command and get the exit code - int exitValue = executor.execute(commandLine); - - // if we are in verbose mode - if (showVerboseOutput) { - - // print the output status - System.out.print(localization.getMessage("Msg_Status").concat(" ")); - - } - - // add the output to the logger - logger.trace(localization.getMessage("Log_OutputLogging")); - logger.trace(stringLogger.toString()); - - // return the status as a boolean - return (exitValue == 0 ? true : false); - - } catch (ExecuteException executeException) { - - // in case of an error, or the watchdog in action, - // the logger addition is not reached, so we need - // to replicate it here - logger.trace(localization.getMessage("Log_OutputLogging")); - logger.trace(stringLogger.toString()); - - // something bad happened, return false - return false; - - } catch (IOException ioException) { - - // log error - logger.error(localization.getMessage("Log_CommandNotFound", command.getName(), command.getCommand())); - - // command not found, throw exception - throw new AraraException(localization.getMessage("Error_CommandNotFound", command.getName(), command.getCommand())); - - } - } -} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/ConfigurationLoader.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/ConfigurationLoader.java deleted file mode 100644 index db743c2e61f..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/ConfigurationLoader.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the project's author nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY - * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * ConfigurationLoader: This class provides an object handler for the arara - * configuration file. - */ -// package definition -package com.github.arara.utils; - -// needed imports -import com.github.arara.Arara; -import com.github.arara.exception.AraraException; -import com.github.arara.model.AraraConfiguration; -import com.github.arara.model.AraraFilePattern; -import java.io.File; -import java.io.FileReader; -import java.net.URLDecoder; -import java.util.ArrayList; -import java.util.List; -import org.apache.commons.lang3.SystemUtils; -import org.yaml.snakeyaml.Yaml; -import org.yaml.snakeyaml.constructor.Constructor; -import org.yaml.snakeyaml.error.MarkedYAMLException; -import org.yaml.snakeyaml.nodes.Tag; -import org.yaml.snakeyaml.representer.Representer; - -/** - * Provides an object handler for the arara configuration file. - * - * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 3.0 - */ -public class ConfigurationLoader { - - // list of search paths - private List<String> paths; - // the application path, that is, where arara is located - private String applicationPath; - // list of file patterns - private List<AraraFilePattern> filePatterns; - // list of valid extensions - private String[] validExtensions; - // the chosen pattern - private AraraFilePattern chosenFilePattern; - // the localization class - final static AraraLocalization localization = AraraLocalization.getInstance(); - - /** - * Constructor. - */ - public ConfigurationLoader() { - - // create a new list of paths - paths = new ArrayList<String>(); - - // try to obtain the application path - try { - applicationPath = Arara.class.getProtectionDomain().getCodeSource().getLocation().getPath(); - applicationPath = URLDecoder.decode(applicationPath, "UTF-8"); - applicationPath = new File(applicationPath).getParentFile().getPath(); - } catch (Exception exception) { - applicationPath = ""; - } - } - - /** - * Loads the configuration settings, either the default setup or through the - * configuration file. - * - * @throws Exception An exception is thrown if something unexpected happens - * during the execution of this method. - */ - public void load() throws Exception { - - // create the default patterns - - // for .tex files - AraraFilePattern texPattern = new AraraFilePattern(); - texPattern.setExtension("tex"); - texPattern.setPattern("^(\\s)*%\\s+"); - - // for .dtx files - AraraFilePattern dtxPattern = new AraraFilePattern(); - dtxPattern.setExtension("dtx"); - dtxPattern.setPattern("^(\\s)*%\\s+"); - - // for .ltx files - AraraFilePattern ltxPattern = new AraraFilePattern(); - ltxPattern.setExtension("ltx"); - ltxPattern.setPattern("^(\\s)*%\\s+"); - - // create a list of default patterns - List<AraraFilePattern> defaultPatterns = new ArrayList<AraraFilePattern>(); - - // add the default ones - defaultPatterns.add(texPattern); - defaultPatterns.add(dtxPattern); - defaultPatterns.add(ltxPattern); - - // create a list of file patterns - filePatterns = new ArrayList<AraraFilePattern>(); - - // create a file reference - File configurationFile = new File(SystemUtils.USER_HOME + File.separator + AraraConstants.ARARACONFIG); - - // if there is not a configuration file - if (!configurationFile.exists()) { - - // there's only one path to look for rules - paths.add(applicationPath + File.separator + "rules"); - - // the only file patterns are the default ones - filePatterns.addAll(defaultPatterns); - - // create an array of valid extensions - validExtensions = new String[filePatterns.size()]; - - // add them according to the file patterns - for (int i = 0; i < filePatterns.size(); i++) { - validExtensions[i] = ".".concat(filePatterns.get(i).getExtension()); - } - - // simply return, there's nothing more to do - return; - } - - // create the YAML representer - Representer representer = new Representer(); - representer.addClassTag(AraraConfiguration.class, new Tag("!config")); - representer.addClassTag(AraraFilePattern.class, new Tag("!pattern")); - - // create the YAML parser - Yaml yaml = new Yaml(new Constructor(AraraConfiguration.class), representer); - - // create the file reader - FileReader fileReader = new FileReader(configurationFile); - - // set the new configuration object - AraraConfiguration configuration = null; - - try { - - // try to read the configuration object - configuration = (AraraConfiguration) yaml.load(fileReader); - - } catch (MarkedYAMLException yamlException) { - - // there's an error with the YAML file, so an exception is thrown - AraraLogging.enableLogging(false); - throw new AraraException(localization.getMessage("Error_InvalidYAMLConfigurationFile").concat("\n\n").concat(AraraUtils.extractInformationFromYAMLException(yamlException))); - } - catch (Exception e) { - System.out.println(e.getMessage()); - } - - // close the file reader - fileReader.close(); - - // check if the configuration is invalid - if (configuration == null) { - - // it's invalid, raise an exception - AraraLogging.enableLogging(false); - throw new AraraException(localization.getMessage("Error_InvalidConfigurationFile")); - } - - // check if there's an available language - if (configuration.getLanguage() != null) { - - // create a new language control - LanguageController languageController = new LanguageController(); - - // if the language is not valid - if (languageController.setLanguage(configuration.getLanguage()) == false) { - - // it's invalid, raise an exception - AraraLogging.enableLogging(false); - throw new AraraException(localization.getMessage("Error_InvalidLanguageConfigurationFile", languageController.getLanguagesList())); - } - } - - // check if there are new paths - if (configuration.getPaths() != null) { - - // a runtime exception happened when resolving some - // path names - if (configuration.getPathRuntimeException() != null) { - - // raise an exception - AraraLogging.enableLogging(false); - throw new AraraException(localization.getMessage("Error_PathRuntimeErrorConfigurationFile", AraraUtils.getVariableFromException(configuration.getPathRuntimeException()))); - } - - // a IO exception happened when checking if it was - // a valid path entry - if (configuration.getPathIOException() != null) { - - // raise an exception - AraraLogging.enableLogging(false); - throw new AraraException(localization.getMessage("Error_PathIOErrorConfigurationFile")); - } - - // for every path set - for (String currentPath : configuration.getPaths()) { - - // add it to the paths list - paths.add(currentPath); - } - } - - // the last path to be added is the application path - paths.add(applicationPath + File.separator + "rules"); - - // check if there are new file patterns - if (configuration.getFiletypes() != null) { - - // get all file patterns - List<AraraFilePattern> filetypes = configuration.getFiletypes(); - - // reorder the list of filetypes - for (int i = 0; i < defaultPatterns.size(); i++) { - - // if the filetype is not in the default list - if (!isAlreadyDefined(defaultPatterns.get(i), filetypes)) { - - // simply add it - filePatterns.add(defaultPatterns.get(i)); - } - } - - // merge the two lists - filePatterns.addAll(filetypes); - - // create a new array of valid extensions - validExtensions = new String[filePatterns.size()]; - int counter = 0; - - // sanity check, if there are valid extensions and patterns - for (AraraFilePattern currentPattern : filePatterns) { - - // check if either of those fields is missing - if ((currentPattern.getPattern() == null) || (currentPattern.getExtension() == null)) { - - // it's invalid, raise an exception - AraraLogging.enableLogging(false); - throw new AraraException(localization.getMessage("Error_InvalidFiletypesConfigurationFile")); - - } - - // add the dot to the extension - validExtensions[counter] = ".".concat(currentPattern.getExtension()); - counter++; - } - } else { - - // no new filetypes, simply merge the lists - filePatterns.addAll(defaultPatterns); - - // create a new array for extensions - validExtensions = new String[filePatterns.size()]; - - // iterate through all filetypes and add the extension to the array - for (int i = 0; i < filePatterns.size(); i++) { - validExtensions[i] = ".".concat(filePatterns.get(i).getExtension()); - } - } - - } - - /** - * Checks if the filetype is already defined in the list, and updates the - * latter if needed. - * - * @param filePattern The filetype object. - * @param list The list to be inspected. - * @return A boolean indicating if the filetype is already defined in the - * list. - */ - private boolean isAlreadyDefined(AraraFilePattern filePattern, List<AraraFilePattern> list) { - - // iterate through all elements - for (int i = 0; i < list.size(); i++) { - - // check if it already exists - if (filePattern.getExtension().equalsIgnoreCase(list.get(i).getExtension())) { - - // update the element if needed - if (list.get(i).getPattern() == null) { - list.set(i, filePattern); - } - - // already defined - return true; - } - } - - // not found - return false; - } - - /** - * Getter for the paths. - * - * @return The paths. - */ - public List<String> getPaths() { - return paths; - } - - /** - * Getter for the file patterns. - * - * @return The file patterns. - */ - public List<AraraFilePattern> getFilePatterns() { - return filePatterns; - } - - /** - * Getter for the valid extensions available. - * - * @return An array containing the valid extensions. - */ - public String[] getValidExtensions() { - return validExtensions; - } - - /** - * Setter for the chosen file pattern. - * - * @param extension A string containing a reference for the file extension. - */ - public void setChosenFilePattern(String extension) { - - // for every file pattern - for (AraraFilePattern currentPattern : filePatterns) { - - // if the extension matches - if (".".concat(currentPattern.getExtension()).equals(extension)) { - - // we found our pattern - chosenFilePattern = currentPattern; - - // return - return; - } - } - - // nothing found - chosenFilePattern = null; - } - - /** - * Getter for the chosen file pattern. - * - * @return The chosen file pattern. - */ - public AraraFilePattern getChosenFilePattern() { - return chosenFilePattern; - } -} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/DirectiveExtractor.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/DirectiveExtractor.java deleted file mode 100644 index 0614fcf4306..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/DirectiveExtractor.java +++ /dev/null @@ -1,287 +0,0 @@ -/** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the project's author nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY - * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * DirectiveExtractor: This class reads the file and extracts all the directives - * it could find. - */ -// package definition -package com.github.arara.utils; - -// needed imports -import com.github.arara.exception.AraraException; -import com.github.arara.model.AraraDirective; -import java.io.*; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.yaml.snakeyaml.DumperOptions; -import org.yaml.snakeyaml.Yaml; -import org.yaml.snakeyaml.constructor.Constructor; -import org.yaml.snakeyaml.error.MarkedYAMLException; -import org.yaml.snakeyaml.representer.Representer; - -/** - * Reads the file and extracts all the directives it could find. - * - * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 1.0 - */ -public class DirectiveExtractor { - - // the logger - final static Logger logger = LoggerFactory.getLogger(DirectiveExtractor.class); - // the list of directives - private List<AraraDirective> directives; - // the file - private File file; - // the current line number - private int currentLineNumber; - // the configuration object - private ConfigurationLoader configuration; - // the localization class - final static AraraLocalization localization = AraraLocalization.getInstance(); - - /** - * Constructor. - */ - public DirectiveExtractor() { - - // create new list - directives = new ArrayList<AraraDirective>(); - - // set file to null - file = null; - } - - /** - * Constructor. - * - * @param file The file. - */ - public DirectiveExtractor(File file, ConfigurationLoader configuration) { - - // create a new list - directives = new ArrayList<AraraDirective>(); - - this.configuration = configuration; - - // set file - this.file = file; - } - - /** - * Setter for file. - * - * @param file The file. - */ - public void setFile(File file) { - - // set the file - this.file = file; - } - - /** - * Getter for Arara directives. - * - * @return A list containing all Arara directives. - */ - public List<AraraDirective> getDirectives() { - - // return the list - return directives; - } - - /** - * Extracts the directives from the file. - * - * @throws FileNotFoundException Raised when file not found. - * @throws IOException Raised when an IO error happened. - * @throws AraraException Raised when there's a problem with the directive. - */ - public void extract() throws FileNotFoundException, IOException, AraraException { - - // create a new file reader - FileReader fileReader = new FileReader(file); - - // create a new buffer - BufferedReader bufferedReader = new BufferedReader(fileReader); - - // variable to hold the current line - String currentLine; - - // the line count - currentLineNumber = 0; - - // log directives - logger.info("Reading directives from {}.", file.getName()); - - // while not EOF - while ((currentLine = bufferedReader.readLine()) != null) { - - // increment the current line number - currentLineNumber++; - - // extract directive - extractDirective(currentLine); - } - - // close the buffer - bufferedReader.close(); - - // close the reader - fileReader.close(); - - } - - /** - * Extracts the Arara directives from the current line. - * - * @param currentLine The current line. - * @throws AraraException Raised when there is a problem with the directive. - */ - private void extractDirective(String currentLine) throws AraraException { - - // get the pattern for the chosen filetype - Pattern linePattern = Pattern.compile(configuration.getChosenFilePattern().getPattern()); - - // create the matcher according to the pattern - Matcher matcher = linePattern.matcher(currentLine); - - // if the pattern is found - if (matcher.find()) { - - // get the substring - currentLine = (currentLine.substring(matcher.end(), currentLine.length())).trim(); - - // there is actually something after the keyword - if (!"".equals(currentLine)) { - - // log directive - logger.trace(localization.getMessage("Log_DirectiveFound", currentLineNumber, currentLine)); - - // look for a full directive - if (AraraUtils.checkForFullDirective(currentLine)) { - - // add it - addAraraDirective(currentLine); - } - else { - - // look for an empty directive - if (AraraUtils.checkForEmptyDirective(currentLine)) { - - // add it - addEmptyAraraDirective(currentLine.trim()); - } - else { - - // an invalid directive was found, throw error - throw new AraraException(localization.getMessage("Error_InvalidDirective", currentLineNumber)); - } - } - - } - } - } - - /** - * Extracts an empty Arara directive. - * - * @param currentLine The current line. - */ - private void addEmptyAraraDirective(String currentLine) { - - // create a new directive - AraraDirective araraDirective = new AraraDirective(); - - // set the name - araraDirective.setName(currentLine); - - // set the config - araraDirective.setConfig(new HashMap()); - - // set the line number, in case of error - araraDirective.setLineNumber(currentLineNumber); - - // add the directive to the list - directives.add(araraDirective); - - } - - /** - * Extracts am Arara directive. - * - * @param currentLine The current line. - * @throws AraraException Raised when there is a problem with the directive. - */ - private void addAraraDirective(String currentLine) throws AraraException { - - // lets try - try { - - // create a new YAML parser - Yaml yaml = new Yaml(new Constructor(), new Representer(), new DumperOptions(), new AraraResolver()); - - // create a new map and load the current line - Map config = (Map) yaml.load(currentLine); - - // create a new directive - AraraDirective ad = new AraraDirective(); - - // set the name - ad.setName(currentLine); - - // set the config - ad.setConfig(config); - - // set line number. in case of error - ad.setLineNumber(currentLineNumber); - - // add the directive to the list - directives.add(ad); - - } catch (MarkedYAMLException yamlException) { - - // malformed directive, throw exception - throw new AraraException(localization.getMessage("Error_InvalidYAMLDirective", currentLineNumber).concat("\n\n").concat(AraraUtils.extractInformationFromYAMLException(yamlException))); - } - } -} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/DirectiveParser.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/DirectiveParser.java deleted file mode 100644 index b79a3741bd8..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/DirectiveParser.java +++ /dev/null @@ -1,321 +0,0 @@ -/** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the project's author nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY - * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * DirectiveParser: This class analyzes the list of directives and converts them - * to a list of arara tasks. - */ -// package definition -package com.github.arara.utils; - -// needed imports -import com.github.arara.exception.AraraException; -import com.github.arara.model.AraraDirective; -import com.github.arara.model.AraraTask; -import java.io.File; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Analyzes the list of directives and converts them to a list of arara tasks. - * - * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 1.0 - */ -public class DirectiveParser { - - // the logger - final static Logger logger = LoggerFactory.getLogger(DirectiveParser.class); - // the list of directives - private List<AraraDirective> directives; - // the list of tasks - private List<AraraTask> tasks; - // the list of file names, to use as a temporary variable - private List<String> fileNames; - // the list of items - private List<String> items; - // the current file reference - private File file; - // the localization class - final static AraraLocalization localization = AraraLocalization.getInstance(); - - /** - * Constructor - */ - public DirectiveParser() { - } - - /** - * Constructor. - * - * @param directives The Arara directives. - */ - public DirectiveParser(List<AraraDirective> directives) { - - // set the directives - this.directives = directives; - - // create a new list of tasks - this.tasks = new ArrayList<AraraTask>(); - - // create a new list of file names - this.fileNames = new ArrayList<String>(); - - // create a new list of items - this.items = new ArrayList<String>(); - } - - /** - * Setter for file. - * - * @param file The file. - */ - public void setFile(File file) { - - // set the file - this.file = file; - } - - /** - * Setter for the list of Arara directives. - * - * @param directives The list of Arara directives. - */ - public void setDirectives(List<AraraDirective> directives) { - - // set the list - this.directives = directives; - } - - /** - * Parses the list of Arara directives. - * - * @return A list of Arara tasks based on the directives. - * @throws AraraMalformedDirective Raised when a malformed directive is - * found. - */ - public List<AraraTask> parse() throws AraraException { - - // log message - logger.info("Parsing directives."); - - // for every directive - for (AraraDirective currentDirective : directives) { - - // clear the list of files - fileNames.clear(); - - // clear the task name - String taskName = ""; - - // create a new map - Map taskConfig = new HashMap(); - - // if there's no configuration - if (currentDirective.getConfig().isEmpty()) { - - // set the name - taskName = currentDirective.getName(); - - } else { - - // get the current config - Map currentConfig = currentDirective.getConfig(); - - // and get the directive name - String directiveName = (String) currentConfig.keySet().iterator().next(); - - // set the name to the task - taskName = directiveName; - - // get the parameters - Object currentConfigParameters = currentConfig.get(directiveName); - - // if it is a map - if (currentConfigParameters instanceof Map) { - - // get the map - Map currentParameters = (Map) currentConfigParameters; - - // if it is empty, error - if (currentParameters.isEmpty()) { - - // raise an error - throw new AraraException(localization.getMessage("Error_DirectiveEmptyCurlyBrackets", directiveName, currentDirective.getLineNumber())); - - } else { - - // for every parameter - for (Object currentParameterKey : currentParameters.keySet()) { - - // if the parameter is a string - if (currentParameters.get(currentParameterKey) instanceof String) { - - // if it is a file reference, error - if (((String) currentParameterKey).equals("files")) { - - // raise an error - throw new AraraException(localization.getMessage("Error_DirectiveInvalidArgumentList", directiveName, currentDirective.getLineNumber(), "files")); - } - - if (((String) currentParameterKey).equals("items")) { - - // raise an error - throw new AraraException(localization.getMessage("Error_DirectiveInvalidArgumentList", directiveName, currentDirective.getLineNumber(), "items")); - } - - // if it is a file reference, error - if (((String) currentParameterKey).equals("file")) { - - // raise an error - throw new AraraException(localization.getMessage("Error_DirectiveReservedKeyword", directiveName, currentDirective.getLineNumber(), "file", "files")); - } - - if (((String) currentParameterKey).equals("item")) { - - // raise an error - throw new AraraException(localization.getMessage("Error_DirectiveReservedKeyword", directiveName, currentDirective.getLineNumber(), "item", "items")); - } - - - // add the parameter to the configuration - taskConfig.put(currentParameterKey, (String) currentParameters.get(currentParameterKey)); - - } else { - - // if it is a list - if (currentParameters.get(currentParameterKey) instanceof List) { - - // if it is a file reference - if (((String) currentParameterKey).equals("files")) { - - // get the list - for (Object currentListValue : ((List) currentParameters.get(currentParameterKey))) { - - // add the file names - fileNames.add(currentListValue.toString()); - } - } else { - - if (((String) currentParameterKey).equals("items")) { - - // get the list - for (Object currentListValue : ((List) currentParameters.get(currentParameterKey))) { - - // add the file names - items.add(currentListValue.toString()); - } - } else { - - // raise error - throw new AraraException(localization.getMessage("Error_DirectiveListError", directiveName, currentDirective.getLineNumber())); - } - } - } else { - - // raise error - throw new AraraException(localization.getMessage("Error_DirectiveGenericError", directiveName, currentDirective.getLineNumber())); - } - } - } - } - } else { - - // raise error - throw new AraraException(localization.getMessage("Error_DirectiveGenericError", directiveName, currentDirective.getLineNumber())); - } - } - - // set original file name - AraraMethods.setOriginalFile(file.getName()); - - // if there is not a list of filenames - if (fileNames.isEmpty()) { - - // add the only filename available - fileNames.add(file.getName()); - } - - // if there are no items available - if (items.isEmpty()) { - - // simply add an empty entry - items.add(""); - } - - // for every filename - for (String filename : fileNames) { - - // and for every item - for (String item : items) { - - // create a new task - AraraTask araraTask = new AraraTask(); - - // set the name - araraTask.setName(taskName); - - // create a new map based on the current configuration - HashMap currentTaskConfig = new HashMap(taskConfig); - - // add the current file - currentTaskConfig.put("file", filename); - currentTaskConfig.put("item", item); - - // set the parameters - araraTask.setParameters(currentTaskConfig); - - // and add the task to the list - tasks.add(araraTask); - - // the current task is now null - araraTask = null; - } - } - - // clear the list of files and items - fileNames.clear(); - items.clear(); - - } - - // return the list of tasks - return tasks; - } -} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/LanguageController.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/LanguageController.java deleted file mode 100644 index ea3468c0443..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/LanguageController.java +++ /dev/null @@ -1,159 +0,0 @@ -/** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the project's author nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY - * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * LanguageController: This class holds the language model controller for arara. - */ -// package definition -package com.github.arara.utils; - -// needed imports -import com.github.arara.model.AraraLanguage; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; - -/** - * Holds the language model controller for arara. - * - * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 3.0 - */ -public class LanguageController { - - // list of available languages - private List<AraraLanguage> languages; - // the localization singleton instance - final static AraraLocalization localization = AraraLocalization.getInstance(); - - /** - * Constructor. - */ - public LanguageController() { - - // create a new list of languages - languages = new ArrayList<AraraLanguage>(); - - // add the resources - languages.add(new AraraLanguage("English", "en", new Locale("en"))); - languages.add(new AraraLanguage("Brazilian Portuguese", "ptbr", new Locale("pt", "BR"))); - languages.add(new AraraLanguage("Italian", "it", new Locale("it"))); - languages.add(new AraraLanguage("French", "fr", new Locale("fr"))); - languages.add(new AraraLanguage("Spanish", "es", new Locale("es"))); - languages.add(new AraraLanguage("German", "de", new Locale("de"))); - languages.add(new AraraLanguage("Turkish", "tr", new Locale("tr", "TR"))); - languages.add(new AraraLanguage("Russian", "ru", new Locale("ru"))); - - } - - /** - * Sets the current language according to the provided country code. - * - * @param code The country code. - * @return A boolean value indicating if the new language was properly - * applied. - */ - public boolean setLanguage(String code) { - - // get the index of the language - int i = getIndex(code); - - // if it's valid - if (i != -1) { - - // set locale and refresh the resource bundle - Locale.setDefault(languages.get(i).getLocale()); - localization.refresh(); - - // everything went fine - return true; - } - - // the country code is invalid - return false; - } - - /** - * Returns a string containing the list of available languages. - * - * @return A string containing the list of available languages. - */ - public String getLanguagesList() { - - // get the first one in the list - String result = languages.get(0).toString(); - - // iterate through the rest - for (int i = 1; i < languages.size(); i++) { - - // separate them by commas - result = result.concat(", ").concat(languages.get(i).toString()); - } - - // return the string - return result; - } - - /** - * Prints the language help. - */ - public void printLanguageHelp() { - - // print message - System.out.println(AraraUtils.wrap(localization.getMessage("Error_InvalidLanguage").concat("\n\n").concat(getLanguagesList()).concat("\n"))); - } - - /** - * Gets the index for the country code. - * @param code The country code. - * @return An integer representing the index. - */ - private int getIndex(String code) { - - // for every language - for (int i = 0; i < languages.size(); i++) { - - // if the codes are equal - if (languages.get(i).getCode().equalsIgnoreCase(code)) { - - // return the current counter - return i; - } - } - - // nothing was found, return a negative value - return -1; - } -} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/TaskDeployer.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/TaskDeployer.java deleted file mode 100644 index 2a5a9c462e5..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/TaskDeployer.java +++ /dev/null @@ -1,532 +0,0 @@ -/** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the project's author nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY - * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * TaskDeployer: This class is responsible for taking the tasks and turning them - * into rara commands. - */ -// package definition -package com.github.arara.utils; - -// needed imports -import com.github.arara.exception.AraraException; -import com.github.arara.model.AraraCommand; -import com.github.arara.model.AraraRuleArgument; -import com.github.arara.model.AraraRuleConfig; -import com.github.arara.model.AraraTask; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.util.*; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang3.SystemUtils; -import org.mvel2.templates.TemplateRuntime; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.yaml.snakeyaml.Yaml; -import org.yaml.snakeyaml.constructor.Constructor; -import org.yaml.snakeyaml.error.MarkedYAMLException; -import org.yaml.snakeyaml.nodes.Tag; -import org.yaml.snakeyaml.representer.Representer; - -/** - * Class responsible for taking the tasks and turning them into Arara commands. - * - * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 1.0 - */ -public class TaskDeployer { - - // the logger - final static Logger logger = LoggerFactory.getLogger(TaskDeployer.class); - // the localization class - final static AraraLocalization localization = AraraLocalization.getInstance(); - // the tasks list - private List<AraraTask> tasks; - //the output list with the proper commands - private List<AraraCommand> commands; - // the configuration - private ConfigurationLoader configuration; - - /** - * Constructor. - * - * @param tasks The Arara tasks. - */ - public TaskDeployer(List<AraraTask> tasks, ConfigurationLoader configuration) { - - // set everything - this.tasks = tasks; - - // set the configuration - this.configuration = configuration; - - // create the list - commands = new ArrayList<AraraCommand>(); - - } - - /** - * Deploys the tasks and returns the commands list. - * - * @return The Arara commands list. - * @throws Exception Raised if something bad happened. - */ - public List<AraraCommand> deploy() throws Exception { - - // log message - logger.info("Deploying tasks into commands."); - - // for each task - for (AraraTask currentTask : tasks) { - - // get the index where the rule is located - int pathIndex = findRule(currentTask); - - // if it's not a negative index, that is, the rule was found - if (pathIndex != -1) { - - // deploy plain rule - deployRule(currentTask, pathIndex); - - } else { - - // not found, throw exception - throw new AraraException(localization.getMessage("Error_RuleNotFound", currentTask.getName())); - } - } - - // return the commands - return commands; - - } - - /** - * Finds the rule in the rules directory. - * - * @param task The task to find. - * @return The rule location. - */ - private int findRule(AraraTask task) { - - // get the search path - List<String> paths = configuration.getPaths(); - - // for every entry in the search path - for (int i = 0; i < paths.size(); i++) { - - // if the current task is found in the current path - if (new File(paths.get(i).concat(File.separator).concat(task.getName()).concat(".yaml")).exists()) { - - // add an entry to the logger - logger.trace(localization.getMessage("Log_RuleFound", task.getName(), paths.get(i))); - - // return the index of the current path - return i; - } - } - - // nothing was found, return a negative value - return -1; - - } - - /** - * Deploys plain rule. - * - * @param task The task. - * @throws Exception The rule has a bad definition. - */ - private void deployRule(AraraTask task, int pathIndex) throws Exception { - - // create a representer - Representer representer = new Representer(); - - // add a class tag - representer.addClassTag(AraraRuleConfig.class, new Tag("!config")); - representer.addClassTag(AraraRuleArgument.class, new Tag("!argument")); - - // create a new YAML parser - Yaml yaml = new Yaml(new Constructor(AraraRuleConfig.class), representer); - - FileReader fileReader = null; - - // new file reader - fileReader = new FileReader(configuration.getPaths().get(pathIndex).concat(File.separator).concat(task.getName()).concat(".yaml")); - - // load rule - AraraRuleConfig plainRule = null; - - try { - - // try to load the rule - plainRule = (AraraRuleConfig) yaml.load(fileReader); - - } catch (MarkedYAMLException yamlException) { - - // YAML syntax error, throw exception - throw new AraraException(localization.getMessage("Error_InvalidYAMLRule", task.getName(), configuration.getPaths().get(pathIndex)).concat("\n\n").concat(AraraUtils.extractInformationFromYAMLException(yamlException))); - } - - try { - - // close reader - fileReader.close(); - - } catch (IOException ioException) { - // do nothing here - } - - // check if the rule is invalid - if (plainRule == null) { - - // raise an error - throw new AraraException(localization.getMessage("Error_InvalidRule", task.getName(), configuration.getPaths().get(pathIndex))); - } - - // verify if the identifier is empty - if (plainRule.getIdentifier() == null) { - - // raise error - throw new AraraException(localization.getMessage("Error_EmptyIdentifierRule", task.getName(), configuration.getPaths().get(pathIndex))); - - } else { - - // check if the rule has a proper name - if (plainRule.getName() == null) { - - // raise error - throw new AraraException(localization.getMessage("Error_EmptyNameRule", task.getName(), configuration.getPaths().get(pathIndex))); - - } else { - - // check if the rule has a proper list of arguments - if (plainRule.getArguments() == null) { - - // raise error - throw new AraraException(localization.getMessage("Error_EmptyArgumentsListRule", task.getName(), configuration.getPaths().get(pathIndex))); - - } - } - } - - // if the rule name doesn't match with the file name - if (!task.getName().equals(plainRule.getIdentifier())) { - - // throw exception - throw new AraraException(localization.getMessage("Error_WrongIdentifierRule", task.getName(), configuration.getPaths().get(pathIndex), plainRule.getIdentifier())); - } - - // check if the rule has any forbidden identifier - if (plainRule.checkForForbiddenIdentifiers() != null) { - - // raise error - throw new AraraException(localization.getMessage("Error_ForbiddenIdentifierRule", task.getName(), configuration.getPaths().get(pathIndex), plainRule.checkForForbiddenIdentifiers())); - } - - // get the list of all arguments available in the rule - List<String> availableArgumentsInRule = plainRule.getIdentifiersList(); - - // add the two reserved keywords - availableArgumentsInRule.add("file"); - availableArgumentsInRule.add("item"); - - // get the parameters for the task - HashMap directiveMap = task.getParameters(); - - // for every entry in the parameters map of the task, add it to the - // list of available parameters in the directive - List<String> availableArgumentsInDirective = new ArrayList<String>(); - for (Object theKey : directiveMap.keySet()) { - availableArgumentsInDirective.add((String) theKey); - } - - // find out which arguments are not defined in the directive and in - // the rule - List<String> argumentsNotDefinedInDirective = (List<String>) CollectionUtils.subtract(availableArgumentsInRule, availableArgumentsInDirective); - List<String> argumentsNotDefinedInRule = (List<String>) CollectionUtils.subtract(availableArgumentsInDirective, availableArgumentsInRule); - - // if there are invalid arguments in the directive - if (!argumentsNotDefinedInRule.isEmpty()) { - - // raise error - throw new AraraException(localization.getMessage("Error_ArgumentsNotDefinedInRule", task.getName(), configuration.getPaths().get(pathIndex), argumentsNotDefinedInRule.toString())); - } - - // for all arguments in the rule not mapped in the directive, set - // their default value to an empty string - for (String currentKey : argumentsNotDefinedInDirective) { - directiveMap.put(currentKey, ""); - } - - // add entries in the arguments map - HashMap argumentMap = new HashMap(); - argumentMap.put("file", directiveMap.get("file")); - argumentMap.put("item", directiveMap.get("item")); - directiveMap.remove("file"); - directiveMap.remove("item"); - argumentMap.put("parameters", directiveMap); - - // helper functions added - argumentMap.put("SystemUtils", SystemUtils.class); - argumentMap.put("isEmpty", AraraMethods.class.getMethod("isEmpty", String.class)); - argumentMap.put("isNotEmpty", AraraMethods.class.getMethod("isNotEmpty", String.class)); - argumentMap.put("isEmpty", AraraMethods.class.getMethod("isEmpty", String.class, String.class)); - argumentMap.put("isNotEmpty", AraraMethods.class.getMethod("isNotEmpty", String.class, String.class)); - argumentMap.put("isEmpty", AraraMethods.class.getMethod("isEmpty", String.class, String.class, String.class)); - argumentMap.put("isNotEmpty", AraraMethods.class.getMethod("isNotEmpty", String.class, String.class, String.class)); - argumentMap.put("isTrue", AraraMethods.class.getMethod("isTrue", String.class)); - argumentMap.put("isFalse", AraraMethods.class.getMethod("isFalse", String.class)); - argumentMap.put("isTrue", AraraMethods.class.getMethod("isTrue", String.class, String.class)); - argumentMap.put("isFalse", AraraMethods.class.getMethod("isFalse", String.class, String.class)); - argumentMap.put("isTrue", AraraMethods.class.getMethod("isTrue", String.class, String.class, String.class)); - argumentMap.put("isFalse", AraraMethods.class.getMethod("isFalse", String.class, String.class, String.class)); - argumentMap.put("isTrue", AraraMethods.class.getMethod("isTrue", String.class, String.class, String.class, String.class)); - argumentMap.put("isFalse", AraraMethods.class.getMethod("isFalse", String.class, String.class, String.class, String.class)); - argumentMap.put("trimSpaces", AraraMethods.class.getMethod("trimSpaces", String.class)); - argumentMap.put("getFilename", AraraMethods.class.getMethod("getFilename", String.class)); - argumentMap.put("getBasename", AraraMethods.class.getMethod("getBasename", String.class)); - argumentMap.put("getFiletype", AraraMethods.class.getMethod("getFiletype", String.class)); - argumentMap.put("getDirname", AraraMethods.class.getMethod("getDirname", String.class)); - argumentMap.put("isFile", AraraMethods.class.getMethod("isFile", String.class)); - argumentMap.put("isDir", AraraMethods.class.getMethod("isDir", String.class)); - argumentMap.put("isWindows", AraraMethods.class.getMethod("isWindows", String.class, String.class)); - argumentMap.put("isLinux", AraraMethods.class.getMethod("isLinux", String.class, String.class)); - argumentMap.put("isUnix", AraraMethods.class.getMethod("isUnix", String.class, String.class)); - argumentMap.put("isMac", AraraMethods.class.getMethod("isMac", String.class, String.class)); - - argumentMap.put("isTrue", AraraMethods.class.getMethod("isTrue", boolean.class, String.class)); - argumentMap.put("isTrue", AraraMethods.class.getMethod("isTrue", boolean.class, String.class, String.class)); - argumentMap.put("isFalse", AraraMethods.class.getMethod("isFalse", boolean.class, String.class)); - argumentMap.put("isFalse", AraraMethods.class.getMethod("isFalse", boolean.class, String.class, String.class)); - - argumentMap.put("getOriginalFile", AraraMethods.class.getMethod("getOriginalFile")); - - // create a rule map - HashMap ruleMap = new HashMap(); - - // for every argument in the rule - for (AraraRuleArgument currentArgument : plainRule.getArguments()) { - - // if there's not a default value - if (currentArgument.getDefault() == null) { - - // set the default to an empty string - ruleMap.put(currentArgument.getIdentifier(), ""); - - } else { - - // there's actually a default value - try { - - // get the default value and apply the template - String defaultValue = (String) TemplateRuntime.eval(currentArgument.getDefault(), argumentMap); - - // put the new default value into the rule map - ruleMap.put(currentArgument.getIdentifier(), defaultValue); - - } catch (RuntimeException runtimeException) { - - // an error occurred, throw exception - throw new AraraException(localization.getMessage("Error_DefaultValueRuntimeErrorRule", currentArgument.getIdentifier(), task.getName(), configuration.getPaths().get(pathIndex), AraraUtils.getVariableFromException(runtimeException))); - - } - } - } - - // after setting the default values into the rule map, let's add - // the directive parameters and both file and item references - ruleMap.put("parameters", directiveMap); - ruleMap.put("file", argumentMap.get("file")); - ruleMap.put("item", argumentMap.get("item")); - - // helper classes - ruleMap.put("SystemUtils", SystemUtils.class); - ruleMap.put("isEmpty", AraraMethods.class.getMethod("isEmpty", String.class)); - ruleMap.put("isNotEmpty", AraraMethods.class.getMethod("isNotEmpty", String.class)); - ruleMap.put("isEmpty", AraraMethods.class.getMethod("isEmpty", String.class, String.class)); - ruleMap.put("isNotEmpty", AraraMethods.class.getMethod("isNotEmpty", String.class, String.class)); - ruleMap.put("isEmpty", AraraMethods.class.getMethod("isEmpty", String.class, String.class, String.class)); - ruleMap.put("isNotEmpty", AraraMethods.class.getMethod("isNotEmpty", String.class, String.class, String.class)); - ruleMap.put("isTrue", AraraMethods.class.getMethod("isTrue", String.class)); - ruleMap.put("isFalse", AraraMethods.class.getMethod("isFalse", String.class)); - ruleMap.put("isTrue", AraraMethods.class.getMethod("isTrue", String.class, String.class)); - ruleMap.put("isFalse", AraraMethods.class.getMethod("isFalse", String.class, String.class)); - ruleMap.put("isTrue", AraraMethods.class.getMethod("isTrue", String.class, String.class, String.class)); - ruleMap.put("isFalse", AraraMethods.class.getMethod("isFalse", String.class, String.class, String.class)); - ruleMap.put("isTrue", AraraMethods.class.getMethod("isTrue", String.class, String.class, String.class, String.class)); - ruleMap.put("isFalse", AraraMethods.class.getMethod("isFalse", String.class, String.class, String.class, String.class)); - ruleMap.put("trimSpaces", AraraMethods.class.getMethod("trimSpaces", String.class)); - ruleMap.put("getFilename", AraraMethods.class.getMethod("getFilename", String.class)); - ruleMap.put("getBasename", AraraMethods.class.getMethod("getBasename", String.class)); - ruleMap.put("getFiletype", AraraMethods.class.getMethod("getFiletype", String.class)); - ruleMap.put("getDirname", AraraMethods.class.getMethod("getDirname", String.class)); - ruleMap.put("isFile", AraraMethods.class.getMethod("isFile", String.class)); - ruleMap.put("isDir", AraraMethods.class.getMethod("isDir", String.class)); - ruleMap.put("isWindows", AraraMethods.class.getMethod("isWindows", String.class, String.class)); - ruleMap.put("isLinux", AraraMethods.class.getMethod("isLinux", String.class, String.class)); - ruleMap.put("isUnix", AraraMethods.class.getMethod("isUnix", String.class, String.class)); - ruleMap.put("isMac", AraraMethods.class.getMethod("isMac", String.class, String.class)); - - ruleMap.put("isTrue", AraraMethods.class.getMethod("isTrue", boolean.class, String.class)); - ruleMap.put("isTrue", AraraMethods.class.getMethod("isTrue", boolean.class, String.class, String.class)); - ruleMap.put("isFalse", AraraMethods.class.getMethod("isFalse", boolean.class, String.class)); - ruleMap.put("isFalse", AraraMethods.class.getMethod("isFalse", boolean.class, String.class, String.class)); - - ruleMap.put("getOriginalFile", AraraMethods.class.getMethod("getOriginalFile")); - - // remove references to file and item - availableArgumentsInDirective.remove("file"); - availableArgumentsInDirective.remove("item"); - - // for all arguments in the rule - for (AraraRuleArgument currentArgument : plainRule.getArguments()) { - - // if the current argument is defined in the directive - if (isArgumentDefinedInDirective(availableArgumentsInDirective, currentArgument)) { - - // if there is a valid flag - if (currentArgument.getFlag() != null) { - - try { - - // get the flag and apply template - String defaultFlag = (String) TemplateRuntime.eval(currentArgument.getFlag(), ruleMap); - - // put the new flag reference into the rule map - ruleMap.put(currentArgument.getIdentifier(), defaultFlag); - } catch (RuntimeException runtimeException) { - - // an error occurred, throw exception - throw new AraraException(localization.getMessage("Error_FlagRuntimeErrorRule", currentArgument.getIdentifier(), task.getName(), configuration.getPaths().get(pathIndex), AraraUtils.getVariableFromException(runtimeException))); - - } - } - } - } - - // create a new list of commands to be executed by the current task - List<String> commandsList = new ArrayList<String>(); - - // if there is a command element in the rule - if (plainRule.getCommand() != null) { - - // and if there isn't a list of commands - if (plainRule.getCommands() == null) { - - // add the current command to the list of commands to - // be executed - commandsList.add(plainRule.getCommand()); - - } else { - - // both are defined, throw an error - throw new AraraException(localization.getMessage("Error_DuplicatedCommandElementsRule", task.getName(), configuration.getPaths().get(pathIndex))); - - } - } else { - - // none of the fields is defined - if (plainRule.getCommands() == null) { - - // neither of the elements is defined, throw an error - throw new AraraException(localization.getMessage("Error_MissingCommandElementsRule", task.getName(), configuration.getPaths().get(pathIndex))); - - } else { - - // there's a list of commands, add them to the list - commandsList.addAll(plainRule.getCommands()); - } - } - - // for every command to be processed - for (String commandTemplate : commandsList) { - - try { - // get the current command and apply template - commandTemplate = (String) TemplateRuntime.eval(commandTemplate, ruleMap); - - } catch (RuntimeException runtimeException) { - - // an error occurred, throw exception - throw new AraraException(localization.getMessage("Error_CommandRuntimeErrorRule", task.getName(), configuration.getPaths().get(pathIndex), AraraUtils.getVariableFromException(runtimeException))); - - } - - // check if it's a valid command - if (!"".equals(commandTemplate.trim())) { - - // create a new command - AraraCommand araraCommand = new AraraCommand(); - - // add the command - araraCommand.setCommand(commandTemplate); - - // add the name - araraCommand.setName(plainRule.getName()); - - // add to the list - commands.add(araraCommand); - - } - } - } - - /** - * Checks if the current argument is included in the list of arguments from - * the directive. - * - * @param arguments List of arguments from the directive. - * @param argument The current argument to be analyzed. - * @return A logic value indicating if the current argument is included in - * the list of arguments from the directive. - */ - private boolean isArgumentDefinedInDirective(List<String> arguments, AraraRuleArgument argument) { - - // for every argument in the list - for (String current : arguments) { - - // if the identifiers match - if (current.equalsIgnoreCase(argument.getIdentifier())) { - - // found it - return true; - } - } - - // not found - return false; - } -} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/Arara.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/Arara.java new file mode 100644 index 00000000000..c644978c93b --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/Arara.java @@ -0,0 +1,205 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara; + +import com.github.cereda.arara.controller.LanguageController; +import com.github.cereda.arara.controller.LoggingController; +import com.github.cereda.arara.model.AraraException; +import com.github.cereda.arara.model.Configuration; +import com.github.cereda.arara.model.Directive; +import com.github.cereda.arara.model.Extractor; +import com.github.cereda.arara.model.Interpreter; +import com.github.cereda.arara.model.Parser; +import com.github.cereda.arara.model.StopWatch; +import com.github.cereda.arara.utils.CommonUtils; +import com.github.cereda.arara.utils.DirectiveUtils; +import com.github.cereda.arara.utils.DisplayUtils; +import java.util.List; + +/** + * Main class. This class wraps all classes from the application model as well + * as utilitary classes in order to provide modularity. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class Arara { + + /** + * Main method. This is the application entry point. + * @param args A string array containing all command line arguments. + */ + public static void main(String[] args) { + + // the first component to be initialized is the + // language controller; note that init() actually + // has no body at all, but it's a dirty maneuver to + // trigger the static class startup + LanguageController.init(); + + // the second component to be initalized is the + // logging controller; note init() actually disables + // the logging, so early exceptions won't generate + // a lot of noise in the terminal + LoggingController.init(); + + // print the arara logo in the terminal; I just + // hope people use this tool in a good terminal with + // fixed-width fonts, otherwise the logo will be messed + DisplayUtils.printLogo(); + + try { + + // first of all, let's try to load a potential + // configuration file located at the current + // user's home directory; if there's a bad + // configuration file, arara will panic and + // end the execution + Configuration.load(); + + // if we are here, either there was no configuration + // file at all or we managed to load the settings; now, + // it's time to properly parse the command line arguments; + // this is done by creating a brand new instance of arara's + // command line parser and providing the string array to it + Parser parser = new Parser(args); + + // now let's see if we are good to go; parse() will return + // a boolean value indicating if the provided arguments + // allow the tool to continue (we might reach some special + // flags as well, like --help or --version, which simply + // do their jobs and return false, since there's no point + // of continuing processing with such flags) + if (parser.parse()) { + + // let's print the current file information; it is a + // basic display, just the file name, the size properly + // formatted as a human readable format, and the last + // modification date; also, in this point, the logging + // feature starts to collect data (of course, if enabled + // either through the configuration file or manually + // in the command line) + DisplayUtils.printFileInformation(); + + // time to read the file and try to extract the directives; + // this class does a pretty good job on finding directives, + // including the multiline ones; it was a long awaited + // feature people were asking me to implement, so here + // it is! + Extractor extractor = new Extractor(); + + // extract() brings us a list of directives properly parsed + // and almost ready to be handled; note that no directives + // in the provided file will raise an exception; this is + // by design and I opted to not include a default fallback + // (although it wouldn't be so difficult to write one, + // I decided not to take the risk) + List<Directive> directives = extractor.extract(); + + // once we have our nice list of directives, it is time to + // actually validate them (for example, we have a couple of + // keywords that cannot be used as directive parameters); + // another interesting feature of the validate() method is + // to replicate a directive that has the 'files' keyword on + // it, since it's the whole point of having 'files' in the + // first place; if you check the log file, you will see + // that the list of extracted directives might differ from + // the final list of directives to be effectively processed + // by arara + directives = DirectiveUtils.validate(directives); + + // arara features now a cool stopwatch, so we can see how + // much time has passed since everything started; start(), + // for obvious reasons, starts the stopwatch and keeps track + // of time for us; internally, this class makes use of + // nano time, so we might get an interesting precision here + // (although timing is not a serious business in here, it's + // just a cool addition) + StopWatch.start(); + + // this is surely the golden heart of arara; this class + // implements a powerful interpreter that will handle all + // rules and their corresponding tasks + Interpreter interpreter = new Interpreter(); + + // once we have this bad boy ready, let's provide the list + // of directives previously extracted and validated; it is + // like loading a cannon, I guess + interpreter.setDirectives(directives); + + // time to shine, now the interpreter class will interpret + // one directive at a time, get the corresponding rule, + // set the parameters, evaluate it, get the tasks, run them, + // evaluate the result and print the status; note that + // arara, from this version on, will try to evaluate things + // progressively, so in case of an error, the previous tasks + // were already processed and potentially executed + interpreter.execute(); + } + + } catch (AraraException exception) { + + // something bad just happened, so arara will print the proper + // exception and provide details on it, if available; the idea + // here is to propagate an exception throughout the whole + // application and catch it here instead of a local treatment + DisplayUtils.printException(exception); + } + + // we are done here (with or without errors, that makes no difference + // at this point), so let's stop our stopwatch; now it's just an easy + // subtraction to be made (note that the values are internally + // represented as nanoseconds, but the result is printed as seconds) + StopWatch.stop(); + + // this is the last command from arara; once the execution time is + // available, print it; note that this notification is suppressed + // when the command line parsing returns false as result (it makes + // no sense to print the execution time for a help message, I guess) + DisplayUtils.printTime(); + + // gets the application exit status; the rule here is: + // 0 : everything went just fine (note that the dry-run mode always + // makes arara exit with 0, unless it is an error in the directive + // builder itself). + // 1 : one of the tasks failed, so the execution ended abruptly. This + // means the error relies on the command line call, not with arara. + // 2 : arara just handled an exception, meaning that something bad + // just happened and might require user intervention. + System.exit(CommonUtils.getExitStatus()); + + // I owe David Carlisle $10 + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/controller/ConfigurationController.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/controller/ConfigurationController.java new file mode 100644 index 00000000000..f3868b488f5 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/controller/ConfigurationController.java @@ -0,0 +1,106 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.controller; + +import java.util.HashMap; +import java.util.Map; + +/** + * Implements the configuration controller. The idea here is to provide a map + * that holds all configuration settings used by model and utilitary classes + * throughout the execution. This controller is implemented as a singleton. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class ConfigurationController { + + // the controller itself, since we have a singleton; + // this is the reference instance, instantiated once + private static final ConfigurationController instance = + new ConfigurationController(); + + // the configuration settings are stored in a map; + // pretty much everything can be stored in this map, + // as long as you know what to retrieve later on + private final Map<String, Object> map; + + /** + * Private constructor. Called once for creating the proper singleton. + */ + private ConfigurationController() { + map = new HashMap<String, Object>(); + } + + /** + * Gets the current configuration controller. Since this class is + * implemented as a singleton, you will get the same controller every + * single time, and that's good. + * @return The configuration controller, which hold the settings map. + */ + public static ConfigurationController getInstance() { + return instance; + } + + /** + * Returns the object indexed by the provided key. This method provides an + * easy access to the underlying map. + * @param key A string representing the key. + * @return An object indexed by the provided key. + */ + public Object get(String key) { + return map.get(key); + } + + /** + * Puts the object in the map and indexes it in the provided key. This + * method provides an easy access to the underlying map. + * @param key A string representing the key. + * @param value The object to be indexed by the provided key. + */ + public void put(String key, Object value) { + map.put(key, value); + } + + /** + * Checks if the map contains the provided key. This is actually a wrapper + * to the private map's method of the same name. + * @param key The key to be checked. + * @return A boolean value indicating if the map contains the provided key. + */ + public boolean contains(String key) { + return map.containsKey(key); + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/controller/LanguageController.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/controller/LanguageController.java new file mode 100644 index 00000000000..a0ccc2a9586 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/controller/LanguageController.java @@ -0,0 +1,120 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.controller; + +import ch.qos.cal10n.IMessageConveyor; +import ch.qos.cal10n.MessageConveyor; +import java.util.Locale; + +/** + * Implements the language controller. This controller provides a singleton + * object that holds the application messages, easily available to all model + * and utilitary classes. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class LanguageController { + + // the controller itself, since we have a singleton; + // this is the reference instance, instantiated once + private static final LanguageController instance = + new LanguageController(); + + // the message conveyor helps us to get localized messages + // according to the provided locale + private IMessageConveyor conveyor; + + /** + * Private constructor. The fallback language is set to English for all + * messages in arara. + */ + private LanguageController() { + conveyor = new MessageConveyor(new Locale("en")); + } + + /** + * Initializes the class. This method actually does nothing, it just + * triggers the static attributions. Dirty, isn't it? + */ + public static void init() { + // quack, quack, quack! + } + + /** + * Gets the singleton reference. Since this class is implemented as a + * singleton, you will get the same controller every single time. + * @return The language controller which holds the conveyor. + */ + public static LanguageController getInstance() { + return instance; + } + + /** + * Sets the current locale. This method actually resets the language + * conveyor in order to use the new locale. It's quite simple. + * @param locale The new locale for localized messages through the language + * conveyor. + */ + public void setLocale(Locale locale) { + conveyor = new MessageConveyor(locale); + } + + /** + * Gets the localized message indexed by the provided enumeration key, + * applying an array of objects as parameters. This method is a wrapper to + * the conveyor's method of the same name. + * @param <E> Enumeration type that represents the conveyor messages. + * @param key Key set in the provided enumeration type. + * @param parameters Array of objects to be used as parameters. + * @return A string containing a localized message indexed by the provided + * enumeration key and applied the array of objects as parameters. + */ + public <E extends Enum<?>> String getMessage(E key, Object... parameters) { + return conveyor.getMessage(key, parameters); + } + + /** + * Gets the localized message indexed by the provided enumeration key. This + * method is a wrapper to the conveyor's method of the same name. + * @param <E> Enumeration type that represents the conveyor messages. + * @param key Key set in the provided enumeration type. + * @return A string containing a localized message indexed by the provided + * enumeration key. + */ + public <E extends Enum<?>> String getMessage(E key) { + return conveyor.getMessage(key); + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/controller/LoggingController.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/controller/LoggingController.java new file mode 100644 index 00000000000..193726fcc42 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/controller/LoggingController.java @@ -0,0 +1,109 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.controller; + +import ch.qos.logback.classic.LoggerContext; +import ch.qos.logback.classic.joran.JoranConfigurator; +import ch.qos.logback.core.joran.spi.JoranException; +import java.io.InputStream; +import org.slf4j.LoggerFactory; + +/** + * Implements the logging controller. This class actually sets the logging + * configuration in order to allow appending results to a file. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class LoggingController { + + /** + * Sets the logging configuration according to the provided boolean value. + * If the value is set to true, the log entries will be appended to a file, + * otherwise the logging feature will keep silent. + * @param enable A boolean value that indicates the logging behaviour + * throughout the application. + */ + public static void enableLogging(boolean enable) { + + // get the logger context from a factory, set a + // new context and reset it + LoggerContext loggerContext = + (LoggerContext) LoggerFactory.getILoggerFactory(); + + try { + + // get a new configuration and set + // the context + JoranConfigurator configurator = new JoranConfigurator(); + configurator.setContext(loggerContext); + loggerContext.reset(); + + // if enabled, the log entries will be + // appended to a file, otherwise it will + // remain silent + if (enable) { + + // set the file name and configure + // the logging controller to append + // entries to the file + String name = (String) ConfigurationController. + getInstance().get("execution.log.name"); + loggerContext.putProperty("name", name); + configurator.doConfigure(getResource()); + } + } catch (JoranException exception) { + // quack, quack, quack! + } + } + + /** + * Get the configuration resource as an input stream. The configuration + * is actually a XML file. + * @return An input stream of the provided configuration XML resource. + */ + private static InputStream getResource() { + String resource = "/com/github/cereda/arara/configuration/logback.xml"; + return LoggingController.class.getResourceAsStream(resource); + } + + /** + * Initializes the logging controller by disabling it. I don't want an odd + * behaviour out of the box. + */ + public static void init() { + enableLogging(false); + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/controller/SessionController.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/controller/SessionController.java new file mode 100644 index 00000000000..ac5a45d2b3e --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/controller/SessionController.java @@ -0,0 +1,124 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.controller; + +import java.util.HashMap; +import java.util.Map; + +/** + * Implements a session controller. This class wraps a map that holds the + * execution session, that is, a dirty maneuver to exchange pretty much any + * data between commands and even rules. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class SessionController { + + // the controller itself, since we have a singleton; + // this is the reference instance, instantiated once + private static final SessionController instance = + new SessionController(); + + // the session map which holds the execution session; + // the idea here is to provide wrappers to the map + // methods, so it could be easily manipulated + private final Map<String, Object> map; + + /** + * Private constructor. Called once when the singleton is created. + */ + private SessionController() { + map = new HashMap<String, Object>(); + } + + /** + * Gets the singleton reference. Since this class is implemented as a + * singleton, you will get the same controller every single time. + * @return The session controller which holds the session map. + */ + public static SessionController getInstance() { + return instance; + } + + /** + * Gets the object indexed by the provided key. This method actually holds + * the map method of the very same name. + * @param key The provided map key. + * @return The object indexed by the provided map key. + */ + public Object get(String key) { + return map.get(key); + } + + /** + * Puts the object in the session map and indexes it under the provided + * key. This method actually holds the map method of the very same name. + * @param key The provided map key. + * @param value The object to be indexed under the provided key. + */ + public void put(String key, Object value) { + map.put(key, value); + } + + /** + * Checks if the session map contains the provided key. This method holds + * the map method of the very same name. + * @param key The key to be checked. + * @return A boolean value indicating if the session map contains the + * provided key. + */ + public boolean contains(String key) { + return map.containsKey(key); + } + + /** + * Remove an entry from the map according to the provided key. This method + * holds the map method of the same name. + * @param key The provided key to indicate which session map entry should + * be removed. + */ + public void remove(String key) { + map.remove(key); + } + + /** + * Clears the session map. This method, as usual, holds the map method of + * the same name. + */ + public void clear() { + map.clear(); + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/controller/SystemCallController.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/controller/SystemCallController.java new file mode 100644 index 00000000000..9a592853f69 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/controller/SystemCallController.java @@ -0,0 +1,153 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.controller; + +import java.util.HashMap; +import java.util.Map; +import org.zeroturnaround.exec.ProcessExecutor; + +/** + * Implements a system call controller. This class wraps a map that holds the + * result of system specific variables not directly available at runtime. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class SystemCallController { + + /** + * Implements a private command interface. + */ + private interface Command { + + /** + * Executes the command body. + * @return An object. + */ + public Object execute(); + } + + // the controller itself, since we have a singleton; + // this is the reference instance, instantiated once + private static final SystemCallController instance = + new SystemCallController(); + + // the system call map which holds the result of + // system specific variables not directly available + // at runtime; the idea here is to provide wrappers + // to the map getter, so it could be easily manipulated + private final Map<String, Object> map; + + // the commands map will allow the system call map being + // populated only on demand, that is, if the key is not + // found, this map will provide the corresponding method + // and update the value + private final Map<String, Command> commands; + + /** + * Private constructor. Called once when the singleton is created. + */ + private SystemCallController() { + + // create the new map instance to be + // populated on demand + map = new HashMap<String, Object>(); + + // create the new map of commands and + // add the corresponding system calls + commands = new HashMap<String, Command>(); + + // add the check for a Cygwin + // environment in here + commands.put("cygwin", new Command() { + + /** + * Implements the body of the command. In this particular + * instance, it checks if we are inside a Cygwin environment. + * @return A boolean value indicating if we are inside a Cygwin + * environment. + */ + public Object execute() { + try { + + // execute a new system call to 'uname -s', read the output + // as an UTF-8 string, lowercase it and check if it starts + // with the 'cygwin' string; if so, we are inside Cygwin + return ( + new ProcessExecutor().command("uname", "-s"). + readOutput(true).execute().outputUTF8() + ).toLowerCase().startsWith("cygwin"); + + } catch (Exception exception) { + + // gracefully fallback in case of any nasty and evil + // exception, e.g, if the command is unavailable + return false; + } + } + }); + } + + /** + * Gets the singleton reference. Since this class is implemented as a + * singleton, you will get the same controller every single time. + * @return The system call controller which holds the system call map. + */ + public static SystemCallController getInstance() { + return instance; + } + + /** + * Gets the object indexed by the provided key. This method actually holds + * the map method of the very same name. + * @param key The provided map key. + * @return The object indexed by the provided map key. + */ + public Object get(String key) { + + // if key is not found, meaning that + // the value wasn't required before + if (!map.containsKey(key)) { + + // perform the system call and + // populate the corresponding value + map.put(key, commands.get(key).execute()); + } + + // simply return the corresponding + // value based on the provided key + return map.get(key); + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/exception/AraraException.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/AraraException.java index daa1b4ac48a..f2a340fd01f 100644 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/exception/AraraException.java +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/AraraException.java @@ -1,7 +1,6 @@ /** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,57 +30,59 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * AraraException: This class aims at reducing every exception that happens in the - * whole application to a single self-contained exception. */ -// package definition -package com.github.arara.exception; +package com.github.cereda.arara.model; /** - * Aims at reducing every exception that happens in the whole application to a - * single self-contained exception. - * + * Implements the specific exception model for arara. * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 3.0 + * @version 4.0 + * @since 4.0 */ public class AraraException extends Exception { + // the underlying exception, + // used to hold more details + // on what really happened + private Exception exception; + /** - * Constructor. + * Constructor. Takes the exception message. + * @param message The exception message. */ - public AraraException() { - super(); + public AraraException(String message) { + super(message); } /** - * Constructor with a message. - * - * @param message A message containing the cause of the exception thrown. + * Constructor. Takes the exception message and the underlying exception. + * @param message The exception message. + * @param exception The underlying exception object. */ - public AraraException(String message) { + public AraraException(String message, Exception exception) { super(message); + this.exception = exception; } /** - * Constructor with both message and the cause of the exception. - * - * @param message A message containing the cause of the exception thrown. - * @param cause The throwable cause. + * Gets the underlying exception. + * @return The underlying message. */ - public AraraException(String message, Throwable cause) { - super(message, cause); + public Exception getException() { + return exception; } /** - * Constructor with the cause of the exception. - * - * @param cause The throwable cause. + * Checks if there is an underlying exception defined in the current object. + * @return A boolean value indicating if the current object has an + * underlying exception. */ - public AraraException(Throwable cause) { - super(cause); + public boolean hasException() { + if (exception != null) { + return (exception.getMessage() != null); + } else { + return false; + } } } diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/model/AraraRuleArgument.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Argument.java index 5f38418060a..0b15baf9d70 100644 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/model/AraraRuleArgument.java +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Argument.java @@ -1,7 +1,6 @@ /** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,94 +30,96 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * PlainAraraRuleArgument: This class provides the model for representing a - * plain Arara rule argument based on the YAML files. It's a plain old Java - * object. */ -// package definition -package com.github.arara.model; +package com.github.cereda.arara.model; -// needed import -import com.github.arara.utils.AraraUtils; +import com.github.cereda.arara.utils.CommonUtils; /** - * Provides the model for representing a plain Arara rule argument based on the - * YAML files. This class will be used to map YAML rules into Java objects. - * + * The rule argument model. * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 1.0 + * @version 4.0 + * @since 4.0 */ -public class AraraRuleArgument { +public class Argument { - // the rule argument identifier + // the argument identifier private String identifier; - // the command flag + + // a boolean indicating if the + // current argument is required + private boolean required; + + // the flag to hold the argument + // value manipulation private String flag; - // the default value - private String defaultValue; + + // the argument fallback if it is + // not defined in the directive + private String fallback; /** - * Getter for the default value. - * - * @return The default value. + * Gets the identifier. + * @return The identifier. */ - public String getDefault() { - return defaultValue; + public String getIdentifier() { + return CommonUtils.removeKeyword(identifier); } /** - * Setter for the default value. - * - * @param defaultValue The default value. + * Sets the identifier. + * @param identifier The identifier. */ - public void setDefault(String defaultValue) { - this.defaultValue = AraraUtils.removeKeyword(defaultValue); + public void setIdentifier(String identifier) { + this.identifier = identifier; } /** - * Getter for flag. - * - * @return The command flag. + * Checks if the argument is required. + * @return A boolean value indicating if the argument is required. */ - public String getFlag() { - - // return it - return flag; + public boolean isRequired() { + return required; } /** - * Setter for flag. - * - * @param flag The command flag. + * Sets the argument requirement. + * @param required A boolean value. */ - public void setFlag(String flag) { - - // set the flag - this.flag = AraraUtils.removeKeyword(flag); + public void setRequired(boolean required) { + this.required = required; } /** - * Getter for the argument identifier. - * - * @return The argument identifier. + * Gets the argument flag. + * @return The flag. */ - public String getIdentifier() { + public String getFlag() { + return CommonUtils.removeKeyword(flag); + } - // return it - return identifier; + /** + * Sets the argument flag. + * @param flag The argument flag. + */ + public void setFlag(String flag) { + this.flag = flag; } /** - * Setter for the argument identifier. - * - * @param identifier The argument identifier. + * Gets the argument fallback. + * @return The argument fallback. */ - public void setIdentifier(String identifier) { + public String getDefault() { + return CommonUtils.removeKeyword(fallback); + } - // set the identifier - this.identifier = identifier; + /** + * Sets the argument fallback. + * @param fallback The argument fallback. + */ + public void setDefault(String fallback) { + this.fallback = fallback; } + } diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Command.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Command.java new file mode 100644 index 00000000000..30583898327 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Command.java @@ -0,0 +1,122 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.model; + +import com.github.cereda.arara.utils.CommonUtils; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * Implements a command model, containing a list of strings. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class Command { + + // a list of elements which are components + // of a command and represented as strings + private final List<String> elements; + + // an optional file acting as a reference + // for the default working directory + private File workingDirectory; + + /** + * Constructor. + * @param values An array of objects. + */ + public Command(Object... values) { + elements = new ArrayList<String>(); + List result = CommonUtils.flatten(Arrays.asList(values)); + for (Object value : result) { + String element = String.valueOf(value); + if (!CommonUtils.checkEmptyString(element)) { + elements.add(element); + } + } + } + + /** + * Constructor. + * @param elements A list of strings. + */ + public Command(List<String> elements) { + this.elements = elements; + } + + /** + * Gets the list of strings representing each element of a command. + * @return A list of strings. + */ + public List<String> getElements() { + return elements; + } + + /** + * Sets the working directory. + * @param workingDirectory A file representing the working directory. + */ + public void setWorkingDirectory(File workingDirectory) { + this.workingDirectory = workingDirectory; + } + + /** + * Gets the working directory, if any. + * @return A file representing the working directory. + */ + public File getWorkingDirectory() { + return workingDirectory; + } + + /** + * Checks if a working directory was defined. + * @return A logic value indicating if a working directory was defined. + */ + public boolean hasWorkingDirectory() { + return workingDirectory != null; + } + + /** + * Provides a textual representation of the current command. + * @return A string representing the current command. + */ + @Override + public String toString() { + return CommonUtils.getCollectionElements(elements, "[ ", " ]", ", "); + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Conditional.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Conditional.java new file mode 100644 index 00000000000..4c830f0a1b6 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Conditional.java @@ -0,0 +1,139 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.model; + +/** + * The conditional class, it represents the type of conditional available + * for a directive and its corresponding expression to be evaluated. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class Conditional { + + // these are all types of conditionals arara + // is able to recognize; personally, I believe + // they are more than sufficient to cover the + // majority of test cases + public enum ConditionalType { + + // evaluated beforehand, directive is interpreted + // if and only if the result is true + IF, + + // there is no evaluation, directive is interpreted, + // no extra effort is needed + NONE, + + // evaluated beforehand, directive is interpreted + // if and only if the result is false + UNLESS, + + // directive is interpreted the first time, then the + // evaluation is done; while the result is false, + // the directive is interpreted again and again + UNTIL, + + // evaluated beforehand, directive is interpreted if + // and oly if the result is true, and the process is + // repeated while the result still holds true + WHILE + } + + // the conditional type, specified above; the + // default fallback, as seen in the constructor, + // is set to NONE, that is, no conditional at all + private ConditionalType type; + + // the expression to be evaluated according to its + // type; the default fallback, as seen in the + // constructor, is set to an empty string + private String condition; + + /** + * Constructor. + */ + public Conditional() { + type = ConditionalType.NONE; + condition = ""; + } + + /** + * Gets the conditional type. + * @return The conditional type. + */ + public ConditionalType getType() { + return type; + } + + /** + * Sets the conditional type. + * @param type The conditional type. + */ + public void setType(ConditionalType type) { + this.type = type; + } + + /** + * Gets the condition, that is, the expression to be evaluated. + * @return A string representing the condition. + */ + public String getCondition() { + return condition; + } + + /** + * Sets the condition, that is, the expression to be evaluated. + * @param condition A string representing the condition. + */ + public void setCondition(String condition) { + this.condition = condition; + } + + /** + * Provides a textual representation of the conditional object. + * @return A string representation of this object. + */ + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("{ ").append(type); + if (type != ConditionalType.NONE) { + builder.append(", expression: ").append(condition.trim()); + } + builder.append(" }"); + return builder.toString(); + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Configuration.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Configuration.java new file mode 100644 index 00000000000..0c2c2949586 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Configuration.java @@ -0,0 +1,246 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.model; + +import com.github.cereda.arara.controller.ConfigurationController; +import com.github.cereda.arara.controller.LanguageController; +import com.github.cereda.arara.utils.CommonUtils; +import com.github.cereda.arara.utils.ConfigurationUtils; +import java.io.File; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +/** + * Implements the configuration model, which holds the default settings and can + * load the configuration file. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class Configuration { + + // the application messages obtained from the + // language controller + private static final LanguageController messages = + LanguageController.getInstance(); + + /** + * Loads the application configuration. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static void load() throws AraraException { + + // initialize both file type and language models, + // since we can track errors from there instead + // of relying on a check on this level + FileType.init(); + Language.init(); + + // reset everything + reset(); + + // get the configuration file, if any + File file = ConfigurationUtils.getConfigFile(); + if (file != null) { + + // set the configuration file name for + // logging purposes + ConfigurationController.getInstance(). + put("execution.configuration.name", + CommonUtils.getCanonicalPath(file) + ); + + // then validate it and update the + // configuration accordingly + Resource resource = ConfigurationUtils.validateConfiguration(file); + update(resource); + } + + // just to be sure, update the + // current locale in order to + // display localized messages + Locale locale = ((Language) ConfigurationController. + getInstance().get("execution.language")).getLocale(); + LanguageController.getInstance().setLocale(locale); + } + + /** + * Resets the configuration to initial settings. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + private static void reset() throws AraraException { + + // put everything in a map to be + // later assigned to the configuration + // controller, which holds the settings + Map<String, Object> mapping = new HashMap<String, Object>(); + + mapping.put("execution.loops", 10L); + mapping.put("directives.charset", Charset.forName("UTF-8")); + mapping.put("execution.errors.halt", true); + mapping.put("execution.timeout", false); + mapping.put("execution.timeout.value", 0L); + mapping.put("execution.timeout.unit", TimeUnit.MILLISECONDS); + mapping.put("application.version", "4.0"); + mapping.put("application.revision", "1"); + mapping.put("directives.linebreak.pattern", "^\\s*-->\\s(.*)$"); + + String directive = "^\\s*(\\w+)\\s*(:\\s*(\\{.*\\})\\s*)?"; + String pattern = "(\\s+(if|while|until|unless)\\s+(\\S.*))?$"; + + mapping.put("directives.pattern", directive.concat(pattern)); + mapping.put("application.pattern", "arara:\\s"); + mapping.put("application.width", 65); + mapping.put("execution.database.name", "arara"); + mapping.put("execution.log.name", "arara"); + mapping.put("execution.verbose", false); + + mapping.put("trigger.halt", false); + mapping.put("execution.language", new Language("en")); + mapping.put("execution.logging", false); + mapping.put("execution.dryrun", false); + mapping.put("execution.status", 0); + mapping.put("application.copyright.year", "2012-2018"); + mapping.put("execution.filetypes", ConfigurationUtils. + getDefaultFileTypes()); + mapping.put("execution.rule.paths", + Arrays.asList( + CommonUtils.buildPath( + ConfigurationUtils.getApplicationPath(), + "rules" + ) + ) + ); + + mapping.put("execution.preambles", new HashMap<String, String>()); + mapping.put("execution.preamble.active", false); + mapping.put("execution.configuration.name", "[none]"); + mapping.put("execution.header", false); + mapping.put("ui.lookandfeel", "none"); + + // get the configuration controller and + // set every map key to it + ConfigurationController controller = + ConfigurationController.getInstance(); + for (String key : mapping.keySet()) { + controller.put(key, mapping.get(key)); + } + } + + /** + * Update the configuration based on the provided map. + * @param data Map containing the new configuration settings. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + private static void update(Resource resource) throws AraraException { + + ConfigurationController controller = + ConfigurationController.getInstance(); + + if (resource.getPaths() != null) { + List<String> paths = resource.getPaths(); + paths = ConfigurationUtils.normalizePaths(paths); + controller.put("execution.rule.paths", paths); + } + + if (resource.getFiletypes() != null) { + List<FileTypeResource> resources = resource.getFiletypes(); + List<FileType> filetypes = new ArrayList<FileType>(); + for (FileTypeResource type : resources) { + if (type.getPattern() != null) { + filetypes.add( + new FileType(type.getExtension(), type.getPattern()) + ); + } else { + filetypes.add(new FileType(type.getExtension())); + } + } + filetypes = ConfigurationUtils.normalizeFileTypes(filetypes); + controller.put("execution.filetypes", filetypes); + } + + controller.put("execution.verbose", resource.isVerbose()); + controller.put("execution.logging", resource.isLogging()); + controller.put("execution.header", resource.isHeader()); + + if (resource.getDbname() != null) { + controller.put("execution.database.name", + ConfigurationUtils.cleanFileName(resource.getDbname())); + } + + if (resource.getLogname() != null) { + controller.put("execution.log.name", + ConfigurationUtils.cleanFileName(resource.getLogname())); + } + + if (resource.getLanguage() != null) { + controller.put("execution.language", + new Language(resource.getLanguage())); + } + + long loops = resource.getLoops(); + if (loops > 0) { + controller.put("execution.loops", loops); + } else { + if (loops < 0) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_CONFIGURATION_LOOPS_INVALID_RANGE + ) + ); + } + } + + if (resource.getPreambles() != null) { + controller.put("execution.preambles", + resource.getPreambles()); + } + + if (resource.getLaf() != null) { + controller.put("ui.lookandfeel", + resource.getLaf()); + } + + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Database.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Database.java new file mode 100644 index 00000000000..66d360fdc08 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Database.java @@ -0,0 +1,80 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.model; + +import java.util.HashMap; +import org.simpleframework.xml.ElementMap; +import org.simpleframework.xml.Root; + +/** + * The XML database model, which keeps track on file changes. I am using the + * Simple framework to marshall and unmarshall objects and XML files. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +@Root(name = "status") +public class Database { + + // the whole database is implemented as a map, where + // the key is the absolute canonical file and the value + // is its corresponding CRC32 hash; the XML map is done + // inline, so it does not clutter the output a lot + @ElementMap(entry = "hash", key = "file", attribute = true, inline = true) + private HashMap<String, String> map; + + /** + * Constructor. It creates a new map. + */ + public Database() { + map = new HashMap<String, String>(); + } + + /** + * Gets the map. + * @return The map. + */ + public HashMap<String, String> getMap() { + return map; + } + + /** + * Sets the map. + * @param map The map. + */ + public void setMap(HashMap<String, String> map) { + this.map = map; + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Directive.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Directive.java new file mode 100644 index 00000000000..e311477125c --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Directive.java @@ -0,0 +1,146 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.model; + +import java.util.List; +import java.util.Map; + +/** + * Implements the directive model. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class Directive { + + // the directive identifier, it is resolved + // to the rule identifier later on + private String identifier; + + // a map containing the parameters; they + // are validated later on in order to + // ensure they are valid + private Map<String, Object> parameters; + + // a conditional containing the type and + // the expression to be evaluated later on + private Conditional conditional; + + // a list contained all line numbers from + // the main file which built the current + // directive + private List<Integer> lineNumbers; + + /** + * Gets the directive identifier. + * @return A string representing the directive identifier. + */ + public String getIdentifier() { + return identifier; + } + + /** + * Sets the directive identifier. + * @param identifier A string representing the directive identifier. + */ + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + /** + * Gets the directive parameters. + * @return A map containing the directive parameters. + */ + public Map<String, Object> getParameters() { + return parameters; + } + + /** + * Sets the directive parameters. + * @param parameters A map containing the directive parameters. + */ + public void setParameters(Map<String, Object> parameters) { + this.parameters = parameters; + } + + /** + * Gets the conditional object from the current directive. + * @return The conditional object from the current directive. + */ + public Conditional getConditional() { + return conditional; + } + + /** + * Sets the conditional object from the current directive. + * @param conditional The conditional object from the current directive. + */ + public void setConditional(Conditional conditional) { + this.conditional = conditional; + } + + /** + * Gets the list containing all line numbers from the current directive. + * @return A list containing all line numbers from the current directive. + */ + public List<Integer> getLineNumbers() { + return lineNumbers; + } + + /** + * Sets the list containing all line numbers from the current directive. + * @param lineNumbers A list containing all line numbers from the current + * directive. + */ + public void setLineNumbers(List<Integer> lineNumbers) { + this.lineNumbers = lineNumbers; + } + + /** + * Provides a textual representation of the current directive. + * @return A string containing a textual representation of the current + * directive. + */ + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("Directive: { "); + builder.append("identifier: ").append(identifier).append(", "); + builder.append("parameters: ").append(parameters).append(", "); + builder.append("conditional: ").append(conditional).append(", "); + builder.append("lines: ").append(lineNumbers).append(" }"); + return builder.toString(); + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Evaluator.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Evaluator.java new file mode 100644 index 00000000000..41f8d099430 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Evaluator.java @@ -0,0 +1,158 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.model; + +import com.github.cereda.arara.controller.ConfigurationController; +import com.github.cereda.arara.controller.LanguageController; +import com.github.cereda.arara.utils.CommonUtils; +import com.github.cereda.arara.utils.Methods; +import java.util.HashMap; +import java.util.Map; +import org.mvel2.templates.TemplateRuntime; + +/** + * Implements the evaluator model, on which a conditional can be analyzed and + * processed. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class Evaluator { + + // this attribute holds the maximum number of + // loops arara will accept; it's like + // reaching infinity + private final long loops; + + // the counter for the current execution, it + // helps us keep track of the number of times + // this evaluation has happened, and also to + // prevent potential infinite loops + private long counter; + + // a flag that indicates the + // evaluation to halt regardless + // of the the result + private boolean halt; + + // the application messages obtained from the + // language controller + private static final LanguageController messages = + LanguageController.getInstance(); + + /** + * Constructor. It gets the application maximum number of loops and reset + * all counters. + */ + public Evaluator() { + loops = (Long) ConfigurationController.getInstance(). + get("execution.loops"); + counter = 0; + halt = false; + } + + /** + * Evaluate the provided conditional. + * @param conditional The conditional object. + * @return A boolean value indicating if the conditional holds. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public boolean evaluate(Conditional conditional) throws AraraException { + + // when in dry-run mode, arara + // always ignore conditional evaluations + if (((Boolean) ConfigurationController. + getInstance().get("execution.dryrun")) == true) { + return false; + } + + switch (conditional.getType()) { + case NONE: + return false; + case IF: + case UNLESS: + if (!halt) { + halt = true; + } else { + return false; + } + break; + } + + // check counters and see if the execution + // has reached our concept of infinity, + // thus breaking the cycles + counter++; + if (((conditional.getType() == Conditional.ConditionalType.WHILE) && + (counter > loops)) || + ((conditional.getType() == Conditional.ConditionalType.UNTIL) && + (counter >= loops))) { + return false; + } else { + + Map<String, Object> context = new HashMap<String, Object>(); + Methods.addConditionalMethods(context); + + try { + Object result = TemplateRuntime.eval("@{ ".concat( + conditional.getCondition()).concat(" }"), context); + if (!CommonUtils.checkClass(Boolean.class, result)) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_EVALUATE_NOT_BOOLEAN_VALUE + ) + ); + } else { + boolean value = (Boolean) result; + switch (conditional.getType()) { + case UNLESS: + case UNTIL: + value = !value; + break; + } + return value; + } + } catch (RuntimeException exception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_EVALUATE_COMPILATION_FAILED + ), + exception + ); + } + } + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Extractor.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Extractor.java new file mode 100644 index 00000000000..84edef1eb05 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Extractor.java @@ -0,0 +1,88 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.model; + +import com.github.cereda.arara.controller.ConfigurationController; +import com.github.cereda.arara.controller.LanguageController; +import com.github.cereda.arara.utils.CommonUtils; +import com.github.cereda.arara.utils.DirectiveUtils; +import java.io.File; +import java.io.IOException; +import java.nio.charset.Charset; +import java.util.List; +import org.apache.commons.io.FileUtils; + +/** + * It extracts directives from the provided main file. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class Extractor { + + // the application messages obtained from the + // language controller + private static final LanguageController messages = + LanguageController.getInstance(); + + /** + * Extracts a list of directives from the provided main file, obtained from + * the configuration controller. + * @return A list of directives. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public List<Directive> extract() throws AraraException { + + File file = (File) ConfigurationController. + getInstance().get("execution.reference"); + Charset charset = (Charset) ConfigurationController. + getInstance().get("directives.charset"); + + try { + List<String> content = CommonUtils.getPreambleContent(); + List<String> lines = FileUtils.readLines(file, charset.name()); + content.addAll(lines); + return DirectiveUtils.extractDirectives(content); + } catch (IOException ioexception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_EXTRACTOR_IO_ERROR + ), + ioexception + ); + } + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/FileType.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/FileType.java new file mode 100644 index 00000000000..b9f2a01e032 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/FileType.java @@ -0,0 +1,170 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.model; + +import com.github.cereda.arara.controller.LanguageController; +import com.github.cereda.arara.utils.CommonUtils; +import java.util.HashMap; +import java.util.Map; +import org.apache.commons.lang.builder.EqualsBuilder; +import org.apache.commons.lang.builder.HashCodeBuilder; + +/** + * Implements the file type model. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class FileType { + + // string representing the + // file extension + private String extension; + + // string representing the + // file pattern to be used + // as directive lookup + private String pattern; + + // the application messages obtained from the + // language controller + private static final LanguageController messages = + LanguageController.getInstance(); + + // a map containing all file + // types that arara accepts + private static final Map<String, String> types = + new HashMap<String, String>(); + + /** + * Initializes the file type class by setting the default file types and + * their corresponding patterns. + */ + public static void init() { + types.put("tex", "^\\s*%\\s+"); + types.put("dtx", "^\\s*%\\s+"); + types.put("ltx", "^\\s*%\\s+"); + types.put("drv", "^\\s*%\\s+"); + types.put("ins", "^\\s*%\\s+"); + } + + /** + * Constructor. It takes both file extension and pattern lookup. + * @param extension The file extension. + * @param pattern The file pattern. + */ + public FileType(String extension, String pattern) { + this.extension = extension; + this.pattern = pattern; + } + + /** + * Constructor. It takes the extension, but it might raise an exception if + * the extension is unknown. This constructor is used when you just want + * to reorganize the file lookup priority without the need of changing the + * default extensions. + * @param extension The file extension. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public FileType(String extension) throws AraraException { + if (types.containsKey(extension)) { + this.extension = extension; + this.pattern = types.get(extension); + } else { + throw new AraraException( + messages.getMessage( + Messages.ERROR_FILETYPE_UNKNOWN_EXTENSION, + extension, + CommonUtils.getFileTypesList() + ) + ); + } + } + + /** + * Implements the file type hash code. Note that only the file extension is + * considered. + * @return An integer representing the file type hash code. + */ + @Override + public int hashCode() { + return new HashCodeBuilder().append(extension).toHashCode(); + } + + /** + * Implements the file type equals method, checking if one file type is + * equal to another. Note that only the file extension is considered. + * @param object The object to be analyzed. + * @return A boolean value indicating if those two objects are equal. + */ + @Override + public boolean equals(Object object) { + if (object == null) { + return false; + } + if (getClass() != object.getClass()) { + return false; + } + final FileType reference = (FileType) object; + return new EqualsBuilder().append(extension, reference.extension).isEquals(); + } + + /** + * Gets the file type extension. + * @return String representing the file type extension. + */ + public String getExtension() { + return extension; + } + + /** + * Gets the file type pattern. + * @return String representing the file type pattern. + */ + public String getPattern() { + return pattern; + } + + /** + * Provides a textual representation of the current file type object. + * @return A string containing a textual representation of the current file + * type object. + */ + @Override + public String toString() { + return ".".concat(extension); + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/model/AraraFilePattern.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/FileTypeResource.java index 91e1e4759f9..29340358581 100644 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/model/AraraFilePattern.java +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/FileTypeResource.java @@ -1,7 +1,6 @@ /** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,63 +30,55 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * AraraFilePattern: This class maps the supported filetypes. */ -// package definition -package com.github.arara.model; +package com.github.cereda.arara.model; -// needed imports -import com.github.arara.utils.AraraConstants; +import com.github.cereda.arara.utils.CommonUtils; /** - * Maps the supported filetypes. - * + * Implements the file type resource model. * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 3.0 + * @version 4.0 + * @since 4.0 */ -public class AraraFilePattern { +public class FileTypeResource { - // file extension + // the file extension private String extension; - // file pattern + + // the file pattern private String pattern; /** - * Getter for the file extension. - * - * @return The file extension. + * Gets the extension. + * @return The extension. */ public String getExtension() { - return extension; + return CommonUtils.removeKeyword(extension); } /** - * Setter for the file extension. - * - * @param extension The file extension. + * Sets the extension. + * @param extension The extension. */ public void setExtension(String extension) { this.extension = extension; } /** - * Getter for the file pattern. - * - * @return The file pattern. + * Gets the pattern. + * @return The pattern. */ public String getPattern() { - return pattern; + return CommonUtils.removeKeyword(pattern); } /** - * Setter for the file pattern. - * - * @param pattern The file pattern. + * Sets the pattern. + * @param pattern The pattern. */ public void setPattern(String pattern) { - this.pattern = pattern.concat(AraraConstants.DIRECTIVEPREFIX); + this.pattern = pattern; } + } diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Interpreter.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Interpreter.java new file mode 100644 index 00000000000..7c8f6e3928a --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Interpreter.java @@ -0,0 +1,458 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.model; + +import com.github.cereda.arara.controller.ConfigurationController; +import com.github.cereda.arara.controller.LanguageController; +import com.github.cereda.arara.utils.CommonUtils; +import com.github.cereda.arara.utils.DisplayUtils; +import com.github.cereda.arara.utils.InterpreterUtils; +import com.github.cereda.arara.utils.Methods; +import com.github.cereda.arara.utils.RuleUtils; +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.mvel2.templates.TemplateRuntime; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Interprets the list of directives. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class Interpreter { + + // the application messages obtained from the + // language controller + private static final LanguageController messages = + LanguageController.getInstance(); + + // the class logger obtained from + // the logger factory + private static final Logger logger = + LoggerFactory.getLogger(Interpreter.class); + + // list of directives to be + // interpreted in here + private List<Directive> directives; + + /** + * Sets the list of directives. + * @param directives The list of directives. + */ + public void setDirectives(List<Directive> directives) { + this.directives = directives; + } + + /** + * Executes each directive, throwing an exception if something bad has + * happened. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public void execute() throws AraraException { + + for (Directive directive : directives) { + + logger.info( + messages.getMessage( + Messages.LOG_INFO_INTERPRET_RULE, + directive.getIdentifier() + ) + ); + + ConfigurationController.getInstance(). + put("execution.file", + directive.getParameters().get("reference") + ); + File file = getRule(directive); + + logger.info( + messages.getMessage( + Messages.LOG_INFO_RULE_LOCATION, + file.getParent() + ) + ); + + ConfigurationController.getInstance(). + put("execution.info.rule.id", directive.getIdentifier()); + ConfigurationController.getInstance(). + put("execution.info.rule.path", file.getParent()); + ConfigurationController.getInstance(). + put("execution.directive.lines", + directive.getLineNumbers() + ); + ConfigurationController.getInstance(). + put("execution.directive.reference", + directive.getParameters().get("reference") + ); + + Rule rule = parseRule(file, directive); + Map<String, Object> parameters = parseArguments(rule, directive); + Methods.addRuleMethods(parameters); + + String name = rule.getName(); + List<String> authors = rule.getAuthors() == null ? + new ArrayList<String>() : rule.getAuthors(); + ConfigurationController.getInstance(). + put("execution.rule.arguments", + InterpreterUtils.getRuleArguments(rule) + ); + + Evaluator evaluator = new Evaluator(); + + boolean available = true; + if (InterpreterUtils. + runPriorEvaluation(directive.getConditional())) { + available = evaluator.evaluate(directive.getConditional()); + } + + if (available) { + + do { + + List<RuleCommand> commands = rule.getCommands(); + for (RuleCommand command : commands) { + String closure = command.getCommand(); + Object result = null; + try { + result = TemplateRuntime.eval(closure, parameters); + } catch (RuntimeException exception) { + throw new AraraException( + CommonUtils.getRuleErrorHeader().concat( + messages.getMessage( + Messages.ERROR_INTERPRETER_COMMAND_RUNTIME_ERROR + ) + ), + exception + ); + } + + List<Object> execution = new ArrayList<Object>(); + if (CommonUtils.checkClass(List.class, result)) { + execution = CommonUtils.flatten((List<?>) result); + } else { + execution.add(result); + } + + for (Object current : execution) { + + if (current == null) { + throw new AraraException( + CommonUtils.getRuleErrorHeader().concat( + messages.getMessage( + Messages.ERROR_INTERPRETER_NULL_COMMAND + ) + ) + ); + } else { + + if (!CommonUtils.checkEmptyString( + String.valueOf(current))) { + + DisplayUtils.printEntry(name, + command.getName() == null ? + messages.getMessage( + Messages.INFO_LABEL_UNNAMED_TASK + ) + : command.getName() + ); + boolean success = true; + + if (CommonUtils.checkClass( + Trigger.class, current)) { + if (((Boolean) ConfigurationController. + getInstance(). + get("execution.dryrun")) == false) { + if (((Boolean) ConfigurationController. + getInstance(). + get("execution.verbose")) == true) { + DisplayUtils.wrapText( + messages.getMessage( + Messages.INFO_INTERPRETER_VERBOSE_MODE_TRIGGER_MODE + ) + ); + } + } else { + DisplayUtils.printAuthors(authors); + DisplayUtils.wrapText( + messages.getMessage( + Messages.INFO_INTERPRETER_DRYRUN_MODE_TRIGGER_MODE + ) + ); + DisplayUtils.printConditional( + directive.getConditional() + ); + } + Trigger trigger = (Trigger) current; + trigger.process(); + } else { + Object representation = + CommonUtils.checkClass( + Command.class, + current + ) ? + current + : String.valueOf(current); + logger.info( + messages.getMessage( + Messages.LOG_INFO_SYSTEM_COMMAND, + representation + ) + ); + + if (((Boolean) ConfigurationController. + getInstance(). + get("execution.dryrun")) == false) { + int code = InterpreterUtils. + run(representation); + Object check = null; + try { + Map<String, Object> context = + new HashMap<String, Object>(); + context.put("value", code); + check = TemplateRuntime.eval( + "@{ ".concat( + command.getExit() == null ? + "value == 0" + : command.getExit()).concat(" }"), + context); + } catch (RuntimeException exception) { + throw new AraraException( + CommonUtils.getRuleErrorHeader(). + concat( + messages.getMessage( + Messages.ERROR_INTERPRETER_EXIT_RUNTIME_ERROR + ) + ), + exception + ); + } + if (CommonUtils. + checkClass( + Boolean.class, + check)) { + success = (Boolean) check; + } else { + throw new AraraException( + CommonUtils.getRuleErrorHeader().concat( + messages.getMessage( + Messages.ERROR_INTERPRETER_WRONG_EXIT_CLOSURE_RETURN + ) + ) + ); + } + } else { + DisplayUtils.printAuthors(authors); + DisplayUtils.wrapText( + messages.getMessage( + Messages.INFO_INTERPRETER_DRYRUN_MODE_SYSTEM_COMMAND, + representation + ) + ); + DisplayUtils.printConditional( + directive.getConditional() + ); + } + } + + DisplayUtils.printEntryResult(success); + + if (((Boolean) ConfigurationController. + getInstance().get("trigger.halt")) + || (((Boolean) ConfigurationController. + getInstance(). + get("execution.errors.halt") + && !success))) { + return; + } + } + } + } + } + } while (evaluator.evaluate(directive.getConditional())); + } + } + } + + /** + * Gets the rule according to the provided directive. + * @param directive The provided directive. + * @return The absolute canonical path of the rule, given the provided + * directive. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + private File getRule(Directive directive) throws AraraException { + File file = InterpreterUtils.buildRulePath(directive.getIdentifier()); + if (file == null) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_INTERPRETER_RULE_NOT_FOUND, + directive.getIdentifier(), + CommonUtils.getCollectionElements( + CommonUtils.getAllRulePaths(), + "(", + ")", + "; " + ) + ) + ); + } else { + return file; + } + } + + /** + * Parses the rule against the provided directive. + * @param file The file representing the rule. + * @param directive The directive to be analyzed. + * @return A rule object. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + private Rule parseRule(File file, Directive directive) + throws AraraException { + return RuleUtils.parseRule(file, directive.getIdentifier()); + } + + /** + * Parses the rule arguments against the provided directive. + * @param rule The rule object. + * @param directive The directive. + * @return A map containing all arguments resolved according to the + * directive parameters. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + private Map<String, Object> parseArguments(Rule rule, Directive directive) + throws AraraException { + + List<Argument> arguments = rule.getArguments(); + + Set<String> unknown = CommonUtils. + getUnknownKeys(directive.getParameters(), arguments); + unknown.remove("file"); + unknown.remove("reference"); + if (!unknown.isEmpty()) { + throw new AraraException( + CommonUtils.getRuleErrorHeader().concat( + messages.getMessage( + Messages.ERROR_INTERPRETER_UNKNOWN_KEYS, + CommonUtils.getCollectionElements( + unknown, + "(", + ")", + ", " + ) + ) + ) + ); + } + + Map<String, Object> mapping = new HashMap<String, Object>(); + mapping.put("file", directive.getParameters().get("file")); + mapping.put("reference", directive.getParameters().get("reference")); + + Map<String, Object> context = new HashMap<String, Object>(); + context.put("parameters", directive.getParameters()); + context.put("file", directive.getParameters().get("file")); + context.put("reference", directive.getParameters().get("reference")); + Methods.addRuleMethods(context); + + for (Argument argument : arguments) { + if ((argument.isRequired()) && + (!directive.getParameters().containsKey( + argument.getIdentifier()))) { + throw new AraraException( + CommonUtils.getRuleErrorHeader().concat( + messages.getMessage( + Messages.ERROR_INTERPRETER_ARGUMENT_IS_REQUIRED, + argument.getIdentifier() + ) + ) + ); + } + + if (argument.getDefault() != null) { + try { + Object result = TemplateRuntime. + eval(argument.getDefault(), context); + mapping.put(argument.getIdentifier(), result); + } catch (RuntimeException exception) { + throw new AraraException( + CommonUtils.getRuleErrorHeader(). + concat(messages.getMessage( + Messages.ERROR_INTERPRETER_DEFAULT_VALUE_RUNTIME_ERROR + ) + ), + exception + ); + } + } else { + mapping.put(argument.getIdentifier(), ""); + } + + if ((argument.getFlag() != null) && + (directive.getParameters().containsKey( + argument.getIdentifier()))) { + + try { + Object result = TemplateRuntime.eval( + argument.getFlag(), + context + ); + mapping.put(argument.getIdentifier(), result); + } catch (RuntimeException exception) { + throw new AraraException(CommonUtils.getRuleErrorHeader(). + concat( + messages.getMessage( + Messages.ERROR_INTERPRETER_FLAG_RUNTIME_EXCEPTION + ) + ), + exception + ); + } + } + } + + return mapping; + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Language.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Language.java new file mode 100644 index 00000000000..2b0fc8266e8 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Language.java @@ -0,0 +1,148 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.model; + +import com.github.cereda.arara.controller.LanguageController; +import com.github.cereda.arara.utils.CommonUtils; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +/** + * Implements the language model. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class Language { + + // the language code, based on + // ISO 639-1 and language variants + private final String code; + + // map containing all languages + // supported by nightingale + private static final Map<String, Pair<String, Locale>> languages = + new HashMap<String, Pair<String, Locale>>(); + + // the application messages obtained from the + // language controller + private static final LanguageController messages = + LanguageController.getInstance(); + + /** + * Initialize the language model. All supported languages are added in here. + */ + public static void init() { + languages.put("en", new Pair<String, Locale>( + "English", + new Locale("en") + )); + languages.put("de", new Pair<String, Locale>( + "German", + new Locale("de") + )); + languages.put("nl", new Pair<String, Locale>( + "Dutch", + new Locale("nl") + )); + languages.put("qn", new Pair<String, Locale>( + "Broad Norfolk", + new Locale("en", "QN") + )); + languages.put("ptbr", new Pair<String, Locale>( + "Brazilian Portuguese", + new Locale("pt", "BR") + )); + languages.put("it", new Pair<String, Locale>( + "Italian", + new Locale("it") + )); + } + + /** + * Creates a new language object. It might raise an exception if the + * provided language does not exist in the map. + * @param code The language code, based on ISO 639-1 and language variants. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public Language(String code) throws AraraException { + if (languages.containsKey(code)) { + this.code = code; + } else { + throw new AraraException( + messages.getMessage( + Messages.ERROR_LANGUAGE_INVALID_CODE, + getLanguagesList() + ) + ); + } + } + + /** + * Gets the language name. + * @return A string representing the language name. + */ + public String getName() { + return languages.get(code).getFirstElement(); + } + + /** + * Gets the language locale. + * @return The language locale. + */ + public Locale getLocale() { + return languages.get(code).getSecondElement(); + } + + /** + * Gets a string representing the list of available languages. + * @return String representing the list of available languages. + */ + public static String getLanguagesList() { + List<String> entries = new ArrayList<String>(); + for (String key : languages.keySet()) { + entries.add(languages.get(key). + getFirstElement(). + concat(": "). + concat(key) + ); + } + return CommonUtils.getCollectionElements(entries, "(", ")", ", "); + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Messages.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Messages.java new file mode 100644 index 00000000000..9916c3c145b --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Messages.java @@ -0,0 +1,170 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.model; + +import ch.qos.cal10n.BaseName; +import ch.qos.cal10n.Locale; +import ch.qos.cal10n.LocaleData; + +/** + * This enumeration contains all application messages. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +@BaseName("com.github.cereda.arara.localization.messages") +@LocaleData({ + @Locale(value = "de", charset = "UTF-8"), + @Locale(value = "en", charset = "UTF-8"), + @Locale(value = "en_QN", charset = "UTF-8"), + @Locale(value = "it", charset = "UTF-8"), + @Locale(value = "nl", charset = "UTF-8"), + @Locale(value = "pt_BR", charset = "UTF-8") +}) +public enum Messages { + + ERROR_BASENAME_NOT_A_FILE, + ERROR_CALCULATEHASH_IO_EXCEPTION, + ERROR_CHECKBOOLEAN_NOT_VALID_BOOLEAN, + ERROR_CHECKOS_INVALID_OPERATING_SYSTEM, + ERROR_CHECKREGEX_IO_EXCEPTION, + ERROR_CONFIGURATION_GENERIC_ERROR, + ERROR_CONFIGURATION_INVALID_YAML, + ERROR_CONFIGURATION_LOOPS_INVALID_RANGE, + ERROR_DISCOVERFILE_FILE_NOT_FOUND, + ERROR_EVALUATE_COMPILATION_FAILED, + ERROR_EVALUATE_NOT_BOOLEAN_VALUE, + ERROR_EXTRACTOR_IO_ERROR, + ERROR_FILETYPE_NOT_A_FILE, + ERROR_FILETYPE_UNKNOWN_EXTENSION, + ERROR_GETAPPLICATIONPATH_ENCODING_EXCEPTION, + ERROR_GETCANONICALFILE_IO_EXCEPTION, + ERROR_GETCANONICALPATH_IO_EXCEPTION, + ERROR_GETPARENTCANONICALPATH_IO_EXCEPTION, + ERROR_INTERPRETER_ARGUMENT_IS_REQUIRED, + ERROR_INTERPRETER_COMMAND_RUNTIME_ERROR, + ERROR_INTERPRETER_DEFAULT_VALUE_RUNTIME_ERROR, + ERROR_INTERPRETER_EXIT_RUNTIME_ERROR, + ERROR_INTERPRETER_FLAG_RUNTIME_EXCEPTION, + ERROR_INTERPRETER_NULL_COMMAND, + ERROR_INTERPRETER_RULE_NOT_FOUND, + ERROR_INTERPRETER_UNKNOWN_KEYS, + ERROR_INTERPRETER_WRONG_EXIT_CLOSURE_RETURN, + ERROR_LANGUAGE_INVALID_CODE, + ERROR_LOAD_COULD_NOT_LOAD_XML, + ERROR_PARSER_INVALID_PREAMBLE, + ERROR_PARSER_LOOPS_INVALID_RANGE, + ERROR_PARSER_LOOPS_NAN, + ERROR_PARSER_TIMEOUT_INVALID_RANGE, + ERROR_PARSER_TIMEOUT_NAN, + ERROR_PARSERULE_GENERIC_ERROR, + ERROR_PARSERULE_INVALID_YAML, + ERROR_REPLICATELIST_MISSING_FORMAT_ARGUMENTS_EXCEPTION, + ERROR_RULE_IDENTIFIER_AND_PATH, + ERROR_RUN_GENERIC_EXCEPTION, + ERROR_RUN_INTERRUPTED_EXCEPTION, + ERROR_RUN_INVALID_EXIT_VALUE_EXCEPTION, + ERROR_RUN_IO_EXCEPTION, + ERROR_RUN_TIMEOUT_EXCEPTION, + ERROR_RUN_TIMEOUT_INVALID_RANGE, + ERROR_SAVE_COULD_NOT_SAVE_XML, + ERROR_SESSION_OBTAIN_UNKNOWN_KEY, + ERROR_SESSION_REMOVE_UNKNOWN_KEY, + ERROR_TRIGGER_ACTION_NOT_FOUND, + ERROR_TRIGGER_CALL_EXCEPTION, + ERROR_VALIDATE_EMPTY_FILES_LIST, + ERROR_VALIDATE_FILE_IS_RESERVED, + ERROR_VALIDATE_FILES_IS_NOT_A_LIST, + ERROR_VALIDATE_INVALID_DIRECTIVE_FORMAT, + ERROR_VALIDATE_NO_DIRECTIVES_FOUND, + ERROR_VALIDATE_ORPHAN_LINEBREAK, + ERROR_VALIDATE_REFERENCE_IS_RESERVED, + ERROR_VALIDATE_YAML_EXCEPTION, + ERROR_VALIDATEBODY_ARGUMENT_ID_IS_RESERVED, + ERROR_VALIDATEBODY_ARGUMENTS_LIST, + ERROR_VALIDATEBODY_DUPLICATE_ARGUMENT_IDENTIFIERS, + ERROR_VALIDATEBODY_MISSING_KEYS, + ERROR_VALIDATEBODY_NULL_ARGUMENT_ID, + ERROR_VALIDATEBODY_NULL_COMMAND, + ERROR_VALIDATEBODY_NULL_COMMANDS_LIST, + ERROR_VALIDATEHEADER_NULL_ID, + ERROR_VALIDATEHEADER_NULL_NAME, + ERROR_VALIDATEHEADER_WRONG_IDENTIFIER, + ERROR_VELOCITY_FILE_NOT_FOUND, + ERROR_VELOCITY_PARSE_EXCEPTION, + ERROR_VELOCITY_METHOD_INVOCATION_EXCEPTION, + ERROR_VELOCITY_IO_EXCEPTION, + INFO_DISPLAY_EXCEPTION_MORE_DETAILS, + INFO_DISPLAY_EXECUTION_TIME, + INFO_DISPLAY_FILE_INFORMATION, + INFO_INTERPRETER_DRYRUN_MODE_SYSTEM_COMMAND, + INFO_INTERPRETER_DRYRUN_MODE_TRIGGER_MODE, + INFO_INTERPRETER_VERBOSE_MODE_TRIGGER_MODE, + INFO_LABEL_AUTHOR, + INFO_LABEL_AUTHORS, + INFO_LABEL_CONDITIONAL, + INFO_LABEL_NO_AUTHORS, + INFO_LABEL_ON_DETAILS, + INFO_LABEL_ON_ERROR, + INFO_LABEL_ON_FAILURE, + INFO_LABEL_ON_SUCCESS, + INFO_LABEL_UNNAMED_TASK, + INFO_PARSER_ALL_RIGHTS_RESERVED, + INFO_PARSER_DRYRUN_MODE_DESCRIPTION, + INFO_PARSER_HELP_DESCRIPTION, + INFO_PARSER_LANGUAGE_DESCRIPTION, + INFO_PARSER_LOG_DESCRIPTION, + INFO_PARSER_LOOPS_DESCRIPTION, + INFO_PARSER_NOTES, + INFO_PARSER_ONLY_HEADER, + INFO_PARSER_PREAMBLE_DESCRIPTION, + INFO_PARSER_SILENT_MODE_DESCRIPTION, + INFO_PARSER_TIMEOUT_DESCRIPTION, + INFO_PARSER_VERBOSE_MODE_DESCRIPTION, + INFO_PARSER_VERSION_DESCRIPTION, + LOG_INFO_BEGIN_BUFFER, + LOG_INFO_DIRECTIVES_BLOCK, + LOG_INFO_END_BUFFER, + LOG_INFO_INTERPRET_RULE, + LOG_INFO_INTERPRET_TASK, + LOG_INFO_POTENTIAL_DIRECTIVE_FOUND, + LOG_INFO_POTENTIAL_PATTERN_FOUND, + LOG_INFO_RULE_LOCATION, + LOG_INFO_SYSTEM_COMMAND, + LOG_INFO_TASK_RESULT, + LOG_INFO_VALIDATED_DIRECTIVES, + LOG_INFO_WELCOME_MESSAGE, + ERROR_CONFIGURATION_FILETYPE_MISSING_EXTENSION + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Pair.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Pair.java new file mode 100644 index 00000000000..d8591b6ef75 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Pair.java @@ -0,0 +1,92 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.model; + +/** + * Implements a pair of objects. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class Pair<T, V> { + + // first element of the pair + private final T firstElement; + + // second element of the pair + private final V secondElement; + + /** + * Constructor. + * @param firstElement The first element. + * @param secondElement The second element. + */ + public Pair(T firstElement, V secondElement) { + this.firstElement = firstElement; + this.secondElement = secondElement; + } + + /** + * Gets the first element. + * @return The first element. + */ + public T getFirstElement() { + return firstElement; + } + + /** + * Gets the second element. + * @return The second element. + */ + public V getSecondElement() { + return secondElement; + } + + /** + * A shorter version for getting the first element. + * @return The first element. + */ + public T first() { + return getFirstElement(); + } + + /** + * A shorter version for getting the second element. + * @return The second element. + */ + public V second() { + return getSecondElement(); + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Parser.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Parser.java new file mode 100644 index 00000000000..723e24e76e4 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Parser.java @@ -0,0 +1,410 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.model; + +import com.github.cereda.arara.controller.ConfigurationController; +import com.github.cereda.arara.controller.LanguageController; +import com.github.cereda.arara.controller.LoggingController; +import com.github.cereda.arara.utils.CommonUtils; +import com.github.cereda.arara.utils.DisplayUtils; +import java.util.Locale; +import java.util.Map; +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.DefaultParser; +import org.apache.commons.cli.HelpFormatter; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; + +/** + * Implements the command line parser. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class Parser { + + // command line arguments to be + // processed by this parser + private final String[] arguments; + + // command line options, it will + // group each option available + // in arara + private Options options; + + // each option available in + // arara + private Option version; + private Option help; + private Option log; + private Option verbose; + private Option silent; + private Option dryrun; + private Option timeout; + private Option language; + private Option loops; + private Option preamble; + private Option onlyheader; + + public Parser() { + this.arguments = null; + } + + // the application messages obtained from the + // language controller + private static final LanguageController messages = + LanguageController.getInstance(); + + /** + * Constructor. + * @param arguments Array of strings representing the command line + * arguments. + */ + public Parser(String[] arguments) { + this.arguments = arguments; + } + + /** + * Parses the command line arguments. + * @return A boolean value indicating if the parsing should allow the + * application to look for directives in the provided main file. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public boolean parse() throws AraraException { + + // create new instances of the + // command line options, including + // the ones that require arguments + version = new Option("V", "version", false, ""); + help = new Option("h", "help", false, ""); + log = new Option("l", "log", false, ""); + verbose = new Option("v", "verbose", false, ""); + silent = new Option("s", "silent", false, ""); + dryrun = new Option("n", "dry-run", false, ""); + timeout = new Option("t", "timeout", true, ""); + timeout.setArgName("number"); + language = new Option("L", "language", true, ""); + language.setArgName("code"); + loops = new Option("m", "max-loops", true, ""); + loops.setArgName("number"); + preamble = new Option("p", "preamble", true, ""); + preamble.setArgName("name"); + onlyheader = new Option("H", "header", false, ""); + + // add all options to the options + // group, so they are recognized + // by the command line parser + options = new Options(); + options.addOption(version); + options.addOption(help); + options.addOption(log); + options.addOption(verbose); + options.addOption(silent); + options.addOption(dryrun); + options.addOption(timeout); + options.addOption(language); + options.addOption(loops); + options.addOption(preamble); + options.addOption(onlyheader); + + // update all descriptions based + // on the localized messages + updateDescriptions(); + + // a new default command line + // parser is created and the + // arguments are parsed + CommandLineParser parser = new DefaultParser(); + + try { + + CommandLine line = parser.parse(options, arguments); + + String reference; + if (line.hasOption("language")) { + ConfigurationController.getInstance(). + put("execution.language", + new Language(line.getOptionValue("language")) + ); + Locale locale = ((Language) ConfigurationController. + getInstance().get("execution.language")).getLocale(); + messages.setLocale(locale); + updateDescriptions(); + } + + if (line.hasOption("help")) { + printVersion(); + printUsage(); + return false; + } + + if (line.hasOption("version")) { + printVersion(); + printNotes(); + return false; + } + + if (line.getArgs().length != 1) { + printVersion(); + printUsage(); + return false; + } else { + reference = line.getArgs()[0]; + } + + if (line.hasOption("timeout")) { + try { + long value = Long.parseLong(line.getOptionValue("timeout")); + if (value <= 0) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_PARSER_TIMEOUT_INVALID_RANGE + ) + ); + } else { + ConfigurationController.getInstance(). + put("execution.timeout", true); + ConfigurationController.getInstance(). + put("execution.timeout.value", value); + } + } catch (NumberFormatException nfexception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_PARSER_TIMEOUT_NAN + ) + ); + } + } + + if (line.hasOption("max-loops")) { + try { + long value = Long.parseLong( + line.getOptionValue("max-loops") + ); + if (value <= 0) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_PARSER_LOOPS_INVALID_RANGE + ) + ); + } else { + ConfigurationController.getInstance(). + put("execution.loops", value); + } + } catch (NumberFormatException nfexception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_PARSER_LOOPS_NAN + ) + ); + } + } + + if (line.hasOption("verbose")) { + ConfigurationController.getInstance(). + put("execution.verbose", true); + } + + if (line.hasOption("silent")) { + ConfigurationController.getInstance(). + put("execution.verbose", false); + } + + if (line.hasOption("dry-run")) { + ConfigurationController.getInstance(). + put("execution.dryrun", true); + ConfigurationController.getInstance(). + put("execution.errors.halt", false); + } + + if (line.hasOption("log")) { + ConfigurationController.getInstance(). + put("execution.logging", true); + } + + if (line.hasOption("preamble")) { + @SuppressWarnings("unchecked") + Map<String, String> preambles = (Map<String, String>) + ConfigurationController.getInstance(). + get("execution.preambles"); + if (preambles.containsKey(line.getOptionValue("preamble"))) { + ConfigurationController.getInstance(). + put("execution.preamble.active", true); + ConfigurationController.getInstance(). + put("execution.preamble.content", + preambles.get(line.getOptionValue("preamble")) + ); + } + else { + throw new AraraException( + messages.getMessage( + Messages.ERROR_PARSER_INVALID_PREAMBLE, + line.getOptionValue("preamble") + ) + ); + } + } + + if (line.hasOption("header")) { + ConfigurationController.getInstance(). + put("execution.header", true); + } + + CommonUtils.discoverFile(reference); + LoggingController.enableLogging((Boolean) ConfigurationController. + getInstance().get("execution.logging")); + ConfigurationController.getInstance().put("display.time", true); + + return true; + + } catch (ParseException pexception) { + printVersion(); + printUsage(); + return false; + } + } + + /** + * Prints the application usage. + */ + private void printUsage() { + HelpFormatter formatter = new HelpFormatter(); + StringBuilder builder = new StringBuilder(); + builder.append("arara [file [--dry-run] [--log] "); + builder.append("[--verbose | --silent] [--timeout N] "); + builder.append("[--max-loops N] [--language L] "); + builder.append("[ --preamble P ] [--header] | --help | --version]"); + formatter.printHelp(builder.toString(), options); + } + + /** + * Prints the application version. + */ + private void printVersion() { + String year = (String) ConfigurationController.getInstance(). + get("application.copyright.year"); + String number = (String) ConfigurationController.getInstance(). + get("application.version"); + String revision = (String) ConfigurationController.getInstance(). + get("application.revision"); + StringBuilder builder = new StringBuilder(); + builder.append("arara "); + builder.append(number); + builder.append(" (revision "); + builder.append(revision); + builder.append(")"); + builder.append("\n"); + builder.append("Copyright (c) ").append(year).append(", "); + builder.append("Paulo Roberto Massa Cereda"); + builder.append("\n"); + builder.append(messages.getMessage( + Messages.INFO_PARSER_ALL_RIGHTS_RESERVED) + ); + builder.append("\n"); + System.out.println(builder.toString()); + } + + /** + * Print the application notes. + */ + private void printNotes() { + DisplayUtils.wrapText(messages.getMessage(Messages.INFO_PARSER_NOTES)); + } + + /** + * Updates all the descriptions in order to make them reflect the current + * language setting. + */ + private void updateDescriptions() { + version.setDescription( + messages.getMessage( + Messages.INFO_PARSER_VERSION_DESCRIPTION + ) + ); + help.setDescription( + messages.getMessage( + Messages.INFO_PARSER_HELP_DESCRIPTION + ) + ); + log.setDescription( + messages.getMessage( + Messages.INFO_PARSER_LOG_DESCRIPTION + ) + ); + verbose.setDescription( + messages.getMessage( + Messages.INFO_PARSER_VERBOSE_MODE_DESCRIPTION + ) + ); + silent.setDescription( + messages.getMessage( + Messages.INFO_PARSER_SILENT_MODE_DESCRIPTION + ) + ); + dryrun.setDescription( + messages.getMessage( + Messages.INFO_PARSER_DRYRUN_MODE_DESCRIPTION + ) + ); + timeout.setDescription( + messages.getMessage( + Messages.INFO_PARSER_TIMEOUT_DESCRIPTION + ) + ); + language.setDescription( + messages.getMessage( + Messages.INFO_PARSER_LANGUAGE_DESCRIPTION + ) + ); + loops.setDescription( + messages.getMessage( + Messages.INFO_PARSER_LOOPS_DESCRIPTION + ) + ); + preamble.setDescription( + messages.getMessage( + Messages.INFO_PARSER_PREAMBLE_DESCRIPTION + ) + ); + onlyheader.setDescription( + messages.getMessage( + Messages.INFO_PARSER_ONLY_HEADER + ) + ); + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Resource.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Resource.java new file mode 100644 index 00000000000..2994a4d6912 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Resource.java @@ -0,0 +1,291 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.model; + +import com.github.cereda.arara.utils.CommonUtils; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.Transformer; +import org.apache.commons.lang.SystemUtils; +import org.mvel2.templates.TemplateRuntime; + +/** + * Implements the configuration resource model. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class Resource { + + // rule paths + private List<String> paths; + + // file types + private List<FileTypeResource> filetypes; + + // the application language + private String language; + + // maximum number of loops + private long loops; + + // verbose flag + private boolean verbose; + + // logging flag + private boolean logging; + + // database name + private String dbname; + + // log name + private String logname; + + // header flag + private boolean header; + + // map of preambles + private Map<String, String> preambles; + + // look and feel + private String laf; + + /** + * Gets the rule paths. + * @return The rule paths. + */ + public List<String> getPaths() { + if (paths != null) { + + final Map<String, Object> map = new HashMap<String, Object>(); + Map<String, Object> user = new HashMap<String, Object>(); + user.put("home", SystemUtils.USER_HOME); + user.put("dir", SystemUtils.USER_DIR); + user.put("name", SystemUtils.USER_NAME); + map.put("user", user); + + Collection<String> result = CollectionUtils.collect( + paths, new Transformer<String, String>() { + public String transform(String input) { + String path = CommonUtils.removeKeyword(input); + try { + path = (String) TemplateRuntime.eval(path, map); + } + catch (RuntimeException nothandled) { + // do nothing, gracefully fallback to + // the default, unparsed path + } + return path; + } + }); + paths = new ArrayList<String>(result); + } + return paths; + } + + /** + * Sets the rule paths. + * @param paths The rule paths. + */ + public void setPaths(List<String> paths) { + this.paths = paths; + } + + /** + * Gets the list of file types. + * @return The list of file types. + */ + public List<FileTypeResource> getFiletypes() { + return filetypes; + } + + /** + * Sets the list of file types. + * @param filetypes The list of file types. + */ + public void setFiletypes(List<FileTypeResource> filetypes) { + this.filetypes = filetypes; + } + + /** + * Gets the language. + * @return The language. + */ + public String getLanguage() { + return CommonUtils.removeKeyword(language); + } + + /** + * Sets the language. + * @param language The language. + */ + public void setLanguage(String language) { + this.language = language; + } + + /** + * Get the maximum number of loops. + * @return The maximum number of loops. + */ + public long getLoops() { + return loops; + } + + /** + * Sets the maximum number of loops. + * @param loops The maximum number of loops. + */ + public void setLoops(long loops) { + this.loops = loops; + } + + /** + * Checks if verbose mode is active. + * @return A boolean value. + */ + public boolean isVerbose() { + return verbose; + } + + /** + * Sets the verbose mode. + * @param verbose A boolean value. + */ + public void setVerbose(boolean verbose) { + this.verbose = verbose; + } + + /** + * Checks if logging mode is active. + * @return A boolean value. + */ + public boolean isLogging() { + return logging; + } + + /** + * Sets the logging mode. + * @param logging A boolean value. + */ + public void setLogging(boolean logging) { + this.logging = logging; + } + + /** + * Gets the database name. + * @return The database name. + */ + public String getDbname() { + return CommonUtils.removeKeyword(dbname); + } + + /** + * Sets the database name. + * @param dbname The database name. + */ + public void setDbname(String dbname) { + this.dbname = dbname; + } + + /** + * Gets the log name. + * @return The log name. + */ + public String getLogname() { + return CommonUtils.removeKeyword(logname); + } + + /** + * Sets the log name. + * @param logname The log name. + */ + public void setLogname(String logname) { + this.logname = logname; + } + + /** + * Gets the map of preambles. + * @return Map of preambles. + */ + public Map<String, String> getPreambles() { + return preambles; + } + + /** + * Sets the map of preambles. + * @param preambles Map of preambles. + */ + public void setPreambles(Map<String, String> preambles) { + this.preambles = preambles; + } + + /** + * Gets the logical value of the header flag. + * @return Logical value of the header flag. + */ + public boolean isHeader() { + return header; + } + + /** + * Sets the logical value of the header flag. + * @param header The header flag. + */ + public void setHeader(boolean header) { + this.header = header; + } + + /** + * Gets the look and feel reference. + * @return The look and feel reference. + */ + public String getLaf() { + return CommonUtils.removeKeyword(laf); + } + + /** + * Sets the look and feel reference. + * @param laf The look and feel reference. + */ + public void setLaf(String laf) { + this.laf = laf; + } + + + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Rule.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Rule.java new file mode 100644 index 00000000000..af3ad199506 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Rule.java @@ -0,0 +1,155 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.model; + +import com.github.cereda.arara.utils.CommonUtils; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.Transformer; + +/** + * Implements the rule model. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class Rule { + + // the rule identifier + private String identifier; + + // the rule name + private String name; + + // the list of authors + private List<String> authors; + + // the list of commands + private List<RuleCommand> commands; + + // the list of arguments + private List<Argument> arguments; + + /** + * Gets the rule identifier. + * @return The rule identifier. + */ + public String getIdentifier() { + return CommonUtils.removeKeyword(identifier); + } + + /** + * Sets the rule identifier. + * @param identifier The rule identifier. + */ + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + /** + * Gets the rule identifier. + * @return The rule identifier. + */ + public String getName() { + return CommonUtils.removeKeyword(name); + } + + /** + * Sets the rule name. + * @param name The rule name. + */ + public void setName(String name) { + this.name = name; + } + + /** + * Gets the list of authors. + * @return A list of authors. + */ + public List<String> getAuthors() { + if (authors != null) { + Collection<String> result = CollectionUtils.collect( + authors, new Transformer<String, String>() { + public String transform(String input) { + return CommonUtils.removeKeyword(input); + } + }); + authors = new ArrayList<String>(result); + } + return authors; + } + + /** + * Sets the list of authors. + * @param authors The list of authors. + */ + public void setAuthors(List<String> authors) { + this.authors = authors; + } + + /** + * Gets the list of commands. + * @return The list of commands. + */ + public List<RuleCommand> getCommands() { + return commands; + } + + /** + * Sets the list of commands. + * @param commands The list of commands. + */ + public void setCommands(List<RuleCommand> commands) { + this.commands = commands; + } + + /** + * Gets the list of arguments. + * @return The list of arguments. + */ + public List<Argument> getArguments() { + return arguments; + } + + /** + * Sets the list of arguments. + * @param arguments The list of arguments. + */ + public void setArguments(List<Argument> arguments) { + this.arguments = arguments; + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/model/AraraCommand.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/RuleCommand.java index 80da972003d..b209d19bcb0 100644 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/model/AraraCommand.java +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/RuleCommand.java @@ -1,7 +1,6 @@ /** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,69 +30,74 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * AraraCommand: This class provides the model for commands to be executed by - * the runtime. It's a plain old Java object. */ -// package definition -package com.github.arara.model; +package com.github.cereda.arara.model; + +import com.github.cereda.arara.utils.CommonUtils; /** - * Provides the model for commands to be executed by the runtime. - * + * Implements the rule command model. * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 1.0 + * @version 4.0 + * @since 4.0 */ -public class AraraCommand { +public class RuleCommand { - // the name to be displayed in the command line + // the command name private String name; - // the command itself + + // the command instruction private String command; + + // the exit status expression + private String exit; /** - * Getter for command. - * - * @return The command to be executed by the runtime. + * Gets the command name. + * @return The command name. */ - public String getCommand() { + public String getName() { + return CommonUtils.removeKeyword(name); + } - // return it - return command; + /** + * Sets the command name. + * @param name The command name. + */ + public void setName(String name) { + this.name = name; } /** - * Setter for command. - * - * @param command The command, already expanded. + * Gets the command instruction. + * @return The command instruction. */ - public void setCommand(String command) { + public String getCommand() { + return CommonUtils.removeKeyword(command); + } - // set the command + /** + * Sets the command instruction. + * @param command The command instruction. + */ + public void setCommand(String command) { this.command = command; } /** - * Getter for the command name. - * - * @return The command name, provided by the rule. + * Gets the exit status expression. + * @return The exit status expression. */ - public String getName() { - - // return it - return name; + public String getExit() { + return CommonUtils.removeKeyword(exit); } /** - * Setter for the command name. - * - * @param name The command name. + * Sets the exit status expression. + * @param exit The exit status expression. */ - public void setName(String name) { - - // set the name - this.name = name; + public void setExit(String exit) { + this.exit = exit; } + } diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Session.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Session.java new file mode 100644 index 00000000000..c756ae4550e --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Session.java @@ -0,0 +1,122 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.model; + +import com.github.cereda.arara.controller.LanguageController; +import com.github.cereda.arara.controller.SessionController; + +/** + * Implements the session model. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class Session { + + // get the current instance from the + // session controller + private static final SessionController session = + SessionController.getInstance(); + + // the application messages obtained from the + // language controller + private static final LanguageController messages = + LanguageController.getInstance(); + + /** + * Inserts the object into the session, indexed by the provided key. + * @param key The provided key. + * @param value The value to be inserted. + */ + public void insert(String key, Object value) { + session.put(key, value); + } + + /** + * Removes the entry indexed by the provided key from the session. + * @param key The provided key. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public void remove(String key) throws AraraException { + if (session.contains(key)) { + session.remove(key); + } else { + throw new AraraException( + messages.getMessage( + Messages.ERROR_SESSION_REMOVE_UNKNOWN_KEY, + key + ) + ); + } + } + + /** + * Checks if the provided key exists in the session. + * @param key The provided key. + * @return A boolean value indicating if the provided key exists in the + * session. + */ + public boolean exists(String key) { + return session.contains(key); + } + + /** + * Clears the session. + */ + public void forget() { + session.clear(); + } + + /** + * Gets the object indexed by the provided key from the session. + * @param key The provided key. + * @return The object indexed by the provided key. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public Object obtain(String key) throws AraraException { + if (session.contains(key)) { + return session.get(key); + } else { + throw new AraraException( + messages.getMessage( + Messages.ERROR_SESSION_OBTAIN_UNKNOWN_KEY, + key + ) + ); + } + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/StopWatch.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/StopWatch.java new file mode 100644 index 00000000000..45e0969d0b7 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/StopWatch.java @@ -0,0 +1,84 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.model; + +import com.github.cereda.arara.controller.ConfigurationController; + +/** + * Implements a stopwatch. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class StopWatch { + + // two variables indicating the + // times the stopwatch started + // and stopped + private static long beginning = 0; + private static long end = 0; + + // a variable to indicate the + // stopwatch is enabled; so far, + // it hasn't started, then it is + // not enabled + private static boolean enabled = false; + + /** + * Starts the stopwatch. + */ + public static void start() { + beginning = System.nanoTime(); + enabled = true; + } + + /** + * Stops the stopwatch. + */ + public static void stop() { + end = System.nanoTime(); + } + + /** + * Gets the string representation of the elapsed time. + * @return A string representation of the elapsed time. + */ + public static String getTime() { + Language language = (Language) ConfigurationController. + getInstance().get("execution.language"); + double result = enabled ? (double) (end - beginning) / 1000000000 : 0.0; + return String.format(language.getLocale(), "%1.2f", result); + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Trigger.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Trigger.java new file mode 100644 index 00000000000..11da04bfcb9 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/model/Trigger.java @@ -0,0 +1,135 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.model; + +import com.github.cereda.arara.controller.ConfigurationController; +import com.github.cereda.arara.controller.LanguageController; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Callable; + +/** + * Implements the trigger model. The tool provides triggers, which are a way + * to alter its internal behaviour according to a list of parameters. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class Trigger { + + // the action name and its + // list of parameters + private final String action; + private final List<Object> parameters; + + // the application messages obtained from the + // language controller + private static final LanguageController messages = + LanguageController.getInstance(); + + /** + * Constructor. + * @param action The action name. + * @param parameters The list of parameters. + */ + public Trigger(String action, List<Object> parameters) { + this.action = action; + this.parameters = parameters; + } + + /** + * Gets the action name. + * @return The action name. + */ + public String getAction() { + return action; + } + + /** + * Gets the list of parameters. + * @return The list of parameters. + */ + public List<Object> getParameters() { + return parameters; + } + + /** + * Returns a textual representation of the current trigger. + * @return A string containing a textual representation of the current + * trigger. + */ + @Override + public String toString() { + return "trigger"; + } + + /** + * Processes the current trigger. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public void process() throws AraraException { + + Map<String, Callable<Object>> mapping = + new HashMap<String, Callable<Object>>(); + mapping.put("halt", new Callable<Object>() { + public Object call() { + ConfigurationController.getInstance().put("trigger.halt", true); + return null; + } + }); + if (mapping.containsKey(action)) { + try { + mapping.get(action).call(); + } catch (Exception exception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_TRIGGER_CALL_EXCEPTION, + action + ), + exception + ); + } + } else { + throw new AraraException( + messages.getMessage( + Messages.ERROR_TRIGGER_ACTION_NOT_FOUND, + action + ) + ); + } + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/ClassLoadingUtils.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/ClassLoadingUtils.java new file mode 100644 index 00000000000..c40536ce08f --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/ClassLoadingUtils.java @@ -0,0 +1,166 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.utils; + +import com.github.cereda.arara.model.Pair; +import java.io.File; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; + +/** + * Implements utilitary methods for classloading and object instantiation. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class ClassLoadingUtils { + + /** + * Loads a class from the provided file, potentially a Java archive. + * @param file File containing the Java bytecode (namely, a JAR). + * @param name The canonical name of the class. + * @return A pair representing the status and the class. + */ + public static Pair<Integer, Class> loadClass(File file, String name) { + + // status and class to be returned, + // it defaults to an object class + int status = 0; + Class value = Object.class; + + // if file does not exist, nothing + // can be done, status is changed + if (!file.exists()) { + status = 1; + } else { + + // classloading involves defining + // a classloader and fetching the + // desired class from it, based on + // the provided file archive + try { + + // creates a new classloader with + // the provided file (potentially + // a JAR file) + URLClassLoader classloader = new URLClassLoader( + new URL[]{ + file.toURI().toURL() + }, + ClassLoadingUtils.class.getClassLoader() + ); + + // fetches the class from the + // instantiated classloader + value = Class.forName(name, true, classloader); + + } catch (MalformedURLException nothandled1) { + + // the file URL is incorrect, + // update status accordingly + status = 2; + + } catch (ClassNotFoundException nothandled2) { + + // the class was not found, + // update status accordingly + status = 3; + + } + } + + // return a new pair based on the + // current status and class holder + return new Pair<Integer, Class>(status, value); + } + + /** + * Loads a class from the provided file, instantiating it. + * @param file File containing the Java bytecode (namely, a JAR). + * @param name The canonical name of the class. + * @return A pair representing the status and the class object. + */ + public static Pair<Integer, Object> loadObject(File file, String name) { + + // load the corresponding class + // based on the qualified name + Pair<Integer, Class> pair = loadClass(file, name); + + // status and object to be returned, + // it defaults to an object + int status = pair.getFirstElement(); + Object value = new Object(); + + // checks if the class actually + // exists, otherwise simply + // ignore instantiation + if (status == 0) { + + // object instantiation relies + // on the default constructor + // (without arguments), class + // must implement it + + // OBS: constructors with arguments + // must be invoked through reflection + try { + + // get the class reference from + // the pair and instantiate it + // by invoking the default + // constructor (without arguments) + value = pair.getSecondElement().newInstance(); + + } catch (IllegalAccessException nothandled1) { + + // the object instantiation violated + // an access policy, status is updated + status = 4; + + } catch (InstantiationException nothandled2) { + + // an instantiation exception has + // occurred, status is updated + status = 5; + + } + } + + // return a new pair based on the + // current status and object holder + return new Pair<Integer, Object>(status, value); + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/CommonUtils.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/CommonUtils.java new file mode 100644 index 00000000000..621634749ef --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/CommonUtils.java @@ -0,0 +1,929 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.utils; + +import com.github.cereda.arara.controller.ConfigurationController; +import com.github.cereda.arara.controller.LanguageController; +import com.github.cereda.arara.controller.SystemCallController; +import com.github.cereda.arara.model.AraraException; +import com.github.cereda.arara.model.Argument; +import com.github.cereda.arara.model.Database; +import com.github.cereda.arara.model.FileType; +import com.github.cereda.arara.model.Messages; +import java.io.File; +import java.io.IOException; +import java.nio.charset.Charset; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.MissingFormatArgumentException; +import java.util.Set; +import java.util.StringTokenizer; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.Transformer; +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.filefilter.NameFileFilter; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.SystemUtils; + +/** + * Implements common utilitary methods. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class CommonUtils { + + // the application messages obtained from the + // language controller + private static final LanguageController messages = + LanguageController.getInstance(); + + /** + * Checks if the input string is equal to a valid boolean value. + * @param value The input string. + * @return A boolean value represented by the provided string. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean checkBoolean(String value) throws AraraException { + List<String> yes = Arrays.asList( + new String[]{"yes", "true", "1", "on"} + ); + List<String> no = Arrays.asList( + new String[]{"no", "false", "0", "off"} + ); + if (!union(yes, no).contains(value.toLowerCase())) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_CHECKBOOLEAN_NOT_VALID_BOOLEAN, + value + ) + ); + } else { + return yes.contains(value.toLowerCase()); + } + } + + /** + * Provides a union set operation between two lists. + * @param <T> The list type. + * @param list1 The first list. + * @param list2 The second list. + * @return The union of those two lists. + */ + private static <T> List<T> union(List<T> list1, List<T> list2) { + Set<T> elements = new HashSet<T>(); + elements.addAll(list1); + elements.addAll(list2); + return new ArrayList<T>(elements); + } + + /** + * Build a system-dependant path based on the path and the file. + * @param path A string representing the path to be prepended. + * @param file A string representing the file to be appended. + * @return The full path as a string. + */ + public static String buildPath(String path, String file) { + return path.endsWith(File.separator) ? + path.concat(file) : path.concat(File.separator).concat(file); + } + + /** + * Checks if the provided string is empty. It does not handle a null value. + * @param string A string. + * @return A boolean value indicating if the string is empty. + */ + public static boolean checkEmptyString(String string) { + return "".equals(string); + } + + /** + * Removes the keyword from the beginning of the provided string. + * @param line A string to be analyzed. + * @return The provided string without the keyword. + */ + public static String removeKeyword(String line) { + if (line != null) { + Pattern pattern = Pattern.compile("^(\\s)*<arara>\\s"); + Matcher matcher = pattern.matcher(line); + if (matcher.find()) { + line = (line.substring(matcher.end(), line.length())); + } + line = line.trim(); + } + return line; + } + + /** + * Discovers the file through string reference lookup and sets the + * configuration accordingly. + * @param reference The string reference. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static void discoverFile(String reference) throws AraraException { + File file = lookupFile(reference); + if (file == null) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_DISCOVERFILE_FILE_NOT_FOUND, + reference, + getFileTypesList() + ) + ); + } + } + + /** + * Performs a file lookup based on a string reference. + * @param reference The file reference as a string. + * @return The file as result of the lookup operation. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + private static File lookupFile(String reference) throws AraraException { + @SuppressWarnings("unchecked") + List<FileType> types = (List<FileType>) ConfigurationController. + getInstance().get("execution.filetypes"); + File file = new File(reference); + String name = file.getName(); + String parent = getParentCanonicalPath(file); + String path = buildPath(parent, name); + + // direct search, so we are considering + // the reference as a complete name + for (FileType type : types) { + if (path.endsWith(".".concat(type.getExtension()))) { + file = new File(path); + if (file.exists()) { + if (file.isFile()) { + ConfigurationController. + getInstance(). + put("execution.file.pattern", + type.getPattern()); + ConfigurationController. + getInstance(). + put("execution.reference", file); + return file; + } + } + } + } + + // indirect search; in this case, we are considering + // that the file reference has an implict extension, + // so we need to add it and look again + for (FileType type : types) { + path = buildPath(parent, name.concat("."). + concat(type.getExtension())); + file = new File(path); + if (file.exists()) { + if (file.isFile()) { + ConfigurationController.getInstance(). + put("execution.file.pattern", type.getPattern()); + ConfigurationController.getInstance(). + put("execution.reference", file); + return file; + } + } + } + return null; + } + + /** + * Gets the parent canonical path of a file. + * @param file The file. + * @return The parent canonical path of a file. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static String getParentCanonicalPath(File file) + throws AraraException { + try { + String path = file.getCanonicalFile().getParent(); + return path; + } catch (IOException exception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_GETPARENTCANONICALPATH_IO_EXCEPTION + ), + exception + ); + } + } + + /** + * Gets the canonical file from a file. + * @param file The file. + * @return The canonical file. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static File getCanonicalFile(String file) throws AraraException { + try { + return (new File(file)).getCanonicalFile(); + } catch (IOException exception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_GETCANONICALFILE_IO_EXCEPTION + ), + exception + ); + } + } + + /** + * Checks if the provided object is from a certain class. + * @param clazz The class. + * @param object The object. + * @return A boolean value indicating if the provided object is from a + * certain class. + */ + public static boolean checkClass(Class clazz, Object object) { + return clazz.isInstance(object); + } + + /** + * Helper method to flatten a potential list of lists into a list of + * objects. + * @param list First list. + * @param flat Second list. + */ + private static void flatten(List<?> list, List<Object> flat) { + for (Object item : list) { + if (item instanceof List<?>) { + flatten((List<?>) item, flat); + } else { + flat.add(item); + } + } + } + + /** + * Flattens a potential list of lists into a list of objects. + * @param list The list to be flattened. + * @return The flattened list. + */ + public static List<Object> flatten(List<?> list) { + List<Object> result = new ArrayList<Object>(); + flatten(list, result); + return result; + } + + /** + * Gets the list of file types, in order. + * @return A string representation of the list of file types, in order. + */ + public static String getFileTypesList() { + @SuppressWarnings("unchecked") + List<FileType> types = (List<FileType>) ConfigurationController. + getInstance().get("execution.filetypes"); + return getCollectionElements(types, "[ ", " ]", " | "); + } + + /** + * Gets a string representation of a collection. + * @param collection The collection. + * @param open The opening string. + * @param close The closing string. + * @param separator The element separator. + * @return A string representation of the provided collection. + */ + public static String getCollectionElements(Collection collection, + String open, String close, String separator) { + StringBuilder builder = new StringBuilder(); + builder.append(open); + builder.append(StringUtils.join(collection, separator)); + builder.append(close); + return builder.toString(); + } + + /** + * Gets a set of strings containing unknown keys from a map and a list. It + * is a set difference from the keys in the map and the entries in the list. + * @param parameters The map of parameters. + * @param arguments The list of arguments. + * @return A set of strings representing unknown keys from a map and a list. + */ + public static Set<String> getUnknownKeys(Map<String, Object> parameters, + List<Argument> arguments) { + Collection<String> found = parameters.keySet(); + Collection<String> expected = CollectionUtils.collect( + arguments, new Transformer<Argument, String>() { + public String transform(Argument argument) { + return argument.getIdentifier(); + } + }); + Collection<String> difference = CollectionUtils. + subtract(found, expected); + return new HashSet<String>(difference); + } + + /** + * Gets the rule error header, containing the identifier and the path, if + * any. + * @return A string representation of the rule error header, containing the + * identifier and the path, if any. + */ + public static String getRuleErrorHeader() { + if ((ConfigurationController.getInstance(). + contains("execution.info.rule.id")) && + (ConfigurationController.getInstance(). + contains("execution.info.rule.path"))) { + String id = (String) ConfigurationController.getInstance(). + get("execution.info.rule.id"); + String path = (String) ConfigurationController.getInstance(). + get("execution.info.rule.path"); + return messages.getMessage( + Messages.ERROR_RULE_IDENTIFIER_AND_PATH, + id, + path + ).concat(" "); + } else { + return ""; + } + } + + /** + * Trims spaces from every string of a list of strings. + * @param input The list of strings. + * @return A new list of strings, with each element trimmed. + */ + public static List<String> trimSpaces(List<String> input) { + Collection<String> result = CollectionUtils.collect( + input, new Transformer<String, String>() { + public String transform(String input) { + return input.trim(); + } + }); + return new ArrayList<String>(result); + } + + /** + * Gets a human readable representation of a file size. + * @param file The file. + * @return A string representation of the file size. + */ + public static String calculateFileSize(File file) { + return FileUtils.byteCountToDisplaySize(file.length()); + } + + /** + * Gets the date the provided file was last modified. + * @param file The file. + * @return A string representation of the date the provided file was last + * modified. + */ + public static String getLastModifiedInformation(File file) { + SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); + return format.format(file.lastModified()); + } + + /** + * Gets a list of all rule paths. + * @return A list of all rule paths. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static List<String> getAllRulePaths() throws AraraException { + @SuppressWarnings("unchecked") + List<String> paths = (List<String>) ConfigurationController. + getInstance().get("execution.rule.paths"); + List<String> result = new ArrayList<String>(); + for (String path : paths) { + File location = new File(InterpreterUtils.construct(path, "quack")); + result.add(getParentCanonicalPath(location)); + } + return result; + } + + /** + * Gets the reference of the current file in execution. Note that this + * method might return a value different than the main file provided in + * the command line. + * @return A reference of the current file in execution. Might be different + * than the main file provided in the command line. + */ + private static File getCurrentReference() { + return (File) ConfigurationController.getInstance(). + get("execution.file"); + } + + /** + * Calculates the CRC32 checksum of the provided file. + * @param file The file. + * @return A string containing the CRC32 checksum of the provided file. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static String calculateHash(File file) throws AraraException { + try { + long result = FileUtils.checksumCRC32(file); + return String.format("%08x", result); + } catch (IOException exception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_CALCULATEHASH_IO_EXCEPTION + ), + exception + ); + } + } + + /** + * Gets the file type of a file. + * @param file The file. + * @return The corresponding file type. + */ + public static String getFiletype(File file) { + return getFiletype(file.getName()); + } + + /** + * Gets the file type of a string representing the file. + * @param name A string representing the file. + * @return The corresponding file type. + */ + public static String getFiletype(String name) { + name = name.lastIndexOf(".") != -1 ? + name.substring(name.lastIndexOf(".") + 1, name.length()) : ""; + return name; + } + + /** + * Gets the base name of a file. + * @param file The file. + * @return The corresponding base name. + */ + public static String getBasename(File file) { + return getBasename(file.getName()); + } + + /** + * Gets the base name of a string representing the file. + * @param name A string representing the file. + * @return The corresponding base name. + */ + public static String getBasename(String name) { + int index = name.lastIndexOf(".") != -1 ? + name.lastIndexOf(".") : name.length(); + return name.substring(0, index); + } + + /** + * Encloses the provided object in double quotes. + * @param object The object. + * @return A string representation of the provided object enclosed in double + * quotes. + */ + public static String addQuotes(Object object) { + return "\"".concat(String.valueOf(object)).concat("\""); + } + + /** + * Generates a string based on a list of objects, separating each one of + * them by one space. + * @param objects A list of objects. + * @return A string based on the list of objects, separating each one of + * them by one space. Empty values are not considered. + */ + public static String generateString(Object... objects) { + List<String> values = new ArrayList<String>(); + for (Object object : objects) { + if (!CommonUtils.checkEmptyString(String.valueOf(object))) { + values.add(String.valueOf(object)); + } + } + return StringUtils.join(values, " "); + } + + /** + * Checks if a file exists. + * @param file The file. + * @return A boolean value indicating if the file exists. + */ + public static boolean exists(File file) { + return file.exists(); + } + + /** + * Checks if a file exists based on its extension. + * @param extension The extension. + * @return A boolean value indicating if the file exists. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean exists(String extension) throws AraraException { + File file = new File(getPath(extension)); + return file.exists(); + } + + /** + * Checks if a file has changed since the last verification. + * @param file The file. + * @return A boolean value indicating if the file has changed since the last + * verification. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean hasChanged(File file) throws AraraException { + Database database = DatabaseUtils.load(); + HashMap<String, String> map = database.getMap(); + String path = getCanonicalPath(file); + if (!file.exists()) { + if (map.containsKey(path)) { + map.remove(path); + database.setMap(map); + DatabaseUtils.save(database); + return true; + } else { + return false; + } + } else { + String hash = calculateHash(file); + if (map.containsKey(path)) { + String value = map.get(path); + if (hash.equals(value)) { + return false; + } else { + map.put(path, hash); + database.setMap(map); + DatabaseUtils.save(database); + return true; + } + } else { + map.put(path, hash); + database.setMap(map); + DatabaseUtils.save(database); + return true; + } + } + } + + /** + * Checks if the file has changed since the last verification based on the + * provided extension. + * @param extension The provided extension. + * @return A boolean value indicating if the file has changed since the last + * verification. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean hasChanged(String extension) throws AraraException { + File file = new File(getPath(extension)); + return hasChanged(file); + } + + /** + * Gets the full file path based on the provided extension. + * @param extension The extension. + * @return A string containing the full file path. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + private static String getPath(String extension) throws AraraException { + String name = getBasename(getCurrentReference()); + String path = getParentCanonicalPath(getCurrentReference()); + name = name.concat(".").concat(extension); + return buildPath(path, name); + } + + /** + * Gets the canonical path from the provided file. + * @param file The file. + * @return The canonical path from the provided file. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static String getCanonicalPath(File file) throws AraraException { + try { + return file.getCanonicalPath(); + } catch (IOException exception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_GETCANONICALPATH_IO_EXCEPTION + ), + exception + ); + } + } + + /** + * Checks if the file based on the provided extension contains the provided + * regex. + * @param extension The file extension. + * @param regex The regex. + * @return A boolean value indicating if the file contains the provided + * regex. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean checkRegex(String extension, String regex) + throws AraraException { + File file = new File(getPath(extension)); + return checkRegex(file, regex); + } + + /** + * Checks if the file contains the provided regex. + * @param file The file. + * @param regex The regex. + * @return A boolean value indicating if the file contains the provided + * regex. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean checkRegex(File file, String regex) + throws AraraException { + Charset charset = (Charset) ConfigurationController. + getInstance().get("directives.charset"); + try { + String text = FileUtils.readFileToString(file, charset.name()); + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(text); + return matcher.find(); + } catch (IOException exception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_CHECKREGEX_IO_EXCEPTION, + file.getName() + ), + exception + ); + } + } + + /** + * Replicates a string pattern based on a list of objects, generating a list + * as result. + * @param pattern The string pattern. + * @param values The list of objects to be merged with the pattern. + * @return A list containing the string pattern replicated to each object + * from the list. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static List<Object> replicateList(String pattern, + List<Object> values) throws AraraException { + List<Object> result = new ArrayList<Object>(); + for (Object value : values) { + try { + result.add(String.format(pattern, value)); + } catch (MissingFormatArgumentException exception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_REPLICATELIST_MISSING_FORMAT_ARGUMENTS_EXCEPTION + ), + exception + ); + } + } + return result; + } + + /** + * Checks if the provided operating system string holds according to the + * underlying operating system. + * @param value A string representing an operating system. + * @return A boolean value indicating if the provided string refers to the + * underlying operating system. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean checkOS(String value) throws AraraException { + Map<String, Boolean> values = new HashMap<String, Boolean>(); + values.put("windows", SystemUtils.IS_OS_WINDOWS); + values.put("linux", SystemUtils.IS_OS_LINUX); + values.put("mac", SystemUtils.IS_OS_MAC_OSX); + values.put("unix", SystemUtils.IS_OS_UNIX); + values.put("aix", SystemUtils.IS_OS_AIX); + values.put("irix", SystemUtils.IS_OS_IRIX); + values.put("os2", SystemUtils.IS_OS_OS2); + values.put("solaris", SystemUtils.IS_OS_SOLARIS); + values.put("cygwin", (Boolean) SystemCallController. + getInstance().get("cygwin")); + if (!values.containsKey(value.toLowerCase())) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_CHECKOS_INVALID_OPERATING_SYSTEM, + value + ) + ); + } + return values.get(value.toLowerCase()); + } + + /** + * Returns the exit status of the application. + * @return An integer representing the exit status of the application. + */ + public static int getExitStatus() { + return (Integer) ConfigurationController. + getInstance().get("execution.status"); + } + + /** + * Gets the system property according to the provided key, or resort to the + * fallback value if an exception is thrown or if the key is invalid. + * @param key The system property key. + * @param fallback The fallback value. + * @return A string containing the system property value or the fallback. + */ + public static String getSystemProperty(String key, String fallback) { + try { + String result = System.getProperty(key, fallback); + return result.equals("") ? fallback : result; + } catch (Exception exception) { + return fallback; + } + } + + /** + * Gets the preamble content, converting a single string into a list of + * strings, based on new lines. + * @return A list of strings representing the preamble content. + */ + public static List<String> getPreambleContent() { + if (((Boolean) ConfigurationController. + getInstance().get("execution.preamble.active")) == true) { + return new ArrayList<String>( + Arrays.asList( + ((String) ConfigurationController.getInstance(). + get("execution.preamble.content") + ).split("\n")) + ); + } + else { + return new ArrayList<String>(); + } + } + + /** + * Generates a list of filenames from the provided command based on a list + * of extensions for each underlying operating system. + * @param command A string representing the command. + * @return A list of filenames. + */ + private static List<String> appendExtensions(String command) { + + // the resulting list, to hold the + // filenames generated from the + // provided command + List<String> result = new ArrayList<String>(); + + // list of extensions, specific for + // each operating system (in fact, it + // is more Windows specific) + List<String> extensions; + + // the application is running on + // Windows, so let's look for the + // following extensions in order + if (SystemUtils.IS_OS_WINDOWS) { + + // this list is actually a sublist from + // the original Windows PATHEXT environment + // variable which holds the list of executable + // extensions that Windows supports + extensions = Arrays.asList(".com", ".exe", ".bat", ".cmd"); + } + else { + + // no Windows, so the default + // extension will be just an + // empty string + extensions = Arrays.asList(""); + } + + // for each and every extension in the + // list, let's build the corresponding + // filename and add to the result + for (String extension : extensions) { + result.add(command.concat(extension)); + } + + // return the resulting list + // holding the filenames + return result; + } + + /** + * Checks if the provided command name is reachable from the system path. + * @param command A string representing the command. + * @return A logic value. + */ + public static boolean isOnPath(String command) { + try { + + // first and foremost, let's build the list + // of filenames based on the underlying + // operating system + List<String> filenames = appendExtensions(command); + + // break the path into several parts + // based on the path separator symbol + StringTokenizer tokenizer = new StringTokenizer( + System.getenv("PATH"), + File.pathSeparator + ); + + // iterate through every part of the + // path looking for each filename + while (tokenizer.hasMoreTokens()) { + + // if the search does not return an empty + // list, one of the filenames got a match, + // and the command is available somewhere + // in the system path + if ( + !FileUtils.listFiles( + new File(tokenizer.nextToken()), + new NameFileFilter(filenames), + null + ).isEmpty()) { + + // command is found somewhere, + // so it is on path + return true; + } + } + + // nothing was found, + // command is not on path + return false; + } + catch (Exception exception) { + + // an exception was raised, simply + // return and forget about it + return false; + } + } + + /** + * Gets the full base name of a file. + * @param file The file. + * @return The corresponding full base name. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static String getFullBasename(File file) throws AraraException { + + // if the provided file does not contain a + // file separator, fallback to the usual + // base name lookup + if (!file.toString().contains(File.separator)) { + return getBasename(file); + } + else { + + // we need to get the parent file, get the + // canonical path and build the corresponding + // full base name path + File parent = file.getParentFile(); + String path = getCanonicalPath(parent == null ? file : parent); + return buildPath(path, getBasename(file)); + } + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/ConfigurationUtils.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/ConfigurationUtils.java new file mode 100644 index 00000000000..0b7d3b8a5b4 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/ConfigurationUtils.java @@ -0,0 +1,239 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.utils; + +import com.github.cereda.arara.Arara; +import com.github.cereda.arara.controller.LanguageController; +import com.github.cereda.arara.model.AraraException; +import com.github.cereda.arara.model.FileType; +import com.github.cereda.arara.model.FileTypeResource; +import com.github.cereda.arara.model.Messages; +import com.github.cereda.arara.model.Resource; +import java.io.File; +import java.io.FileReader; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.Predicate; +import org.apache.commons.lang.SystemUtils; +import org.yaml.snakeyaml.Yaml; +import org.yaml.snakeyaml.constructor.Constructor; +import org.yaml.snakeyaml.error.MarkedYAMLException; +import org.yaml.snakeyaml.nodes.Tag; +import org.yaml.snakeyaml.representer.Representer; + +/** + * Implements configuration utilitary methods. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class ConfigurationUtils { + + // the application messages obtained from the + // language controller + private static final LanguageController messages = + LanguageController.getInstance(); + + /** + * Gets the list of default file types provided by nightingale, in order. + * @return The list of default file types, in order. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static List<FileType> getDefaultFileTypes() throws AraraException { + return Arrays.asList( + new FileType("tex"), + new FileType("dtx"), + new FileType("ltx"), + new FileType("drv"), + new FileType("ins") + ); + } + + /** + * Gets the configuration file located at the user home directory, if any. + * @return The file reference to the external configuration, if any. + */ + public static File getConfigFile() { + List<String> names = Arrays.asList( + ".araraconfig.yaml", + "araraconfig.yaml", + ".arararc.yaml", + "arararc.yaml" + ); + + // look for configuration files in the user's working directory first + for (String name : names) { + String path = CommonUtils.buildPath(SystemUtils.USER_DIR, name); + File file = new File(path); + if (file.exists()) { + return file; + } + } + + // if no configuration files are found in the user's working directory, + // try to look up in a global directory, that is, the user home + for (String name : names) { + String path = CommonUtils.buildPath(SystemUtils.USER_HOME, name); + File file = new File(path); + if (file.exists()) { + return file; + } + } + return null; + } + + /** + * Validates the configuration file. + * @param file The configuration file. + * @return The configuration file as a resource. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static Resource validateConfiguration(File file) + throws AraraException { + + Representer representer = new Representer(); + representer.addClassTag(Resource.class, new Tag("!config")); + Yaml yaml = new Yaml(new Constructor(Resource.class), representer); + try { + Resource resource = yaml.loadAs(new FileReader(file), + Resource.class); + if (resource.getFiletypes() != null) { + List<FileTypeResource> filetypes = resource.getFiletypes(); + if (CollectionUtils.exists(filetypes, + new Predicate<FileTypeResource>() { + public boolean evaluate(FileTypeResource filetype) { + return (filetype.getExtension() == null); + } + })) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_CONFIGURATION_FILETYPE_MISSING_EXTENSION + ) + ); + } + } + return resource; + } catch (MarkedYAMLException yamlException) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_CONFIGURATION_INVALID_YAML + ), + yamlException + ); + } catch (Exception exception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_CONFIGURATION_GENERIC_ERROR + ) + ); + } + } + + /** + * Normalize a list of rule paths, removing all duplicates. + * @param paths The list of rule paths. + * @return A list of normalized paths, without duplicates. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static List<String> normalizePaths(List<String> paths) + throws AraraException { + paths.add(CommonUtils.buildPath(getApplicationPath(), "rules")); + Set<String> set = new LinkedHashSet<String>(paths); + List<String> result = new ArrayList<String>(set); + return result; + } + + /** + * Normalize a list of file types, removing all duplicates. + * @param types The list of file types. + * @return A list of normalized file types, without duplicates. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static List<FileType> normalizeFileTypes(List<FileType> types) + throws AraraException { + types.addAll(getDefaultFileTypes()); + Set<FileType> set = new LinkedHashSet<FileType>(types); + List<FileType> result = new ArrayList<FileType>(set); + return result; + } + + /** + * Gets the canonical absolute application path. + * @return The string representation of the canonical absolute application + * path. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static String getApplicationPath() throws AraraException { + try { + String path = Arara.class.getProtectionDomain(). + getCodeSource().getLocation().getPath(); + path = URLDecoder.decode(path, "UTF-8"); + path = new File(path).getParentFile().getPath(); + return path; + } catch (UnsupportedEncodingException exception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_GETAPPLICATIONPATH_ENCODING_EXCEPTION + ), + exception + ); + } + } + + /** + * Cleans the file name to avoid invalid entries. + * @param name The file name. + * @return A cleaned file name. + */ + public static String cleanFileName(String name) { + String result = (new File(name)).getName().trim(); + if (CommonUtils.checkEmptyString(result)) { + return "arara"; + } else { + return result.trim(); + } + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/DatabaseUtils.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/DatabaseUtils.java new file mode 100644 index 00000000000..8861ff7e5ee --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/DatabaseUtils.java @@ -0,0 +1,140 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.utils; + +import com.github.cereda.arara.controller.ConfigurationController; +import com.github.cereda.arara.controller.LanguageController; +import com.github.cereda.arara.model.AraraException; +import com.github.cereda.arara.model.Database; +import com.github.cereda.arara.model.Messages; +import java.io.File; +import org.simpleframework.xml.Serializer; +import org.simpleframework.xml.core.Persister; + +/** + * Implements database utilitary methods. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class DatabaseUtils { + + // the application messages obtained from the + // language controller + private static final LanguageController messages = + LanguageController.getInstance(); + + /** + * Loads the XML file representing the database. + * @return The database object. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static Database load() throws AraraException { + if (!exists()) { + return new Database(); + } else { + File file = new File(getPath()); + try { + Serializer serializer = new Persister(); + Database database = serializer.read(Database.class, file); + return database; + } catch (Exception exception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_LOAD_COULD_NOT_LOAD_XML, + file.getName() + ), + exception + ); + } + } + } + + /** + * Saves the database on a XML file. + * @param database The database object. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static void save(Database database) throws AraraException { + File file = new File(getPath()); + try { + Serializer serializer = new Persister(); + serializer.write(database, file); + } catch (Exception exception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_SAVE_COULD_NOT_SAVE_XML, + file.getName() + ), + exception + ); + } + } + + /** + * Checks if the XML file representing the database exists. + * @return A boolean value indicating if the XML file exists. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + private static boolean exists() throws AraraException { + File file = new File(getPath()); + return file.exists(); + } + + /** + * Gets the path to the XML file representing the database. + * @return A string representing the path to the XML file. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + private static String getPath() throws AraraException { + String name = ((String) ConfigurationController. + getInstance().get("execution.database.name")).concat(".xml"); + String path = CommonUtils.getParentCanonicalPath(getReference()); + return CommonUtils.buildPath(path, name); + } + + /** + * Gets the main file reference. + * @return The main file reference. + */ + private static File getReference() { + return (File) ConfigurationController. + getInstance().get("execution.reference"); + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/model/AraraTask.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/DirectiveAssembler.java index cd8c8d674b0..d2dd5889967 100644 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/model/AraraTask.java +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/DirectiveAssembler.java @@ -1,7 +1,6 @@ /** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,79 +30,77 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * AraraTask: This class provides the model for representing the Arara tasks - * based on the directives and rules. It's a plain old Java object. */ -// package definition -package com.github.arara.model; +package com.github.cereda.arara.utils; -// needed import -import java.util.HashMap; +import java.util.ArrayList; +import java.util.List; /** - * Provides the model for representing the Arara tasks based on the directives - * and rules. - * + * Implements a directive assembler in order to help build a directive from a + * list of strings. * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 1.0 + * @version 4.0 + * @since 4.0 */ -public class AraraTask { +public class DirectiveAssembler { - // the task name - private String name; - // a map to hold the tasks parameters - private HashMap parameters; + // this variable holds a list of + // line numbers indicating which + // lines composed the resulting + // potential directive + private final List<Integer> lineNumbers; + + // this variable holds the textual + // representation of the directive + private String text; /** - * Empty constructor. + * Constructor. */ - public AraraTask() { + public DirectiveAssembler() { + lineNumbers = new ArrayList<Integer>(); + text = ""; } - /** - * Getter for name. - * - * @return The task name. + /** + * Checks if an append operation is allowed. + * @return A boolean value indicating if an append operation is allowed. */ - public String getName() { - - // return it - return name; + public boolean isAppendAllowed() { + return !lineNumbers.isEmpty(); } /** - * Setter for name. - * - * @param name The task name. + * Adds a line number to the assembler. + * @param line An integer representing the line number. */ - public void setName(String name) { - - // set the name - this.name = name; + public void addLineNumber(int line) { + lineNumbers.add(line); } /** - * Getter for parameters. - * - * @return A map containing all the task parameters. + * Appends the provided line to the assembler text. + * @param line The provided line. */ - public HashMap getParameters() { - - // return it - return parameters; + public void appendLine(String line) { + text = text.concat(" ").concat(line.trim()); } /** - * Setter for parameters. - * - * @param parameters The task parameters as a map. + * Gets the list of line numbers. + * @return The list of line numbers. */ - public void setParameters(HashMap parameters) { + public List<Integer> getLineNumbers() { + return lineNumbers; + } - // set parameters - this.parameters = parameters; + /** + * Gets the text. + * @return The assembler text, properly trimmed. + */ + public String getText() { + return text.trim(); } + } diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/AraraResolver.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/DirectiveResolver.java index 6ac807f6564..6ea18e31ba5 100644 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/AraraResolver.java +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/DirectiveResolver.java @@ -1,7 +1,6 @@ /** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,44 +30,30 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * AraraResolver: This class extends a Resolver class to disable mapping of - * numeric times, as arara works better with text. */ -// package definition -package com.github.arara.utils; +package com.github.cereda.arara.utils; -// needed import import org.yaml.snakeyaml.nodes.Tag; import org.yaml.snakeyaml.resolver.Resolver; /** - * Extends a Resolver class to disable mapping of numeric times, as Arara works - * better with text. - * + * This class implements a directive resolver. * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 1.0 + * @version 4.0 + * @since 4.0 */ -public class AraraResolver extends Resolver { +public class DirectiveResolver extends Resolver { /** - * Adds the implicit resolvers to the Yaml mechanism. + * Adds implicit resolvers to the YAML model. For arara, I disabled + * boolean and numeric values to be automatically parsed. They still can + * be used through an explicit conversion in the rule context. */ @Override protected void addImplicitResolvers() { - - // for merges addImplicitResolver(Tag.MERGE, MERGE, "<"); - - // for null values addImplicitResolver(Tag.NULL, NULL, "~nN\0"); - - // for empty values addImplicitResolver(Tag.NULL, EMPTY, null); - - // for values - addImplicitResolver(Tag.VALUE, VALUE, "="); } + } diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/DirectiveUtils.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/DirectiveUtils.java new file mode 100644 index 00000000000..d4d2a88ac7e --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/DirectiveUtils.java @@ -0,0 +1,438 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.utils; + +import com.github.cereda.arara.controller.ConfigurationController; +import com.github.cereda.arara.controller.LanguageController; +import com.github.cereda.arara.model.AraraException; +import com.github.cereda.arara.model.Conditional; +import com.github.cereda.arara.model.Directive; +import com.github.cereda.arara.model.Messages; +import com.github.cereda.arara.model.Pair; +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.yaml.snakeyaml.DumperOptions; +import org.yaml.snakeyaml.Yaml; +import org.yaml.snakeyaml.constructor.Constructor; +import org.yaml.snakeyaml.error.MarkedYAMLException; +import org.yaml.snakeyaml.representer.Representer; + +/** + * Implements directive utilitary methods. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class DirectiveUtils { + + // the application messages obtained from the + // language controller + private static final LanguageController messages = + LanguageController.getInstance(); + + // get the logger context from a factory + private static final Logger logger = + LoggerFactory.getLogger(DirectiveUtils.class); + + /** + * Extracts a list of directives from a list of strings. + * @param lines List of strings. + * @return A list of directives. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static List<Directive> extractDirectives(List<String> lines) + throws AraraException { + + boolean header = (Boolean) ConfigurationController. + getInstance().get("execution.header"); + String regex = (String) ConfigurationController. + getInstance().get("execution.file.pattern"); + Pattern linecheck = Pattern.compile(regex); + regex = regex.concat((String) ConfigurationController. + getInstance().get("application.pattern")); + Pattern pattern = Pattern.compile(regex); + List<Pair<Integer, String>> pairs = + new ArrayList<Pair<Integer, String>>(); + Matcher matcher; + for (int i = 0; i < lines.size(); i++) { + matcher = pattern.matcher(lines.get(i)); + if (matcher.find()) { + String line = lines.get(i).substring( + matcher.end(), + lines.get(i).length() + ); + Pair<Integer, String> pair = + new Pair<Integer, String>(i + 1, line); + pairs.add(pair); + + logger.info( + messages.getMessage( + Messages.LOG_INFO_POTENTIAL_PATTERN_FOUND, + (i + 1), + line.trim() + ) + ); + } + else { + if (header) { + if (!checkLinePattern(linecheck, lines.get(i))) { + break; + } + } + } + } + + if (pairs.isEmpty()) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_VALIDATE_NO_DIRECTIVES_FOUND + ) + ); + } + + List<DirectiveAssembler> assemblers + = new ArrayList<DirectiveAssembler>(); + DirectiveAssembler assembler = new DirectiveAssembler(); + regex = (String) ConfigurationController.getInstance(). + get("directives.linebreak.pattern"); + pattern = Pattern.compile(regex); + for (Pair<Integer, String> pair : pairs) { + matcher = pattern.matcher(pair.getSecondElement()); + if (matcher.find()) { + if (!assembler.isAppendAllowed()) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_VALIDATE_ORPHAN_LINEBREAK, + pair.getFirstElement() + ) + ); + } else { + assembler.addLineNumber(pair.getFirstElement()); + assembler.appendLine(matcher.group(1)); + } + } else { + if (assembler.isAppendAllowed()) { + assemblers.add(assembler); + } + assembler = new DirectiveAssembler(); + assembler.addLineNumber(pair.getFirstElement()); + assembler.appendLine(pair.getSecondElement()); + } + } + if (assembler.isAppendAllowed()) { + assemblers.add(assembler); + } + + List<Directive> directives = new ArrayList<Directive>(); + for (DirectiveAssembler current : assemblers) { + directives.add(generateDirective(current)); + } + return directives; + + } + + /** + * Generates a directive from a directive assembler. + * @param assembler The directive assembler. + * @return The corresponding directive. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static Directive generateDirective(DirectiveAssembler assembler) + throws AraraException { + String regex = (String) ConfigurationController.getInstance(). + get("directives.pattern"); + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(assembler.getText()); + if (matcher.find()) { + Directive directive = new Directive(); + directive.setIdentifier(matcher.group(1)); + directive.setParameters( + getParameters(matcher.group(3), assembler.getLineNumbers()) + ); + Conditional conditional = new Conditional(); + conditional.setType(getType(matcher.group(5))); + conditional.setCondition(getCondition(matcher.group(6))); + directive.setConditional(conditional); + directive.setLineNumbers(assembler.getLineNumbers()); + + logger.info( + messages.getMessage( + Messages.LOG_INFO_POTENTIAL_DIRECTIVE_FOUND, + directive + ) + ); + + return directive; + } else { + throw new AraraException( + messages.getMessage( + Messages.ERROR_VALIDATE_INVALID_DIRECTIVE_FORMAT, + CommonUtils.getCollectionElements( + assembler.getLineNumbers(), + "(", + ")", + ", " + ) + ) + ); + } + } + + /** + * Gets the conditional type based on the input string. + * @param text The input string. + * @return The conditional type. + */ + private static Conditional.ConditionalType getType(String text) { + if (text == null) { + return Conditional.ConditionalType.NONE; + } else { + if (text.equals("if")) { + return Conditional.ConditionalType.IF; + } else { + if (text.equals("while")) { + return Conditional.ConditionalType.WHILE; + } else { + if (text.equals("until")) { + return Conditional.ConditionalType.UNTIL; + } else { + return Conditional.ConditionalType.UNLESS; + } + } + } + } + } + + /** + * Gets the condition from the input string. + * @param text The input string. + * @return A string representing the condition. + */ + private static String getCondition(String text) { + return text == null ? "" : text; + } + + /** + * Gets the parameters from the input string. + * @param text The input string. + * @param numbers The list of line numbers. + * @return A map containing the directive parameters. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + private static Map<String, Object> getParameters(String text, + List<Integer> numbers) throws AraraException { + + if (text == null) { + return new HashMap<String, Object>(); + } + + Yaml yaml = new Yaml( + new Constructor(), + new Representer(), + new DumperOptions(), + new DirectiveResolver() + ); + try { + @SuppressWarnings("unchecked") + HashMap<String, Object> map = yaml.loadAs(text, HashMap.class); + return map; + } catch (MarkedYAMLException exception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_VALIDATE_YAML_EXCEPTION, + CommonUtils.getCollectionElements( + numbers, + "(", + ")", + ", " + ) + ), + exception + ); + } + } + + /** + * Validates the list of directives, returning a new list. + * @param directives The list of directives. + * @return A new list of directives. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static List<Directive> validate(List<Directive> directives) + throws AraraException { + + ArrayList<Directive> result = new ArrayList<Directive>(); + for (Directive directive : directives) { + Map<String, Object> parameters = directive.getParameters(); + + if (parameters.containsKey("file")) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_VALIDATE_FILE_IS_RESERVED, + CommonUtils.getCollectionElements( + directive.getLineNumbers(), + "(", + ")", + ", " + ) + ) + ); + } + + if (parameters.containsKey("reference")) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_VALIDATE_REFERENCE_IS_RESERVED, + CommonUtils.getCollectionElements( + directive.getLineNumbers(), + "(", + ")", + ", " + ) + ) + ); + } + + if (parameters.containsKey("files")) { + + Object holder = parameters.get("files"); + if (holder instanceof List) { + @SuppressWarnings("unchecked") + List<Object> files = (List<Object>) holder; + parameters.remove("files"); + if (files.isEmpty()) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_VALIDATE_EMPTY_FILES_LIST, + CommonUtils.getCollectionElements( + directive.getLineNumbers(), + "(", + ")", + ", " + ) + ) + ); + } + for (Object file : files) { + Map<String, Object> map = new HashMap<String, Object>(); + for (String key : parameters.keySet()) { + map.put(key, parameters.get(key)); + } + File representation = CommonUtils. + getCanonicalFile(String.valueOf(file)); + + map.put("reference", representation); + map.put("file", representation.getName()); + + Directive addition = new Directive(); + Conditional conditional = new Conditional(); + conditional.setCondition(directive.getConditional(). + getCondition() + ); + conditional.setType(directive.getConditional(). + getType() + ); + addition.setIdentifier(directive.getIdentifier()); + addition.setConditional(conditional); + addition.setParameters(map); + addition.setLineNumbers(directive.getLineNumbers()); + result.add(addition); + } + } else { + throw new AraraException( + messages.getMessage( + Messages.ERROR_VALIDATE_FILES_IS_NOT_A_LIST, + CommonUtils.getCollectionElements( + directive.getLineNumbers(), + "(", + ")", + ", " + ) + ) + ); + } + } else { + File representation = (File) ConfigurationController. + getInstance().get("execution.reference"); + parameters.put("file", representation.getName()); + parameters.put("reference", representation); + directive.setParameters(parameters); + result.add(directive); + } + } + + logger.info( + messages.getMessage( + Messages.LOG_INFO_VALIDATED_DIRECTIVES + ) + ); + logger.info(DisplayUtils.displayOutputSeparator( + messages.getMessage( + Messages.LOG_INFO_DIRECTIVES_BLOCK + ) + )); + for (Directive directive : result) { + logger.info(directive.toString()); + } + + logger.info(DisplayUtils.displaySeparator()); + + return result; + } + + /** + * Checks if the provided line contains the corresponding pattern, based on + * the file type, or an empty line. + * @param pattern Pattern to be matched, based on the file type. + * @param line Provided line. + * @return Logical value indicating if the provided line contains the + * corresponding pattern, based on the file type, or an empty line. + */ + private static boolean checkLinePattern(Pattern pattern, String line) { + return CommonUtils.checkEmptyString(line.trim()) || + pattern.matcher(line).find(); + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/DisplayUtils.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/DisplayUtils.java new file mode 100644 index 00000000000..879119e60e2 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/DisplayUtils.java @@ -0,0 +1,502 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.utils; + +import com.github.cereda.arara.controller.ConfigurationController; +import com.github.cereda.arara.controller.LanguageController; +import com.github.cereda.arara.model.AraraException; +import com.github.cereda.arara.model.Conditional; +import com.github.cereda.arara.model.Messages; +import com.github.cereda.arara.model.StopWatch; +import java.io.File; +import java.util.List; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.WordUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Implements display utilitary methods. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class DisplayUtils { + + // the application messages obtained from the + // language controller + private static final LanguageController messages = + LanguageController.getInstance(); + + // get the logger context from a factory + private static final Logger logger = + LoggerFactory.getLogger(DisplayUtils.class); + + /** + * Displays the short version of the current entry in the terminal. + * @param name Rule name. + * @param task Task name. + */ + private static void buildShortEntry(String name, String task) { + int width = getWidth(); + int result = getLongestMatch(); + if (result >= width) { + result = 10; + } + int space = width - result - 1; + StringBuilder entry = new StringBuilder(); + entry.append("(").append(name).append(") "); + entry.append(task).append(" "); + String line = StringUtils.abbreviate(entry.toString(), space - 4); + entry = new StringBuilder(); + entry.append(StringUtils.rightPad(line, space, ".")).append(" "); + System.out.print(entry); + } + + /** + * Displays the short version of the current entry result in the terminal. + * @param value The boolean value to be displayed. + */ + private static void buildShortResult(boolean value) { + int result = getLongestMatch(); + System.out.println(StringUtils.leftPad(getResult(value), result)); + } + + /** + * Displays the current entry result in the terminal. + * @param value The boolean value to be displayed. + */ + public static void printEntryResult(boolean value) { + ConfigurationController.getInstance().put("display.line", false); + ConfigurationController.getInstance().put("display.result", true); + ConfigurationController.getInstance() + .put("execution.status", value ? 0 : 1); + logger.info( + messages.getMessage( + Messages.LOG_INFO_TASK_RESULT + ).concat(" ").concat(getResult(value)) + ); + if (!isDryRunMode()) { + if (!isVerboseMode()) { + buildShortResult(value); + } else { + buildLongResult(value); + } + } + } + + /** + * Displays a long version of the current entry result in the terminal. + * @param value The boolean value to be displayed + */ + private static void buildLongResult(boolean value) { + int width = getWidth(); + System.out.println("\n".concat(StringUtils.leftPad( + " ".concat(getResult(value)), width, "-" + ))); + } + + /** + * Displays the current entry in the terminal. + * @param name The rule name. + * @param task The task name. + */ + public static void printEntry(String name, String task) { + logger.info( + messages.getMessage( + Messages.LOG_INFO_INTERPRET_TASK, + task, + name + ) + ); + ConfigurationController.getInstance().put("display.line", true); + ConfigurationController.getInstance().put("display.result", false); + if (!isDryRunMode()) { + if (!isVerboseMode()) { + buildShortEntry(name, task); + } else { + buildLongEntry(name, task); + } + } else { + buildDryRunEntry(name, task); + } + } + + /** + * Gets the length of the longest result match. + * @return An integer value representing the longest result match. + */ + private static int getLongestMatch() { + String[] values = new String[]{ + messages.getMessage(Messages.INFO_LABEL_ON_SUCCESS), + messages.getMessage(Messages.INFO_LABEL_ON_FAILURE), + messages.getMessage(Messages.INFO_LABEL_ON_ERROR) + }; + int max = values[0].length(); + for (String value : values) { + if (max < value.length()) { + max = value.length(); + } + } + return max; + } + + /** + * Displays a long version of the current entry in the terminal. + * @param name Rule name. + * @param task Task name. + */ + private static void buildLongEntry(String name, String task) { + if (ConfigurationController.getInstance().contains("display.rolling")) { + addNewLine(); + } else { + ConfigurationController.getInstance().put("display.rolling", true); + } + StringBuilder line = new StringBuilder(); + line.append("(").append(name).append(") "); + line.append(task); + System.out.println(displaySeparator()); + System.out.println(StringUtils.abbreviate(line.toString(), getWidth())); + System.out.println(displaySeparator()); + } + + /** + * Displays a dry-run version of the current entry in the terminal. + * @param name The rule name. + * @param task The task name. + */ + private static void buildDryRunEntry(String name, String task) { + if (ConfigurationController.getInstance().contains("display.rolling")) { + addNewLine(); + } else { + ConfigurationController.getInstance().put("display.rolling", true); + } + StringBuilder line = new StringBuilder(); + line.append("[DR] (").append(name).append(") "); + line.append(task); + System.out.println(StringUtils.abbreviate(line.toString(), getWidth())); + System.out.println(displaySeparator()); + } + + /** + * Displays the exception in the terminal. + * @param exception The exception object. + */ + public static void printException(AraraException exception) { + ConfigurationController.getInstance().put("display.exception", true); + ConfigurationController.getInstance().put("execution.status", 2); + boolean display = false; + if (ConfigurationController.getInstance().contains("display.line")) { + display = (Boolean) ConfigurationController. + getInstance().get("display.line"); + } + if (ConfigurationController.getInstance().contains("display.result")) { + if (((Boolean) ConfigurationController. + getInstance().get("display.result")) == true) { + addNewLine(); + } + } + if (display) { + if (!isDryRunMode()) { + if (!isVerboseMode()) { + buildShortError(); + } else { + buildLongError(); + } + addNewLine(); + } + } + String text = exception.hasException() ? + exception.getMessage().concat(" ").concat( + messages.getMessage( + Messages.INFO_DISPLAY_EXCEPTION_MORE_DETAILS + ) + ) + : exception.getMessage(); + logger.error(text); + wrapText(text); + if (exception.hasException()) { + addNewLine(); + displayDetailsLine(); + String details = exception.getException().getMessage(); + logger.error(details); + wrapText(details); + } + } + + /** + * Gets the string representation of the provided boolean value. + * @param value The boolean value. + * @return The string representation. + */ + private static String getResult(boolean value) { + return (value == true ? + messages.getMessage( + Messages.INFO_LABEL_ON_SUCCESS + ) + : messages.getMessage(Messages.INFO_LABEL_ON_FAILURE)); + } + + /** + * Displays the short version of an error in the terminal. + */ + private static void buildShortError() { + int result = getLongestMatch(); + System.out.println(StringUtils.leftPad( + messages.getMessage( + Messages.INFO_LABEL_ON_ERROR + ), + result + )); + } + + /** + * Displays the long version of an error in the terminal. + */ + private static void buildLongError() { + String line = StringUtils.leftPad( + " ".concat(messages.getMessage(Messages.INFO_LABEL_ON_ERROR)), + getWidth(), "-"); + System.out.println(line); + } + + /** + * Gets the default terminal width defined in the settings. + * @return An integer representing the terminal width. + */ + private static int getWidth() { + return (Integer) ConfigurationController. + getInstance().get("application.width"); + } + + /** + * Displays the provided text wrapped nicely according to the default + * terminal width. + * @param text The text to be displayed. + */ + public static void wrapText(String text) { + System.out.println(WordUtils.wrap(text, getWidth())); + } + + /** + * Checks if the execution is in dry-run mode. + * @return A boolean value indicating if the execution is in dry-run mode. + */ + private static boolean isDryRunMode() { + return (Boolean) ConfigurationController. + getInstance().get("execution.dryrun"); + } + + /** + * Checks if the execution is in verbose mode. + * @return A boolean value indicating if the execution is in verbose mode. + */ + private static boolean isVerboseMode() { + return (Boolean) ConfigurationController. + getInstance().get("execution.verbose"); + } + + /** + * Displays the rule authors in the terminal. + * @param authors The list of authors. + */ + public static void printAuthors(List<String> authors) { + StringBuilder line = new StringBuilder(); + line.append(authors.size() == 1 ? + messages.getMessage(Messages.INFO_LABEL_AUTHOR) + : messages.getMessage(Messages.INFO_LABEL_AUTHORS)); + String text = authors.isEmpty() ? + messages.getMessage(Messages.INFO_LABEL_NO_AUTHORS) + : CommonUtils.getCollectionElements( + CommonUtils.trimSpaces(authors), "", "", ", "); + line.append(" ").append(text); + wrapText(line.toString()); + } + + /** + * Displays the current conditional in the terminal. + * @param conditional The conditional object. + */ + public static void printConditional(Conditional conditional) { + if (conditional.getType() != Conditional.ConditionalType.NONE) { + StringBuilder line = new StringBuilder(); + line.append(messages.getMessage(Messages.INFO_LABEL_CONDITIONAL)); + line.append(" ("); + line.append(String.valueOf(conditional.getType())); + line.append(") ").append(conditional.getCondition()); + wrapText(line.toString()); + } + } + + /** + * Displays the file information in the terminal. + */ + public static void printFileInformation() { + File file = (File) ConfigurationController. + getInstance().get("execution.reference"); + String version = (String) ConfigurationController. + getInstance().get("application.version"); + String revision = (String) ConfigurationController. + getInstance().get("application.revision"); + String line = messages.getMessage( + Messages.INFO_DISPLAY_FILE_INFORMATION, + file.getName(), + CommonUtils.calculateFileSize(file), + CommonUtils.getLastModifiedInformation(file) + ); + logger.info(messages.getMessage( + Messages.LOG_INFO_WELCOME_MESSAGE, + version, + revision + )); + logger.info(displaySeparator()); + logger.info(String.format("::: arara @ %s", + getApplicationPath() + )); + logger.info(String.format("::: Java %s, %s", + CommonUtils.getSystemProperty("java.version", + "[unknown version]"), + CommonUtils.getSystemProperty("java.vendor", + "[unknown vendor]") + )); + logger.info(String.format("::: %s", + CommonUtils.getSystemProperty("java.home", + "[unknown location]") + )); + logger.info(String.format("::: %s, %s, %s", + CommonUtils.getSystemProperty("os.name", + "[unknown OS name]"), + CommonUtils.getSystemProperty("os.arch", + "[unknown OS arch]"), + CommonUtils.getSystemProperty("os.version", + "[unknown OS version]") + )); + logger.info(String.format("::: user.home @ %s", + CommonUtils.getSystemProperty("user.home", + "[unknown user's home directory]") + )); + logger.info(String.format("::: user.dir @ %s", + CommonUtils.getSystemProperty("user.dir", + "[unknown user's working directory]") + )); + logger.info(String.format("::: CF @ %s", + (String) ConfigurationController. + getInstance().get("execution.configuration.name") + )); + logger.info(displaySeparator()); + logger.info(line); + wrapText(line); + addNewLine(); + } + + /** + * Displays the elapsed time in the terminal. + */ + public static void printTime() { + if (ConfigurationController.getInstance().contains("display.time")) { + if ((ConfigurationController.getInstance().contains("display.line")) + || (ConfigurationController.getInstance(). + contains("display.exception"))) { + addNewLine(); + } + String text = messages.getMessage( + Messages.INFO_DISPLAY_EXECUTION_TIME, StopWatch.getTime()); + logger.info(text); + wrapText(text); + } + } + + /** + * Displays the application logo in the terminal. + */ + public static void printLogo() { + StringBuilder builder = new StringBuilder(); + builder.append(" __ _ _ __ __ _ _ __ __ _ ").append("\n"); + builder.append(" / _` | '__/ _` | '__/ _` |").append("\n"); + builder.append("| (_| | | | (_| | | | (_| |").append("\n"); + builder.append(" \\__,_|_| \\__,_|_| \\__,_|"); + System.out.println(builder.toString()); + addNewLine(); + } + + /** + * Adds a new line in the terminal. + */ + private static void addNewLine() { + System.out.println(); + } + + /** + * Displays a line containing details. + */ + private static void displayDetailsLine() { + String line = messages.getMessage( + Messages.INFO_LABEL_ON_DETAILS).concat(" "); + line = StringUtils.rightPad( + StringUtils.abbreviate(line, getWidth()), getWidth(), "-"); + System.out.println(line); + } + + /** + * Gets the output separator with the provided text. + * @param message The provided text. + * @return A string containing the output separator with the provided text. + */ + public static String displayOutputSeparator(String message) { + return StringUtils.center(" ".concat(message).concat(" "), + getWidth(), "-"); + } + + /** + * Gets the line separator. + * @return A string containing the line separator. + */ + public static String displaySeparator() { + return StringUtils.repeat("-", getWidth()); + } + + /** + * Gets the application path. + * @return A string containing the application path. + */ + private static String getApplicationPath() { + try { + return ConfigurationUtils.getApplicationPath(); + } + catch (AraraException ae) { + return "[unknown application path]"; + } + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/FileHandlingUtils.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/FileHandlingUtils.java new file mode 100644 index 00000000000..9f56c92f5d9 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/FileHandlingUtils.java @@ -0,0 +1,124 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.utils; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.apache.commons.io.FileUtils; + +/** + * Implements file handling utilitary methods. + * + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class FileHandlingUtils { + + /** + * Writes the string to a file, using UTF-8 as default encoding. + * @param file The file. + * @param text The string to be written. + * @param append A flag whether to append the content. + * @return A logical value indicating whether it was successful. + */ + public static boolean writeToFile(File file, String text, boolean append) { + try { + + // try to write the provided + // string to the file, with + // UTF-8 as encoding + FileUtils.writeStringToFile(file, text, "UTF-8", append); + return true; + + } catch (IOException nothandled) { + + // if something bad happens, + // gracefully fallback to + // reporting the failure + return false; + } + } + + /** + * Writes the string list to a file, using UTF-8 as default encoding. + * @param file The file. + * @param lines The string list to be written. + * @param append A flag whether to append the content. + * @return A logical value indicating whether it was successful. + */ + public static boolean writeToFile(File file, List<String> lines, + boolean append) { + try { + + // try to write the provided + // string lists to the file, + // with UTF-8 as encoding + FileUtils.writeLines(file, "UTF-8", lines, append); + return true; + + } catch (IOException nothandled) { + + // if something bad happens, + // gracefully fallback to + // reporting the failure + return false; + } + } + + /** + * Reads the provided file into a list of strings. + * @param file The file. + * @return A list of strings. + */ + public static List<String> readFromFile(File file) { + try { + + // returns the contents of + // the provided file as + // a list of strings + return FileUtils.readLines(file, "UTF-8"); + + } catch (IOException nothandled) { + + // if something bad happens, + // gracefully fallback to + // an empty file list + return new ArrayList<String>(); + } + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/FileSearchingUtils.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/FileSearchingUtils.java new file mode 100644 index 00000000000..473674cbc50 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/FileSearchingUtils.java @@ -0,0 +1,117 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.utils; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.filefilter.FalseFileFilter; +import org.apache.commons.io.filefilter.TrueFileFilter; +import org.apache.commons.io.filefilter.WildcardFileFilter; + +/** + * Implements file searching utilitary methods. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class FileSearchingUtils { + + /** + * List all files from the provided directory according to the list of + * extensions. The leading dot must be omitted, unless it is part of the + * extension. + * @param directory The provided directory. + * @param extensions The list of extensions. + * @param recursive A flag indicating whether the search is recursive. + * @return A list of files. + */ + public static List<File> listFilesByExtensions(File directory, + List<String> extensions, boolean recursive) { + try { + + // convert the provided extension + // list to an extension array + String[] array = new String[extensions.size()]; + array = extensions.toArray(array); + + // return the result of the + // provided search + return new ArrayList<File>( + FileUtils.listFiles(directory, array, recursive) + ); + } catch (Exception nothandled) { + + // if something bad happens, + // gracefully fallback to + // an empty file list + return new ArrayList<File>(); + } + } + + /** + * List all files from the provided directory matching the list of file + * name patterns. Such list can contain wildcards. + * @param directory The provided directory. + * @param patterns The list of file name patterns. + * @param recursive A flag indicating whether the search is recursive. + * @return A list of files. + */ + public static List<File> listFilesByPatterns(File directory, + List<String> patterns, boolean recursive) { + try { + + // return the result of the provided + // search, with the wildcard filter + // and a potential recursive search + return new ArrayList<File>( + FileUtils.listFiles( + directory, + new WildcardFileFilter(patterns), + recursive + ? TrueFileFilter.INSTANCE + : FalseFileFilter.INSTANCE + ) + ); + } catch (Exception nothandled) { + + // if something bad happens, + // gracefully fallback to + // an empty file list + return new ArrayList<File>(); + } + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/InterpreterUtils.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/InterpreterUtils.java new file mode 100644 index 00000000000..978cb07374f --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/InterpreterUtils.java @@ -0,0 +1,257 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.utils; + +import com.github.cereda.arara.controller.ConfigurationController; +import com.github.cereda.arara.controller.LanguageController; +import com.github.cereda.arara.model.AraraException; +import com.github.cereda.arara.model.Argument; +import com.github.cereda.arara.model.Command; +import com.github.cereda.arara.model.Conditional; +import com.github.cereda.arara.model.Messages; +import com.github.cereda.arara.model.Rule; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.Transformer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.zeroturnaround.exec.InvalidExitValueException; +import org.zeroturnaround.exec.ProcessExecutor; +import org.zeroturnaround.exec.listener.ShutdownHookProcessDestroyer; + +/** + * Implements interpreter utilitary methods. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class InterpreterUtils { + + // the application messages obtained from the + // language controller + private static final LanguageController messages = + LanguageController.getInstance(); + + // get the logger context from a factory + private static final Logger logger = + LoggerFactory.getLogger(InterpreterUtils.class); + + /** + * Gets a list of all rule arguments. + * @param rule The provided rule. + * @return A list of strings containing all rule arguments. + */ + public static List<String> getRuleArguments(Rule rule) { + Collection<String> result = CollectionUtils.collect( + rule.getArguments(), new Transformer<Argument, String>() { + public String transform(Argument input) { + return input.getIdentifier(); + } + }); + return new ArrayList<String>(result); + } + + /** + * Checks if the current conditional has a prior evaluation. + * @param conditional The current conditional object. + * @return A boolean value indicating if the current conditional has a prior + * evaluation. + */ + public static boolean runPriorEvaluation(Conditional conditional) { + if (((Boolean) ConfigurationController.getInstance(). + get("execution.dryrun")) == true) { + return false; + } + switch (conditional.getType()) { + case IF: + case WHILE: + case UNLESS: + return true; + default: + return false; + } + } + + /** + * Runs the command in the underlying operating system. + * @param command An object representing the command. + * @return An integer value representing the exit code. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static int run(Object command) throws AraraException { + boolean verbose = (Boolean) ConfigurationController. + getInstance().get("execution.verbose"); + boolean timeout = (Boolean) ConfigurationController. + getInstance().get("execution.timeout"); + long value = (Long) ConfigurationController. + getInstance().get("execution.timeout.value"); + TimeUnit unit = (TimeUnit) ConfigurationController. + getInstance().get("execution.timeout.unit"); + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + ProcessExecutor executor = new ProcessExecutor(); + if (CommonUtils.checkClass(Command.class, command)) { + executor = executor.command(((Command) command).getElements()); + if (((Command) command).hasWorkingDirectory()) { + executor = executor.directory( + ((Command) command).getWorkingDirectory() + ); + } + } else { + executor = executor.commandSplit((String) command); + } + if (timeout) { + if (value == 0) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_RUN_TIMEOUT_INVALID_RANGE + ) + ); + } + executor = executor.timeout(value, unit); + } + TeeOutputStream tee; + if (verbose) { + tee = new TeeOutputStream(System.out, buffer); + executor = executor.redirectInput(System.in); + } else { + tee = new TeeOutputStream(buffer); + } + executor = executor.redirectOutput(tee).redirectError(tee); + ShutdownHookProcessDestroyer hook = new ShutdownHookProcessDestroyer(); + executor = executor.addDestroyer(hook); + try { + int exit = executor.execute().getExitValue(); + logger.info(DisplayUtils.displayOutputSeparator( + messages.getMessage( + Messages.LOG_INFO_BEGIN_BUFFER + ) + )); + logger.info(buffer.toString()); + logger.info(DisplayUtils.displayOutputSeparator( + messages.getMessage( + Messages.LOG_INFO_END_BUFFER + ) + )); + return exit; + } catch (IOException ioexception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_RUN_IO_EXCEPTION + ), + ioexception + ); + } catch (InterruptedException iexception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_RUN_INTERRUPTED_EXCEPTION + ), + iexception + ); + } catch (InvalidExitValueException ievexception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_RUN_INVALID_EXIT_VALUE_EXCEPTION + ), + ievexception + ); + } catch (TimeoutException texception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_RUN_TIMEOUT_EXCEPTION + ), + texception + ); + } catch (Exception exception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_RUN_GENERIC_EXCEPTION + ), + exception + ); + } + } + + /** + * Builds the rule path based on the rule name and returns the corresponding + * file location. + * @param name The rule name. + * @return The rule file. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static File buildRulePath(String name) throws AraraException { + @SuppressWarnings("unchecked") + List<String> paths = (List<String>) ConfigurationController. + getInstance().get("execution.rule.paths"); + for (String path : paths) { + File location = new File(construct(path, name)); + if (location.exists()) { + return location; + } + } + return null; + } + + /** + * Constructs the path given the current path and the rule name. + * @param path The current path. + * @param name The rule name. + * @return The constructed path. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static String construct(String path, String name) + throws AraraException { + name = name.concat(".yaml"); + File location = new File(path); + if (location.isAbsolute()) { + return CommonUtils.buildPath(path, name); + } else { + File reference = (File) ConfigurationController. + getInstance().get("execution.reference"); + String parent = CommonUtils.buildPath( + CommonUtils.getParentCanonicalPath(reference), path); + return CommonUtils.buildPath(parent, name); + } + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/MessageUtils.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/MessageUtils.java new file mode 100644 index 00000000000..52a5d095a8e --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/MessageUtils.java @@ -0,0 +1,313 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.utils; + +import com.github.cereda.arara.controller.ConfigurationController; +import javax.swing.JOptionPane; +import javax.swing.UIManager; + +/** + * Implements utilitary methods for displaying messages. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class MessageUtils { + + // holds the default width for the + // message body, in pixels + private static final int WIDTH = 250; + + // let's start the UI manager and set + // the default look and feel to be as + // close as possible to the system + static { + + // get the current look and feel + String laf = (String) ConfigurationController. + getInstance().get("ui.lookandfeel"); + + // check if one is actually set + if (!laf.equals("none")) { + + // use a special keyword to indicate + // the use of a system look and feel + if (laf.equals("system")) { + laf = UIManager.getSystemLookAndFeelClassName(); + } + + // let's try it, in case it fails, + // rely to the default look and feel + try { + + // get the system look and feel name + // and try to set it as default + UIManager.setLookAndFeel(laf); + } + catch (Exception exception) { + // quack, quack, quack + } + + } + } + + /** + * Normalizes the icon type to one of the five available icons. + * @param value An integer value. + * @return The normalized integer value. + */ + private static int normalizeIconType(int value) { + + // do the normalization according to the available + // icons in the underlying message implementation + switch (value) { + case 1: + value = JOptionPane.ERROR_MESSAGE; + break; + case 2: + value = JOptionPane.INFORMATION_MESSAGE; + break; + case 3: + value = JOptionPane.WARNING_MESSAGE; + break; + case 4: + value = JOptionPane.QUESTION_MESSAGE; + break; + default: + value = JOptionPane.PLAIN_MESSAGE; + break; + } + return value; + } + + /** + * Normalizes the message width, so only valid nonzero values are accepted. + * @param value An integer value corresponding to the message width. + * @return The normalized width. + */ + private static int normalizeMessageWidth(int value) { + return (value > 0 ? value : WIDTH); + } + + /** + * Shows the message. + * @param width Integer value, in pixels. + * @param type Type of message. + * @param title Title of the message. + * @param text Text of the message. + */ + public static void showMessage(int width, int type, + String title, String text) { + + // effectively shows the message based + // on the provided parameters + JOptionPane.showMessageDialog( + null, + String.format( + "<html><body style=\"width:%dpx\">%s</body></html>", + normalizeMessageWidth(width), + text + ), + title, + normalizeIconType(type) + ); + } + + /** + * Shows the message. It relies on the default width. + * @param type Type of message. + * @param title Title of the message. + * @param text Text of the message. + */ + public static void showMessage(int type, String title, String text) { + showMessage(WIDTH, type, title, text); + } + + /** + * Shows a message with options presented as an array of buttons. + * @param width Integer value, in pixels. + * @param type Type of message. + * @param title Title of the message. + * @param text Text of the message. + * @param buttons An array of objects to be presented as buttons. + * @return The index of the selected button, starting from 1. + */ + public static int showOptions(int width, int type, String title, + String text, Object... buttons) { + + // returns the index of the selected button, + // zero if nothing is selected + return JOptionPane.showOptionDialog( + null, + String.format( + "<html><body style=\"width:%dpx\">%s</body></html>", + normalizeMessageWidth(width), + text + ), + title, + JOptionPane.DEFAULT_OPTION, + normalizeIconType(type), + null, + buttons, + buttons[0] + ) + 1; + } + + /** + * Shows a message with options presented as an array of buttons. It relies + * on the default width. + * @param type Type of message. + * @param title Title of the message. + * @param text Text of the message. + * @param buttons An array of objects to be presented as buttons. + * @return The index of the selected button, starting from 1. + */ + public static int showOptions(int type, String title, + String text, Object... buttons) { + return showOptions(WIDTH, type, title, text, buttons); + } + + /** + * Shows a message with a text input. + * @param width Integer value, in pixels. + * @param type Type of message. + * @param title Title of the message. + * @param text Text of the message. + * @return The string representing the input text. + */ + public static String showInput(int width, int type, + String title, String text) { + + // get the string from the + // input text, if any + String input = JOptionPane.showInputDialog( + null, + String.format( + "<html><body style=\"width:%dpx\">%s</body></html>", + normalizeMessageWidth(width), + text + ), + title, + normalizeIconType(type) + ); + + // if the input is not null, that is, + // the user actually typed something + if (input != null) { + + // return the trimmed string + return input.trim(); + } + + // nothing was typed, so let's + // return an empty string + return ""; + } + + /** + * Shows a message with a text input. It relies on the default width. + * @param type Type of message. + * @param title Title of the message. + * @param text Text of the message. + * @return The string representing the input text. + */ + public static String showInput(int type, String title, String text) { + return showInput(WIDTH, type, title, text); + } + + /** + * Shows a message with options presented as a dropdown list of elements. + * @param width Integer value, in pixels. + * @param type Type of message. + * @param title Title of the message. + * @param text Text of the message. + * @param elements An array of objects representing the elements. + * @return The index of the selected element, starting from 1. + */ + public static int showDropdown(int width, int type, String title, + String text, Object... elements) { + + // show the dropdown list and get + // the selected object, if any + Object index = JOptionPane.showInputDialog( + null, + String.format( + "<html><body style=\"width:%dpx\">%s</body></html>", + normalizeMessageWidth(width), + text + ), + title, + normalizeIconType(type), + null, + elements, + elements[0] + ); + + // if it's not a null object, let's + // find the corresponding index + if (index != null) { + + // iterate through the array of elements + for (int i = 0; i < elements.length; i++) { + + // if the element is found, simply + // return the index plus 1, as zero + // corresponds to no selection at all + if (elements[i].equals(index)) { + return i + 1; + } + + } + } + + // nothing was selected, + // simply return zero + return 0; + } + + /** + * Shows a message with options presented as a dropdown list of elements. It + * relies on the default width. + * @param type Type of message. + * @param title Title of the message. + * @param text Text of the message. + * @param elements An array of objects representing the elements. + * @return The index of the selected element, starting from 1. + */ + public static int showDropdown(int type, String title, + String text, Object... elements) { + return showDropdown(WIDTH, type, title, text, elements); + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/Methods.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/Methods.java new file mode 100644 index 00000000000..15c66049342 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/Methods.java @@ -0,0 +1,1356 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.utils; + +import com.github.cereda.arara.controller.ConfigurationController; +import com.github.cereda.arara.controller.LanguageController; +import com.github.cereda.arara.model.AraraException; +import com.github.cereda.arara.model.Command; +import com.github.cereda.arara.model.Messages; +import com.github.cereda.arara.model.Pair; +import com.github.cereda.arara.model.Session; +import com.github.cereda.arara.model.Trigger; +import java.io.File; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * Implements some auxiliary methods for runtime evaluation. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class Methods { + + // the language controller + private static final LanguageController messages = + LanguageController.getInstance(); + + // the session controller + private static final Session session = new Session(); + + /** + * Adds the rule methods to the provided map. + * @param map The map. + */ + public static void addRuleMethods(Map<String, Object> map) { + addConditionalMethods(map); + try { + map.put("getOriginalFile", Methods.class.getMethod("getOriginalFile")); + map.put("getOriginalReference", Methods.class.getMethod("getOriginalReference")); + map.put("isEmpty", Methods.class.getMethod("isEmpty", String.class)); + map.put("isNotEmpty", Methods.class.getMethod("isNotEmpty", String.class)); + map.put("isEmpty", Methods.class.getMethod("isEmpty", String.class, Object.class)); + map.put("isNotEmpty", Methods.class.getMethod("isNotEmpty", String.class, Object.class)); + map.put("isEmpty", Methods.class.getMethod("isEmpty", String.class, Object.class, Object.class)); + map.put("isNotEmpty", Methods.class.getMethod("isNotEmpty", String.class, Object.class, Object.class)); + map.put("isTrue", Methods.class.getMethod("isTrue", String.class)); + map.put("isFalse", Methods.class.getMethod("isFalse", String.class)); + map.put("isTrue", Methods.class.getMethod("isTrue", String.class, Object.class)); + map.put("isFalse", Methods.class.getMethod("isFalse", String.class, Object.class)); + map.put("isTrue", Methods.class.getMethod("isTrue", String.class, Object.class, Object.class)); + map.put("isFalse", Methods.class.getMethod("isFalse", String.class, Object.class, Object.class)); + map.put("isTrue", Methods.class.getMethod("isTrue", String.class, Object.class, Object.class, Object.class)); + map.put("isFalse", Methods.class.getMethod("isFalse", String.class, Object.class, Object.class, Object.class)); + map.put("trimSpaces", Methods.class.getMethod("trimSpaces", String.class)); + map.put("isTrue", Methods.class.getMethod("isTrue", boolean.class, Object.class)); + map.put("isFalse", Methods.class.getMethod("isFalse", boolean.class, Object.class)); + map.put("isTrue", Methods.class.getMethod("isTrue", boolean.class, Object.class, Object.class)); + map.put("isFalse", Methods.class.getMethod("isFalse", boolean.class, Object.class, Object.class)); + map.put("getBasename", Methods.class.getMethod("getBasename", File.class)); + map.put("getBasename", Methods.class.getMethod("getBasename", String.class)); + map.put("getFullBasename", Methods.class.getMethod("getFullBasename", File.class)); + map.put("getFullBasename", Methods.class.getMethod("getFullBasename", String.class)); + map.put("getFiletype", Methods.class.getMethod("getFiletype", File.class)); + map.put("getFiletype", Methods.class.getMethod("getFiletype", String.class)); + map.put("throwError", Methods.class.getMethod("throwError", String.class)); + map.put("getSession", Methods.class.getMethod("getSession")); + map.put("isWindows", Methods.class.getMethod("isWindows")); + map.put("isLinux", Methods.class.getMethod("isLinux")); + map.put("isMac", Methods.class.getMethod("isMac")); + map.put("isUnix", Methods.class.getMethod("isUnix")); + map.put("isAIX", Methods.class.getMethod("isAIX")); + map.put("isIrix", Methods.class.getMethod("isIrix")); + map.put("isOS2", Methods.class.getMethod("isOS2")); + map.put("isSolaris", Methods.class.getMethod("isSolaris")); + map.put("isCygwin", Methods.class.getMethod("isCygwin")); + map.put("isWindows", Methods.class.getMethod("isWindows", Object.class, Object.class)); + map.put("isLinux", Methods.class.getMethod("isLinux", Object.class, Object.class)); + map.put("isMac", Methods.class.getMethod("isMac", Object.class, Object.class)); + map.put("isUnix", Methods.class.getMethod("isUnix", Object.class, Object.class)); + map.put("isAIX", Methods.class.getMethod("isAIX", Object.class, Object.class)); + map.put("isIrix", Methods.class.getMethod("isIrix", Object.class, Object.class)); + map.put("isOS2", Methods.class.getMethod("isOS2", Object.class, Object.class)); + map.put("isSolaris", Methods.class.getMethod("isSolaris", Object.class, Object.class)); + map.put("isCygwin", Methods.class.getMethod("isCygwin", Object.class, Object.class)); + map.put("replicatePattern", Methods.class.getMethod("replicatePattern", String.class, List.class)); + map.put("buildString", Methods.class.getMethod("buildString", Object[].class)); + map.put("addQuotes", Methods.class.getMethod("addQuotes", Object.class)); + map.put("getCommand", Methods.class.getMethod("getCommand", List.class)); + map.put("getCommand", Methods.class.getMethod("getCommand", Object[].class)); + map.put("getTrigger", Methods.class.getMethod("getTrigger", String.class)); + map.put("getTrigger", Methods.class.getMethod("getTrigger", String.class, Object[].class)); + map.put("checkClass", Methods.class.getMethod("checkClass", Class.class, Object.class)); + map.put("isString", Methods.class.getMethod("isString", Object.class)); + map.put("isList", Methods.class.getMethod("isList", Object.class)); + map.put("isMap", Methods.class.getMethod("isMap", Object.class)); + map.put("isBoolean", Methods.class.getMethod("isBoolean", Object.class)); + map.put("isVerboseMode", Methods.class.getMethod("isVerboseMode")); + map.put("showMessage", Methods.class.getMethod("showMessage", int.class, String.class, String.class)); + map.put("showMessage", Methods.class.getMethod("showMessage", int.class, int.class, String.class, String.class)); + map.put("isOnPath", Methods.class.getMethod("isOnPath", String.class)); + map.put("unsafelyExecuteSystemCommand", Methods.class.getMethod("unsafelyExecuteSystemCommand", Command.class)); + map.put("mergeVelocityTemplate", Methods.class.getMethod("mergeVelocityTemplate", File.class, File.class, Map.class)); + map.put("getCommandWithWorkingDirectory", Methods.class.getMethod("getCommandWithWorkingDirectory", String.class, List.class)); + map.put("getCommandWithWorkingDirectory", Methods.class.getMethod("getCommandWithWorkingDirectory", String.class, Object[].class)); + map.put("getCommandWithWorkingDirectory", Methods.class.getMethod("getCommandWithWorkingDirectory", File.class, List.class)); + map.put("getCommandWithWorkingDirectory", Methods.class.getMethod("getCommandWithWorkingDirectory", File.class, Object[].class)); + map.put("listFilesByExtensions", Methods.class.getMethod("listFilesByExtensions", File.class, List.class, boolean.class)); + map.put("listFilesByExtensions", Methods.class.getMethod("listFilesByExtensions", String.class, List.class, boolean.class)); + map.put("listFilesByPatterns", Methods.class.getMethod("listFilesByPatterns", File.class, List.class, boolean.class)); + map.put("listFilesByPatterns", Methods.class.getMethod("listFilesByPatterns", String.class, List.class, boolean.class)); + map.put("writeToFile", Methods.class.getMethod("writeToFile", File.class, String.class, boolean.class)); + map.put("writeToFile", Methods.class.getMethod("writeToFile", File.class, List.class, boolean.class)); + map.put("writeToFile", Methods.class.getMethod("writeToFile", String.class, String.class, boolean.class)); + map.put("writeToFile", Methods.class.getMethod("writeToFile", String.class, List.class, boolean.class)); + map.put("readFromFile", Methods.class.getMethod("readFromFile", File.class)); + map.put("readFromFile", Methods.class.getMethod("readFromFile", String.class)); + } catch (Exception exception) { + // quack, quack, quack + } + } + + /** + * Adds conditional methods to the provided map. + * @param map The map. + */ + public static void addConditionalMethods(Map<String, Object> map) { + try { + map.put("exists", Methods.class.getMethod("exists", String.class)); + map.put("exists", Methods.class.getMethod("exists", File.class)); + map.put("missing", Methods.class.getMethod("missing", String.class)); + map.put("missing", Methods.class.getMethod("missing", File.class)); + map.put("changed", Methods.class.getMethod("changed", String.class)); + map.put("changed", Methods.class.getMethod("changed", File.class)); + map.put("unchanged", Methods.class.getMethod("unchanged", String.class)); + map.put("unchanged", Methods.class.getMethod("unchanged", File.class)); + map.put("found", Methods.class.getMethod("found", String.class, String.class)); + map.put("found", Methods.class.getMethod("found", File.class, String.class)); + map.put("toFile", Methods.class.getMethod("toFile", String.class)); + map.put("showDropdown", Methods.class.getMethod("showDropdown", int.class, String.class, String.class, Object[].class)); + map.put("showDropdown", Methods.class.getMethod("showDropdown", int.class, int.class, String.class, String.class, Object[].class)); + map.put("showInput", Methods.class.getMethod("showInput", int.class, String.class, String.class)); + map.put("showInput", Methods.class.getMethod("showInput", int.class, int.class, String.class, String.class)); + map.put("showOptions", Methods.class.getMethod("showOptions", int.class, String.class, String.class, Object[].class)); + map.put("showOptions", Methods.class.getMethod("showOptions", int.class, int.class, String.class, String.class, Object[].class)); + map.put("currentFile", Methods.class.getMethod("currentFile")); + map.put("loadClass", Methods.class.getMethod("loadClass", File.class, String.class)); + map.put("loadClass", Methods.class.getMethod("loadClass", String.class, String.class)); + map.put("loadObject", Methods.class.getMethod("loadObject", File.class, String.class)); + map.put("loadObject", Methods.class.getMethod("loadObject", String.class, String.class)); + } catch (Exception exception) { + // quack, quack, quack + } + } + + /** + * Gets the original file. + * @return The original file. + */ + public static String getOriginalFile() { + File file = (File) ConfigurationController.getInstance().get("execution.reference"); + return file.getName(); + } + + /** + * Gets the original reference. + * @return The original reference. + */ + public static File getOriginalReference() { + return (File) ConfigurationController.getInstance().get("execution.reference"); + } + + /** + * Checks if the string is empty. + * @param string The string. + * @return A boolean value. + */ + public static boolean isEmpty(String string) { + return CommonUtils.checkEmptyString(string); + } + + /** + * Checks if the string is not empty. + * @param string The string. + * @return A boolean value. + */ + public static boolean isNotEmpty(String string) { + return !isEmpty(string); + } + + /** + * Checks if the string is empty. + * @param string The string. + * @param yes Object to return if true. + * @return An object or empty string. + */ + public static Object isEmpty(String string, Object yes) { + return isEmpty(string) ? yes : ""; + } + + /** + * Checks if the string is not empty. + * @param string The string. + * @param yes Object to return if true. + * @return An object or empty string. + */ + public static Object isNotEmpty(String string, Object yes) { + return isNotEmpty(string) ? yes : ""; + } + + /** + * Checks if the string is empty. + * @param string The string. + * @param yes Object to return if true. + * @param no Object to return if false. + * @return One of the two objects. + */ + public static Object isEmpty(String string, Object yes, Object no) { + return isEmpty(string) ? yes : no; + } + + /** + * Checks if the string is not empty. + * @param string The string. + * @param yes Object to return if true. + * @param no Object to return if false. + * @return One of the two objects. + */ + public static Object isNotEmpty(String string, Object yes, Object no) { + return isNotEmpty(string) ? yes : no; + } + + /** + * Checks if the string holds a true value. + * @param string The string. + * @return A boolean value. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean isTrue(String string) throws AraraException { + return isEmpty(string) ? false : CommonUtils.checkBoolean(string); + } + + /** + * Checks if the string holds a false value. + * @param string The string. + * @return A boolean value. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean isFalse(String string) throws AraraException { + return isEmpty(string) ? false : !CommonUtils.checkBoolean(string); + } + + /** + * Checks if the string holds a true value. + * @param string The string. + * @param yes Object to return if true. + * @return An object or an empty string. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static Object isTrue(String string, Object yes) + throws AraraException { + return isTrue(string) ? yes : ""; + } + + /** + * Checks if the string holds a false value. + * @param string The string. + * @param yes Object to return if true. + * @return An object or an empty string. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static Object isFalse(String string, Object yes) + throws AraraException { + return (isFalse(string) ? yes : ""); + } + + /** + * Checks if the string holds a true value. + * @param string The string. + * @param yes Object to return if true. + * @param no Object to return if false. + * @return One of the two objects. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static Object isTrue(String string, Object yes, Object no) + throws AraraException { + return (isTrue(string) ? yes : no); + } + + /** + * Checks if the string holds a false value. + * @param string The string. + * @param yes Object to return if true. + * @param no Object to return if false. + * @return One of the two objects. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static Object isFalse(String string, Object yes, Object no) + throws AraraException { + return (isFalse(string) ? yes : no); + } + + /** + * Checks if the string holds a true value. + * @param string The string. + * @param yes Object to return if true. + * @param no Object to return if false. + * @param fallback Object to return if string is empty. + * @return One of the three options. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static Object isTrue(String string, Object yes, Object no, + Object fallback) throws AraraException { + return isEmpty(string) ? fallback : (isTrue(string) ? yes : no); + } + + /** + * Checks if the string holds a false value. + * @param string The string. + * @param yes Object to return if true. + * @param no Object to return if false. + * @param fallback Object to return if string is empty. + * @return One of the three options. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static Object isFalse(String string, Object yes, Object no, + Object fallback) throws AraraException { + return isEmpty(string) ? fallback : (isFalse(string) ? yes : no); + } + + /** + * Trim spaces from the string. + * @param string The string. + * @return A trimmed string. + */ + public static String trimSpaces(String string) { + return string.trim(); + } + + /** + * Checks if the expression resolves to true. + * @param value The expression. + * @param yes Object to return if true. + * @return An object or an empty string. + */ + public static Object isTrue(boolean value, Object yes) { + return value ? yes : ""; + } + + /** + * Checks if the expression resolves to false. + * @param value The expression. + * @param yes Object to return if true. + * @return An object or an empty string. + */ + public static Object isFalse(boolean value, Object yes) { + return !value ? yes : ""; + } + + /** + * Checks if the expression resolves to true. + * @param value The expression. + * @param yes Object to return if true. + * @param no Object to return if false. + * @return One of the two objects. + */ + public static Object isTrue(boolean value, Object yes, Object no) { + return value ? yes : no; + } + + /** + * Checks if the expression resolves to false. + * @param value The expression. + * @param yes Object to return if true. + * @param no Object to return if false. + * @return One of the two objects. + */ + public static Object isFalse(boolean value, Object yes, Object no) { + return !value ? yes : no; + } + + /** + * Gets the basename. + * @param file The file. + * @return The basename of the provided file. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static String getBasename(File file) throws AraraException { + if (file.isFile()) { + return CommonUtils.getBasename(file); + } else { + throw new AraraException( + CommonUtils.getRuleErrorHeader().concat( + messages.getMessage( + Messages.ERROR_BASENAME_NOT_A_FILE, + file.getName() + ) + ) + ); + } + } + + /** + * Gets the basename. + * @param filename The string. + * @return The basename. + */ + public static String getBasename(String filename) { + return CommonUtils.getBasename(filename); + } + + /** + * Gets the file type. + * @param file The provided file. + * @return The file type. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static String getFiletype(File file) throws AraraException { + if (file.isFile()) { + return CommonUtils.getFiletype(file); + } else { + throw new AraraException( + CommonUtils.getRuleErrorHeader().concat( + messages.getMessage( + Messages.ERROR_FILETYPE_NOT_A_FILE, + file.getName() + ) + ) + ); + } + } + + /** + * Gets the file type. + * @param filename The provided string. + * @return The file type. + */ + public static String getFiletype(String filename) { + return CommonUtils.getFiletype(filename); + } + + /** + * Replicates the pattern to each element of a list. + * @param pattern The pattern. + * @param values The list. + * @return A list of strings containing the pattern applied to the list. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static List<Object> replicatePattern(String pattern, + List<Object> values) throws AraraException { + return CommonUtils.replicateList(pattern, values); + } + + /** + * Throws an exception. + * @param text The text to be thrown as the exception message. + * @throws AraraException The exception to be thrown by this method. + */ + public static void throwError(String text) throws AraraException { + throw new AraraException(text); + } + + /** + * Gets the session. + * @return The session. + */ + public static Session getSession() { + return session; + } + + /** + * Checks if Windows is the underlying operating system. + * @return A boolean value. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean isWindows() throws AraraException { + return CommonUtils.checkOS("windows"); + } + + /** + * Checks if we are inside a Cygwin environment. + * @return A boolean value. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean isCygwin() throws AraraException { + return CommonUtils.checkOS("cygwin"); + } + + /** + * Checks if Linux is the underlying operating system. + * @return A boolean value. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean isLinux() throws AraraException { + return CommonUtils.checkOS("linux"); + } + + /** + * Checks if Mac is the underlying operating system. + * @return A boolean value. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean isMac() throws AraraException { + return CommonUtils.checkOS("mac"); + } + + /** + * Checks if Unix is the underlying operating system. + * @return A boolean value. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean isUnix() throws AraraException { + return CommonUtils.checkOS("unix"); + } + + /** + * Checks if AIX is the underlying operating system. + * @return A boolean value. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean isAIX() throws AraraException { + return CommonUtils.checkOS("aix"); + } + + /** + * Checks if Irix is the underlying operating system. + * @return A boolean value. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean isIrix() throws AraraException { + return CommonUtils.checkOS("irix"); + } + + /** + * Checks if OS2 is the underlying operating system. + * @return A boolean value. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean isOS2() throws AraraException { + return CommonUtils.checkOS("os2"); + } + + /** + * Checks if Solaris is the underlying operating system. + * @return A boolean value. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean isSolaris() throws AraraException { + return CommonUtils.checkOS("solaris"); + } + + /** + * Checks if Windows is the underlying operating system. + * @param yes Object to return if true. + * @param no Object to return if false. + * @return One of the two objects. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static Object isWindows(Object yes, Object no) + throws AraraException { + return CommonUtils.checkOS("windows") ? yes : no; + } + + /** + * Checks if we are inside a Cygwin environment. + * @param yes Object to return if true. + * @param no Object to return if false. + * @return One of the two objects. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static Object isCygwin(Object yes, Object no) throws AraraException { + return CommonUtils.checkOS("cygwin") ? yes : no; + } + + /** + * Checks if Linux is the underlying operating system. + * @param yes Object to return if true. + * @param no Object to return if false. + * @return One of the two objects. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static Object isLinux(Object yes, Object no) throws AraraException { + return CommonUtils.checkOS("linux") ? yes : no; + } + + /** + * Checks if Mac is the underlying operating system. + * @param yes Object to return if true. + * @param no Object to return if false. + * @return One of the two objects. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static Object isMac(Object yes, Object no) throws AraraException { + return CommonUtils.checkOS("mac") ? yes : no; + } + + /** + * Checks if Unix is the underlying operating system. + * @param yes Object to return if true. + * @param no Object to return if false. + * @return One of the two objects. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static Object isUnix(Object yes, Object no) throws AraraException { + return CommonUtils.checkOS("unix") ? yes : no; + } + + /** + * Checks if AIX is the underlying operating system. + * @param yes Object to return if true. + * @param no Object to return if false. + * @return One of the two objects. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static Object isAIX(Object yes, Object no) throws AraraException { + return CommonUtils.checkOS("aix") ? yes : no; + } + + /** + * Checks if Irix is the underlying operating system. + * @param yes Object to return if true. + * @param no Object to return if false. + * @return One of the two objects. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static Object isIrix(Object yes, Object no) throws AraraException { + return CommonUtils.checkOS("irix") ? yes : no; + } + + /** + * Checks if OS2 is the underlying operating system. + * @param yes Object to return if true. + * @param no Object to return if false. + * @return One of the two objects. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static Object isOS2(Object yes, Object no) throws AraraException { + return CommonUtils.checkOS("os2") ? yes : no; + } + + /** + * Checks if Solaris is the underlying operating system. + * @param yes Object to return if true. + * @param no Object to return if false. + * @return One of the two objects. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static Object isSolaris(Object yes, Object no) throws AraraException { + return CommonUtils.checkOS("solaris") ? yes : no; + } + + /** + * Checks if the file exists according to its extension. + * @param extension The extension. + * @return A boolean value. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean exists(String extension) throws AraraException { + return CommonUtils.exists(extension); + } + + /** + * Checks if the file is missing according to its extension. + * @param extension The extension. + * @return A boolean value. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean missing(String extension) throws AraraException { + return !exists(extension); + } + + /** + * Checks if the file has changed, according to its extension. + * @param extension The extension. + * @return A boolean value. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean changed(String extension) throws AraraException { + return CommonUtils.hasChanged(extension); + } + + /** + * Checks if the file is unchanged according to its extension. + * @param extension The extension. + * @return A boolean value. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean unchanged(String extension) throws AraraException { + return !changed(extension); + } + + /** + * Checks if the file exists. + * @param filename The file. + * @return A boolean value. + */ + public static boolean exists(File filename) { + return CommonUtils.exists(filename); + } + + /** + * Checks if the file is missing. + * @param filename The file. + * @return A boolean value. + */ + public static boolean missing(File filename) { + return !exists(filename); + } + + /** + * Checks if the file has changed. + * @param filename The file. + * @return A boolean value. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean changed(File filename) throws AraraException { + return CommonUtils.hasChanged(filename); + } + + /** + * Checks if the file is unchanged. + * @param filename The file. + * @return A boolean value. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean unchanged(File filename) throws AraraException { + return !changed(filename); + } + + /** + * Build a string based on an array of objects. + * @param objects Array of objects. + * @return A string built from the array. + */ + public static String buildString(Object... objects) { + return CommonUtils.generateString(objects); + } + + /** + * Encloses the provided object into double quotes. + * @param object The object. + * @return The object enclosed in double quotes. + */ + public static String addQuotes(Object object) { + return CommonUtils.addQuotes(object); + } + + /** + * Checks if the file contains the regex, based on its extension. + * @param extension The extension. + * @param regex The regex. + * @return A boolean value. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean found(String extension, String regex) + throws AraraException { + return CommonUtils.checkRegex(extension, regex); + } + + /** + * Checks if the file contains the provided regex. + * @param file The file. + * @param regex The regex. + * @return A boolean value. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static boolean found(File file, String regex) + throws AraraException { + return CommonUtils.checkRegex(file, regex); + } + + /** + * Gets the command based on a list of strings. + * @param elements The list of strings. + * @return A command. + */ + public static Command getCommand(List<String> elements) { + return new Command(elements); + } + + /** + * Gets the command based on an array of objects. + * @param elements Array of objects. + * @return A command. + */ + public static Command getCommand(Object... elements) { + return new Command(elements); + } + + /** + * Gets the command based on an array of objects and with the provided + * working directory as string. + * @param path String path representing the working directory. + * @param elements Array of elements. + * @return A command. + */ + public static Command getCommandWithWorkingDirectory(String path, + Object... elements) { + Command command = new Command(elements); + command.setWorkingDirectory(new File(path)); + return command; + } + + /** + * Gets the command based on an array of objects and with the provided + * working directory as file. + * @param file File representing the working directory. + * @param elements Array of elements. + * @return A command. + */ + public static Command getCommandWithWorkingDirectory(File file, + Object... elements) { + Command command = new Command(elements); + command.setWorkingDirectory(file); + return command; + } + + /** + * Gets the command based on a list of strings and with the provided + * working directory as string. + * @param path String path representing the working directory. + * @param elements List of strings. + * @return A command. + */ + public static Command getCommandWithWorkingDirectory(String path, + List<String> elements) { + Command command = new Command(elements); + command.setWorkingDirectory(new File(path)); + return command; + } + + /** + * Gets the command based on a list of strings and with the provided + * working directory as file. + * @param file File representing the working directory. + * @param elements List of strings. + * @return A command. + */ + public static Command getCommandWithWorkingDirectory(File file, + List<String> elements) { + Command command = new Command(elements); + command.setWorkingDirectory(file); + return command; + } + + /** + * Gets the trigger. + * @param action The action name. + * @return The trigger. + */ + public static Trigger getTrigger(String action) { + return new Trigger(action, null); + } + + /** + * Gets the trigger. + * @param action The action name. + * @param parameters The trigger parameters. + * @return A trigger. + */ + public static Trigger getTrigger(String action, Object... parameters) { + return new Trigger(action, Arrays.asList(parameters)); + } + + /** + * Checks if the object is an intance of the provided class. + * @param clazz The class. + * @param object The object. + * @return A boolean value. + */ + public static boolean checkClass(Class clazz, Object object) { + return CommonUtils.checkClass(clazz, object); + } + + /** + * Checks if the object is a string. + * @param object The object. + * @return A boolean value. + */ + public static boolean isString(Object object) { + return checkClass(String.class, object); + } + + /** + * Checks if the object is a list. + * @param object The object. + * @return A boolean value. + */ + public static boolean isList(Object object) { + return checkClass(List.class, object); + } + + /** + * Checks if the object is a map. + * @param object The object. + * @return A boolean value. + */ + public static boolean isMap(Object object) { + return checkClass(Map.class, object); + } + + /** + * Checks if the object is a boolean. + * @param object The object. + * @return A boolean value. + */ + public static boolean isBoolean(Object object) { + return checkClass(Boolean.class, object); + } + + /** + * Checks if the execution is in verbose mode. + * @return A boolean value indicating if the execution is in verbose mode. + */ + public static boolean isVerboseMode() { + return (Boolean) ConfigurationController. + getInstance().get("execution.verbose"); + } + + /** + * Returns a file object based on the provided name. + * @param name The file name. + * @return A file object. + */ + public static File toFile(String name) { + return new File(name); + } + + /** + * Shows the message. + * @param width Integer value, in pixels. + * @param type Type of message. + * @param title Title of the message. + * @param text Text of the message. + */ + public static void showMessage(int width, int type, + String title, String text) { + MessageUtils.showMessage(width, type, title, text); + } + + /** + * Shows the message. It relies on the default width. + * @param type Type of message. + * @param title Title of the message. + * @param text Text of the message. + */ + public static void showMessage(int type, String title, String text) { + MessageUtils.showMessage(type, title, text); + } + + /** + * Shows a message with options presented as an array of buttons. + * @param width Integer value, in pixels. + * @param type Type of message. + * @param title Title of the message. + * @param text Text of the message. + * @param buttons An array of objects to be presented as buttons. + * @return The index of the selected button, starting from 1. + */ + public static int showOptions(int width, int type, String title, + String text, Object... buttons) { + return MessageUtils.showOptions(width, type, title, text, buttons); + } + + /** + * Shows a message with options presented as an array of buttons. It relies + * on the default width. + * @param type Type of message. + * @param title Title of the message. + * @param text Text of the message. + * @param buttons An array of objects to be presented as buttons. + * @return The index of the selected button, starting from 1. + */ + public static int showOptions(int type, String title, + String text, Object... buttons) { + return MessageUtils.showOptions(type, title, text, buttons); + } + + /** + * Shows a message with a text input. + * @param width Integer value, in pixels. + * @param type Type of message. + * @param title Title of the message. + * @param text Text of the message. + * @return The string representing the input text. + */ + public static String showInput(int width, int type, + String title, String text) { + return MessageUtils.showInput(width, type, title, text); + } + + /** + * Shows a message with a text input. It relies on the default width. + * @param type Type of message. + * @param title Title of the message. + * @param text Text of the message. + * @return The string representing the input text. + */ + public static String showInput(int type, String title, String text) { + return MessageUtils.showInput(type, title, text); + } + + /** + * Shows a message with options presented as a dropdown list of elements. + * @param width Integer value, in pixels. + * @param type Type of message. + * @param title Title of the message. + * @param text Text of the message. + * @param elements An array of objects representing the elements. + * @return The index of the selected element, starting from 1. + */ + public static int showDropdown(int width, int type, String title, + String text, Object... elements) { + return MessageUtils.showDropdown(width, type, title, text, elements); + } + + /** + * Shows a message with options presented as a dropdown list of elements. It + * relies on the default width. + * @param type Type of message. + * @param title Title of the message. + * @param text Text of the message. + * @param elements An array of objects representing the elements. + * @return The index of the selected element, starting from 1. + */ + public static int showDropdown(int type, String title, + String text, Object... elements) { + return MessageUtils.showDropdown(type, title, text, elements); + } + + /** + * Checks if the provided command name is reachable from the system path. + * @param command A string representing the command. + * @return A logic value. + */ + public static boolean isOnPath(String command) { + return CommonUtils.isOnPath(command); + } + + /** + * Gets the full basename. + * @param file The file. + * @return The full basename of the provided file. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static String getFullBasename(File file) throws AraraException { + if (file.isFile()) { + return CommonUtils.getFullBasename(file); + } else { + throw new AraraException( + CommonUtils.getRuleErrorHeader().concat( + messages.getMessage( + Messages.ERROR_BASENAME_NOT_A_FILE, + file.getName() + ) + ) + ); + } + } + + /** + * Gets the full basename. + * @param name The string. + * @return The full basename. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static String getFullBasename(String name) throws AraraException { + return getFullBasename(new File(name)); + } + + /** + * Unsafely executes a system command from the underlying operating system + * and returns a pair containing the exit status and the command output as a + * string. + * @param command The system command to be executed. + * @return A pair containing the exit status and the system command output + * as a string. + */ + public static Pair<Integer, String> + unsafelyExecuteSystemCommand(Command command) { + return UnsafeUtils.executeSystemCommand(command); + } + + /** + * Merges the provided template with a context map and writes the result in + * an output file. This method relies on Apache Velocity. + * @param input The input file. + * @param output The output file. + * @param map The context map. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static void mergeVelocityTemplate(File input, File output, + Map<String, Object> map) throws AraraException { + VelocityUtils.mergeVelocityTemplate(input, output, map); + } + + /** + * Gets the file reference for the current directive. It is important to + * observe that version 4.0 of arara replicates the directive when 'files' + * is detected amongst the parameters, so each instance will have a + * different reference. + * @return A file reference for the current directive. + */ + public static File currentFile() { + return (File) ConfigurationController.getInstance(). + get("execution.directive.reference"); + } + + /** + * Loads a class from the provided file, potentially a Java archive. + * @param file File containing the Java bytecode (namely, a JAR). + * @param name The canonical name of the class. + * @return A pair representing the status and the class. + */ + public static Pair<Integer, Class> loadClass(File file, String name) { + return ClassLoadingUtils.loadClass(file, name); + } + + /** + * Loads a class from the provided string reference, representing a file. + * @param ref String reference representing a file. + * @param name The canonical name of the class. + * @return A pair representing the status and the class. + */ + public static Pair<Integer, Class> loadClass(String ref, String name) { + return ClassLoadingUtils.loadClass(new File(ref), name); + } + + /** + * Loads a class from the provided file, instantiating it. + * @param file File containing the Java bytecode (namely, a JAR). + * @param name The canonical name of the class. + * @return A pair representing the status and the class object. + */ + public static Pair<Integer, Object> loadObject(File file, String name) { + return ClassLoadingUtils.loadObject(file, name); + } + + /** + * Loads a class from the provided string reference, instantiating it. + * @param ref String reference representing a file. + * @param name The canonical name of the class. + * @return A pair representing the status and the class object. + */ + public static Pair<Integer, Object> loadObject(String ref, String name) { + return ClassLoadingUtils.loadObject(new File(ref), name); + } + + /** + * List all files from the provided directory according to the list of + * extensions. The leading dot must be omitted, unless it is part of the + * extension. + * @param directory The provided directory. + * @param extensions The list of extensions. + * @param recursive A flag indicating whether the search is recursive. + * @return A list of files. + */ + public static List<File> listFilesByExtensions(File directory, + List<String> extensions, boolean recursive) { + return FileSearchingUtils.listFilesByExtensions( + directory, + extensions, + recursive + ); + } + + /** + * List all files from the provided string path according to the list of + * extensions. The leading dot must be omitted, unless it is part of the + * extension. + * @param path The provided path as plain string. + * @param extensions The list of extensions. + * @param recursive A flag indicating whether the search is recursive. + * @return A list of files. + */ + public static List<File> listFilesByExtensions(String path, + List<String> extensions, boolean recursive) { + return FileSearchingUtils.listFilesByExtensions( + new File(path), + extensions, + recursive + ); + } + + /** + * List all files from the provided directory matching the list of file + * name patterns. Such list can contain wildcards. + * @param directory The provided directory. + * @param patterns The list of file name patterns. + * @param recursive A flag indicating whether the search is recursive. + * @return A list of files. + */ + public static List<File> listFilesByPatterns(File directory, + List<String> patterns, boolean recursive) { + return FileSearchingUtils.listFilesByPatterns( + directory, + patterns, + recursive + ); + } + + /** + * List all files from the provided path matching the list of file + * name patterns. Such list can contain wildcards. + * @param path The provided path as plain string. + * @param patterns The list of file name patterns. + * @param recursive A flag indicating whether the search is recursive. + * @return A list of files. + */ + public static List<File> listFilesByPatterns(String path, + List<String> patterns, boolean recursive) { + return FileSearchingUtils.listFilesByPatterns( + new File(path), + patterns, + recursive + ); + } + + /** + * Writes the string to a file, using UTF-8 as default encoding. + * @param file The file. + * @param text The string to be written. + * @param append A flag whether to append the content. + * @return A logical value indicating whether it was successful. + */ + public static boolean writeToFile(File file, String text, boolean append) { + return FileHandlingUtils.writeToFile(file, text, append); + } + + /** + * Writes the string to a file, using UTF-8 as default encoding. + * @param path The path. + * @param text The string to be written. + * @param append A flag whether to append the content. + * @return A logical value indicating whether it was successful. + */ + public static boolean writeToFile(String path, String text, + boolean append) { + return FileHandlingUtils.writeToFile(new File(path), text, append); + } + + /** + * Writes the string list to a file, using UTF-8 as default encoding. + * @param file The file. + * @param lines The string list to be written. + * @param append A flag whether to append the content. + * @return A logical value indicating whether it was successful. + */ + public static boolean writeToFile(File file, List<String> lines, + boolean append) { + return FileHandlingUtils.writeToFile(file, lines, append); + } + + /** + * Writes the string list to a file, using UTF-8 as default encoding. + * @param path The path. + * @param lines The string list to be written. + * @param append A flag whether to append the content. + * @return A logical value indicating whether it was successful. + */ + public static boolean writeToFile(String path, List<String> lines, + boolean append) { + return FileHandlingUtils.writeToFile(new File(path), lines, append); + } + + /** + * Reads the provided file into a list of strings. + * @param file The file. + * @return A list of strings. + */ + public static List<String> readFromFile(File file) { + return FileHandlingUtils.readFromFile(file); + } + + /** + * Reads the provided file into a list of strings. + * @param path The path. + * @return A list of strings. + */ + public static List<String> readFromFile(String path) { + return FileHandlingUtils.readFromFile(new File(path)); + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/RuleUtils.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/RuleUtils.java new file mode 100644 index 00000000000..d855344762d --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/RuleUtils.java @@ -0,0 +1,244 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.utils; + +import com.github.cereda.arara.controller.LanguageController; +import com.github.cereda.arara.model.AraraException; +import com.github.cereda.arara.model.Argument; +import com.github.cereda.arara.model.Messages; +import com.github.cereda.arara.model.RuleCommand; +import com.github.cereda.arara.model.Rule; +import java.io.File; +import java.io.FileReader; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.Predicate; +import org.yaml.snakeyaml.Yaml; +import org.yaml.snakeyaml.constructor.Constructor; +import org.yaml.snakeyaml.error.MarkedYAMLException; +import org.yaml.snakeyaml.nodes.Tag; +import org.yaml.snakeyaml.representer.Representer; + +/** + * Implements rule utilitary methods. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class RuleUtils { + + // the application messages obtained from the + // language controller + private static final LanguageController messages = + LanguageController.getInstance(); + + /** + * Parses the provided file, checks the identifier and returns a rule + * representation. + * @param file The rule file. + * @param identifier The directive identifier. + * @return The rule object. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + public static Rule parseRule(File file, String identifier) + throws AraraException { + Representer representer = new Representer(); + representer.addClassTag(Rule.class, new Tag("!config")); + Yaml yaml = new Yaml(new Constructor(Rule.class), representer); + Rule rule = null; + try { + rule = yaml.loadAs(new FileReader(file), Rule.class); + } catch (MarkedYAMLException yamlException) { + throw new AraraException( + CommonUtils.getRuleErrorHeader().concat( + messages.getMessage( + Messages.ERROR_PARSERULE_INVALID_YAML + ) + ), + yamlException + ); + } catch (Exception exception) { + throw new AraraException( + CommonUtils.getRuleErrorHeader().concat( + messages.getMessage( + Messages.ERROR_PARSERULE_GENERIC_ERROR + ) + ) + ); + } + validateHeader(rule, identifier); + validateBody(rule); + return rule; + } + + /** + * Validates the rule header according to the directive identifier. + * @param rule The rule object. + * @param identifier The directive identifier. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + private static void validateHeader(Rule rule, String identifier) + throws AraraException { + if (rule.getIdentifier() != null) { + if (!rule.getIdentifier().equals(identifier)) { + throw new AraraException(CommonUtils.getRuleErrorHeader(). + concat( + messages.getMessage( + Messages.ERROR_VALIDATEHEADER_WRONG_IDENTIFIER, + rule.getIdentifier(), + identifier + ) + ) + ); + } + } else { + throw new AraraException( + CommonUtils.getRuleErrorHeader().concat( + messages.getMessage( + Messages.ERROR_VALIDATEHEADER_NULL_ID + ) + ) + ); + } + if (rule.getName() == null) { + throw new AraraException( + CommonUtils.getRuleErrorHeader().concat( + messages.getMessage( + Messages.ERROR_VALIDATEHEADER_NULL_NAME + ) + ) + ); + } + } + + /** + * Validates the rule body. + * @param rule The rule object. + * @throws AraraException Something wrong happened, to be caught in the + * higher levels. + */ + private static void validateBody(Rule rule) throws AraraException { + if (rule.getCommands() == null) { + throw new AraraException( + CommonUtils.getRuleErrorHeader().concat( + messages.getMessage( + Messages.ERROR_VALIDATEBODY_NULL_COMMANDS_LIST + ) + ) + ); + } else { + if (CollectionUtils.exists(rule.getCommands(), + new Predicate<RuleCommand>() { + public boolean evaluate(RuleCommand command) { + return (command.getCommand() == null); + } + })) { + throw new AraraException(CommonUtils.getRuleErrorHeader(). + concat( + messages.getMessage( + Messages.ERROR_VALIDATEBODY_NULL_COMMAND + ) + ) + ); + } + } + if (rule.getArguments() == null) { + throw new AraraException( + CommonUtils.getRuleErrorHeader().concat( + messages.getMessage( + Messages.ERROR_VALIDATEBODY_ARGUMENTS_LIST + ) + ) + ); + } else { + String[] keywords = new String[]{"file", "files", "reference"}; + + List<String> arguments = new ArrayList<String>(); + for (Argument argument : rule.getArguments()) { + if (argument.getIdentifier() != null) { + if ((argument.getFlag() != null) || + (argument.getDefault() != null)) { + arguments.add(argument.getIdentifier()); + } else { + throw new AraraException( + CommonUtils.getRuleErrorHeader().concat( + messages.getMessage( + Messages.ERROR_VALIDATEBODY_MISSING_KEYS + ) + ) + ); + } + } else { + throw new AraraException( + CommonUtils.getRuleErrorHeader().concat( + messages.getMessage( + Messages.ERROR_VALIDATEBODY_NULL_ARGUMENT_ID + ) + ) + ); + } + } + + for (String keyword : keywords) { + if (arguments.contains(keyword)) { + throw new AraraException( + CommonUtils.getRuleErrorHeader().concat( + messages.getMessage( + Messages.ERROR_VALIDATEBODY_ARGUMENT_ID_IS_RESERVED, + keyword + ) + ) + ); + } + } + + int expected = arguments.size(); + int found = (new HashSet<String>(arguments)).size(); + if (expected != found) { + throw new AraraException( + CommonUtils.getRuleErrorHeader().concat( + messages.getMessage( + Messages.ERROR_VALIDATEBODY_DUPLICATE_ARGUMENT_IDENTIFIERS + ) + ) + ); + } + } + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/TeeOutputStream.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/TeeOutputStream.java index 36b5df82f59..65d3d58ffba 100644 --- a/Master/texmf-dist/source/support/arara/src/main/java/com/github/arara/utils/TeeOutputStream.java +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/TeeOutputStream.java @@ -1,7 +1,6 @@ /** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,125 +30,80 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * TeeOutputStream: This class implements an output stream that handles other - * streams, so the flow is propagated to all of them in an easy way. */ -// package definition -package com.github.arara.utils; +package com.github.cereda.arara.utils; -// needed importa import java.io.IOException; import java.io.OutputStream; +import org.apache.commons.io.IOUtils; /** - * Implements an output stream that handles other streams, so the flow is - * propagated to all of them in an easy way. - * + * Implements a stream splitter. * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 2.0 + * @version 4.0 + * @since 4.0 */ public class TeeOutputStream extends OutputStream { - // the list of the output streams + // an array of streams in which + // an object of this class will + // split data private final OutputStream[] streams; /** * Constructor. - * - * @param outputStreams An array containing the output streams. + * @param outputStreams An array of output streams. */ public TeeOutputStream(OutputStream... outputStreams) { - - // set the array streams = outputStreams; } /** - * Writes the byte to all the output streams. - * - * @param b The byte to write. - * @throws IOException Exception if an error ocurred. + * Writes the provided integer to each stream. + * @param b The provided integer + * @throws IOException An IO exception. */ @Override public void write(int b) throws IOException { - - // for every stream for (OutputStream ostream : streams) { - - // write the byte ostream.write(b); } } /** - * Writes an array of bytes to all the output streams. - * - * @param b The bytes to write. + * Writes the provided byte array to each stream, with the provided offset + * and length. + * @param b The byte array. * @param offset The offset. - * @param length Number of bytes. - * @throws IOException Exception if an error ocurred. + * @param length The length. + * @throws IOException An IO exception. */ @Override public void write(byte[] b, int offset, int length) throws IOException { - - // for every stream for (OutputStream ostream : streams) { - - // write the array ostream.write(b, offset, length); } } /** - * Flushes the stream. - * - * @throws IOException Exception if an error ocurred. + * Flushes every stream. + * @throws IOException An IO exception. */ @Override public void flush() throws IOException { - - // for every stream for (OutputStream ostream : streams) { - - // flush the stream ostream.flush(); } } /** - * Closes the stream. - * - * @throws IOException Exception if an error ocurred. + * Closes every stream silently. */ @Override - public void close() throws IOException { - - // for every stream + public void close() { for (OutputStream ostream : streams) { - - // try to close the stream - forceClose(ostream); - } - } - - /** - * Forces the stream to close without raising exceptions. - * - * @param ostream The stream. - */ - private void forceClose(OutputStream ostream) { - - // try to close - try { - - // close it - ostream.close(); - - } catch (IOException exception) { - // do nothing + IOUtils.closeQuietly(ostream); } } + } diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/UnsafeUtils.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/UnsafeUtils.java new file mode 100644 index 00000000000..b989e074c8f --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/UnsafeUtils.java @@ -0,0 +1,87 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.utils; + +import com.github.cereda.arara.model.Command; +import com.github.cereda.arara.model.Pair; +import org.zeroturnaround.exec.ProcessExecutor; +import org.zeroturnaround.exec.ProcessResult; + +/** + * Implements unsafe utilitary methods. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class UnsafeUtils { + + /** + * Executes a system command from the underlying operating system and + * returns a pair containing the exit status and the command output as a + * string. + * @param command The system command to be executed. + * @return A pair containing the exit status and the system command output + * as a string. + */ + public static Pair<Integer, String> executeSystemCommand(Command command) { + + try { + + // create a process result with the provided + // command, capturing the output + ProcessResult result = new ProcessExecutor( + command.getElements() + ).readOutput(true).execute(); + + // return the pair containing the exit status + // and the output string as UTF-8 + return new Pair<Integer, String>( + result.getExitValue(), + result.outputUTF8() + ); + + } catch (Exception exception) { + + // quack, quack, do nothing, just + // return a default error code + + // if something goes wrong, the default + // error branch returns an exit status of + // -99 and an empty string + return new Pair<Integer, String>(-99, ""); + + } + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/VelocityUtils.java b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/VelocityUtils.java new file mode 100644 index 00000000000..2040b671b70 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/java/com/github/cereda/arara/utils/VelocityUtils.java @@ -0,0 +1,157 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.utils; + +import com.github.cereda.arara.controller.LanguageController; +import com.github.cereda.arara.model.AraraException; +import com.github.cereda.arara.model.Messages; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.util.Map; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.VelocityEngine; +import org.apache.velocity.exception.MethodInvocationException; +import org.apache.velocity.exception.ParseErrorException; +import org.apache.velocity.exception.ResourceNotFoundException; +import org.apache.velocity.runtime.RuntimeConstants; + +/** + * Implements the template merging from Apache Velocity. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class VelocityUtils { + + // the language controller + private static final LanguageController messages = + LanguageController.getInstance(); + + /** + * Merges the provided template with the context map and writes the result + * in an output file. The operation relies on the Apache Velocity project. + * @param input The input file. + * @param output The output file. + * @param map The context map. + * @throws AraraException Something terribly wrong happened, to be caught + * in the higher levels. + */ + public static void mergeVelocityTemplate(File input, File output, + Map<String, Object> map) throws AraraException { + + // let us try + try { + + // create the template engine instance + VelocityEngine engine = new VelocityEngine(); + + // use the resource path trick: set the default + // location to the input file's parent directory, + // so our file is easily located + engine.setProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, + input.getCanonicalFile().getParent()); + + // set the logging feature of Apache Velocity to + // register the occurrences in a null provider + // (we do not want unnecessary verbose output) + engine.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, + "org.apache.velocity.runtime.log.NullLogSystem"); + + // init the engine with the + // provided settings + engine.init(); + + // create a context for Apache Velocity, + // based on the provided map + VelocityContext context = new VelocityContext(map); + + // get the template from the engine and + // read it as an UTF-8 file + Template template = engine.getTemplate(input.getName(), "UTF-8"); + + // create an output stream from + // the file output reference + FileOutputStream stream = new FileOutputStream(output); + + // create a writer based on the + // previously created stream + Writer writer = new OutputStreamWriter(stream, "UTF-8"); + + // merge the context map with the + // template file and write the result + // to the output stream writer + template.merge(context, writer); + + // close both writer + // and output stream + writer.close(); + stream.close(); + + } catch(ResourceNotFoundException rnfexception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_VELOCITY_FILE_NOT_FOUND + ), + rnfexception + ); + } catch(ParseErrorException peexception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_VELOCITY_PARSE_EXCEPTION + ), + peexception + ); + } catch(MethodInvocationException miexception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_VELOCITY_METHOD_INVOCATION_EXCEPTION + ), + miexception + ); + } catch (IOException ioexception) { + throw new AraraException( + messages.getMessage( + Messages.ERROR_VELOCITY_FILE_NOT_FOUND + ), + ioexception + ); + } + + } + +} diff --git a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/conf/logback.xml b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/conf/logback.xml deleted file mode 100644 index 22f73680d00..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/conf/logback.xml +++ /dev/null @@ -1,13 +0,0 @@ -<configuration> - <appender name="FILE" class="ch.qos.logback.core.FileAppender"> - <file>${araraLogName}.log</file> - <append>false</append> - <encoder> - <charset>UTF-8</charset> - <pattern>%date{dd MMM yyyy HH:mm:ss.SSS} %-5level %logger{0} - %msg%n</pattern> - </encoder> - </appender> - <root level="ALL"> - <appender-ref ref="FILE" /> - </root> -</configuration>
\ No newline at end of file diff --git a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages.properties b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages.properties deleted file mode 100644 index dbcde45e7f8..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages.properties +++ /dev/null @@ -1,163 +0,0 @@ -# Arara -- the cool TeX automation tool -# Copyright (c) 2012, Paulo Roberto Massa Cereda -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the project's author nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# Messages: This file holds the default messages for arara. -# -# author: Paulo Roberto Massa Cereda -# e-mail: cereda@users.sf.net - -Log_WelcomeMessage = Welcome to arara! - -Log_ProcessingFile = Processing file ''{0}'', please wait. - -Log_Done = Done. - -Log_ExceptionRaised = Arara raised an exception with the following message: - -Log_ReadyToRunCommands = Ready to run commands. - -Log_CommandName = Running ''{0}''. - -Log_Command = Command: {0} - -Log_CommandSuccess = ''{0}'' was successfully executed. - -Log_CommandFailure = ''{0}'' returned an error status. - -Log_AllCommandsSuccess = All commands were successfully executed. - -Log_OutputLogging = Output logging: - -Log_CommandNotFound = ''{0}'' was not found in the path. Execution attempt: {1} - -Log_DirectiveFound = Directive found in line {0} with {1}. - -Log_RuleFound = Task ''{0}'' found in ''{1}''. - -Log_NoDirectivesFound = No directives found in ''{0}''. - -Help_Version = print the application version - -Help_Help = print the help message - -Help_Log = generate a log output - -Help_Verbose = print the command output - -Help_Timeout = set the execution timeout (in milliseconds) - -Help_Language = set the application language - -Header_Slogan = The cool TeX automation tool - -Header_AllRightsReserved = All rights reserved. - -Msg_NoDirectivesFound = I didn''t find any directives in ''{0}'', and so didn''t do anything. Is that what you really wanted? - -Msg_SpecialThanks = A special thanks goes to Alan Munn, Andrew Stacey, Brent Longborough, Clemens Niederberger, David Carlisle, Enrico Gregorio, Francesco Endrici, Gonzalo Medina, Harish Kumar, \u0130lhan Polat, Joseph Wright, Marco Daniel, Mika\u00ebl Maunier, Patrick Gundlach, Rasmus Roulund, Sergey Ulyanov, Stefan Kottwitz, and many others for making this humble tool possible. - -Msg_RunningCommand = Running {0}... - -Msg_Success = SUCCESS - -Msg_Failure = FAILURE - -Msg_Status = Status: - -YamlError_Context = Context: {0} - -YamlError_Problem = Problem: {0} - -YamlError_ErrorLocation = Error found in line {0}, column {1}. - -Error_FileDoesNotExistWithExtensionsList = I''m sorry, but the file ''{0} {1}'' does not exist. Note that when you provide only the basename (i.e, the filename without the extension) or with an unknown extension, arara will try to look for files ending with the predefined extensions {1} in that order. You can override the order, the search pattern or even add support for new extensions through the configuration file. Please refer to the arara manual to learn more about this feature. - -Error_FileDoesNotExist = File ''{0}'' does not exist. - -Error_CommandNotFound = \nI''m sorry, but the command from the ''{0}'' task could not be found. Are you sure the command ''{1}'' is correct, or even accessible from the system path? - -Error_InvalidYAMLConfigurationFile = I'm sorry, but apparently your arara configuration file is invalid, that is, it has invalid or missing YAML entries. Unfortunately, arara cannot proceed until the error is fixed. I tried my best to dump the error message, so here it is: - -Error_InvalidConfigurationFile = Uh-oh, the configuration file appears to be invalid. Are you sure it's a proper YAML file? Unfortunately, arara cannot proceed until a proper configuration file is provided. - -Error_InvalidLanguageConfigurationFile = Houston, we have a problem. Sadly, the language set in the configuration file is not valid. Currently, arara can provide support for the following languages: {0}. Make sure to choose a valid language or remove the entry from the configuration file (the field is optional), otherwise arara cannot proceed. - -Error_InvalidFiletypesConfigurationFile = I'm sorry, but it seems your configuration file has customized filetypes with neither the extension or pattern defined. Both are required in order to continue. Please fix this error in your configuration file and try again. - -Error_PathRuntimeErrorConfigurationFile = I''m sorry, but one of the entries of the search path in your configuration file has an unavailable variable in the path context: ''{0}'' - -Error_PathIOErrorConfigurationFile = I'm sorry, but one of the entries of the search path in your configuration file has a malformed directory structure. Could you take a look at it? - -Error_InvalidYAMLDirective = It appears there is a malformed directive found at line {0}, that is, a directive that might have a YAML syntax error or an invalid field. I tried my best to dump the error message, so here it is: - -Error_DirectiveEmptyCurlyBrackets = Directive ''{0}'' at line {1} has empty curly brackets. Note that arara opts for a cleaner syntax when a directive has no parameters. To fix it, it''s enough to either remove the curly brackets or provide the arguments for the directive. - -Error_DirectiveInvalidArgumentList = Directive ''{0}'' at line {1} has an invalid argument type. The argument ''{2}'' is a reserved arara keyword and always requires a list. - -Error_DirectiveReservedKeyword = Directive ''{0}'' at line {1} has an invalid argument name. The name ''{2}'' is a reserved arara keyword representing every element in the ''{3}'' list. Please, pick another name for that argument. - -Error_DirectiveListError = Directive ''{0}'' at line {1} has an invalid argument type. Only the arguments ''files'' and ''items'' can have a list. Both are reserved arara keywords. - -Error_InvalidDirective = Apparently, there''s an invalid directive at line {0}. Please take a look and fix it. - -Error_DirectiveGenericError = Directive ''{0}'' at line {1} seems to be malformed. It might be a YAML syntax error or a wrong mapping. - -Error_InvalidLanguage = I'm sorry, but the language code you chose is invalid. Currently, the following languages are supported: - -Error_RuleNotFound = Uh-oh, I could not find the ''{0}'' rule in the search path. Could you take a look if the rule name is correct and if the rule is accessible through the search path? - -Error_InvalidYAMLRule = It appears that the ''{0}'' task has a YAML syntax error or an invalid field. Could you take a look at the ''{0}.yaml'' file located at ''{1}''. I tried my best to dump the error message, so here it is: - -Error_InvalidRule = Uh-oh, the ''{0}'' task appears to be invalid. Are you sure the ''{0}.yaml'' file located at ''{1}'' is a proper YAML file? - -Error_EmptyIdentifierRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid identifier. Could you fix it? - -Error_EmptyNameRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid name. Could you fix it? - -Error_ForbiddenIdentifierRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has an invalid argument identifier. ''{2}'' is a reserved keyword, so it cannot be used. Could you use another name? - -Error_EmptyArgumentsListRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid list of arguments. Could you fix it? Note that the list of arguments can also be empty, but it is still necessary to define it explicitly (with ''arguments: []''). - -Error_WrongIdentifierRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has the wrong identifier - ''{0}'' was expected, rather than ''{2}''. Could you fix it? - -Error_ArgumentsNotDefinedInRule = Oh no, there are arguments used in the diretive ''{0}'' which are not defined in the ''{0}.yaml'' rule located at ''{1}''. You can either remove them from the ''{0}'' directive or add them to the list of arguments in the ''{0}.yaml'' rule. Here they are: {2} - -Error_DefaultValueRuntimeErrorRule = I''m sorry, but the default value set for the argument ''{0}'' of the ''{1}'' task (referencing the ''{1}.yaml'' file located at ''{2}'') has an unavailable variable/method in the rule context: ''{3}'' - -Error_FlagRuntimeErrorRule = I''m sorry, but the flag set for the argument ''{0}'' of the ''{1}'' task (referencing the ''{1}.yaml'' file located at ''{2}'') has an unavailable variable/method in the rule context: ''{3}'' - -Error_DuplicatedCommandElementsRule = Uh-oh, both ''command'' and ''commands'' fields are set in the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}''). You need to pick only one of them. If your task only relies on a single command, you can opt for ''command''; if your rule requires a set of commands, maybe the ''commands'' field is more suitable. - -Error_MissingCommandElementsRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') does not have either the ''command'' or ''commands'' elements. You need to pick only one of them. If your task only relies on a single command, you can opt for ''command''; if your rule requires a set of commands, maybe the ''commands'' field is more suitable. - -Error_CommandRuntimeErrorRule = I''m sorry, but the command set for the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has an unavailable variable/method in the rule context: ''{2}'' - diff --git a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_de.properties b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_de.properties deleted file mode 100644 index e0183983cf8..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_de.properties +++ /dev/null @@ -1,226 +0,0 @@ -# Arara -- the cool TeX automation tool -# Copyright (c) 2012, Paulo Roberto Massa Cereda -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the project's author nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# Messages_de: Diese Datei beinhalted alle Meldungen f\u00fcr arara in Deutsch. -# -# translator: Marco Daniel -# e-mail: marco.daniel@mada-nada.de - -# Log_WelcomeMessage = Welcome to arara! -Log_WelcomeMessage = Willkommen zu arara! - -# Log_ProcessingFile = Processing file ''{0}'', please wait. -Log_ProcessingFile = Bearbeitung der Datei ''{0}'', bitte warten. - -# Log_Done = Done. -Log_Done = Fertig. - -# Log_ExceptionRaised = Arara raised an exception with the following message: -Log_ExceptionRaised = Eine Ausnahme mit folgender Nachricht ist durch arara ausgel\u00f6st worden: - -# Log_ReadyToRunCommands = Ready to run commands. -Log_ReadyToRunCommands = Bereit zum Start der Anweisungen. - -# Log_CommandName = Running ''{0}''. -Log_CommandName = Verarbeitung von: ''{0}''. - -# Log_Command = Command: {0} -Log_Command = Anweisung: {0} - -# Log_CommandSuccess = ''{0}'' was successfully executed. -Log_CommandSuccess = ''{0}'' wurde erfolgreich ausgef\u00fchrt. - -# Log_CommandFailure = ''{0}'' returned an error status. -Log_CommandFailure = ''{0}'' gibt einen Fehlerwert zur\u00fcck. - -# Log_AllCommandsSuccess = All commands were successfully executed. -Log_AllCommandsSuccess = Alle Anweisungen wurden erfolgreich ausgef\u00fchrt. - -# Log_OutputLogging = Output logging: -Log_OutputLogging = Ausgabe des Protokolls: - -# Log_CommandNotFound = ''{0}'' was not found in the path. Execution attempt: {1} -Log_CommandNotFound = ''{0}'' wurde nicht im Suchpfad gefunden. Ausf\u00fchrungsversuch: {1} - -# Log_DirectiveFound = Directive found in line {0} with {1}. -Log_DirectiveFound = Anweisung in Zeile {0} mit {1} gefunden. - -# Log_RuleFound = Task ''{0}'' found in ''{1}''. -Log_RuleFound = Aufgabe ''{0}'' gefunden in ''{1}''. - -# Log_NoDirectivesFound = No directives found in ''{0}''. -Log_NoDirectivesFound = Keine Anweisungen in ''{0}'' gefunden. - -# Help_Version = print the application version -Help_Version = Ausgabe der Version. - -# Help_Help = print the help message -Help_Help = Ausgabe der Hilfe. - -# Help_Log = generate a log output -Help_Log = Erstelle eine Protokolldatei (.log-Datei). - -# Help_Verbose = print the command output -Help_Verbose = Zeige das Protokoll der Anweisungen im Terminal an. - -# Help_Timeout = set the execution timeout (in milliseconds) -Help_Timeout = Deklariere die Zeitbeschr\u00e4nkung je Anweisung (in Millisekunden). - -# Help_Language = set the application language -Help_Language = Lege die Sprache der Anwendung fest. - -# Header_Slogan = The cool TeX automation tool -Header_Slogan = Das coole TeX Automatisierungstool - -# Header_AllRightsReserved = All rights reserved. -Header_AllRightsReserved = Alle Rechte vorbehalten! - -# Msg_NoDirectivesFound = I didn''t find any directives in ''{0}'', and so didn''t do anything. Is that what you really wanted? -Msg_NoDirectivesFound = Ich habe keine Anweisungen in ''{0}'' gefunden und daher nichts getan. Ist es das, was du wirklich wolltest. - -# Msg_SpecialThanks = A special thanks goes to Alan Munn, Andrew Stacey, Brent Longborough, Clemens Niederberger, David Carlisle, Enrico Gregorio, Francesco Endrici, Gonzalo Medina, Harish Kumar, \u0130lhan Polat, Joseph Wright, Marco Daniel, Mika\u00ebl Maunier, Patrick Gundlach, Rasmus Roulund, Sergey Ulyanov, Stefan Kottwitz, and many others for making this humble tool possible. -Msg_SpecialThanks = Ein besonderes Danke geht an Alan Munn, Andrew Stacey, Brent Longborough, Clemens Niederberger, David Carlisle, Enrico Gregorio, Francesco Endrici, Gonzalo Medina, Harish Kumar, \u0130lhan Polat, Joseph Wright, Marco Daniel, Mika\u00ebl Maunier, Patrick Gundlach, Rasmus Roulund, Sergey Ulyanov, Stefan Kottwitz und viele andere, die dieses bescheidene Tool erm\u00f6glichten. - -# Msg_RunningCommand = Running {0}... -Msg_RunningCommand = Verarbeite {0}... - -# Msg_Success = SUCCESS -Msg_Success = ERFOLGREICH - -# Msg_Failure = FAILURE -Msg_Failure = FEHLERHAFT - -# Msg_Status = Status: -Msg_Status = Status: - -# YamlError_Context = Context: {0} -YamlError_Context = Kontext: {0} - -# YamlError_Problem = Problem: {0} -YamlError_Problem = Problem: {0} - -# YamlError_ErrorLocation = Error found in line {0}, column {1}. -YamlError_ErrorLocation = Fehler in Zeile {0}, Spalte {1}. - -# Error_FileDoesNotExistWithExtensionsList = I''m sorry, but the file ''{0} {1}'' does not exist. Note that when you provide only the basename (i.e, the filename without the extension) or with an unknown extension, arara will try to look for files ending with the predefined extensions {1} in that order. You can override the order, the search pattern or even add support for new extensions through the configuration file. Please refer to the arara manual to learn more about this feature. -Error_FileDoesNotExistWithExtensionsList = Es tut mir Leid, aber die Datei ''{0} {1}'' existiert nicht. Beachte bitte, dass wenn du nur den Dateinamen (ohne Endung) oder eine unbekannte Dateiendung angegeben hast, arara stets versucht nach unterst\u00fctzten Dateiendungen in der Reihenfolge {1} zu suchen. Du kannst die Reihenfolge bzw. das Suchmuster \u00e4ndern oder sogar neue Dateiendung hinzuf\u00fcgen. Bitte konsolidiere die Dokumentation, um mehr \u00fcber dieses und andere Features zu erfahren. - -# Error_FileDoesNotExist = File ''{0}'' does not exist. -Error_FileDoesNotExist = Datei ''{0}'' existiert nicht. - -# Error_CommandNotFound = \nI''m sorry, but the command from the ''{0}'' task could not be found. Are you sure the command ''{1}'' is correct, or even accessible from the system path? -Error_CommandNotFound = Es tut mir Leid, aber die Anweisung der Aufgabe ''{0}'' konnte nicht gefunden werden. Bist du dir sicher, dass die Anweisung ''{1}'' korrekt oder \u00fcber die Systempfade zug\u00e4nglich ist? - -# Error_InvalidYAMLConfigurationFile = I'm sorry, but apparently your arara configuration file is invalid, that is, it has invalid or missing YAML entries. Unfortunately, arara cannot proceed until the error is fixed. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLConfigurationFile = Es tut mir Leid, aber deine arara Konfigurationsdatei ist unzul\u00e4ssig. Dies kann aus einem unzul\u00e4ssigen oder fehlenden YAML Eintrag resultieren. - -# Error_InvalidConfigurationFile = Uh-oh, the configuration file appears to be invalid. Are you sure it's a proper YAML file? Unfortunately, arara cannot proceed until a proper configuration file is provided. -Error_InvalidConfigurationFile = Uh-oh, die Konfigurationsdatei scheint unzul\u00e4ssig zu sein. Bist du dir sicher, dass es sich um eine korrekt erstellte YAML-Datei handelt? Leider kann arara nicht fortsetzen, bis eine passende Konfigurationsdatei bereitgestellt wird. - -# Error_InvalidLanguageConfigurationFile = Houston, we have a problem. Sadly, the language set in the configuration file is not valid. Currently, arara can provide support for the following languages: {0}. Make sure to choose a valid language or remove the entry from the configuration file (the field is optional), otherwise arara cannot proceed. -Error_InvalidLanguageConfigurationFile = Housten, wir haben ein Problem. Leider ist die in der Konfigurationsdatei spezifizierte Sprache nicht zul\u00e4ssig. Momentan kann arara die folgenden Sprachen unterst\u00fctzen: {0}. Stelle sicher, dass eine g\u00fcltige Sprache gew\u00e4hlt wird oder entferne den Eintrag aus deiner Konfigurationsdatei (der Sprachschl\u00fcssel ist optional), ansonsten kann arara nicht ausgef\u00fchrt werden. - -# Error_InvalidFiletypesConfigurationFile = I'm sorry, but it seems your configuration file has customized filetypes with neither the extension or pattern defined. Both are required in order to continue. Please fix this error in your configuration file and try again. -Error_InvalidFiletypesConfigurationFile = Es tut mir Leid, aber es scheint, dass du eine benutzerdefinierte Konfigurationsdatei nutzt, bei der weder die Dateiendung noch das Muster definiert wurde. Beides wird zum Fortfahren ben\u00f6tigt. Bitte behebe diesen Fehler in deiner Konfigurationsdatei und versuche es erneut. - -# Error_PathRuntimeErrorConfigurationFile = I''m sorry, but one of the entries of the search path in your configuration file has an unavailable variable in the path context: ''{0}'' -Error_PathRuntimeErrorConfigurationFile = Es tut mir Leid, aber einer der Eintr\u00e4ge des Suchpfades in deiner Konfigurationsdatei hat eine nicht verf\u00fcgbare Variable im Zusammenhang mit dem Pfad: {0} - -# Error_PathIOErrorConfigurationFile = I'm sorry, but one of the entries of the search path in your configuration file has a malformed directory structure. Could you take a look at it? -Error_PathIOErrorConfigurationFile = Es tut mir Leid, aber einer der Eintr\u00e4ge des Suchpfades in deiner Konfigurationsdatei hat eine ung\u00fcltige Verzeichnisstruktur. Kannst du einen Blick drauf werfen? - -# Error_InvalidYAMLDirective = It appears there is a malformed directive found at line {0}, that is, a directive that might have a YAML syntax error or an invalid field. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLDirective = Es scheint, als g\u00e4be es eine deformierte Anweisung in der Zeile {0}. Die Anweisung kann einen Fehler in der YAML-Syntax aufweisen bzw. einen ung\u00fcltiger Eintrag haben. - -# Error_DirectiveEmptyCurlyBrackets = Directive ''{0}'' at line {1} has empty curly brackets. Note that arara opts for a cleaner syntax when a directive has no parameters. To fix it, it''s enough to either remove the curly brackets or provide the arguments for the directive. -Error_DirectiveEmptyCurlyBrackets = Die Anweisung {0} in Zeile {1} hat ein leeres geschweiftes Klammerpaar. Beachte bitte, dass arara f\u00fcr eine klare Syntax optimiert ist, wenn kein Parameter \u00fcbergeben wird, sollte auch keine Klammer angegeben werden. Um den Fehler zu beseitigen, reicht es aus, die geschweiften Klammern zu entfernen oder ein Argument f\u00fcr die Anweisung zu \u00fcbergeben. - -# Error_DirectiveInvalidArgumentList = Directive ''{0}'' at line {1} has an invalid argument type. The argument ''{2}'' is a reserved arara keyword and always requires a list. -Error_DirectiveInvalidArgumentList = Die Anweisung {0} in Zeile {1} hat einen unzul\u00e4ssigen Argumenttypen. Das Argument {2} ist ein reserviertes Schl\u00fcsselwort von arara und verlangt stets eine Liste. - -# Error_DirectiveReservedKeyword = Directive ''{0}'' at line {1} has an invalid argument name. The name ''{2}'' is a reserved arara keyword representing every element in the ''{3}'' list. Please, pick another name for that argument. -Error_DirectiveReservedKeyword = Die Anweisung {0} in Zeile {1} hat einen unzul\u00e4ssigen Argumentnamen. Der Name {2} ist ein reserviertes Schl\u00fcsselwort von arara und repr\u00e4sentiert jedes Element in der Liste {3}. Bitte w\u00e4hle einen anderen Namen als Argument. - -# Error_DirectiveListError = Directive ''{0}'' at line {1} has an invalid argument type. Only the arguments ''files'' and ''items'' can have a list. Both are reserved arara keywords. -Error_DirectiveListError = Die Anweisung ''{0}'' in Zeile ''{1}'' hat einen unzul\u00e4ssigen Argumenttypen. Nur die Argumente ''files'' und ''items'' k\u00f6nnen eine liste haben. Beides sind reservierte Schl\u00fcsselw\u00f6rter von arara. - -# Error_InvalidDirective = Apparently, there''s an invalid directive at line {0}. Please take a look and fix it. -Error_InvalidDirective = Anscheinend gibt es eine ung\u00fcltige Direktive in der Zeile {0}. Bitte pr\u00fcfe es. - -# Error_DirectiveGenericError = Directive ''{0}'' at line {1} seems to be malformed. It might be a YAML syntax error or a wrong mapping. -Error_DirectiveGenericError = Die Anweisung ''{0}'' in Zeile ''{1}'' scheint deformiert zu sein. Es kann ein Fehler in der YAML-Syntax oder eine falsche Zuordnung sein. - -# Error_InvalidLanguage = I'm sorry, but the language code you chose is invalid. Currently, the following languages are supported: -Error_InvalidLanguage = Es tut mir Leid, aber die gew\u00e4hlte Sprache ist nicht verf\u00fcgbar. Im Moment werden folgende Sprachen unterst\u00fctzt: - -# Error_RuleNotFound = Uh-oh, I could not find the ''{0}'' rule in the search path. Could you take a look if the rule name is correct and if the rule is accessible through the search path? -Error_RuleNotFound = Uh-oh, Ich konnte die Regel ''{0}'' im Suchpfad nicht finden. Kannst du bitte pr\u00fcfen, ob der Regelname korrekt ist und die Regel durch den Suchpfad gefunden wird. - -# Error_InvalidYAMLRule = It appears that the ''{0}'' task has a YAML syntax error or an invalid field. Could you take a look at the ''{0}.yaml'' file located at ''{1}''. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLRule = Es scheint, dass die Aufgabe ''{0}'' einen Fehler in der YAML-Syntax hat oder einen ung\u00fcltiges Feld nutzt. Kannst du einen Blick auf die Datei ''{0}.yaml'' im Pfad ''{1}'' werfen. I versuchte mein Bestes, um die Fehlermeldung auszuwerfen, daher hier ist sie: - -# Error_InvalidRule = Uh-oh, the ''{0}'' task appears to be invalid. Are you sure the ''{0}.yaml'' file located at ''{1}'' is a proper YAML file? -Error_InvalidRule = Uh-oh, Die Aufgabe ''{0}'' scheint ung\u00fcltig zu sein. Bist du dir sicher, dass die Datei ''{0}.yaml'' im Pfad ''{1}'' eine g\u00fcltige YAML file ist? - -# Error_EmptyIdentifierRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid identifier. Could you fix it? -Error_EmptyIdentifierRule = Ein Problem in der Aufgabe ''{0}'' wurde festgestellt. Die Datei ''{0}.yaml'' im Pfad ''{1}'' verlangt einen g\u00fcltigen Bezeichner (identifier). Siehst du den Fehler? - -# Error_EmptyNameRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid name. Could you fix it? -Error_EmptyNameRule = Ein Problem in der Aufgabe ''{0}'' wurde festgestellt. Die Datei ''{0}.yaml'' im Pfad ''{1}'' verlangt einen g\u00fcltigen Dateinamen. Kannst du es beheben? - -# Error_ForbiddenIdentifierRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has an invalid argument identifier. ''{2}'' is a reserved keyword, so it cannot be used. Could you use another name? -Error_ForbiddenIdentifierRule = Uh-oh, die Aufgabe ''{0}'' (Referenzierung auf Datei ''{0}.yaml'' im Pfad ''{1}'') hat einen ung\u00fcltigen Argumenteinbezeichner. ''{2}'' ist ein reserviertes Schl\u00fcsselwort und kann daher nicht genutzt werden. Kannst du einen anderen nutzen? - -# Error_EmptyArgumentsListRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid list of arguments. Could you fix it? Note that the list of arguments can also be empty, but it is still necessary to define it explicitly (with ''arguments: []''). -Error_EmptyArgumentsListRule = Ein Problem wurde in der Aufgabe ''{0}'' festgestellt. Die Datei ''{0}.yaml'' im Pfad ''{1}'' verlangt eine validierte Liste an Argumenten. Kannst du es beheben? Beachte, dass die Liste der Argumente auch leer sein kann. Es ist aber unbedingt notwendig, dass das Argument explizit angeben wird: ''arguments: []''. - -# Error_WrongIdentifierRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has the wrong identifier - ''{0}'' was expected, rather than ''{2}''. Could you fix it? -Error_WrongIdentifierRule = Uh-oh, die Aufgabe ''{0}'' (Referenzierung auf Datei ''{0}.yaml'' im Pfad ''{1}'') hat einen falschen ''identifier'' - es wurde ''{0}'' anstelle von ''{2}'' erwartet. Kannst du es beheben? - -# Error_ArgumentsNotDefinedInRule = Oh no, there are arguments used in the diretive ''{0}'' which are not defined in the ''{0}.yaml'' rule located at ''{1}''. You can either remove them from the ''{0}'' directive or add them to the list of arguments in the ''{0}.yaml'' rule. Here they are: {2} -Error_ArgumentsNotDefinedInRule = Oh nein, es gibt Argumente in der Anweisung ''{0}'', welche nicht in der Regel ''{0}.yaml'' im Pfad ''{1}'' definiert wurden. Du kannst sie aus der Anweisung ''{0}'' entfernen oder als Liste von Argumenten in der Regel ''{0}.yaml'' erg\u00e4nzen. Hier sind sie: {2} - -# Error_DefaultValueRuntimeErrorRule = I''m sorry, but the default value set for the argument ''{0}'' of the ''{1}'' task (referencing the ''{1}.yaml'' file located at ''{2}'') has an unavailable variable/method in the rule context: ''{3}'' -Error_DefaultValueRuntimeErrorRule = Es tut mir Leid, aber der Defaultwert f\u00fcr das Argument ''{0}'' der Aufgabe ''{1}'' (Referenzierung auf Datei ''{0}.yaml'' im Pfad ''{1}'') hat eine ung\u00fcltige Variable/Methode im Regelkontext: ''{3}'' - -# Error_FlagRuntimeErrorRule = I''m sorry, but the flag set for the argument ''{0}'' of the ''{1}'' task (referencing the ''{1}.yaml'' file located at ''{2}'') has an unavailable variable/method in the rule context: ''{3}'' -Error_FlagRuntimeErrorRule = Es tut mir Leid, aber der Flag f\u00fcr das Argument ''{0}'' der Aufgabe ''{1}'' (Referenzierung auf Datei ''{0}.yaml'' im Pfad ''{1}'') hat eine ung\u00fcltige Variable/Methode im Regelkontext: ''{3}'' - -# Error_DuplicatedCommandElementsRule = Uh-oh, both ''command'' and ''commands'' fields are set in the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}''). You need to pick only one of them. If your task only relies on a single command, you can opt for ''command''; if your rule requires a set of commands, maybe the ''commands'' field is more suitable. -Error_DuplicatedCommandElementsRule = Uh-oh, in der Aufgabe ''{0}'' werden beide Felder ''command'' und ''commands'' verwendet (Referenzierung auf Datei ''{0}.yaml'' im Pfad ''{1}''). Du kannst nur eine der Anweisungen ausw\u00e4hlen. Sollte deine Aufgabe von einem einzelnen Kommando abh\u00e4ngen, kannst du ''command'' optimieren. Sollte deine Regel mehrere Anweisungen ben\u00f6tigen, k\u00f6nnte das Feld ''commands'' geeignet sein. - -# Error_MissingCommandElementsRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') does not have either the ''command'' or ''commands'' elements. You need to pick only one of them. If your task only relies on a single command, you can opt for ''command''; if your rule requires a set of commands, maybe the ''commands'' field is more suitable. -Error_MissingCommandElementsRule = Uh-oh, die Aufgabe ''{0}'' (Referenzierung auf Datei ''{0}.yaml'' im Pfad ''{1}'') hat weder 'command'' noch 'commands'' Elemente. Du musst nur eine der Anweisungen ausw\u00e4hlen. Sollte deine Aufgabe von einem einzelnen Kommando abh\u00e4ngen, kannst du ''command'' optimieren. Sollte deine Regel mehrere Anweisungen ben\u00f6tigen, k\u00f6nnte das Feld ''commands'' geeignet sein. - -# Error_CommandRuntimeErrorRule = I''m sorry, but the command set for the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has an unavailable variable/method in the rule context: ''{2}'' -Error_CommandRuntimeErrorRule = Es tut mir Leid, aber das Kommando, welches in der Aufgabe ''{0}'' (Referenzierung auf Datei ''{0}.yaml'' im Pfad ''{1}'') genutzt wird, hat eine ung\u00fcltige Variable/Methode im Regelsinn: ''{2}'' - diff --git a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_es.properties b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_es.properties deleted file mode 100644 index f48535fe9ce..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_es.properties +++ /dev/null @@ -1,226 +0,0 @@ -# Arara -- the cool TeX automation tool -# Copyright (c) 2012, Paulo Roberto Massa Cereda -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the project's author nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# Messages: This file holds the default Spanish messages for arara. -# -# author: Gonzalo Medina -# e-mail: gmedinaar@unal.edu.co - -# Log_WelcomeMessage = Welcome to arara! -Log_WelcomeMessage = \u00a1Bienvenido a arara! - -# Log_ProcessingFile = Processing file ''{0}'', please wait. -Log_ProcessingFile = Procesando el archivo ''{0}'', por favor espere. - -# Log_Done = Done. -Log_Done = Listo. - -# Log_ExceptionRaised = Arara raised an exception with the following message: -Log_ExceptionRaised = Arara gener\u00f3 una excepci\u00f3n con el siguiente mensaje: - -# Log_ReadyToRunCommands = Ready to run commands. -Log_ReadyToRunCommands = Listo para ejecutar comandos. - -# Log_CommandName = Running ''{0}''. -Log_CommandName = Ejecutando ''{0}''. - -# Log_Command = Command: {0} -Log_Command = Comando: {0} - -# Log_CommandSuccess = ''{0}'' was successfully executed. -Log_CommandSuccess = ''{0}'' se ejecut\u00f3 de manera exitosa. - -# Log_CommandFailure = ''{0}'' returned an error status. -Log_CommandFailure = ''{0}'' emiti\u00f3 un estado de error. - -# Log_AllCommandsSuccess = All commands were successfully executed. -Log_AllCommandsSuccess = Todos los comandos han sido ejecutados de manera exitosa. - -# Log_OutputLogging = Output logging: -Log_OutputLogging = Recuento de la salida: - -# Log_CommandNotFound = ''{0}'' was not found in the path. Execution attempt: {1} -Log_CommandNotFound = ''{0}'' no se encontr\u00f3 en la ruta. Tentativa de ejecuci\u00f3n: {1} - -# Log_DirectiveFound = Directive found in line {0} with {1}. -Log_DirectiveFound = Directiva encontrada en la l\u00ednea {0} con {1}. - -# Log_RuleFound = Task ''{0}'' found in ''{1}''. -Log_RuleFound = Tarea ''{0}'' encontrada en ''{1}''. - -# Log_NoDirectivesFound = No directives found in ''{0}''. -Log_NoDirectivesFound = No se encontraron directivas en ''{0}''. - -# Help_Version = print the application version -Help_Version = imprime la versi\u00f3n de la aplicaci\u00f3n - -# Help_Help = print the help message -Help_Help = imprime el mensaje de ayuda - -# Help_Log = generate a log output -Help_Log = genera el registro de la salida - -# Help_Verbose = print the command output -Help_Verbose = imprime la salida del comando - -# Help_Timeout = set the execution timeout (in milliseconds) -Help_Timeout = configura el 'timeout' de la ejecuci\u00f3n (en milisegundos) - -# Help_Language = set the application language -Help_Language = configura el idioma de la aplicaci\u00f3n - -# Header_Slogan = The cool TeX automation tool -Header_Slogan = The cool TeX automation tool - -# Header_AllRightsReserved = All rights reserved. -Header_AllRightsReserved = Todos los derechos reservados. - -# Msg_NoDirectivesFound = I didn''t find any directives in ''{0}'', and so didn''t do anything. Is that what you really wanted? -Msg_NoDirectivesFound = No encontr\u00e9 directivas en ''{0}'', por lo que no ejecut\u00e9 ninguna acci\u00f3n. \u00bfEra esto lo que realmente deseaba? - -# Msg_SpecialThanks = A special thanks goes to Alan Munn, Andrew Stacey, Brent Longborough, Clemens Niederberger, David Carlisle, Enrico Gregorio, Francesco Endrici, Gonzalo Medina, Harish Kumar, \u0130lhan Polat, Joseph Wright, Marco Daniel, Mika\u00ebl Maunier, Patrick Gundlach, Rasmus Roulund, Sergey Ulyanov, Stefan Kottwitz, and many others for making this humble tool possible. -Msg_SpecialThanks = Un agradecimiento especial a Alan Munn, Andrew Stacey, Brent Longborough, Clemens Niederberger, David Carlisle, Enrico Gregorio, Francesco Endrici, Gonzalo Medina, Harish Kumar, \u0130lhan Polat, Joseph Wright, Marco Daniel, Mika\u00ebl Maunier, Patrick Gundlach, Rasmus Roulund, Sergey Ulyanov, Stefan Kottwitz, y a muchos otros por hacer posible esta herramienta. - -# Msg_RunningCommand = Running {0}... -Msg_RunningCommand = Ejecutando {0}... - -# Msg_Success = SUCCESS -Msg_Success = \u00c9XITO - -# Msg_Failure = FAILURE -Msg_Failure = FALLO - -# Msg_Status = Status: -Msg_Status = Estado: - -# YamlError_Context = Context: {0} -YamlError_Context = Contexto: {0} - -# YamlError_Problem = Problem: {0} -YamlError_Problem = Problema: {0} - -# YamlError_ErrorLocation = Error found in line {0}, column {1}. -YamlError_ErrorLocation = Error encontrado en la l\u00ednea {0}, columna {1}. - -# Error_FileDoesNotExistWithExtensionsList = I''m sorry, but the file ''{0} {1}'' does not exist. Note that when you provide only the basename (i.e, the filename without the extension) or with an unknown extension, arara will try to look for files ending with the predefined extensions {1} in that order. You can override the order, the search pattern or even add support for new extensions through the configuration file. Please refer to the arara manual to learn more about this feature. -Error_FileDoesNotExistWithExtensionsList = Lo siento, pero el archivo ''{0} {1}'' no existe. Note que cuando \u00fanicamente se utiliza el nombre base (es decir, el nombre del archivo sin la extensi\u00f3n) o cuando se usa una extansi\u00f3n desconocida, arara intentar\u00e1 buscar los archivos terminados en las extensiones predefinidas {1} en ese orden. El orden y los patrones de b\u00fasqueda se pueden modificar, incluso se puede agregar soporte para nuevas extensiones, utilizando el archivo de configuraci\u00f3n. Por favor consulte el manual de arara para mayor informaci\u00f3n. - -# Error_FileDoesNotExist = File ''{0}'' does not exist. -Error_FileDoesNotExist = El archivo ''{0}'' no existe. - -# Error_CommandNotFound = \nI''m sorry, but the command from the ''{0}'' task could not be found. Are you sure the command ''{1}'' is correct, or even accessible from the system path? -Error_CommandNotFound = \nLo siento, pero el comando para la tarea ''{0}'' no se encontr\u00f3. Aseg\u00farese de que el comando ''{1}'' sea correcto y accesible desde la ruta (''path'') del sistema. - -# Error_InvalidYAMLConfigurationFile = I'm sorry, but apparently your arara configuration file is invalid, that is, it has invalid or missing YAML entries. Unfortunately, arara cannot proceed until the error is fixed. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLConfigurationFile = Lo siento, pero aparentemente su archivo de configuraci\u00f3n de arara no es v\u00e1lido; es decir, algunas entradas YAML hacen falta o son no v\u00e1lidas. Desafortunadamente, arara no puede seguir adelante hasta que se corrija el error. Hice mi mejor esfuerzo registrando el mensaje de error, que es el siguiente: - -# Error_InvalidConfigurationFile = Uh-oh, the configuration file appears to be invalid. Are you sure it's a proper YAML file? Unfortunately, arara cannot proceed until a proper configuration file is provided. -Error_InvalidConfigurationFile = \u00a10h, oh! El archivo de configuraci\u00f3n parece no ser v\u00e1lido. Aseg\u00farese de que sea un archivo YAML correcto. Desafortunadamente, arara no puede continuar a menos que el archivo de configuraci\u00f3n sea correcto. - -# Error_InvalidLanguageConfigurationFile = Houston, we have a problem. Sadly, the language set in the configuration file is not valid. Currently, arara can provide support for the following languages: {0}. Make sure to choose a valid language or remove the entry from the configuration file (the field is optional), otherwise arara cannot proceed. -Error_InvalidLanguageConfigurationFile = !Houston, tenemos un problema! Lamentablemente, el idioma configurado en el archivo de configuraci\u00f3n no es v\u00e1lido. Actualemente arara soporta los siguientes idiomas: {0}. Aseg\u00farese de escoger un idioma v\u00e1lido o suprima la entrada del archivo de configuraci\u00f3n (el campo es opcional), de lo contrario, arara no podr\u00e1 continuar. - -# Error_InvalidFiletypesConfigurationFile = I'm sorry, but it seems your configuration file has customized filetypes with neither the extension or pattern defined. Both are required in order to continue. Please fix this error in your configuration file and try again. -Error_InvalidFiletypesConfigurationFile = Lo siento, pero parece que el archivo de configuraci\u00f3n contiene tipos de archivo para los cuales no se ha definido una extensi\u00f3n o un patr\u00f3n. Los dos son necesarios para continuar. Por favor, corrija este error en el archivo de configuraci\u00f3n e intente nuevamente. - -# Error_PathRuntimeErrorConfigurationFile = I''m sorry, but one of the entries of the search path in your configuration file has an unavailable variable in the path context: ''{0}'' -Error_PathRuntimeErrorConfigurationFile = Lo siento, pero una de las entradas de la ruta de b\u00fasqueda en el archivo de configuraci\u00f3n contiene una variable no disponible en este contexto: ''{0}'' - -# Error_PathIOErrorConfigurationFile = I'm sorry, but one of the entries of the search path in your configuration file has a malformed directory structure. Could you take a look at it? -Error_PathIOErrorConfigurationFile = Lo siento, pero una de las entradas de la ruta de b\u00fasqueda en el archivo de configuraci\u00f3n tiene una estructura jer\u00e1rquica mal formada. \u00bfPodr\u00eda por favor revisar las entradas? - -# Error_InvalidYAMLDirective = It appears there is a malformed directive found at line {0}, that is, a directive that might have a YAML syntax error or an invalid field. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLDirective = Parece que hay una directiva mal formada en la l\u00ednea {0}; es decir, una directiva con un error de sintaxis YAML o con un campo inv\u00e1lido. Hice mi mejor esfuerzo registrando el mensaje de error, que es el siguiente: - -# Error_DirectiveEmptyCurlyBrackets = Directive ''{0}'' at line {1} has empty curly brackets. Note that arara opts for a cleaner syntax when a directive has no parameters. To fix it, it''s enough to either remove the curly brackets or provide the arguments for the directive. -Error_DirectiveEmptyCurlyBrackets = La directiva ''{0}'' en la l\u00ednea {1} no tiene contenido entre un par de llaves. Note que arara utiliza una sintaxis m\u00e1s simple cuando una directiva no tiene par\u00e1metros. Para corregir este error, es suficiente remover las llaves o insertar un argumento en la directiva. - -# Error_DirectiveInvalidArgumentList = Directive ''{0}'' at line {1} has an invalid argument type. The argument ''{2}'' is a reserved arara keyword and always requires a list. -Error_DirectiveInvalidArgumentList = La directiva ''{0}'' en la l\u00ednea {1} tiene un tipo de argumento no v\u00e1lido. El argumento ''{2}'' es una palabra clave reservada de arara que siempre requiere de una lista. - -# Error_DirectiveReservedKeyword = Directive ''{0}'' at line {1} has an invalid argument name. The name ''{2}'' is a reserved arara keyword representing every element in the ''{3}'' list. Please, pick another name for that argument. -Error_DirectiveReservedKeyword = La directiva ''{0}'' en la l\u00ednea {1} tiene un nombre de argumento no v\u00e1lido. El nombre ''{2}'' es una palabra clave reservada de arara que representa todos los elementos de la lista ''{3}''. Por favor, escoja otro nombre para el argumento. - -# Error_DirectiveListError = Directive ''{0}'' at line {1} has an invalid argument type. Only the arguments ''files'' and ''items'' can have a list. Both are reserved arara keywords. -Error_DirectiveListError = La directiva ''{0}'' en la l\u00ednea {1} tiene un tipo de argumento no v\u00e1lido. \u00danicamente los argumentos ''files'' e ''items'' pueden contener una lista; los dos son palabras claves reservadas de arara. - -# Error_InvalidDirective = Apparently, there''s an invalid directive at line {0}. Please take a look and fix it. -Error_InvalidDirective = Aparentemente, hay una directiva no v\u00e1lida en la l\u00ednea {0}. Por favor rev\u00edsela y haga las correcciones necesarias. - -# Error_DirectiveGenericError = Directive ''{0}'' at line {1} seems to be malformed. It might be a YAML syntax error or a wrong mapping. -Error_DirectiveGenericError = La directiva ''{0}'' en la l\u00ednea {1} est\u00e1 mal formada. Podr\u00eda tratarse de un error de sintaxis YAML o de una asignaci\u00f3n incorrecta. - -# Error_InvalidLanguage = I'm sorry, but the language code you chose is invalid. Currently, the following languages are supported: -Error_InvalidLanguage = Lo siento, pero el c\u00f3digo de idioma escogido es inv\u00e1lido. Actualmente, arara soporta los siguientes idiomas: - -# Error_RuleNotFound = Uh-oh, I could not find the ''{0}'' rule in the search path. Could you take a look if the rule name is correct and if the rule is accessible through the search path? -Error_RuleNotFound = \u00a1Oh, oh! No se pudo hallar la regla ''{0}'' en la ruta de b\u00fasqueda. Revise que el nombre de la regla sea el corrceto y que la regla sea accesible usando la ruta de b\u00fasqueda. - -# Error_InvalidYAMLRule = It appears that the ''{0}'' task has a YAML syntax error or an invalid field. Could you take a look at the ''{0}.yaml'' file located at ''{1}''. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLRule = Aparentemente la tarea ''{0}'' contiene un error de sintaxis YAML o un campo incorrecto. Por favor revise el archivo ''{0}.yaml'' localizado en ''{1}''. Hice mi mejor esfuerzo registrando el mensaje de error, que es el siguiente: - -# Error_InvalidRule = Uh-oh, the ''{0}'' task appears to be invalid. Are you sure the ''{0}.yaml'' file located at ''{1}'' is a proper YAML file? -Error_InvalidRule = !Oh, oh! Parece que la tarea ''{0}'' es inv\u00e1lida. Aseg\u00farese de que el archivo ''{0}.yaml'' localizado en ''{1}'' sea un archivo YAML correcto. - -# Error_EmptyIdentifierRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid identifier. Could you fix it? -Error_EmptyIdentifierRule = Se detect\u00f3 un problema en la tarea ''{0}''. El archivo ''{0}.yaml'' localizado en ''{1}'' necesita un identificador v\u00e1lido. \u00bfPodr\u00eda, por favor, corregirlo? - -# Error_EmptyNameRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid name. Could you fix it? -Error_EmptyNameRule = Se detect\u00f3 un problema en la tarea ''{0}''. El archivo ''{0}.yaml'' localizado en ''{1}'' necesita un nombre v\u00e1lido. \u00bfPodr\u00eda, por favor, corregirlo? - -# Error_ForbiddenIdentifierRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has an invalid argument identifier. ''{2}'' is a reserved keyword, so it cannot be used. Could you use another name? -Error_ForbiddenIdentifierRule = !Oh, oh! La tarea ''{0}'' (que hace referencia al archivo ''{0}.yaml'' localizado en ''{1}'') contiene un identificador de argumentos inv\u00e1lido. ''{2}'' es una palabra reservada y no puede ser utilizada. Por favor, utilice otro nombre. - -# Error_EmptyArgumentsListRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid list of arguments. Could you fix it? Note that the list of arguments can also be empty, but it is still necessary to define it explicitly (with ''arguments: []''). -Error_EmptyArgumentsListRule = Se detect\u00f3 un problema en la tarea ''{0}''. El archivo ''{0}.yaml'' localizado en ''{1}'' necesita una lista valida de argumentos. Por favor, corr\u00edjala. Note que la lista de argumentos puede ser vac\u00eda, pero esto debe declararse expl\u00edcitamente (utilizando ''arguments: []''). - -# Error_WrongIdentifierRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has the wrong identifier - ''{0}'' was expected, rather than ''{2}''. Could you fix it? -Error_WrongIdentifierRule = \u00a1Oh, oh! La tarea ''{0}'' (que hace referencia al archivo ''{0}.yaml'' localizado en ''{1}'') tiene un identificadoe err\u00f3neo - Se esperaba ''{0}'' y no ''{2}''. Por favor, corr\u00edjalo. - -# Error_ArgumentsNotDefinedInRule = Oh no, there are arguments used in the diretive ''{0}'' which are not defined in the ''{0}.yaml'' rule located at ''{1}''. You can either remove them from the ''{0}'' directive or add them to the list of arguments in the ''{0}.yaml'' rule. Here they are: {2} -Error_ArgumentsNotDefinedInRule = \u00a1Oh, no! En la directiva ''{0}'' se usan argumentos que no est\u00e1n definidos en la regla ''{0}.yaml'' localizada en ''{1}''. Puede o bien removerlos de la directiva ''{0}'' o bien agregarlos a la lista de argumentos en la regla ''{0}.yaml''. Estos son: {2} - -# Error_DefaultValueRuntimeErrorRule = I''m sorry, but the default value set for the argument ''{0}'' of the ''{1}'' task (referencing the ''{1}.yaml'' file located at ''{2}'') has an unavailable variable/method in the rule context: ''{3}'' -Error_DefaultValueRuntimeErrorRule = Lo siento, pero el valor por defecto asignado al argumento ''{0}'' de la tarea ''{1}'' (que hace referencia al archivo ''{1}.yaml'' localizado en ''{2}'') contiene una variable o un m\u00e9todo no v\u00e1lido en el contexto de la regla: ''{3}'' - -# Error_FlagRuntimeErrorRule = I''m sorry, but the flag set for the argument ''{0}'' of the ''{1}'' task (referencing the ''{1}.yaml'' file located at ''{2}'') has an unavailable variable/method in the rule context: ''{3}'' -Error_FlagRuntimeErrorRule = Lo siento, pero la se\u00f1al (''flag'') asignada al argumento ''{0}'' de la tarea ''{1}'' (que hace referencia al archivo ''{1}.yaml'' localizado en ''{2}'') contiene una variable o un m\u00e9todo no v\u00e1lido en el contexto de la regla: ''{3}'' - -# Error_DuplicatedCommandElementsRule = Uh-oh, both ''command'' and ''commands'' fields are set in the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}''). You need to pick only one of them. If your task only relies on a single command, you can opt for ''command''; if your rule requires a set of commands, maybe the ''commands'' field is more suitable. -Error_DuplicatedCommandElementsRule = \u00a1Oh, oh! Los dos campos ''command'' y ''commands'' fueron simult\u00e1neamente asignados en la tarea ''{0}'' (que hace referencia al archivo ''{0}.yaml'' localizado en ''{1}''). Es necesario escoger \u00fanicamente uno de los dos. Si la tarea tan solo requiere un \u00fanico comando, puede usar ''command''; si la regla requiere un conjunto de comandos, quiz\u00e1 sea preferible utilizar el campo ''commands''. - -# Error_MissingCommandElementsRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') does not have either the ''command'' or ''commands'' elements. You need to pick only one of them. If your task only relies on a single command, you can opt for ''command''; if your rule requires a set of commands, maybe the ''commands'' field is more suitable. -Error_MissingCommandElementsRule = \u00a1Oh, oh! En la tarea ''{0}'' (que hace referencia al archivo ''{0}.yaml'' localizado en ''{1}'') hace falta o bien ''command'' o bien ''commands''. Es necesario utilizar uno de ellos. Si la tarea tan solo requiere un \u00fanico comando, puede usar ''command''; si la regla requiere de un conjunto de comandos, quiz\u00e1 sea preferible utilizar el campo ''commands''. - -# Error_CommandRuntimeErrorRule = I''m sorry, but the command set for the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has an unavailable variable/method in the rule context: ''{2}'' -Error_CommandRuntimeErrorRule = Lo siento, pero el comando asignado a la tarea ''{0}'' (que hace referencia al archivo ''{0}.yaml'' localizado en ''{1}'') contiene una variable o un m\u00e9todo no v\u00e1lido en el contexto de la regla: ''{2}'' - diff --git a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_fr.properties b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_fr.properties deleted file mode 100644 index 8796caa1817..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_fr.properties +++ /dev/null @@ -1,226 +0,0 @@ -# Arara -- the cool TeX automation tool -# Copyright (c) 2012, Paulo Roberto Massa Cereda -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the project's author nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# Messages_fr: This file holds the French language messages for arara. -# -# translator: Mika\u00ebl Maunier -# e-mail: mmaunier2001@yahoo.fr - -# Log_WelcomeMessage = Welcome to arara! -Log_WelcomeMessage = Arara vous souhaite la bienvenue ! - -# Log_ProcessingFile = Processing file ''{0}'', please wait. -Log_ProcessingFile = Traitement du fichier ''{0}'', veuillez patienter. - -# Log_Done = Done. -Log_Done = Termin\u00e9. - -# Log_ExceptionRaised = Arara raised an exception with the following message: -Log_ExceptionRaised = Arara a g\u00e9n\u00e9r\u00e9 une erreur avec le message suivant : - -# Log_ReadyToRunCommands = Ready to run commands. -Log_ReadyToRunCommands = Pr\u00eat \u00e0 executer des commandes. - -# Log_CommandName = Running ''{0}''. -Log_CommandName = Execution de ''{0}''. - -# Log_Command = Command: {0} -Log_Command = Commande : {0} - -# Log_CommandSuccess = ''{0}'' was successfully executed. -Log_CommandSuccess = ''{0}'' ex\u00e9cut\u00e9 avec succ\u00e8s. - -# Log_CommandFailure = ''{0}'' returned an error status. -Log_CommandFailure = ''{0}'' a renvoy\u00e9 une erreur. - -# Log_AllCommandsSuccess = All commands were successfully executed. -Log_AllCommandsSuccess = Toutes les commandes ont \u00e9t\u00e9 correctement ex\u00e9cut\u00e9es. - -# Log_OutputLogging = Output logging: -Log_OutputLogging = Journal de sortie: - -# Log_CommandNotFound = ''{0}'' was not found in the path. Execution attempt: {1} -Log_CommandNotFound = ''{0}'' non trouv\u00e9(e) dans le PATH. Tentative d''execution : {1} - -# Log_DirectiveFound = Directive found in line {0} with {1}. -Log_DirectiveFound = Instruction trouv\u00e9e \u00e0 la ligne {0} avec {1}. - -# Log_RuleFound = Task ''{0}'' found in ''{1}''. -Log_RuleFound = T\u00e2che ''{0}'' trouv\u00e9e dans ''{1}''. - -# Log_NoDirectivesFound = No directives found in ''{0}''. -Log_NoDirectivesFound = Aucune instructions trouv\u00e9es dans ''{0}''. - -# Help_Version = print the application version -Help_Version = affiche la version de l'application - -# Help_Help = print the help message -Help_Help = affiche le message d'aide - -# Help_Log = generate a log output -Help_Log = g\u00e9n\u00e8re un journal de sortie - -# Help_Verbose = print the command output -Help_Verbose = affiche la sortie de la commande. - -# Help_Timeout = set the execution timeout (in milliseconds) -Help_Timeout = d\u00e9finit le temps d'execution (en millisecondes) - -# Help_Language = set the application language -Help_Language = d\u00e9finit la langue de l'application - -# Header_Slogan = The cool TeX automation tool -Header_Slogan = L'outil de traitement TeX vraiment cool - -# Header_AllRightsReserved = All rights reserved. -Header_AllRightsReserved = Tous droits r\u00e9serv\u00e9s. - -# Msg_NoDirectivesFound = I didn''t find any directives in ''{0}'', and so didn''t do anything. Is that what you really wanted? -Msg_NoDirectivesFound = Je n''ai trouv\u00e9 aucunes instructions dans ''{0}'', aussi n''ai-je rien fait. Est-ce r\u00e9ellment ce que vous vouliez ? - -# Msg_SpecialThanks = A special thanks goes to Alan Munn, Andrew Stacey, Brent Longborough, Clemens Niederberger, David Carlisle, Enrico Gregorio, Francesco Endrici, Gonzalo Medina, Harish Kumar, \u0130lhan Polat, Joseph Wright, Marco Daniel, Mika\u00ebl Maunier, Patrick Gundlach, Rasmus Roulund, Sergey Ulyanov, Stefan Kottwitz, and many others for making this humble tool possible. -Msg_SpecialThanks = Un remerciement sp\u00e9cial pour Alan Munn, Andrew Stacey, Brent Longborough, Clemens Niederberger, David Carlisle, Enrico Gregorio, Francesco Endrici, Gonzalo Medina, Harish Kumar, \u0130lhan Polat, Joseph Wright, Marco Daniel, Mika\u00ebl Maunier, Patrick Gundlach, Rasmus Roulund, Sergey Ulyanov, Stefan Kottwitz, et de nombreux autres qui ont rendu possible la cr\u00e9ation de cet humble outil. - -# Msg_RunningCommand = Running {0}... -Msg_RunningCommand = Execution de {0}... - -# Msg_Success = SUCCESS -Msg_Success = SUCC\u00c8S - -# Msg_Failure = FAILURE -Msg_Failure = \u00c9CHEC - -# Msg_Status = Status: -Msg_Status = Status : - -# YamlError_Context = Context: {0} -YamlError_Context = Contexte : {0} - -# YamlError_Problem = Problem: {0} -YamlError_Problem = Probl\u00e8me: {0} - -# YamlError_ErrorLocation = Error found in line {0}, column {1}. -YamlError_ErrorLocation = Erreur trouv\u00e9e \u00e0 la ligne {0}, colonne {1}. - -# Error_FileDoesNotExistWithExtensionsList = I''m sorry, but the file ''{0} {1}'' does not exist. Note that when you provide only the basename (i.e, the filename without the extension) or with an unknown extension, arara will try to look for files ending with the predefined extensions {1} in that order. You can override the order, the search pattern or even add support for new extensions through the configuration file. Please refer to the arara manual to learn more about this feature. -Error_FileDoesNotExistWithExtensionsList = Je suis d\u00e9sol\u00e9 mais le fichier ''{0} {1}'' n''existe pas. Notez qu''en ne fournissant que le nom de base (i.e, le nom sans l''extension) ou bien une extension inconnue, arara essaiera de chercher des fichiers se terminant par les extensions pr\u00e9d\u00e9finies {1} dans cet ordre. Vous pouvez modifier l''ordre, le motif pour la recherche ou m\u00eame ajouter de nouvelles extensions par le biais du fichier de configuration. Merci de vous r\u00e9f\u00e9rer au manuel d'arara pour en apprendre plus sur cette caract\u00e9ristique. - -# Error_FileDoesNotExist = File ''{0}'' does not exist. -Error_FileDoesNotExist = Le fichier ''{0}'' n''existe pas. - -# Error_CommandNotFound = \nI''m sorry, but the command from the ''{0}'' task could not be found. Are you sure the command ''{1}'' is correct, or even accessible from the system path? -Error_CommandNotFound = \nJe suis navr\u00e9, mais la commande en provenance de la t\u00e2che ''{0}'' n''a pas \u00e9t\u00e9 trouv\u00e9e. \u00cates-vous sur(e) que la commande ''{1}'' est correcte et accessible depuis le PATH ? - -# Error_InvalidYAMLConfigurationFile = I'm sorry, but apparently your arara configuration file is invalid, that is, it has invalid or missing YAML entries. Unfortunately, arara cannot proceed until the error is fixed. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLConfigurationFile = Je suis d\u00e9sol\u00e9, apparemment votre fichier de configuration d'arara est invalide ; il contient des entr\u00e9es YAML invalides ou certaines sont manquantes. Malheureusement, arara ne peut pas continuer tant que l'erreur n'est pas r\u00e9par\u00e9e. J'ai fait de mon mieux pour r\u00e9cup\u00e9rer le message d'erreur, le voici : - -# Error_InvalidConfigurationFile = Uh-oh, the configuration file appears to be invalid. Are you sure it's a proper YAML file? Unfortunately, arara cannot proceed until a proper configuration file is provided. -Error_InvalidConfigurationFile = Oh-oh, le fichier de configuration est invalide. \u00cates-vous sur(e) qu'il s'agit d'un fichier YAML correct ? Malheureusement, arara ne pourra pas continuer tant qu'un fichier de configuration correct ne sera pas disponible. - -# Error_InvalidLanguageConfigurationFile = Houston, we have a problem. Sadly, the language set in the configuration file is not valid. Currently, arara can provide support for the following languages: {0}. Make sure to choose a valid language or remove the entry from the configuration file (the field is optional), otherwise arara cannot proceed. -Error_InvalidLanguageConfigurationFile = Houston, nous avons un probl\u00e8me. C''est triste \u00e0 dire mais le langage d\u00e9finit dans le fichier de configuration est incorrect. Pour l''instant, arara supporte les langages suivants : {0}. Soyez sur(e) de choisir un langage correct ou de retirer l''entr\u00e9e du fichier de configuration (le champ est optionnel), sinon arara ne pourra pas continuer. - -# Error_InvalidFiletypesConfigurationFile = I'm sorry, but it seems your configuration file has customized filetypes with neither the extension or pattern defined. Both are required in order to continue. Please fix this error in your configuration file and try again. -Error_InvalidFiletypesConfigurationFile = Je suis navr\u00e9 mais il semble que votre fichier de configuration contient des extensions de fichiers personnalis\u00e9es dont ni l'extension ni le motif ne sont d\u00e9finis. Les deux sont requis pour pouvoir continuer. Veuillez r\u00e9gler ce probl\u00e8me dans votre fichier de configuration puis essayer \u00e0 nouveau. - -# Error_PathRuntimeErrorConfigurationFile = I''m sorry, but one of the entries of the search path in your configuration file has an unavailable variable in the path context: ''{0}'' -Error_PathRuntimeErrorConfigurationFile = Je suis d\u00e9sol\u00e9 mais une des entr\u00e9es du chemin de recherche dans votre fichier de configuration contient une variable non disponible dans le contexte du PATH : ''{0}'' - -# Error_PathIOErrorConfigurationFile = I'm sorry, but one of the entries of the search path in your configuration file has a malformed directory structure. Could you take a look at it? -Error_PathIOErrorConfigurationFile = D\u00e9sol\u00e9. Une des entr\u00e9es du chemin de recherche dans votre fichier de configuration contient une structure de r\u00e9pertoire incorrecte. Pourriez vous y jetez un coup d'oeil ? - -# Error_InvalidYAMLDirective = It appears there is a malformed directive found at line {0}, that is, a directive that might have a YAML syntax error or an invalid field. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLDirective = Il semble qu''il y ait une intruction mal \u00e9crite \u00e0 la ligne {0}. Il est possible que ce soit une instruction qui contiennent une erreur de syntaxe YAML ou un champ invalide. J''ai fait de mon mieux pour r\u00e9cup\u00e9rer le message d''erreur, le voici : - -# Error_DirectiveEmptyCurlyBrackets = Directive ''{0}'' at line {1} has empty curly brackets. Note that arara opts for a cleaner syntax when a directive has no parameters. To fix it, it''s enough to either remove the curly brackets or provide the arguments for the directive. -Error_DirectiveEmptyCurlyBrackets = L''instruction ''{0}'' \u00e0 la ligne {1} a des accolades vides. Notez qu''arara opte pour une syntaxe plus \u00e9pur\u00e9e quand une instruction n''a pas de param\u00e8tres. Pour r\u00e9gler le probl\u00e8me, il suffit soit d''enlever les accolades soit de fournir les arguments pour la commande. - -# Error_DirectiveInvalidArgumentList = Directive ''{0}'' at line {1} has an invalid argument type. The argument ''{2}'' is a reserved arara keyword and always requires a list. -Error_DirectiveInvalidArgumentList = L''instruction ''{0}'' \u00e0 la ligne {1} a un type d''argument incorrect. L''argument ''{2}'' est un mot-cl\u00e9 pour arara et requiert obligatoirement une liste. - -# Error_DirectiveReservedKeyword = Directive ''{0}'' at line {1} has an invalid argument name. The name ''{2}'' is a reserved arara keyword representing every element in the ''{3}'' list. Please, pick another name for that argument. -Error_DirectiveReservedKeyword = L''instruction ''{0}'' \u00e0 la ligne {1} a un nom d''argument incorrect. Le nom ''{2}'' est un mot-cl\u00e9 pour arara qui repr\u00e9sente tous les \u00e9l\u00e9ments dans la liste ''{3}''. Veuillez choisir un autre nom pour cet argument. - -# Error_DirectiveListError = Directive ''{0}'' at line {1} has an invalid argument type. Only the arguments ''files'' and ''items'' can have a list. Both are reserved arara keywords. -Error_DirectiveListError = L''instruction ''{0}'' \u00e0 la ligne {1} a type d''argument incorrect. Seul les arguments ''files'' et ''items'' peuvent avoir une liste. Les deux sont des mots-cl\u00e9s r\u00e9serv\u00e9s pour arara. - -# Error_InvalidDirective = Apparently, there''s an invalid directive at line {0}. Please take a look and fix it. -Error_InvalidDirective = Apparemment, il y a une commande invalide \u00e0 la ligne {0}. S''il vous pla\u00eet, veuillez y jeter un oeil et r\u00e9gler le probl\u00e8me. - -# Error_DirectiveGenericError = Directive ''{0}'' at line {1} seems to be malformed. It might be a YAML syntax error or a wrong mapping. -Error_DirectiveGenericError = L''instruction ''{0}'' \u00e0 la ligne {1} semble malform\u00e9e. Cela pourrait \u00eatre une erreur de syntaxe YAML ou un mauvais mapping. - -# Error_InvalidLanguage = I'm sorry, but the language code you chose is invalid. Currently, the following languages are supported: -Error_InvalidLanguage = Je suis d\u00e9sol\u00e9 mais la langue choisie est incorrecte. Pour l'instant, seuls les langages suivants sont support\u00e9s : - -# Error_RuleNotFound = Uh-oh, I could not find the ''{0}'' rule in the search path. Could you take a look if the rule name is correct and if the rule is accessible through the search path? -Error_RuleNotFound = Oh-oh, Je n''ai pas trouv\u00e9 la r\u00e8gle ''{0}'' dans le chemin de recherche. Pourriez-vous v\u00e9rifier si le nom de la r\u00e8gle est correct et si celle-ci est accessible dans le chemin de recherche ? - -# Error_InvalidYAMLRule = It appears that the ''{0}'' task has a YAML syntax error or an invalid field. Could you take a look at the ''{0}.yaml'' file located at ''{1}''. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLRule = Il semble que la t\u00e2che ''{0}'' contienne une erreur de syntaxe YAML ou un champ invalide. Pourriez-vous v\u00e9rifier le fichier ''{0}.yaml'' situ\u00e9 dans ''{1}''. J''ai fait de mon mieux pour r\u00e9cup\u00e9rer le message d'erreur, le voici : - -# Error_InvalidRule = Uh-oh, the ''{0}'' task appears to be invalid. Are you sure the ''{0}.yaml'' file located at ''{1}'' is a proper YAML file? -Error_InvalidRule = Oh-oh, la t\u00e2che ''{0}'' semble invalide. \u00cates vous sur(e) que le fichier ''{0}.yaml'' situ\u00e9 dans ''{1}'' est un fichier YAML valide ? - -# Error_EmptyIdentifierRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid identifier. Could you fix it? -Error_EmptyIdentifierRule = Un probl\u00e8me a \u00e9t\u00e9 d\u00e9tect\u00e9 dans la t\u00e2che ''{0}''. Le fichier ''{0}.yaml'' situ\u00e9 dans ''{1}'' requiert un identifiant valide. Pouvez-vous r\u00e9gler \u00e7a ? - -# Error_EmptyNameRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid name. Could you fix it? -Error_EmptyNameRule = Un probl\u00e8me a \u00e9t\u00e9 d\u00e9tect\u00e9 dans la t\u00e2che ''{0}''. Le fichier ''{0}.yaml'' situ\u00e9 dans ''{1}'' requiert un nom valide. Pouvez-vous r\u00e9gler \u00e7a ? - -# Error_ForbiddenIdentifierRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has an invalid argument identifier. ''{2}'' is a reserved keyword, so it cannot be used. Could you use another name? -Error_ForbiddenIdentifierRule = Oh-oh, la t\u00e2che ''{0}'' (qui fait r\u00e9f\u00e9rence au fichier ''{0}.yaml'' situ\u00e9 dans ''{1}'') a un identifiant d''argument invalide. ''{2}'' est un mot-cl\u00e9 r\u00e9serv\u00e9, aussi il ne peut pas \u00eatre utilis\u00e9. Pouvez-vous utiliser un autre nom ? - -# Error_EmptyArgumentsListRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid list of arguments. Could you fix it? Note that the list of arguments can also be empty, but it is still necessary to define it explicitly (with ''arguments: []''). -Error_EmptyArgumentsListRule = Un probl\u00e8me a \u00e9t\u00e9 d\u00e9tect\u00e9 dans la t\u00e2che ''{0}''. Le fichier ''{0}.yaml'' situ\u00e9 dans ''{1}'' requiert une liste d''arguments valide. Pourriez-vous r\u00e9gler cela ? Notez que la liste d''arguments peut aussi \u00eatre vide, mais il sera toujours n\u00e9cessaire de la d\u00e9finir explicitement (avec ''arguments: []''). - -# Error_WrongIdentifierRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has the wrong identifier - ''{0}'' was expected, rather than ''{2}''. Could you fix it? -Error_WrongIdentifierRule = Oh-oh, la t\u00e2che ''{0}'' (faisant r\u00e9f\u00e9rence au fichier ''{0}.yaml'' situ\u00e9 dans ''{1}'') a un mauvais identifiant - ''{0}'' \u00e9tait attendu, au lieu de ''{2}''. Pourriez-vous r\u00e9gler cela ? - -# Error_ArgumentsNotDefinedInRule = Oh no, there are arguments used in the diretive ''{0}'' which are not defined in the ''{0}.yaml'' rule located at ''{1}''. You can either remove them from the ''{0}'' directive or add them to the list of arguments in the ''{0}.yaml'' rule. Here they are: {2} -Error_ArgumentsNotDefinedInRule = Oh, non ! Il y a des arguments utilis\u00e9s dans l''instruction ''{0}'' qui ne sont pas d\u00e9finis dans la r\u00e8gle ''{0}.yaml'' situ\u00e9 dans ''{1}''. Vous pouvez soit les enlever de la commande ''{0}'' ou les ajouter \u00e0 la liste des arguments de la r\u00e8gle ''{0}.yaml''. Les voil\u00e0 : {2} - -# Error_DefaultValueRuntimeErrorRule = I''m sorry, but the default value set for the argument ''{0}'' of the ''{1}'' task (referencing the ''{1}.yaml'' file located at ''{2}'') has an unavailable variable/method in the rule context: ''{3}'' -Error_DefaultValueRuntimeErrorRule = D\u00e9sol\u00e9, mais la valeur par d\u00e9faut d\u00e9finie pour l''agument ''{0}'' de la r\u00e8gle ''{1}'' (qui fait r\u00e9f\u00e9rence au fichier ''{0}.yaml'' situ\u00e9 dans ''{2}'') a une variable/m\u00e9thode incorrecte dans le contexte de la r\u00e8gle : ''{3}'' - -# Error_FlagRuntimeErrorRule = I''m sorry, but the flag set for the argument ''{0}'' of the ''{1}'' task (referencing the ''{1}.yaml'' file located at ''{2}'') has an unavailable variable/method in the rule context: ''{3}'' -Error_FlagRuntimeErrorRule = Je suis d\u00e9sol\u00e9 mais le drapeau d\u00e9finit par l''argument ''{0}'' de la t\u00e2che ''{1}'' (qui fait r\u00e9f\u00e9rence au fichier ''{0}.yaml'' situ\u00e9 dans ''{2}'') a une variable/m\u00e9thode incorrecte dans le contexte de la r\u00e8gle : ''{3}'' - -# Error_DuplicatedCommandElementsRule = Uh-oh, both ''command'' and ''commands'' fields are set in the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}''). You need to pick only one of them. If your task only relies on a single command, you can opt for ''command''; if your rule requires a set of commands, maybe the ''commands'' field is more suitable. -Error_DuplicatedCommandElementsRule = Oh-oh, les 2 champs ''command'' et ''commands'' sont simultan\u00e9ment d\u00e9finis dans la t\u00e2che ''{0}'' (qui fait r\u00e9f\u00e9rence au fichier ''{0}.yaml'' situ\u00e9 dans ''{1}''). Vous ne devez en choisir qu''un des deux. Si votre t\u00e2che n''a besoin que d''une seule commande, vous pouvez choisir ''command''; s''il s''agit d''une succession de commandes, peut-\u00eatre que le champ ''commands'' serait plus avis\u00e9. - -# Error_MissingCommandElementsRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') does not have either the ''command'' or ''commands'' elements. You need to pick only one of them. If your task only relies on a single command, you can opt for ''command''; if your rule requires a set of commands, maybe the ''commands'' field is more suitable. -Error_MissingCommandElementsRule = Oh-oh, la t\u00e2che ''{0}'' (qui fait r\u00e9f\u00e9rence au fichier ''{0}.yaml'' situ\u00e9 dans ''{1}'') ne contient ni l''\u00e9l\u00e9ment ''command'' ni l''\u00e9l\u00e9ment ''commands''. Vous devez en choisir un des deux. Si votre t\u00e2che n''a besoin que d''une seule commande, vous pouvez choisir ''command''; s''il s''agit d''une succession de commandes, peut-\u00eatre que le champ ''commands'' serait plus avis\u00e9. - -# Error_CommandRuntimeErrorRule = I''m sorry, but the command set for the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has an unavailable variable/method in the rule context: ''{2}'' -Error_CommandRuntimeErrorRule = Je suis d\u00e9sol\u00e9, mais la commande d\u00e9finie pour la t\u00e2che ''{0}'' (qui fait r\u00e9f\u00e9rence au fichier ''{0}.yaml'' situ\u00e9 dans ''{1}'') contient une variable/m\u00e9thode non disponible dans le contexte de la r\u00e8gle : ''{2}'' - diff --git a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_it.properties b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_it.properties deleted file mode 100644 index e851d9eef11..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_it.properties +++ /dev/null @@ -1,226 +0,0 @@ -# Arara -- the cool TeX automation tool -# Copyright (c) 2012, Paulo Roberto Massa Cereda -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the project's author nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# Messages: This file holds the default Italian language messages for arara. -# -# translator: Enrico Gregorio -# e-mail: Enrico.Gregorio@univr.it - -# Log_WelcomeMessage = Welcome to arara! -Log_WelcomeMessage = arara ti d\u00e0 il benvenuto! - -# Log_ProcessingFile = Processing file ''{0}'', please wait. -Log_ProcessingFile = Sto elaborando il file ''{0}'', attendi. - -# Log_Done = Done. -Log_Done = Done. - -# Log_ExceptionRaised = Arara raised an exception with the following message: -Log_ExceptionRaised = Arara ha sollevato un'eccezione con il seguente messaggio: - -# Log_ReadyToRunCommands = Ready to run commands. -Log_ReadyToRunCommands = Pronto a eseguire comandi. - -# Log_CommandName = Running ''{0}''. -Log_CommandName = Sto eseguendo ''{0}''. - -# Log_Command = Command: {0} -Log_Command = Comando: {0} - -# Log_CommandSuccess = ''{0}'' was successfully executed. -Log_CommandSuccess = ''{0}'' \u00e8 stato eseguito con successo. - -# Log_CommandFailure = ''{0}'' returned an error status. -Log_CommandFailure = ''{0}'' ha emesso uno stato di errore. - -# Log_AllCommandsSuccess = All commands were successfully executed. -Log_AllCommandsSuccess = Tutti i comandi sono stati eseguiti con successo. - -# Log_OutputLogging = Output logging: -Log_OutputLogging = Resoconto dell'output: - -# Log_CommandNotFound = ''{0}'' was not found in the path. Execution attempt: {1} -Log_CommandNotFound = ''{0}'' non \u00e8 stato trovato nel ''path''. Tentativo di esecuzione: {1} - -# Log_DirectiveFound = Directive found in line {0} with {1}. -Log_DirectiveFound = Direttiva trovata alla riga {0} con {1}. - -# Log_RuleFound = Task ''{0}'' found in ''{1}''. -Log_RuleFound = Compito ''{0}'' trovato in ''{1}''. - -# Log_NoDirectivesFound = No directives found in ''{0}''. -Log_NoDirectivesFound = Non ho trovato direttive in ''{0}''. - -# Help_Version = print the application version -Help_Version = stampa la versione dell'applicazione - -# Help_Help = print the help message -Help_Help = stampa il messaggio di aiuto - -# Help_Log = generate a log output -Help_Log = genera un resoconto dell'output - -# Help_Verbose = print the command output -Help_Verbose = stampa l'output del comando - -# Help_Timeout = set the execution timeout (in milliseconds) -Help_Timeout = imposta il 'timeout' dell'esecuzione (in millisecondi) - -# Help_Language = set the application language -Help_Language = imposta la lingua dell'applicazione - -# Header_Slogan = The cool TeX automation tool -Header_Slogan = The cool TeX automation tool - -# Header_AllRightsReserved = All rights reserved. -Header_AllRightsReserved = Tutti i diritti riservati. - -# Msg_NoDirectivesFound = I didn''t find any directives in ''{0}'', and so didn''t do anything. Is that what you really wanted? -Msg_NoDirectivesFound = Non ho trovato direttive in ''{0}'', cos\u00ec non ho fatto niente. \u00c8 proprio quello che volevi? - -# Msg_SpecialThanks = A special thanks goes to Alan Munn, Andrew Stacey, Brent Longborough, Clemens Niederberger, David Carlisle, Enrico Gregorio, Francesco Endrici, Gonzalo Medina, Harish Kumar, \u0130lhan Polat, Joseph Wright, Marco Daniel, Mika\u00ebl Maunier, Patrick Gundlach, Rasmus Roulund, Sergey Ulyanov, Stefan Kottwitz, and many others for making this humble tool possible. -Msg_SpecialThanks = Un ringraziamento speciale va a Alan Munn, Andrew Stacey, Brent Longborough, Clemens Niederberger, David Carlisle, Enrico Gregorio, Francesco Endrici, Gonzalo Medina, Harish Kumar, \u0130lhan Polat, Joseph Wright, Marco Daniel, Mika\u00ebl Maunier, Patrick Gundlach, Rasmus Roulund, Sergey Ulyanov, Stefan Kottwitz e molti altri che hanno reso possibile la realizzazione di questo umile strumento. - -# Msg_RunningCommand = Running {0}... -Msg_RunningCommand = Sto eseguendo {0}... - -# Msg_Success = SUCCESS -Msg_Success = SUCCESSO - -# Msg_Failure = FAILURE -Msg_Failure = FALLIMENTO - -# Msg_Status = Status: -Msg_Status = Stato: - -# YamlError_Context = Context: {0} -YamlError_Context = Contesto: {0} - -# YamlError_Problem = Problem: {0} -YamlError_Problem = Problema: {0} - -# YamlError_ErrorLocation = Error found in line {0}, column {1}. -YamlError_ErrorLocation = Ho trovato un errore alla riga {0}, colonna {1}. - -# Error_FileDoesNotExistWithExtensionsList = I''m sorry, but the file ''{0} {1}'' does not exist. Note that when you provide only the basename (i.e, the filename without the extension) or with an unknown extension, arara will try to look for files ending with the predefined extensions {1} in that order. You can override the order, the search pattern or even add support for new extensions through the configuration file. Please refer to the arara manual to learn more about this feature. -Error_FileDoesNotExistWithExtensionsList = Splacente, ma il file ''{0} {1}'' non esiste. Osserva che quando inserisci solo il nome proprio (cio\u00e8 il nome del file senza estensione) o il nome con un''estensione sconosciuta, arara cercher\u00e0 un file che termini con le estensioni predefinite {1} in quest''ordine. \u00c8 possibile modificare l''ordine, lo schema di ricerca e anche abilitare nuove estensioni agendo sul file di configurazione. Consulta il manuale di arara per saperne di pi\u00f9. - -# Error_FileDoesNotExist = File ''{0}'' does not exist. -Error_FileDoesNotExist = Il file ''{0}'' non esiste. - -# Error_CommandNotFound = \nI''m sorry, but the command from the ''{0}'' task could not be found. Are you sure the command ''{1}'' is correct, or even accessible from the system path? -Error_CommandNotFound = \nMi dispiace, ma il comando chiesto dal compito ''{0}'' non \u00e8 stato trovato. Assicurati che il comando ''{1}'' sia corretto e accessibile dal ''path'' di sistema. - -# Error_InvalidYAMLConfigurationFile = I'm sorry, but apparently your arara configuration file is invalid, that is, it has invalid or missing YAML entries. Unfortunately, arara cannot proceed until the error is fixed. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLConfigurationFile = Mi dispiace, ma sembra che il file di configurazione di arara non sia valido, cio\u00e8 che abbia istruzioni YAML mancanti o scorrette. Sfortunatamente arara non pu\u00f2 andare oltre finch\u00e9 l'errore non viene corretto. Ho fatto del mio meglio registrando il messaggio di errore che \u00e8 questo: - -# Error_InvalidConfigurationFile = Uh-oh, the configuration file appears to be invalid. Are you sure it's a proper YAML file? Unfortunately, arara cannot proceed until a proper configuration file is provided. -Error_InvalidConfigurationFile = Oh, oh! Il file di configurazione non sembra valido. Assicurati che sia un file YAML corretto. Sfortunatamente arara non pu\u00f2 andare oltre finch\u00e9 non trova un file di configurazione corretto. - -# Error_InvalidLanguageConfigurationFile = Houston, we have a problem. Sadly, the language set in the configuration file is not valid. Currently, arara can provide support for the following languages: {0}. Make sure to choose a valid language or remove the entry from the configuration file (the field is optional), otherwise arara cannot proceed. -Error_InvalidLanguageConfigurationFile = Houston, abbiamo un problema. Spiacente, la lingua impostata nel file di configurazione non \u00e8 valida. Attualmente arara comprende le seguenti lingue: {0}. Assicurati di scegliere una lingua della lista o togli quella sbagliata dal file di configurazione (la lingua \u00e8 facoltativa), altrimenti arara non pu\u00f2 andare oltre. - -# Error_InvalidFiletypesConfigurationFile = I'm sorry, but it seems your configuration file has customized filetypes with neither the extension or pattern defined. Both are required in order to continue. Please fix this error in your configuration file and try again. -Error_InvalidFiletypesConfigurationFile = Spiacente, ma sembra che il file di configurazione abbia tipi di file personalizzati senza che siano stati definiti un'estensione o uno schema: entrambi sono richiesti per poter continuare. Per favore, correggi l'errore nel file di configurazione e riprova. - -# Error_PathRuntimeErrorConfigurationFile = I''m sorry, but one of the entries of the search path in your configuration file has an unavailable variable in the path context: ''{0}'' -Error_PathRuntimeErrorConfigurationFile = Spiacente, ma uno degli elementi nel percorso di ricerca indicato nel file di configurazione usa una variabile non disponibile in questo contesto: ''{0}'' - -# Error_PathIOErrorConfigurationFile = I'm sorry, but one of the entries of the search path in your configuration file has a malformed directory structure. Could you take a look at it? -Error_PathIOErrorConfigurationFile = Spiacente, ma uno degli elementi nel percorso di ricerca indicato nel file di configurazione ha una struttura gerarchica malformata. Puoi darci un'occhiata? - -# Error_InvalidYAMLDirective = It appears there is a malformed directive found at line {0}, that is, a directive that might have a YAML syntax error or an invalid field. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLDirective = Sembra che ci sia una direttiva malformata alla riga {0}, cio\u00e8 una direttiva con un errore di sintassi YAML oppure un campo non valido. Ho fatto del mio meglio registrando il messaggio di errore che \u00e8 questo: - -# Error_DirectiveEmptyCurlyBrackets = Directive ''{0}'' at line {1} has empty curly brackets. Note that arara opts for a cleaner syntax when a directive has no parameters. To fix it, it''s enough to either remove the curly brackets or provide the arguments for the directive. -Error_DirectiveEmptyCurlyBrackets = La direttiva ''{0}'' alla riga {1} non ha nulla tra le graffe. Osserva che arara preferisce una sintassi pi\u00f9 snella quando una direttiva non ha parametri. Per correggere, \u00e8 sufficiente togliere le graffe o inserire un argomento per la direttiva. - -# Error_DirectiveInvalidArgumentList = Directive ''{0}'' at line {1} has an invalid argument type. The argument ''{2}'' is a reserved arara keyword and always requires a list. -Error_DirectiveInvalidArgumentList = La direttiva ''{0}'' alla riga {1} ha un argomento di tipo non valido. L''argomento ''{2}'' \u00e8 una parola chiave riservata di arara che richiede sempre una lista. - -# Error_DirectiveReservedKeyword = Directive ''{0}'' at line {1} has an invalid argument name. The name ''{2}'' is a reserved arara keyword representing every element in the ''{3}'' list. Please, pick another name for that argument. -Error_DirectiveReservedKeyword = La direttiva ''{0}'' alla riga {1} ha un nome di argomento non valido. Il nome ''{2}'' \u00e8 una parola chiave riservata di arara che rappresenta tutti gli elementi della lista ''{3}''. Per favore, scegli un nome diverso per quell''argomento. - -# Error_DirectiveListError = Directive ''{0}'' at line {1} has an invalid argument type. Only the arguments ''files'' and ''items'' can have a list. Both are reserved arara keywords. -Error_DirectiveListError = La direttiva ''{0}'' alla riga {1} ha un tipo di argomento non valido. Solo gli argomenti ''files'' e ''items'' possono contenere una lista. Entrambi sono parole chiave riservate di arara. - -# Error_InvalidDirective = Apparently, there''s an invalid directive at line {0}. Please take a look and fix it. -Error_InvalidDirective = Sembra che ci sia una direttiva non valida alla riga {0}. Dacci un''occhiata e correggi. - -# Error_DirectiveGenericError = Directive ''{0}'' at line {1} seems to be malformed. It might be a YAML syntax error or a wrong mapping. -Error_DirectiveGenericError = La direttiva ''{0}'' alla riga {1} sembra malformata. Potrebbe essere un errore di sintassi YAML o un''assegnazione sbagliata. - -# Error_InvalidLanguage = I'm sorry, but the language code you chose is invalid. Currently, the following languages are supported: -Error_InvalidLanguage = Spiacente, ma questo codice di lingua non \u00e8 valido. Attualmente arara comprende le seguenti lingue: - -# Error_RuleNotFound = Uh-oh, I could not find the ''{0}'' rule in the search path. Could you take a look if the rule name is correct and if the rule is accessible through the search path? -Error_RuleNotFound = Oh, oh! Non sono riuscito a trovare la regola ''{0}'' nel percorso di ricerca. Puoi controllare che il nome della regola sia giusto e che la regola sia accessibile nel percorso di ricerca? - -# Error_InvalidYAMLRule = It appears that the ''{0}'' task has a YAML syntax error or an invalid field. Could you take a look at the ''{0}.yaml'' file located at ''{1}''. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLRule = Sembra che il compito ''{0}'' abbia un errore di sintassi YAML o un campo non valido. Puoi dare un''occhiata al file ''{0}.yaml'' che si trova in ''{1}''? Ho fatto del mio meglio registrando il messaggio di errore che \u00e8 questo: - -# Error_InvalidRule = Uh-oh, the ''{0}'' task appears to be invalid. Are you sure the ''{0}.yaml'' file located at ''{1}'' is a proper YAML file? -Error_InvalidRule = Oh, oh! Il compito ''{0}'' sembra non valido. Assicurati che il file ''{0}.yaml'' che si trova in ''{1}'' sia un file YAML corretto. - -# Error_EmptyIdentifierRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid identifier. Could you fix it? -Error_EmptyIdentifierRule = C''\u00e8 un problema nell''eseguire ''{0}''. Il file ''{0}.yaml'' che si trova in ''{1}'' richiede un identificatore valido. Puoi correggerlo? - -# Error_EmptyNameRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid name. Could you fix it? -Error_EmptyNameRule = C''\u00e8 un problema nell''eseguire ''{0}''. Il file ''{0}.yaml'' che si trova in ''{1}'' richede un nome valido. Puoi correggerlo? - -# Error_ForbiddenIdentifierRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has an invalid argument identifier. ''{2}'' is a reserved keyword, so it cannot be used. Could you use another name? -Error_ForbiddenIdentifierRule = Oh, oh! Il compito ''{0}'' (riferito al file ''{0}.yaml'' che si trova in ''{1}'') ha un identificatore di argomento non valido. ''{2}'' \u00e8 una parola chiave riservata e non pu\u00f2 essere usato. Puoi scegliere un altro nome? - -# Error_EmptyArgumentsListRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid list of arguments. Could you fix it? Note that the list of arguments can also be empty, but it is still necessary to define it explicitly (with ''arguments: []''). -Error_EmptyArgumentsListRule = C''\u00e8 un problame nell''eseguire ''{0}''. Il file ''{0}.yaml'' che si trova in ''{1}'' richiede una lista di argomenti valida. Puoi correggerlo? Nota che la lista di argomenti pu\u00f2 anche essere vuota, ma \u00e8 comunque necessario definirla esplicitamente (con ''arguments: []''). - -# Error_WrongIdentifierRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has the wrong identifier - ''{0}'' was expected, rather than ''{2}''. Could you fix it? -Error_WrongIdentifierRule = Oh, oh! Il compito ''{0}'' (riferito al file ''{0}.yaml'' che si trova in ''{1}'') ha un identificatore sbagliato; mi aspettavo ''{0}'' e non ''{2}''. Puoi correggerlo? - -# Error_ArgumentsNotDefinedInRule = Oh no, there are arguments used in the diretive ''{0}'' which are not defined in the ''{0}.yaml'' rule located at ''{1}''. You can either remove them from the ''{0}'' directive or add them to the list of arguments in the ''{0}.yaml'' rule. Here they are: {2} -Error_ArgumentsNotDefinedInRule = Oh, no! Alcuni argomenti usati nella direttiva ''{0}'' non sono definiti nella regola ''{0}.yaml'' che si trova in ''{1}''. Puoi rimuoverli dalla direttiva ''{0}'' oppure aggiungerli alla lista di argomenti nella regola ''{0}.yaml''. Eccoli: {2} - -# Error_DefaultValueRuntimeErrorRule = I''m sorry, but the default value set for the argument ''{0}'' of the ''{1}'' task (referencing the ''{1}.yaml'' file located at ''{2}'') has an unavailable variable/method in the rule context: ''{3}'' -Error_DefaultValueRuntimeErrorRule = Spiacente, ma il valore di default impostato per l''argomento ''{0}'' del compito ''{1}'' (riferito al file ''{1}.yaml'' che si trova in ''{2}'') usa un metodo o una variabile che non \u00e8 disponibile nel contesto della regola: ''{3}'' - -# Error_FlagRuntimeErrorRule = I''m sorry, but the flag set for the argument ''{0}'' of the ''{1}'' task (referencing the ''{1}.yaml'' file located at ''{2}'') has an unavailable variable/method in the rule context: ''{3}'' -Error_FlagRuntimeErrorRule = Spiacente, ma il segnale (flag) impostato per l''argomento ''{0}'' del compito ''{1}'' (riferito al file ''{1}.yaml'' che si trova in ''{2}'') vuole un metodo o una variabile che non \u00e8 disponibile nel contesto della regola: ''{3}'' - -# Error_DuplicatedCommandElementsRule = Uh-oh, both ''command'' and ''commands'' fields are set in the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}''). You need to pick only one of them. If your task only relies on a single command, you can opt for ''command''; if your rule requires a set of commands, maybe the ''commands'' field is more suitable. -Error_DuplicatedCommandElementsRule = Oh, oh! Entrambi i campi ''command'' e ''commands'' sono impostati per il compito ''{0}'' (riferito al file ''{0}.yaml'' che si trova in ''{1}''). Si pu\u00f2 adoperarne solo uno. Se il compito richiede a un solo comando, scegli ''command''; se la regola richiede pi\u00f9 comandi, forse il campo ''commands'' \u00e8 pi\u00f9 adatto. - -# Error_MissingCommandElementsRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') does not have either the ''command'' or ''commands'' elements. You need to pick only one of them. If your task only relies on a single command, you can opt for ''command''; if your rule requires a set of commands, maybe the ''commands'' field is more suitable. -Error_MissingCommandElementsRule = Oh, oh! Il compito ''{0}'' (riferito al file ''{0}.yaml'' che si trova in ''{1}'') non ha n\u00e9 il campo ''command'' n\u00e9 ''commands''. Occorre usare uno (solo) di essi. Se il compito richiede un solo comando, scegli ''command''; se la regola richiede pi\u00f9 comandi, forse il campo ''commands'' \u00e8 pi\u00f9 adatto. - -# Error_CommandRuntimeErrorRule = I''m sorry, but the command set for the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has an unavailable variable/method in the rule context: ''{2}'' -Error_CommandRuntimeErrorRule = Spiacente, ma il comando impostato per il compito ''{0}'' task (riferito al file ''{0}.yaml'' che si trova in ''{1}'') usa un metodo o una variabile non disponibile nel contesto della regola: ''{2}'' - diff --git a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_pt_BR.properties b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_pt_BR.properties deleted file mode 100644 index f41c27490cb..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_pt_BR.properties +++ /dev/null @@ -1,226 +0,0 @@ -# Arara -- the cool TeX automation tool -# Copyright (c) 2012, Paulo Roberto Massa Cereda -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the project's author nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# Messages: This file holds the default Brazilian Portuguese messages for arara. -# -# author: Paulo Roberto Massa Cereda -# e-mail: cereda@users.sf.net - -# Log_WelcomeMessage = Welcome to arara! -Log_WelcomeMessage = Bem-vindo ao arara! - -# Log_ProcessingFile = Processing file ''{0}'', please wait. -Log_ProcessingFile = Processando o arquivo ''{0}''; por favor, aguarde. - -# Log_Done = Done. -Log_Done = Conclu\u00eddo. - -# Log_ExceptionRaised = Arara raised an exception with the following message: -Log_ExceptionRaised = Arara gerou uma exce\u00e7\u00e3o com a seguinte mensagem: - -# Log_ReadyToRunCommands = Ready to run commands. -Log_ReadyToRunCommands = Pronto para executar comandos. - -# Log_CommandName = Running ''{0}''. -Log_CommandName = Executando ''{0}''. - -# Log_Command = Command: {0} -Log_Command = Comando: {0} - -# Log_CommandSuccess = ''{0}'' was successfully executed. -Log_CommandSuccess = ''{0}'' foi executado com sucesso. - -# Log_CommandFailure = ''{0}'' returned an error status. -Log_CommandFailure = ''{0}'' retornou um status de erro. - -# Log_AllCommandsSuccess = All commands were successfully executed. -Log_AllCommandsSuccess = Todos os comandos foram executados com sucesso. - -# Log_OutputLogging = Output logging: -Log_OutputLogging = Registro de sa\u00edda: - -# Log_CommandNotFound = ''{0}'' was not found in the path. Execution attempt: {1} -Log_CommandNotFound = ''{0}'' n\u00e3o foi encontrado no caminho do sistema. Tentativa de execu\u00e7\u00e3o: {1} - -# Log_DirectiveFound = Directive found in line {0} with {1}. -Log_DirectiveFound = Diretiva encontrada na linha {0} com {1}. - -# Log_RuleFound = Task ''{0}'' found in ''{1}''. -Log_RuleFound = Tarefa ''{0}'' encontrada em ''{1}''. - -# Log_NoDirectivesFound = No directives found in ''{0}''. -Log_NoDirectivesFound = Nenhuma diretiva foi encontrada em ''{0}''. - -# Help_Version = print the application version -Help_Version = imprime a vers\u00e3o da aplica\u00e7\u00e3o - -# Help_Help = print the help message -Help_Help = imprime a mensagem de ajuda - -# Help_Log = generate a log output -Help_Log = gera uma sa\u00edda para registro - -# Help_Verbose = print the command output -Help_Verbose = imprime a sa\u00edda do comando - -# Help_Timeout = set the execution timeout (in milliseconds) -Help_Timeout = define o timeout de execu\u00e7\u00e3o (em milissegundos) - -# Help_Language = set the application language -Help_Language = define o idioma da aplica\u00e7\u00e3o - -# Header_Slogan = The cool TeX automation tool -Header_Slogan = A ferramenta legal de automa\u00e7\u00e3o TeX - -# Header_AllRightsReserved = All rights reserved. -Header_AllRightsReserved = Todos os direitos reservados. - -# Msg_NoDirectivesFound = I didn''t find any directives in ''{0}'', and so didn''t do anything. Is that what you really wanted? -Msg_NoDirectivesFound = Eu n\u00e3o encontrei nenhuma diretiva em ''{0}'', e ent\u00e3o n\u00e3o fiz absolutamente nada. \u00c9 isso que voc\u00ea realmente queria? - -# Msg_SpecialThanks = A special thanks goes to Alan Munn, Andrew Stacey, Brent Longborough, Clemens Niederberger, David Carlisle, Enrico Gregorio, Francesco Endrici, Gonzalo Medina, Harish Kumar, \u0130lhan Polat, Joseph Wright, Marco Daniel, Mika\u00ebl Maunier, Patrick Gundlach, Rasmus Roulund, Sergey Ulyanov, Stefan Kottwitz, and many others for making this humble tool possible. -Msg_SpecialThanks = Um agradecimento especial aos amigos Alan Munn, Andrew Stacey, Brent Longborough, Clemens Niederberger, David Carlisle, Enrico Gregorio, Francesco Endrici, Gonzalo Medina, Harish Kumar, \u0130lhan Polat, Joseph Wright, Marco Daniel, Mika\u00ebl Maunier, Patrick Gundlach, Rasmus Roulund, Sergey Ulyanov, Stefan Kottwitz, e muitos outros por tornar poss\u00edvel esta humilde ferramenta. - -# Msg_RunningCommand = Running {0}... -Msg_RunningCommand = Executando {0}... - -# Msg_Success = SUCCESS -Msg_Success = SUCESSO - -# Msg_Failure = FAILURE -Msg_Failure = FRACASSO - -# Msg_Status = Status: -Msg_Status = Status: - -# YamlError_Context = Context: {0} -YamlError_Context = Contexto: {0} - -# YamlError_Problem = Problem: {0} -YamlError_Problem = Problema: {0} - -# YamlError_ErrorLocation = Error found in line {0}, column {1}. -YamlError_ErrorLocation = Erro encontrado na linha {0}, coluna {1}. - -# Error_FileDoesNotExistWithExtensionsList = I''m sorry, but the file ''{0} {1}'' does not exist. Note that when you provide only the basename (i.e, the filename without the extension) or with an unknown extension, arara will try to look for files ending with the predefined extensions {1} in that order. You can override the order, the search pattern or even add support for new extensions through the configuration file. Please refer to the arara manual to learn more about this feature. -Error_FileDoesNotExistWithExtensionsList = Sinto muito, mas o arquivo ''{0} {1}'' n\u00e3o existe. Observe que se voc\u00ea fornecer apenas o nome base (isto \u00e9, o nome do arquivo sem a extens\u00e3o) ou com uma extens\u00e3o desconhecida, arara tentar\u00e1 encontrar arquivos terminados com as extens\u00f5es predefinidas {1} nesta ordem. Voc\u00ea pode alterar a ordem, o padr\u00e3o de busca ou mesmo adicionar suporte para novas extens\u00f5es atrav\u00e9s do arquivo de configura\u00e7\u00e3o. Por favor, verifique o manual para aprender mais sobre essa funcionalidade. - -# Error_FileDoesNotExist = File ''{0}'' does not exist. -Error_FileDoesNotExist = O arquivo ''{0}'' n\u00e3o existe. - -# Error_CommandNotFound = \nI''m sorry, but the command from the ''{0}'' task could not be found. Are you sure the command ''{1}'' is correct, or even accessible from the system path? -Error_CommandNotFound = \nSinto muito, mas o comando da tarefa ''{0}'' n\u00e3o foi encontrado. Voc\u00ea tem certeza de que ''{1}'' est\u00e1 correto, ou mesmo acess\u00edvel a partir do caminho do sistema? - -# Error_InvalidYAMLConfigurationFile = I'm sorry, but apparently your arara configuration file is invalid, that is, it has invalid or missing YAML entries. Unfortunately, arara cannot proceed until the error is fixed. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLConfigurationFile = Sinto muito, mas aparentemente o seu arquivo de configura\u00e7\u00e3o arara \u00e9 inv\u00e1lido, isto \u00e9, cont\u00e9m entradas YAML inv\u00e1lidas ou inexistentes. Infelizmente, arara n\u00e3o pode prosseguir at\u00e9 que o erro seja reparado. Fiz o meu melhor para exibir a mensagem de erro; aqui est\u00e1: - -# Error_InvalidConfigurationFile = Uh-oh, the configuration file appears to be invalid. Are you sure it's a proper YAML file? Unfortunately, arara cannot proceed until a proper configuration file is provided. -Error_InvalidConfigurationFile = Uh-oh, o arquivo de configura\u00e7\u00e3o parece ser inv\u00e1lido. Voc\u00ea tem certeza de que ele \u00e9 um arquivo YAML adequado? Infelizmente, arara n\u00e3o pode prosseguir at\u00e9 que um arquivo de configura\u00e7\u00e3o v\u00e1lido seja fornecido. - -# Error_InvalidLanguageConfigurationFile = Houston, we have a problem. Sadly, the language set in the configuration file is not valid. Currently, arara can provide support for the following languages: {0}. Make sure to choose a valid language or remove the entry from the configuration file (the field is optional), otherwise arara cannot proceed. -Error_InvalidLanguageConfigurationFile = Houston, temos um problema. Infelizmente, o idioma definido no arquivo de configura\u00e7\u00e3o n\u00e3o \u00e9 v\u00e1lido. No momento, arara oferece suporte para os seguintes idiomas: {0}. Certifique-se de ter escolhido um idioma v\u00e1lido, ou remova a entrada do arquivo de configura\u00e7\u00e3o (o campo \u00e9 opcional). Caso contr\u00e1rio arara n\u00e3o poder\u00e1 prosseguir. - -# Error_InvalidFiletypesConfigurationFile = I'm sorry, but it seems your configuration file has customized filetypes with neither the extension or pattern defined. Both are required in order to continue. Please fix this error in your configuration file and try again. -Error_InvalidFiletypesConfigurationFile = Sinto muito, mas parece que o seu arquivo de configura\u00e7\u00e3o tem tipos de arquivos personalizados sem a extens\u00e3o ou o padr\u00e3o de busca definidos. Ambos s\u00e3o requeridos para que arara prossiga. Por favor, conserte o erro no seu arquivo de configura\u00e7\u00e3o e tente novamente. - -# Error_PathRuntimeErrorConfigurationFile = I''m sorry, but one of the entries of the search path in your configuration file has an unavailable variable in the path context: ''{0}'' -Error_PathRuntimeErrorConfigurationFile = Sinto muito, mas uma das entradas do caminho de busca no seu arquivo de configura\u00e7\u00e3o tem uma vari\u00e1vel n\u00e3o resolvida no contexto do caminho: ''{0}'' - -# Error_PathIOErrorConfigurationFile = I'm sorry, but one of the entries of the search path in your configuration file has a malformed directory structure. Could you take a look at it? - Error_PathIOErrorConfigurationFile = Sinto muito, mas uma das entradas do caminho de busca no seu arquivo de configura\u00e7\u00e3o tem uma estrutura de diret\u00f3rio malformada. Voc\u00ea poderia dar uma olhadinha? - -# Error_InvalidYAMLDirective = It appears there is a malformed directive found at line {0}, that is, a directive that might have a YAML syntax error or an invalid field. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLDirective = Parece que existe uma diretiva malformada encontrada na linha {0}, isto \u00e9, uma diretiva que pode ter um erro na sintaxe YAML ou um campo inv\u00e1lido. Fiz o meu melhor para exibir a mensagem de erro; aqui est\u00e1: - -# Error_DirectiveEmptyCurlyBrackets = Directive ''{0}'' at line {1} has empty curly brackets. Note that arara opts for a cleaner syntax when a directive has no parameters. To fix it, it''s enough to either remove the curly brackets or provide the arguments for the directive. -Error_DirectiveEmptyCurlyBrackets = A diretiva ''{0}'' na linha {1} tem chaves vazias. Observe que arara opta por uma sintaxe mais limpa quando uma diretiva n\u00e3o tem par\u00e2metros. Para repar\u00e1-la, \u00e9 suficiente remover as chaves ou fornecer os argumentos para a diretiva. - -# Error_DirectiveInvalidArgumentList = Directive ''{0}'' at line {1} has an invalid argument type. The argument ''{2}'' is a reserved arara keyword and always requires a list. -Error_DirectiveInvalidArgumentList = A diretiva ''{0}'' na linha {1} tem um tipo de argumento inv\u00e1lido. O argumento ''{2}'' \u00e9 uma palavra reservada arara e sempre requer uma lista. - -# Error_DirectiveReservedKeyword = Directive ''{0}'' at line {1} has an invalid argument name. The name ''{2}'' is a reserved arara keyword representing every element in the ''{3}'' list. Please, pick another name for that argument. -Error_DirectiveReservedKeyword = A diretiva ''{0}'' na linha {1} tem um nome de argumento inv\u00e1lido. O nome ''{2}'' \u00e9 uma palavra reservada arara representando cada elemento na lista ''{3}''. Por favor, escolha um outro nome para esse argumento. - -# Error_DirectiveListError = Directive ''{0}'' at line {1} has an invalid argument type. Only the arguments ''files'' and ''items'' can have a list. Both are reserved arara keywords. -Error_DirectiveListError = A diretiva ''{0}'' na linha {1} tem um tipo de argumento inv\u00e1lido. Apenas os argumentos ''files'' e ''items'' podem conter uma lista. Ambos s\u00e3o palavras reservadas arara. - -# Error_InvalidDirective = Apparently, there''s an invalid directive at line {0}. Please take a look and fix it. -Error_InvalidDirective = Aparentemente, existe uma diretiva inv\u00e1lida na linha {0}. Por favor, d\u00ea uma olhadinha e conserte a diretiva. - -# Error_DirectiveGenericError = Directive ''{0}'' at line {1} seems to be malformed. It might be a YAML syntax error or a wrong mapping. -Error_DirectiveGenericError = A diretiva ''{0}'' na linha {1} parece ser malformada. Pode ser um erro na sintaxe YAML ou um mapeamento incorreto. - -# Error_InvalidLanguage = I'm sorry, but the language code you chose is invalid. Currently, the following languages are supported: -Error_InvalidLanguage = Sinto muito, mas o c\u00f3digo de idioma que voc\u00ea escolheu \u00e9 inv\u00e1lido. No momento, os seguintes idiomas s\u00e3o suportados: - -# Error_RuleNotFound = Uh-oh, I could not find the ''{0}'' rule in the search path. Could you take a look if the rule name is correct and if the rule is accessible through the search path? -Error_RuleNotFound = Uh-oh, eu n\u00e3o consegui encontrar a regra ''{0}'' no caminho de busca. Voc\u00ea poderia conferir se o nome da regra est\u00e1 correto e se a regra \u00e9 acess\u00edvel a partir do caminho de busca? - -# Error_InvalidYAMLRule = It appears that the ''{0}'' task has a YAML syntax error or an invalid field. Could you take a look at the ''{0}.yaml'' file located at ''{1}''. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLRule = Parece que a tarefa ''{0}'' tem um erro na sintaxe YAML ou um campo inv\u00e1lido. Voc\u00ea poderia dar uma olhadinha no arquivo ''{0}.yaml'' localizado em ''{1}''? Fiz o meu melhor para exibir a mensagem de erro; aqui est\u00e1: - -# Error_InvalidRule = Uh-oh, the ''{0}'' task appears to be invalid. Are you sure the ''{0}.yaml'' file located at ''{1}'' is a proper YAML file? -Error_InvalidRule = Uh-oh, a tarefa ''{0}'' parece ser inv\u00e1lida. Voc\u00ea tem certeza de que o arquivo ''{0}.yaml'' localizado em ''{1}'' \u00e9 um arquivo YAML apropriado? - -# Error_EmptyIdentifierRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid identifier. Could you fix it? -Error_EmptyIdentifierRule = Um problema foi detectado na tarefa ''{0}''. O arquivo ''{0}.yaml'' localizado em ''{1}'' requer um identificador v\u00e1lido. Voc\u00ea pode consert\u00e1-lo? - -# Error_EmptyNameRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid name. Could you fix it? -Error_EmptyNameRule = Um problema foi detectado na tarefa ''{0}''. O arquivo ''{0}.yaml'' localizado em ''{1}'' requer um nome v\u00e1lido. Voc\u00ea pode consert\u00e1-lo? - -# Error_ForbiddenIdentifierRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has an invalid argument identifier. ''{2}'' is a reserved keyword, so it cannot be used. Could you use another name? -Error_ForbiddenIdentifierRule = Uh-oh, a tarefa ''{0}'' (referenciando o arquivo ''{0}.yaml'' localizado em ''{1}'') tem um identificador de argumento inv\u00e1lido. ''{2}'' \u00e9 uma palavra reservada, portanto n\u00e3o pode ser utilizada. Voc\u00ea poderia utilizar outro nome? - -# Error_EmptyArgumentsListRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid list of arguments. Could you fix it? Note that the list of arguments can also be empty, but it is still necessary to define it explicitly (with ''arguments: []''). -Error_EmptyArgumentsListRule = Um problema foi detectado na tarefa ''{0}''. O arquivo ''{0}.yaml'' localizado em ''{1}'' requer uma lista v\u00e1lida de argumentos. Voc\u00ea pode consert\u00e1-lo? Observe que a lista de argumentos tamb\u00e9m pode ser vazia, mas mesmo assim \u00e9 necess\u00e1rio defin\u00ed-la explicitamente (com ''arguments: []''). - -# Error_WrongIdentifierRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has the wrong identifier - ''{0}'' was expected, rather than ''{2}''. Could you fix it? -Error_WrongIdentifierRule = Uh-oh, a tarefa ''{0}'' (referenciando o arquivo ''{0}.yaml'' localizado em ''{1}'') tem o identificador incorreto - era esperado ''{0}'', ao inv\u00e9s de ''{2}''. Voc\u00ea pode consert\u00e1-lo? - -# Error_ArgumentsNotDefinedInRule = Oh no, there are arguments used in the diretive ''{0}'' which are not defined in the ''{0}.yaml'' rule located at ''{1}''. You can either remove them from the ''{0}'' directive or add them to the list of arguments in the ''{0}.yaml'' rule. Here they are: {2} -Error_ArgumentsNotDefinedInRule = Uh-oh, existem argumentos utilizados na diretiva ''{0}'' que n\u00e3o est\u00e3o definidos na regra ''{0}.yaml'' localizada em ''{1}''. Voc\u00ea pode remover esses argumentos inexistentes da diretiva ''{0}'' ou adicion\u00e1-los \u00e0 lista de argumentos na regra ''{0}.yaml''. Aqui est\u00e3o eles: {2} - -# Error_DefaultValueRuntimeErrorRule = I''m sorry, but the default value set for the argument ''{0}'' of the ''{1}'' task (referencing the ''{1}.yaml'' file located at ''{2}'') has an unavailable variable/method in the rule context: ''{3}'' -Error_DefaultValueRuntimeErrorRule = Sinto muito, mas o valor padr\u00e3o definido para o argumento ''{0}'' da tarefa ''{1}'' (referenciando o arquivo ''{1}.yaml'' localizado em ''{2}'') tem uma vari\u00e1vel ou m\u00e9todo indispon\u00edvel no contexto da regra: ''{3}'' - -# Error_FlagRuntimeErrorRule = I''m sorry, but the flag set for the argument ''{0}'' of the ''{1}'' task (referencing the ''{1}.yaml'' file located at ''{2}'') has an unavailable variable/method in the rule context: ''{3}'' -Error_FlagRuntimeErrorRule = Sinto muito, mas a flag definida para o argumento ''{0}'' da tarefa ''{1}'' (referenciando o arquivo ''{1}.yaml'' localizado em ''{2}'') tem uma vari\u00e1vel ou m\u00e9todo indispon\u00edvel no contexto da regra: ''{3}'' - -# Error_DuplicatedCommandElementsRule = Uh-oh, both ''command'' and ''commands'' fields are set in the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}''). You need to pick only one of them. If your task only relies on a single command, you can opt for ''command''; if your rule requires a set of commands, maybe the ''commands'' field is more suitable. -Error_DuplicatedCommandElementsRule = Uh-oh, os campos ''command'' e ''commands'' est\u00e3o definidos ao mesmo tempo na tarefa ''{0}'' (referenciando o arquivo ''{0}.yaml'' localizado em ''{1}''). Voc\u00ea precisa escolher apenas um deles. Se a sua regra precisa de apenas um comando, voc\u00ea pode optar por ''command''; se a sua regra requer um conjunto de comandos, talvez o campo ''commands'' seja mais adequado. - -# Error_MissingCommandElementsRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') does not have either the ''command'' or ''commands'' elements. You need to pick only one of them. If your task only relies on a single command, you can opt for ''command''; if your rule requires a set of commands, maybe the ''commands'' field is more suitable. -Error_MissingCommandElementsRule = Uh-oh, a tarefa ''{0}'' (referenciando o arquivo ''{0}.yaml'' localizado em ''{1}'') n\u00e3o possui o elemento ''command'' ou ''commands''. Voc\u00ea precisa escolher um deles. Se a sua regra precisa de apenas um comando, voc\u00ea pode optar por ''command''; se a sua regra requer um conjunto de comandos, talvez o campo ''commands'' seja mais adequado. - -# Error_CommandRuntimeErrorRule = I''m sorry, but the command set for the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has an unavailable variable/method in the rule context: ''{2}'' -Error_CommandRuntimeErrorRule = Sinto muito, mas o conjunto de comandos da tarefa ''{0}'' (referenciando o arquivo ''{0}.yaml'' localizado em ''{1}'') tem uma vari\u00e1vel ou m\u00e9todo indispon\u00edvel no contexto da regra: ''{2}'' - diff --git a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_ru.properties b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_ru.properties deleted file mode 100644 index 0e2278ae4dd..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_ru.properties +++ /dev/null @@ -1,226 +0,0 @@ -# Arara -- the cool TeX automation tool -# Copyright (c) 2012, Paulo Roberto Massa Cereda -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the project's author nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# Messages: This file holds the default Russian language messages for arara. -# -# author: Sergey Ulyanov -# e-mail: ulyanov.sergey@gmail.com - -# Log_WelcomeMessage = Welcome to arara! -Log_WelcomeMessage = \u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u0432 arara! - -# Log_ProcessingFile = Processing file ''{0}'', please wait. -Log_ProcessingFile = \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0444\u0430\u0439\u043b\u0430 ''{0}'', \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435. - -# Log_Done = Done. -Log_Done = \u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043e. - -# Log_ExceptionRaised = Arara raised an exception with the following message: -Log_ExceptionRaised = Arara \u0432\u044b\u0434\u0430\u043b\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c: - -# Log_ReadyToRunCommands = Ready to run commands. -Log_ReadyToRunCommands = \u0413\u043e\u0442\u043e\u0432 \u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u043a\u043e\u043c\u0430\u043d\u0434. - -# Log_CommandName = Running ''{0}''. -Log_CommandName = \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 ''{0}''. - -# Log_Command = Command: {0} -Log_Command = \u041a\u043e\u043c\u0430\u043d\u0434\u0430: {0} - -# Log_CommandSuccess = ''{0}'' was successfully executed. -Log_CommandSuccess = ''{0}'' \u0431\u044b\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430. - -# Log_CommandFailure = ''{0}'' returned an error status. -Log_CommandFailure = ''{0}'' \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u0443\u0434\u0430\u0447\u0435\u0439. - -# Log_AllCommandsSuccess = All commands were successfully executed. -Log_AllCommandsSuccess = \u0412\u0441\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0431\u044b\u043b\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b. - -# Log_OutputLogging = Output logging: -Log_OutputLogging = \u0416\u0443\u0440\u043d\u0430\u043b \u0432\u044b\u0432\u043e\u0434\u0430: - -# Log_CommandNotFound = ''{0}'' was not found in the path. Execution attempt: {1} -Log_CommandNotFound = ''{0}'' \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u0432 \u043f\u0443\u0442\u0438. \u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f: {1} - -# Log_DirectiveFound = Directive found in line {0} with {1}. -Log_DirectiveFound = \u0414\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 {0} \u0441 {1}. - -# Log_RuleFound = Task ''{0}'' found in ''{1}''. -Log_RuleFound = \u0417\u0430\u0434\u0430\u0447\u0430 ''{0}'' \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u0432 ''{1}''. - -# Log_NoDirectivesFound = No directives found in ''{0}''. -Log_NoDirectivesFound = \u041d\u0438 \u043e\u0434\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0432 ''{0}''. - -# Help_Version = print the application version -Help_Version = \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f - -# Help_Help = print the help message -Help_Help = \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 - -# Help_Log = generate a log output -Help_Log = \u0432\u0435\u0441\u0442\u0438 \u0436\u0443\u0440\u043d\u0430\u043b \u0432\u044b\u0432\u043e\u0434\u0430 - -# Help_Verbose = print the command output -Help_Verbose = \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u043a\u043e\u043c\u0430\u043d\u0434 - -# Help_Timeout = set the execution timeout (in milliseconds) -Help_Timeout = \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (\u0432 \u043c\u0438\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445) - -# Help_Language = set the application language -Help_Language = \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u044f\u0437\u044b\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f - -# Header_Slogan = The cool TeX automation tool -Header_Slogan = \u041a\u0440\u0443\u0442\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 TeX - -# Header_AllRightsReserved = All rights reserved. -Header_AllRightsReserved = \u0412\u0441\u0435 \u043f\u0440\u0430\u0432\u0430 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u044b. - -# Msg_NoDirectivesFound = I didn''t find any directives in ''{0}'', and so didn''t do anything. Is that what you really wanted? -Msg_NoDirectivesFound = \u042f \u043d\u0435 \u043c\u043e\u0433\u0443 \u043d\u0430\u0439\u0442\u0438 \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u0432 ''{0}'', \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u043c\u043e\u0433\u0443 \u043d\u0438\u0447\u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c. \u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u0432\u044b \u0445\u043e\u0442\u0435\u043b\u0438? - -# Msg_SpecialThanks = A special thanks goes to Alan Munn, Andrew Stacey, Brent Longborough, Clemens Niederberger, David Carlisle, Enrico Gregorio, Francesco Endrici, Gonzalo Medina, Harish Kumar, \u0130lhan Polat, Joseph Wright, Marco Daniel, Mika\u00ebl Maunier, Patrick Gundlach, Rasmus Roulund, Sergey Ulyanov, Stefan Kottwitz, and many others for making this humble tool possible. -Msg_SpecialThanks = \u041e\u0441\u043e\u0431\u0430\u044f \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f Alan Munn, Andrew Stacey, Brent Longborough, Clemens Niederberger, David Carlisle, Enrico Gregorio, Francesco Endrici, Gonzalo Medina, Harish Kumar, \u0130lhan Polat, Joseph Wright, Marco Daniel, Mika\u00ebl Maunier, Patrick Gundlach, Rasmus Roulund, Sergey Ulyanov, Stefan Kottwitz \u0438 \u043c\u043d\u043e\u0433\u0438\u043c \u0434\u0440\u0443\u0433\u0438\u043c, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u043c\u0443 \u0441\u0442\u0430\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u043a\u0440\u043e\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430. - -# Msg_RunningCommand = Running {0}... -Msg_RunningCommand = \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 {0}... - -# Msg_Success = SUCCESS -Msg_Success = \u0423\u0421\u041f\u0415\u0428\u041d\u041e - -# Msg_Failure = FAILURE -Msg_Failure = \u041d\u0415\u0423\u0414\u0410\u0427\u0410 - -# Msg_Status = Status: -Msg_Status = \u0421\u0442\u0430\u0442\u0443\u0441: - -# YamlError_Context = Context: {0} -YamlError_Context = \u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442: {0} - -# YamlError_Problem = Problem: {0} -YamlError_Problem = \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: {0} - -# YamlError_ErrorLocation = Error found in line {0}, column {1}. -YamlError_ErrorLocation = \u041e\u0448\u0438\u0431\u043a\u0430 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 {0} \u043f\u043e\u0437\u0438\u0446\u0438\u0438 {1}. - -# Error_FileDoesNotExistWithExtensionsList = I''m sorry, but the file ''{0} {1}'' does not exist. Note that when you provide only the basename (i.e, the filename without the extension) or with an unknown extension, arara will try to look for files ending with the predefined extensions {1} in that order. You can override the order, the search pattern or even add support for new extensions through the configuration file. Please refer to the arara manual to learn more about this feature. -Error_FileDoesNotExistWithExtensionsList = \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0444\u0430\u0439\u043b ''{0} {1}'' \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0437\u043e\u0432\u043e\u0435 \u0438\u043c\u044f (\u0442.\u0435., \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0431\u0435\u0437 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f) \u0438\u043b\u0438 \u0438\u043c\u044f \u0441 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c, arara \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u0441 \u043f\u0440\u0435\u0434\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u043c\u0438 {1} \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a, \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u043f\u043e\u0438\u0441\u043a\u0430 \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043d\u043e\u0432\u044b\u0445 \u0440\u0430\u0441\u0449\u0438\u0440\u0435\u043d\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044c \u043a \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0443 arara, \u0447\u0442\u043e \u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0431 \u044d\u0442\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438. - -# Error_FileDoesNotExist = File ''{0}'' does not exist. -Error_FileDoesNotExist = \u0424\u0430\u0439\u043b ''{0}'' \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. - -# Error_CommandNotFound = \nI''m sorry, but the command from the ''{0}'' task could not be found. Are you sure the command ''{1}'' is correct, or even accessible from the system path? -Error_CommandNotFound = = \n\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0438\u0437 \u0437\u0430\u0434\u0430\u0447\u0438 ''{0}'' \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430. \u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0430 ''{1}'' \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0430 \u0438\u043b\u0438 \u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438? - -# Error_InvalidYAMLConfigurationFile = I'm sorry, but apparently your arara configuration file is invalid, that is, it has invalid or missing YAML entries. Unfortunately, arara cannot proceed until the error is fixed. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLConfigurationFile = \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432\u0430\u0448 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 arara, \u043f\u043e \u0432\u0441\u0435\u0439 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u043d\u0435\u0432\u0435\u0440\u0435\u043d, \u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u043d\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0438\u043b\u0438 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 YAML. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, arara \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443, \u043f\u043e\u043a\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0430\u200b\u200b. \u042f \u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u0438\u0437\u043e \u0432\u0441\u0435\u0445 \u0441\u0438\u043b, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435, \u0438\u0442\u0430\u043a, \u0432\u043e\u0442 \u043e\u043d\u043e: - -# Error_InvalidConfigurationFile = Uh-oh, the configuration file appears to be invalid. Are you sure it's a proper YAML file? Unfortunately, arara cannot proceed until a proper configuration file is provided. -Error_InvalidConfigurationFile = \u041e\u0439-\u043e\u0439, \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u043d\u0435\u0432\u0435\u0440\u0435\u043d. \u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b YAML? \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, arara \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. - -# Error_InvalidLanguageConfigurationFile = Houston, we have a problem. Sadly, the language set in the configuration file is not valid. Currently, arara can provide support for the following languages: {0}. Make sure to choose a valid language or remove the entry from the configuration file (the field is optional), otherwise arara cannot proceed. -Error_InvalidLanguageConfigurationFile = \u0425\u044c\u044e\u0441\u0442\u043e\u043d, \u0443 \u043d\u0430\u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u044f\u0437\u044b\u043a, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 \u0444\u0430\u0439\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u043c. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f arara \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432: {0}. \u0423\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u044c\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432\u044b\u0431\u0440\u0430\u043d \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u044f\u0437\u044b\u043a \u0438\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0443\u0434\u0430\u043b\u0435\u043d\u0430 \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 (\u043f\u043e\u043b\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c), \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 arara \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443. - -# Error_InvalidFiletypesConfigurationFile = I'm sorry, but it seems your configuration file has customized filetypes with neither the extension or pattern defined. Both are required in order to continue. Please fix this error in your configuration file and try again. -Error_InvalidFiletypesConfigurationFile = \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432\u0438\u0434\u0438\u043c\u043e, \u0432 \u0432\u0430\u0448\u0435\u043c \u0444\u0430\u0439\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0444\u0430\u0439\u043b\u043e\u0432 \u0431\u0435\u0437 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0438 \u043e\u0431\u0440\u0430\u0437\u0446\u0430. \u0418 \u0442\u043e \u0438 \u0434\u0440\u0443\u0433\u043e\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0438\u0441\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u044d\u0442\u0443 \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u0432\u0430\u0448\u0435\u043c \u0444\u0430\u0439\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443. - -# Error_PathRuntimeErrorConfigurationFile = I''m sorry, but one of the entries of the search path in your configuration file has an unavailable variable in the path context: ''{0}'' -Error_PathRuntimeErrorConfigurationFile = \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043e\u0434\u0438\u043d \u0438\u0437 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0443\u0442\u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u0432\u0430\u0448\u0435\u043c \u0444\u0430\u0439\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043f\u0443\u0442\u0438: ''{0}'' - -# Error_PathIOErrorConfigurationFile = I'm sorry, but one of the entries of the search path in your configuration file has a malformed directory structure. Could you take a look at it? -Error_PathIOErrorConfigurationFile = \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043e\u0434\u0438\u043d \u0438\u0437 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0443\u0442\u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u0432\u0430\u0448\u0435\u043c \u0444\u0430\u0439\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432. \u041d\u0435 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0432\u044b \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u044d\u0442\u043e? - -# Error_InvalidYAMLDirective = It appears there is a malformed directive found at line {0}, that is, a directive that might have a YAML syntax error or an invalid field. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLDirective = \u041f\u043e\u0445\u043e\u0436\u0435, \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 {0} \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430, \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 YAML \u0438\u043b\u0438 \u043d\u0435\u0432\u0435\u0440\u043d\u043e\u0435 \u043f\u043e\u043b\u0435. \u042f \u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u0438\u0437\u043e \u0432\u0441\u0435\u0445 \u0441\u0438\u043b, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435, \u0438\u0442\u0430\u043a, \u0432\u043e\u0442 \u043e\u043d\u043e: - -# Error_DirectiveEmptyCurlyBrackets = Directive ''{0}'' at line {1} has empty curly brackets. Note that arara opts for a cleaner syntax when a directive has no parameters. To fix it, it''s enough to either remove the curly brackets or provide the arguments for the directive. -Error_DirectiveEmptyCurlyBrackets = \u0414\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 ''{0}'' \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 {1} \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u0443\u0441\u0442\u044b\u0435 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e arara \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u043a\u043e\u0433\u0434\u0430 \u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438\u0431\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438, \u043b\u0438\u0431\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b. - -# Error_DirectiveInvalidArgumentList = Directive ''{0}'' at line {1} has an invalid argument type. The argument ''{2}'' is a reserved arara keyword and always requires a list. -Error_DirectiveInvalidArgumentList = \u0414\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 ''{0}'' \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 {1} \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u0442\u0438\u043f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430. \u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442 ''{2}'' \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u043e\u043c arara \u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u043f\u0438\u0441\u043a\u043e\u043c. - -# Error_DirectiveReservedKeyword = Directive ''{0}'' at line {1} has an invalid argument name. The name ''{2}'' is a reserved arara keyword representing every element in the ''{3}'' list. Please, pick another name for that argument. -Error_DirectiveReservedKeyword = \u0414\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 ''{0}'' \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 {1} \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u0432\u0435\u0440\u043d\u043e\u0435 \u0438\u043c\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430. \u0418\u043c\u044f ''{2}'' \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u043e\u043c arara, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 ''{3}''. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0440\u0443\u0433\u043e\u0435 \u0438\u043c\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430. - -# Error_DirectiveListError = Directive ''{0}'' at line {1} has an invalid argument type. Only the arguments ''files'' and ''items'' can have a list. Both are reserved arara keywords. -Error_DirectiveListError = \u0414\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 ''{0}'' \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 {1} \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u0442\u0438\u043f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430. \u0422\u043e\u043b\u044c\u043a\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b ''files'' \u0438 ''items'' \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043a\u0438. \u041e\u0431\u0430 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u043e\u043c\u0438 arara. - -# Error_InvalidDirective = Apparently, there''s an invalid directive at line {0}. Please take a look and fix it. -Error_InvalidDirective = \u0412\u0438\u0434\u0438\u043c\u043e, \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 {0} \u043d\u0435\u0432\u0435\u0440\u043d\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u0435\u0435. - -# Error_DirectiveGenericError = Directive ''{0}'' at line {1} seems to be malformed. It might be a YAML syntax error or a wrong mapping. -Error_DirectiveGenericError = \u0414\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 ''{0}'' \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 {1}, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 YAML \u0438\u043b\u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. - -# Error_InvalidLanguage = I'm sorry, but the language code you chose is invalid. Currently, the following languages are supported: -Error_InvalidLanguage = \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0432\u0430\u043c\u0438 \u043a\u043e\u0434 \u044f\u0437\u044b\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u043c. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u044f\u0437\u044b\u043a\u0438: - -# Error_RuleNotFound = Uh-oh, I could not find the ''{0}'' rule in the search path. Could you take a look if the rule name is correct and if the rule is accessible through the search path? -Error_RuleNotFound = \u041e\u0439-\u043e\u0439, \u044f \u043d\u0435 \u0441\u043c\u043e\u0433 \u043d\u0430\u0439\u0442\u0438 ''{0}'' \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u043f\u043e\u0438\u0441\u043a\u0430. \u041d\u0435 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0432\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0432\u0435\u0440\u043d\u043e \u043b\u0438 \u0437\u0430\u0434\u0430\u043d\u043e \u0438\u043c\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u043b\u0438 \u043e\u043d\u043e \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u043f\u043e\u0438\u0441\u043a\u0430? - -# Error_InvalidYAMLRule = It appears that the ''{0}'' task has a YAML syntax error or an invalid field. Could you take a look at the ''{0}.yaml'' file located at ''{1}''. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLRule = \u041f\u043e\u0445\u043e\u0436\u0435, \u0437\u0430\u0434\u0430\u0447\u0430 ''{0}'' \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 YAML \u0438\u043b\u0438 \u043d\u0435\u0432\u0435\u0440\u043d\u043e\u0435 \u043f\u043e\u043b\u0435. \u041d\u0435 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0432\u044b \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u0444\u0430\u0439\u043b ''{0}.yaml'', \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0432 ''{1}''. \u042f \u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u0438\u0437\u043e \u0432\u0441\u0435\u0445 \u0441\u0438\u043b, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435, \u0438\u0442\u0430\u043a, \u0432\u043e\u0442 \u043e\u043d\u043e: - -# Error_InvalidRule = Uh-oh, the ''{0}'' task appears to be invalid. Are you sure the ''{0}.yaml'' file located at ''{1}'' is a proper YAML file? -Error_InvalidRule = \u041e\u0439-\u043e\u0439, \u043f\u043e\u0445\u043e\u0436\u0435, \u0437\u0430\u0434\u0430\u0447\u0430 ''{0}'' \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0432\u0435\u0440\u043d\u043e\u0439. \u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0444\u0430\u0439\u043b ''{0}.yaml'', \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0432 ''{1}'', \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c YAML \u0444\u0430\u0439\u043b\u043e\u043c? - -# Error_EmptyIdentifierRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid identifier. Could you fix it? -Error_EmptyIdentifierRule = \u0412 \u0437\u0430\u0434\u0430\u0447\u0435 ''{0}'' \u0431\u044b\u043b\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u0412 \u0444\u0430\u0439\u043b\u0435 ''{0}.yaml'', \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u043c \u0432 ''{1}'', \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440. \u041d\u0435 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0432\u044b \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c? - -# Error_EmptyNameRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid name. Could you fix it? -Error_EmptyNameRule = \u0412 \u0437\u0430\u0434\u0430\u0447\u0435 ''{0}'' \u0431\u044b\u043b\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u0412 \u0444\u0430\u0439\u043b\u0435 ''{0}.yaml'', \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u043c \u0432 ''{1}'', \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u043d\u043e\u0435 \u0438\u043c\u044f. \u041d\u0435 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0432\u044b \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c? - -# Error_ForbiddenIdentifierRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has an invalid argument identifier. ''{2}'' is a reserved keyword, so it cannot be used. Could you use another name? -Error_ForbiddenIdentifierRule = \u041e\u0439-\u043e\u0439, \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 ''{0}'' (\u0441\u0441\u044b\u043b\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u043d\u0430 \u0444\u0430\u0439\u043b ''{0}.yaml'', \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0432 ''{1}'') \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430. \u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 ''{2}'' \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u043e\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d. \u041d\u0435 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0435 \u0438\u043c\u044f? - -# Error_EmptyArgumentsListRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid list of arguments. Could you fix it? Note that the list of arguments can also be empty, but it is still necessary to define it explicitly (with ''arguments: []''). -Error_EmptyArgumentsListRule = \u0412 \u0437\u0430\u0434\u0430\u0447\u0435 ''{0}'' \u0431\u044b\u043b\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u0412 \u0444\u0430\u0439\u043b\u0435 ''{0}.yaml'', \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u043c \u0432 ''{1}'', \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u041d\u0435 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0432\u044b \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c? \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u043c, \u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0435\u0433\u043e \u044f\u0432\u043d\u043e (\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e ''arguments: []''). - -# Error_WrongIdentifierRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has the wrong identifier - ''{0}'' was expected, rather than ''{2}''. Could you fix it? -Error_WrongIdentifierRule = \u041e\u0439-\u043e\u0439, \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 ''{0}'' (\u0441\u0441\u044b\u043b\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u043d\u0430 \u0444\u0430\u0439\u043b ''{0}.yaml'', \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0432 ''{1}'') \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 - ''{0}'' \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c, \u0430 \u043d\u0435 ''{2}''. \u041d\u0435 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0432\u044b \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c? - -# Error_ArgumentsNotDefinedInRule = Oh no, there are arguments used in the diretive ''{0}'' which are not defined in the ''{0}.yaml'' rule located at ''{1}''. You can either remove them from the ''{0}'' directive or add them to the list of arguments in the ''{0}.yaml'' rule. Here they are: {2} -Error_ArgumentsNotDefinedInRule = \u041e \u043d\u0435\u0442, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0435 ''{0}'', \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u0435 ''{0}.yaml'', \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u043c \u0432 ''{1}''. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0438\u0445 \u0438\u0437 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b ''{0}'', \u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 ''{0}.yaml''. \u0412\u043e\u0442 \u043e\u043d\u0438: {2} - -# Error_DefaultValueRuntimeErrorRule = I''m sorry, but the default value set for the argument ''{0}'' of the ''{1}'' task (referencing the ''{1}.yaml'' file located at ''{2}'') has an unavailable variable/method in the rule context: ''{3}'' -Error_DefaultValueRuntimeErrorRule = \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u0434\u043b\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 ''{0}'' \u0437\u0430\u0434\u0430\u0447\u0438 ''{1}'' (\u0441\u0441\u044b\u043b\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u043d\u0430 \u0444\u0430\u0439\u043b ''{1}.yaml'', \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0432 ''{2}'') \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e / \u043c\u0435\u0442\u043e\u0434 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430: ''{3}'' - -# Error_FlagRuntimeErrorRule = I''m sorry, but the flag set for the argument ''{0}'' of the ''{1}'' task (referencing the ''{1}.yaml'' file located at ''{2}'') has an unavailable variable/method in the rule context: ''{3}'' -Error_FlagRuntimeErrorRule = \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0444\u043b\u0430\u0433, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 ''{0}'' \u0437\u0430\u0434\u0430\u0447\u0438 ''{1}'' (\u0441\u0441\u044b\u043b\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u043d\u0430 \u0444\u0430\u0439\u043b ''{1}.yaml'', \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0432 ''{2}'') \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e / \u043c\u0435\u0442\u043e\u0434 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430: ''{3}'' - -# Error_DuplicatedCommandElementsRule = Uh-oh, both ''command'' and ''commands'' fields are set in the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}''). You need to pick only one of them. If your task only relies on a single command, you can opt for ''command''; if your rule requires a set of commands, maybe the ''commands'' field is more suitable. -Error_DuplicatedCommandElementsRule = \u041e\u0439-\u043e\u0439, \u043e\u0431\u0430 \u043f\u043e\u043b\u044f ''command'' \u0438 ''commands'' \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 ''{0}'' (\u0441\u0441\u044b\u043b\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u043d\u0430 \u0444\u0430\u0439\u043b ''{0}.yaml'', \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0432 ''{1}''). \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u0438\u0437 \u043d\u0438\u0445. \u0415\u0441\u043b\u0438 \u0432\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043e\u0434\u043d\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u0431\u0440\u0430\u0442\u044c ''command'', \u0435\u0441\u043b\u0438 \u0432\u0430\u0448\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u0431\u043e\u0440\u0430 \u043a\u043e\u043c\u0430\u043d\u0434, \u043f\u043e\u043b\u0435 ''commands'' \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u043c. - -# Error_MissingCommandElementsRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') does not have either the ''command'' or ''commands'' elements. You need to pick only one of them. If your task only relies on a single command, you can opt for ''command''; if your rule requires a set of commands, maybe the ''commands'' field is more suitable. -Error_MissingCommandElementsRule = \u041e\u0439-\u043e\u0439, \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 ''{0}'' (\u0441\u0441\u044b\u043b\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u043d\u0430 \u0444\u0430\u0439\u043b ''{0}.yaml'', \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0432 ''{1}'') \u043d\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 ''command'' \u0438\u043b\u0438 ''commands'' \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d. \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445. \u0415\u0441\u043b\u0438 \u0432\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043e\u0434\u043d\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u0431\u0440\u0430\u0442\u044c ''command'', \u0435\u0441\u043b\u0438 \u0432\u0430\u0448\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u0431\u043e\u0440\u0430 \u043a\u043e\u043c\u0430\u043d\u0434, \u043f\u043e\u043b\u0435 ''commands'' \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u043c. - -# Error_CommandRuntimeErrorRule = I''m sorry, but the command set for the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has an unavailable variable/method in the rule context: ''{2}'' -Error_CommandRuntimeErrorRule = \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043a\u043e\u043c\u0430\u043d\u0434\u0430, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447\u0438 ''{0}'' (\u0441\u0441\u044b\u043b\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u043d\u0430 \u0444\u0430\u0439\u043b ''{0}.yaml'', \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0432 ''{1}'') \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e / \u043c\u0435\u0442\u043e\u0434 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430: ''{2}'' - diff --git a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_tr.properties b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_tr.properties deleted file mode 100644 index f7fbb2423ab..00000000000 --- a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/arara/localization/Messages_tr.properties +++ /dev/null @@ -1,228 +0,0 @@ -\ufeff# Arara -- the cool TeX automation tool -# Copyright (c) 2012, Paulo Roberto Massa Cereda -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of the project's author nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# Messages_tr: This file holds the Turkish language messages for arara. -# -# initially translated by: Brent Longborough (Obviously not a fluent Turkish speaker!) -# e-mail: brent@longborough.org -# enjoyed and revised by: \u0130lhan Polat (Brent is just humble, he is wonderful) -# e-mail: i.polat@tudelft.nl - -# Log_WelcomeMessage = Welcome to arara! -Log_WelcomeMessage = arara'ya ho\u015fgeldin - -# Log_ProcessingFile = Processing file ''{0}'', please wait. -Log_ProcessingFile = Dosya ''{0}'' i\u015fleniyor, biraz bekletecegim. - -# Log_Done = Done. -Log_Done = Haz\u0131r. - -# Log_ExceptionRaised = Arara raised an exception with the following message: -Log_ExceptionRaised = arara bir istisna farketti ve \u015f\u00f6yle dedi: - -# Log_ReadyToRunCommands = Ready to run commands. -Log_ReadyToRunCommands = Komutlar icin beklemede. - -# Log_CommandName = Running ''{0}''. -Log_CommandName = ''{0}'' komutu yerine getiriliyor. - -# Log_Command = Command: {0} -Log_Command = Komut: {0} - -# Log_CommandSuccess = ''{0}'' was successfully executed. -Log_CommandSuccess = ''{0}'' ba\u015far\u0131yla yerine getirildi. - -# Log_CommandFailure = ''{0}'' returned an error status. -Log_CommandFailure = ''{0}'' hata durumu bildirdi. - -# Log_AllCommandsSuccess = All commands were successfully executed. -Log_AllCommandsSuccess = T\u00fcm komutlar ba\u015far\u0131yla yerine getirildi. - -# Log_OutputLogging = Output logging: -Log_OutputLogging = Kay\u0131t \u00c7\u0131kt\u0131s\u0131: - -# Log_CommandNotFound = ''{0}'' was not found in the path. Execution attempt: {1} -Log_CommandNotFound = ''{0}'' komutuna giden uygun bir yol bulunamad\u0131. Deneme: {1} - -# Log_DirectiveFound = Directive found in line {0} with {1}. -Log_DirectiveFound = Sat\u0131r {1} \u00fczerinde {0} y\u00f6nergesi bulundu. - -# Log_RuleFound = Task ''{0}'' found in ''{1}''. -Log_RuleFound = ''{1}'' de/da ''{0}'' g\u00f6revi bulundu. - -# Log_NoDirectivesFound = No directives found in ''{0}''. -Log_NoDirectivesFound = ''{0}'' dosyas\u0131nda hi\u00e7bir y\u00f6nerge bulunamad\u0131. - -# Help_Version = print the application version -Help_Version = uygulama s\u00fcr\u00fcm\u00fcn\u00fc yazd\u0131r\u0131r - -# Help_Help = print the help message -Help_Help = yard\u0131m iletisini yazd\u0131r\u0131r - -# Help_Log = generate a log output -Help_Log = kay\u0131t \u00e7\u0131kt\u0131s\u0131 \u00fcretir - -# Help_Verbose = print the command output -Help_Verbose = komut \u00e7\u0131kt\u0131s\u0131 yazd\u0131r\u0131r - -# Help_Timeout = set the execution timeout (in milliseconds) -Help_Timeout = y\u00fcr\u00fctme zaman a\u015f\u0131m\u0131n\u0131 (milisaniye cinsinden) ayarlar - -# Help_Language = set the application language -Help_Language = uygulama dilini ayarlar - -# Header_Slogan = The cool TeX automation tool -Header_Slogan = \u015eahane TeX otomasyon arac\u0131 - -# Header_AllRightsReserved = All rights reserved. -Header_AllRightsReserved = T\u00fcm haklar\u0131 sakl\u0131d\u0131r. - -# Msg_NoDirectivesFound = I didn''t find any directives in ''{0}'', and so didn''t do anything. Is that what you really wanted? -Msg_NoDirectivesFound = Ben ''{0}'' dosyas\u0131nda hi\u00e7bir y\u00f6nerge bulamad\u0131m, nedenle bir \u015fey yapmad\u0131m. Ger\u00e7ekten istedi\u011fin bu mu? - -# Msg_SpecialThanks = A special thanks goes to Alan Munn, Andrew Stacey, Brent Longborough, Clemens Niederberger, David Carlisle, Enrico Gregorio, Francesco Endrici, Gonzalo Medina, Harish Kumar, \u0130lhan Polat, Joseph Wright, Marco Daniel, Mika\u00ebl Maunier, Patrick Gundlach, Rasmus Roulund, Sergey Ulyanov, Stefan Kottwitz, and many others for making this humble tool possible. -Msg_SpecialThanks = Alan Munn, Andrew Stacey, Brent Longborough, Clemens Niederberger, David Carlisle, Enrico Gregorio, Francesco Endrici, Gonzalo Medina, Harish Kumar, \u0130lhan Polat, Joseph Wright, Marco Daniel, Mika\u00ebl Maunier, Patrick Gundlach, Rasmus Roulund, Sergey Ulyanov, Stefan Kottwitz, ve di\u011ferlerine bu m\u00fctevazi arac\u0131 m\u00fcmk\u00fcn k\u0131ld\u0131klar\u0131 i\u00e7in \u00e7ok te\u015fekk\u00fcrler. - -# Msg_RunningCommand = Running {0}... -Msg_RunningCommand = {0} yerine getiriliyor... - -# Msg_Success = SUCCESS -Msg_Success = BA\u015eARILI - -# Msg_Failure = FAILURE -Msg_Failure = BA\u015eARISIZ - -# Msg_Status = Status: -Msg_Status = Durum: - -# YamlError_Context = Context: {0} -YamlError_Context = Ba\u011flam: {0} - -# YamlError_Problem = Problem: {0} -YamlError_Problem = Sorun: {0} - -# YamlError_ErrorLocation = Error found in line {0}, column {1}. -YamlError_ErrorLocation = {0}. sat\u0131r, {1}. s\u00fctunda hata bulundu. - -# Error_FileDoesNotExistWithExtensionsList = I''m sorry, but the file ''{0} {1}'' does not exist. Note that when you provide only the basename (i.e, the filename without the extension) or with an unknown extension, arara will try to look for files ending with the predefined extensions {1} in that order. You can override the order, the search pattern or even add support for new extensions through the configuration file. Please refer to the arara manual to learn more about this feature. -Error_FileDoesNotExistWithExtensionsList = \u00dczg\u00fcn\u00fcm ama ''{0} {1}'' diye bir dosya yok. Ancak, uzant\u0131s\u0131 olmayan (veya bilinmeyen bir uzant\u0131s\u0131 olan) dosya ad\u0131n\u0131 girdi\u011finde, arara s\u0131ras\u0131yla {1} uzant\u0131lar\u0131n\u0131 bulmay\u0131 dener. Elbette bu s\u0131ray\u0131 ge\u00e7ersiz k\u0131lmak, de\u011fi\u015ftirmek hatta yeni uzant\u0131lar ekleyebilmek m\u00fcmk\u00fcn. Bu \u00f6zellik hakk\u0131nda daha fazla bilgi edinmek i\u00e7in arara k\u0131lavuzuna bak\u0131n. - -# Error_FileDoesNotExist = File ''{0}'' does not exist. -Error_FileDoesNotExist = ''{0}'' diye bir dosya yok. - -# Error_CommandNotFound = \nI''m sorry, but the command from the ''{0}'' task could not be found. Are you sure the command ''{1}'' is correct, or even accessible from the system path? -Error_CommandNotFound = \n\u00dczg\u00fcn\u00fcm ama ''{0}'' g\u00f6revindeki komutu bulunamad\u0131. ''{1}'' komutunun do\u011fru veya sistem yolu ile eri\u015filebilir oldu\u011fundan emin misin? - -# Error_InvalidYAMLConfigurationFile = I'm sorry, but apparently your arara configuration file is invalid, that is, it has invalid or missing YAML entries. Unfortunately, arara cannot proceed until the error is fixed. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLConfigurationFile = \u00dczg\u00fcn\u00fcm, ama g\u00f6r\u00fcn\u00fc\u015fe g\u00f6re arara yap\u0131land\u0131rma dosyas\u0131 ge\u00e7ersiz, daha do\u011frusu ge\u00e7ersiz veya eksik YAML giri\u015fleri bar\u0131nd\u0131r\u0131yor. Maalesef, arara bu hata giderilene kadar devam edemeyecek. Elimden geldi\u011fince, \u015f\u00f6yle bir hata d\u00f6k\u00fcm\u00fc \u00e7\u0131kartt\u0131m: - -# Error_InvalidConfigurationFile = Uh-oh, the configuration file appears to be invalid. Are you sure it's a proper YAML file? Unfortunately, arara cannot proceed until a proper configuration file is provided. -Error_InvalidConfigurationFile = T\u00fch, yap\u0131land\u0131rma dosyas\u0131 ge\u00e7ersiz g\u00f6r\u00fcn\u00fcyor. Uygun bir YAML dosyas\u0131 oldu\u011fundan emin misin? Uygun bir yap\u0131land\u0131rma dosyas\u0131 girilene kadar maalesef arara devam edemeyecek. - -# Error_InvalidLanguageConfigurationFile = Houston, we have a problem. Sadly, the language set in the configuration file is not valid. Currently, arara can provide support for the following languages: {0}. Make sure to choose a valid language or remove the entry from the configuration file (the field is optional), otherwise arara cannot proceed. -Error_InvalidLanguageConfigurationFile = Houston, bir sorun var. Ne yaz\u0131k ki, yap\u0131land\u0131rma dosyas\u0131nda ayarlanan dil ge\u00e7erli de\u011fil. \u015eu anda, arara \u015fu dilleri destekliyor: {0}. Anlayabildi\u011fim bir dil se\u00e7in ya da yap\u0131land\u0131rma dosyas\u0131ndan bu (iste\u011fe ba\u011fl\u0131) giri\u015fi kald\u0131r\u0131n, aksi takdirde arara devam edemeyecek. - -# Error_InvalidFiletypesConfigurationFile = I'm sorry, but it seems your configuration file has customized filetypes with neither the extension or pattern defined. Both are required in order to continue. Please fix this error in your configuration file and try again. -Error_InvalidFiletypesConfigurationFile = \u00dczg\u00fcn\u00fcm ama g\u00f6r\u00fcn\u00fc\u015fe g\u00f6re yap\u0131land\u0131rma dosyas\u0131nda ne desen tan\u0131m\u0131 olan ne de uzant\u0131s\u0131 bilinen \u00f6zelle\u015ftirilmi\u015f dosya tipleri var. Her iki bilgininde sa\u011flanm\u0131\u015f olmas\u0131 devam edebilmek i\u00e7in gerekli. Yap\u0131land\u0131rma dosyas\u0131ndaki bu hatay\u0131 d\u00fczeltin, ve tekrar deneyin. - -# Error_PathRuntimeErrorConfigurationFile = I''m sorry, but one of the entries of the search path in your configuration file has an unavailable variable in the path context: ''{0}'' -Error_PathRuntimeErrorConfigurationFile = \u00dczg\u00fcn\u00fcm ama yap\u0131land\u0131rma dosyas\u0131nda arama yolu girdilerinden birinde kullan\u0131lamayacak bir de\u011fi\u015fken var: ''{0}'' - -# Error_PathIOErrorConfigurationFile = I'm sorry, but one of the entries of the search path in your configuration file has a malformed directory structure. Could you take a look at it? -Error_PathIOErrorConfigurationFile = \u00dczg\u00fcn\u00fcm ama yap\u0131land\u0131rma dosyas\u0131nda arama yoluna girdilerinden birini hatal\u0131 bi\u00e7imlendirilmi\u015f bir dizin yap\u0131s\u0131 vard\u0131r. Benim i\u00e7in bir bakabilir misin? - -# Error_InvalidYAMLDirective = It appears there is a malformed directive found at line {0}, that is, a directive that might have a YAML syntax error or an invalid field. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLDirective = Sat\u0131r {0} \u00fczerinde bozuk, yani, YAML s\u00f6zdizimi hatas\u0131 veya ge\u00e7ersiz bir alan\u0131 olabilecek bir y\u00f6nerge var gibi duruyor. Elimden geldi\u011fince, \u015f\u00f6yle bir hata d\u00f6k\u00fcm\u00fc \u00e7\u0131kartt\u0131m: - -# Error_DirectiveEmptyCurlyBrackets = Directive ''{0}'' at line {1} has empty curly brackets. Note that arara opts for a cleaner syntax when a directive has no parameters. To fix it, it''s enough to either remove the curly brackets or provide the arguments for the directive. -Error_DirectiveEmptyCurlyBrackets = Sat\u0131r {1} \u00fczerindeki ''{0}'' y\u00f6nergesinde bo\u015f k\u00fcme parantezleri buldum. arara y\u00f6nergenin arg\u00fcmanlar\u0131 yoksa sade bir s\u00f6zdizimi yap\u0131s\u0131n\u0131 tercih eder. Bunu d\u00fczeltmek i\u00e7in, bo\u015f k\u00fcme parantezlerini kald\u0131rmak veya y\u00f6nerge i\u00e7in arg\u00fcmanlar sunmak yeterli. - -# Error_DirectiveInvalidArgumentList = Directive ''{0}'' at line {1} has an invalid argument type. The argument ''{2}'' is a reserved arara keyword and always requires a list. -Error_DirectiveInvalidArgumentList = Sat\u0131r {1} \u00fczerinde ''{0}'' y\u00f6nergesi i\u00e7in ge\u00e7ersiz bir arg\u00fcman t\u00fcr\u00fc var. ''{2}'' arg\u00fcman\u0131 arara''ya \u00f6zeldir her zaman bir liste gerektirir. - -# Error_DirectiveReservedKeyword = Directive ''{0}'' at line {1} has an invalid argument name. The name ''{2}'' is a reserved arara keyword representing every element in the ''{3}'' list. Please, pick another name for that argument. -Error_DirectiveReservedKeyword = Sat\u0131r {1} \u00fczerinde ''{0}'' y\u00f6nergesi i\u00e7in ge\u00e7ersiz bir arg\u00fcman t\u00fcr\u00fc var. ''{2}'' kelimesi arara''ya ait ''{3}'' listesinde her elementi temsil eden \u00f6zel bir kelimedir. L\u00fctfen, ba\u015fka bir kelime se\u00e7in. - -# Error_DirectiveListError = Directive ''{0}'' at line {1} has an invalid argument type. Only the arguments ''files'' and ''items'' can have a list. Both are reserved arara keywords. -Error_DirectiveListError = Sat\u0131r {1} \u00fczerinde ''{0}'' y\u00f6nergesi i\u00e7in ge\u00e7ersiz bir arg\u00fcman t\u00fcr\u00fc var. Sadece ''file'' ve ''items'' arg\u00fcmanlar\u0131 bir liste olabilir. Her ikisi de arara''ya ait \u00f6zel kelimelerdir. - -# Error_InvalidDirective = Apparently, there''s an invalid directive at line {0}. Please take a look and fix it. -Error_InvalidDirective = G\u00f6r\u00fcn\u00fc\u015fe g\u00f6re, {0}. sat\u0131rda ge\u00e7ersiz bir y\u00f6nerge var. Bir g\u00f6z at\u0131p d\u00fczeltin l\u00fctfen. - -# Error_DirectiveGenericError = Directive ''{0}'' at line {1} seems to be malformed. It might be a YAML syntax error or a wrong mapping. -Error_DirectiveGenericError = Sat\u0131r {1} \u00fczerinde ''{0}'' y\u00f6nergesi bozuk gibi. YAML s\u00f6zdizimi hatas\u0131 ya da yanl\u0131\u015f bir e\u015fleme olabilir. - -# Error_InvalidLanguage = I'm sorry, but the language code you chose is invalid. Currently, the following languages are supported: -Error_InvalidLanguage = \u00dczg\u00fcn\u00fcm, ama se\u00e7ti\u011fin dil kodu ge\u00e7ersiz. \u015eimdilik a\u015fa\u011f\u0131daki dilleri konu\u015fabiliyorum: - -# Error_RuleNotFound = Uh-oh, I could not find the ''{0}'' rule in the search path. Could you take a look if the rule name is correct and if the rule is accessible through the search path? -Error_RuleNotFound = T\u00fch, arama yolunda ''{0}'' kural\u0131n\u0131 bulamad\u0131m. Kural arama yolu \u00fczerinden eri\u015filebilir ise kural ad\u0131n\u0131n do\u011fru oldu\u011funa bakar m\u0131s\u0131n? - -# Error_InvalidYAMLRule = It appears that the ''{0}'' task has a YAML syntax error or an invalid field. Could you take a look at the ''{0}.yaml'' file located at ''{1}''. I tried my best to dump the error message, so here it is: -Error_InvalidYAMLRule = ''{0}'' g\u00f6revi bir YAML s\u00f6zdizimi hatas\u0131 veya ge\u00e7ersiz bir alan i\u00e7eriyor gibi g\u00f6r\u00fcn\u00fcyor. ''{1}'' rdeki ''{0}.yaml'' dosyas\u0131na bir bakar m\u0131s\u0131n? Elimden geldi\u011fince, \u015f\u00f6yle bir hata d\u00f6k\u00fcm\u00fc \u00e7\u0131kartt\u0131m: - -# Error_InvalidRule = Uh-oh, the ''{0}'' task appears to be invalid. Are you sure the ''{0}.yaml'' file located at ''{1}'' is a proper YAML file? -Error_InvalidRule = T\u00fch, ''{0}'' g\u00f6revi ge\u00e7ersiz g\u00f6r\u00fcn\u00fcyor. ''{1}'' de bulunan ''{0}.yaml'' uygun bir YAML dosyas\u0131 oldu\u011fundan emin misin? - -# Error_EmptyIdentifierRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid identifier. Could you fix it? -Error_EmptyIdentifierRule = ''{0}'' g\u00f6revinde bir sorun var. ''{1}'' deki ''{0}.yaml'' dosyas\u0131 i\u00e7in ge\u00e7erli bir tan\u0131mlay\u0131c\u0131 gerek. D\u00fczeltebilir misin? - -# Error_EmptyNameRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid name. Could you fix it? -Error_EmptyNameRule = ''{0}'' g\u00f6revinde bir sorun var. ''{1}'' yer ''{0}.yaml'' dosyas\u0131 i\u00e7in ge\u00e7erli bir isim gerek. D\u00fczeltebilir misin? - -# Error_ForbiddenIdentifierRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has an invalid argument identifier. ''{2}'' is a reserved keyword, so it cannot be used. Could you use another name? -Error_ForbiddenIdentifierRule = T\u00fch, ''{0}'' g\u00f6revi (''{1}'' deki ''{0}.yaml'' dosyas\u0131na atfen) ge\u00e7ersiz bir arg\u00fcman tan\u0131mlay\u0131c\u0131s\u0131 i\u00e7eriyor. ''{2}'' \u00f6zel bir kelime, bu nedenle kullan\u0131lamaz. Ba\u015fka bir isim kullanabilir misin? - -# Error_EmptyArgumentsListRule = A problem was detected in the ''{0}'' task. The ''{0}.yaml'' file located at ''{1}'' requires a valid list of arguments. Could you fix it? Note that the list of arguments can also be empty, but it is still necessary to define it explicitly (with ''arguments: []''). -Error_EmptyArgumentsListRule = ''{0}'' g\u00f6revinde bir sorun var. ''{1}'' deki ''{0}.yaml'' dosyas\u0131 i\u00e7in ge\u00e7erli bir arg\u00fcman listesi gerek. Bunu d\u00fczeltebilir misin? Bu arada, arg\u00fcmanlar listesi bo\u015f dahi olabilir, ama yine de ''arguments: []'' ile belirtmek gerekiyor. - -# Error_WrongIdentifierRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has the wrong identifier - ''{0}'' was expected, rather than ''{2}''. Could you fix it? -Error_WrongIdentifierRule = T\u00fch, ''{0}'' g\u00f6revi (''{1}'' deki ''{0}.yaml'' dosyas\u0131na atfen) yanl\u0131\u015f bir tan\u0131mlay\u0131c\u0131s\u0131 i\u00e7eriyor - ''{0}}'' yerine ''{2}'' bekliyordum. Bunu d\u00fczeltebilir misin? - -# Error_ArgumentsNotDefinedInRule = Oh no, there are arguments used in the diretive ''{0}'' which are not defined in the ''{0}.yaml'' rule located at ''{1}''. You can either remove them from the ''{0}'' directive or add them to the list of arguments in the ''{0}.yaml'' rule. Here they are: {2} -Error_ArgumentsNotDefinedInRule = ''{0}'' y\u00f6nergesinde, ''{1}'' deki ''{0}.yaml'' kural\u0131 taraf\u0131ndan tan\u0131mlanmam\u0131\u015f arg\u00fcmanlar\u0131 kullan\u0131yor. Bunlar\u0131 ya ''{0}'' y\u00f6nergesinden kald\u0131rabilirsin ya da ''{0}.yaml'' kural\u0131 arg\u00fcman listesine ekleyebilirsin. Bahsetti\u011fim arg\u00fcmanlar \u015funlar: {2} - -# Error_DefaultValueRuntimeErrorRule = I''m sorry, but the default value set for the argument ''{0}'' of the ''{1}'' task (referencing the ''{1}.yaml'' file located at ''{2}'') has an unavailable variable/method in the rule context: ''{3}'' -Error_DefaultValueRuntimeErrorRule = \u00dczg\u00fcn\u00fcm ama ''{1}'' g\u00f6revinin ''{0}'' arg\u00fcman\u0131n\u0131n varsay\u0131lan de\u011feri (''{2}'' deki ''{1}.yaml'' dosyas\u0131na atfen) kullan\u0131lamayan bir de\u011fi\u015fken/y\u00f6ntem i\u00e7eriyor: ''{3}'' - -# Error_FlagRuntimeErrorRule = I''m sorry, but the flag set for the argument ''{0}'' of the ''{1}'' task (referencing the ''{1}.yaml'' file located at ''{2}'') has an unavailable variable/method in the rule context: ''{3}'' -Error_FlagRuntimeErrorRule = \u00dczg\u00fcn\u00fcm ama ''{1}'' g\u00f6revinin ''{0}'' arg\u00fcman imlecinde (''{2}'' deki ''{1}.yaml'' dosyas\u0131na atfen) bu kural i\u00e7in kullan\u0131lamayan bir de\u011fi\u015fken/y\u00f6ntem var: ''{3}'' - -# Error_DuplicatedCommandElementsRule = Uh-oh, both ''command'' and ''commands'' fields are set in the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}''). You need to pick only one of them. If your task only relies on a single command, you can opt for ''command''; if your rule requires a set of commands, maybe the ''commands'' field is more suitable. -Error_DuplicatedCommandElementsRule = T\u00fch, her iki ''command'' ve ''commands'' alan\u0131 da ''{0}'' g\u00f6revinde (''{1}'' deki ''{0}.yaml'' dosyas\u0131na atfen) kullan\u0131lmaya ayarlanm\u0131\u015f. Sadece birinin se\u00e7ilmi\u015f olmas\u0131 gerekiyor. E\u011fer i\u015flenecek g\u00f6rev sadece bir komut i\u00e7eriyorsa, ''command'' kullanabilirsin; birden fazla komut kullan\u0131m\u0131 i\u00e7in ''commands'' daha uygun olacakt\u0131r. - -# Error_MissingCommandElementsRule = Uh-oh, the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') does not have either the ''command'' or ''commands'' elements. You need to pick only one of them. If your task only relies on a single command, you can opt for ''command''; if your rule requires a set of commands, maybe the ''commands'' field is more suitable. -Error_MissingCommandElementsRule = her iki ''command'' ve ''commands'' alan\u0131 da ''{0}'' g\u00f6revinde (''{1}'' deki ''{0}.yaml'' dosyas\u0131na atfen) kullan\u0131lmaya ayarlanm\u0131\u015f. \u0130kisinden birinin kullan\u0131l\u0131yor olmas\u0131 gerekiyor. E\u011fer i\u015flenecek g\u00f6rev sadece bir komut i\u00e7eriyorsa, ''command'' kullanabilirsin; birden fazla komut kullan\u0131m\u0131 i\u00e7in ''commands'' daha uygun olacakt\u0131r. - -# Error_CommandRuntimeErrorRule = I''m sorry, but the command set for the ''{0}'' task (referencing the ''{0}.yaml'' file located at ''{1}'') has an unavailable variable/method in the rule context: ''{2}'' -Error_CommandRuntimeErrorRule = \u00dczg\u00fcn\u00fcm ama ''{0}'' g\u00f6revi i\u00e7in belirlenmi\u015f komut (''{1}'' deki ''{0}.yaml'' dosyas\u0131na atfen) bu kural i\u00e7in kullan\u0131lamayacak bir de\u011fi\u015fken/y\u00f6ntem i\u00e7eriyor: ''{2}'' - diff --git a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/configuration/logback.xml b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/configuration/logback.xml new file mode 100644 index 00000000000..93e5e14cea4 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/configuration/logback.xml @@ -0,0 +1,52 @@ +<!-- + - Arara, the cool TeX automation tool + - Copyright (c) 2012, Paulo Roberto Massa Cereda + - All rights reserved. + - + - Redistribution and use in source and binary forms, with or without + - modification, are permitted provided that the following conditions + - are met: + - + - 1. Redistributions of source code must retain the above copyright + - notice, this list of conditions and the following disclaimer. + - + - 2. Redistributions in binary form must reproduce the above copyright + - notice, this list of conditions and the following disclaimer in the + - documentation and/or other materials provided with the distribution. + - + - 3. Neither the name of the project's author nor the names of its + - contributors may be used to endorse or promote products derived from + - this software without specific prior written permission. + - + - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + - FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + - COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + - WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + - POSSIBILITY OF SUCH DAMAGE. +--> + +<configuration> + + <appender name="FILE" class="ch.qos.logback.core.FileAppender"> + <file>${name}.log</file> + <append>false</append> + <encoder> + <charset>UTF-8</charset> + <pattern>%date{dd MMM yyyy HH:mm:ss.SSS} %-5level - %msg%n</pattern> + </encoder> + </appender> + + <logger name="org.zeroturnaround.exec" level="OFF" /> + + <root level="ALL"> + <appender-ref ref="FILE" /> + </root> + +</configuration>
\ No newline at end of file diff --git a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages.properties b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages.properties new file mode 100644 index 00000000000..cdea39f1be1 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages.properties @@ -0,0 +1,149 @@ +# Arara, the cool TeX automation tool +# Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the project's author nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY +# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# --------------------------------------------------------------------- +# Language: English +# Translators: Paulo Roberto Massa Cereda +# --------------------------------------------------------------------- + +ERROR_BASENAME_NOT_A_FILE=The ''basename'' method requires a file, not a directory. It looks like ''{0}'' does not appear to be a file at all. If you need to perform tasks on a directory, you could use a couple of methods from the Java API. +ERROR_CALCULATEHASH_IO_EXCEPTION=For whatever reason, I could not calculate the hash. I have no idea why it failed, though. Perhaps the file was moved or deleted before or during the hashing operation. Or maybe I do not have the proper permissions to read the file. +ERROR_CHECKBOOLEAN_NOT_VALID_BOOLEAN=It looks like ''{0}'' is not a valid boolean value. This should be an easy fix. Make sure to use a valid string that represents boolean values (yes and no, true and false, 1 and 0, and on and off). +ERROR_CHECKOS_INVALID_OPERATING_SYSTEM=I could not check your operating system. The provided value ''{0}'' does not look like a valid operating system entry in my list (I might also be wrong, of course). Please correct the value and try again. +ERROR_CHECKREGEX_IO_EXCEPTION=I could not read the contents of the file ''{0}'', I got an IO error. I have no idea why it failed, though. Perhaps the file was moved or deleted before or during the reading operation. Or maybe I do not have the proper permissions to read the file. +ERROR_CONFIGURATION_FILETYPE_MISSING_EXTENSION=One of your entries in the 'filetypes' list in the configuration file has no 'extension'. Sadly, I cannot apply a new filetype if the extension is not set. This should be an easy fix: add a new extension and try again. +ERROR_CONFIGURATION_GENERIC_ERROR=I could not parse the configuration file, something bad happened. This part is quite tricky, since it involves aspects of the underlying data serialization format. I will do my best to help you in any way I can. +ERROR_CONFIGURATION_INVALID_YAML=I could not parse the configuration file, something bad happened. Apparently, the provided YAML file is invalid. I will do my best to help you in any way I can. +ERROR_CONFIGURATION_LOOPS_INVALID_RANGE=The value defined in the 'loops' key in the configuration file in order to denote the maximum number of loops has an invalid range. Please make sure to use a positive long value. +ERROR_DISCOVERFILE_FILE_NOT_FOUND=I could not find the provided file ''{0}'' {1}. Please make sure the file exists and it has a valid extension. +ERROR_EVALUATE_COMPILATION_FAILED=For whatever reason, I could not compile the expression in the provided conditional. This part is quite tricky, since it involves aspects of the underlying expression language. I will do my best to help you in any way I can. +ERROR_EVALUATE_NOT_BOOLEAN_VALUE=The conditional evaluation was expecting a boolean value as result. This should be an easy fix. Just make sure the conditional evaluation resolves to a boolean value in the end. +ERROR_EXTRACTOR_IO_ERROR=There was an IO error while I was trying to extract the directives. I have no idea why it failed, though. Perhaps the file was moved or deleted before or during the extraction operation. Or maybe I do not have the proper permissions to read the file. +ERROR_FILETYPE_NOT_A_FILE=The ''filetype'' method requires a file, not a directory. It looks like ''{0}'' does not appear to be a file at all. If you need to perform tasks on a directory, you could use a couple of methods from the Java API. +ERROR_FILETYPE_UNKNOWN_EXTENSION=I cannot recognize ''{0}'' as a default extension. If you want to define a new file type, make sure to provide the extension and pattern. These are the default extensions: {1} +ERROR_GETAPPLICATIONPATH_ENCODING_EXCEPTION=There was an encoding problem while trying to obtain the application path. There is nothing much I can do about it. +ERROR_GETCANONICALFILE_IO_EXCEPTION=I could not get the canonical file due to an IO error. I have no idea why it failed, though. Perhaps the file was moved or deleted before or during the lookup operation. Or maybe I do not have the proper permissions. +ERROR_GETCANONICALPATH_IO_EXCEPTION=I could not get the canonical path due to an IO error. I have no idea why it failed, though. Perhaps the file was moved or deleted before or during the lookup operation. Or maybe I do not have the proper permissions. +ERROR_GETPARENTCANONICALPATH_IO_EXCEPTION=I could not get the parent canonical path due to an IO error. I have no idea why it failed, though. Perhaps the file was moved or deleted before or during the hashing operation. Or maybe I do not have the proper permissions. +ERROR_INTERPRETER_ARGUMENT_IS_REQUIRED=It seems that ''{0}'' is marked as required in the rule, but I could not find it in the directive parameters. Please make sure to add it as parameter for your directive and try again. +ERROR_INTERPRETER_COMMAND_RUNTIME_ERROR=I could not evaluate one of the provided commands. This part is quite tricky, since it involves aspects of the underlying expression language. I will do my best to help you in any way I can. +ERROR_INTERPRETER_DEFAULT_VALUE_RUNTIME_ERROR=I could not evaluate the default value expression of one of the arguments. This part is quite tricky, since it involves aspects of the underlying expression language. I will do my best to help you in any way I can. +ERROR_INTERPRETER_EXIT_RUNTIME_ERROR=I could not evaluate the exit status expression of one of the provided commands. This part is quite tricky, since it involves aspects of the underlying expression language. I will do my best to help you in any way I can. +ERROR_INTERPRETER_FLAG_RUNTIME_EXCEPTION=I could not evaluate the flag expression of one of the arguments. This part is quite tricky, since it involves aspects of the underlying expression language. I will do my best to help you in any way I can. +ERROR_INTERPRETER_NULL_COMMAND=I am sorry, but apparently one of the provided commands resolved to a null value. Please make sure the command is valid and try again. +ERROR_INTERPRETER_RULE_NOT_FOUND=I could not find a rule named ''{0}'' in the provided rule paths. Perhaps a misspelled word? I was looking for a file named ''{0}.yaml'' in the following paths in order of priority: {1} +ERROR_INTERPRETER_UNKNOWN_KEYS=I found these unknown keys in the directive: {0}. This should be an easy fix, just remove them from your map. +ERROR_INTERPRETER_WRONG_EXIT_CLOSURE_RETURN=The 'exit' expression must always return a boolean value (even if there is no computation in the closure body). This should be an easy fix: make sure to correct the type return statement and try again. +ERROR_LANGUAGE_INVALID_CODE=The provided language code is invalid. Currently, I know how to speak the following languages: {0} +ERROR_LOAD_COULD_NOT_LOAD_XML=I could not load the XML database named ''{0}''. I have no idea why it failed, though. Perhaps the file was moved or deleted before or during the reading operation. Or maybe I do not have the proper permissions to read the file. By the way, make sure the XML file is well-formed. +ERROR_PARSER_INVALID_PREAMBLE=I am sorry, but the preamble ''{0}'' could not be found. Please make sure this key exists in the configuration file. +ERROR_PARSER_LOOPS_INVALID_RANGE=The value defined in the command line for the maximum number of loops has an invalid range. Please make sure to use a positive long value. +ERROR_PARSER_LOOPS_NAN=The maximum number of loops option expects a number as argument. This should be an easy fix. Just make sure to provide a positive long value. +ERROR_PARSER_TIMEOUT_INVALID_RANGE=The value defined in the command line for the execution timeout has an invalid range. Please make sure to use a positive long value. +ERROR_PARSER_TIMEOUT_NAN=The execution timeout option expects a number as argument. This should be an easy fix. Just make sure to provide a positive long value. +ERROR_PARSERULE_GENERIC_ERROR=I could not parse the rule, something bad happened. This part is quite tricky, since it involves aspects of the underlying data serialization format. I will do my best to help you in any way I can. +ERROR_PARSERULE_INVALID_YAML=I could not parse the rule, something bad happened. Apparently, the provided YAML file is invalid. I will do my best to help you in any way I can. +ERROR_REPLICATELIST_MISSING_FORMAT_ARGUMENTS_EXCEPTION=I could not replicate the list due to a missing format argument. My guess is that there are less (or more) parameters than expected. Make sure to correct the number of parameters and try again. +ERROR_RULE_IDENTIFIER_AND_PATH=I have spotted an error in rule ''{0}'' located at ''{1}''. +ERROR_RUN_GENERIC_EXCEPTION=I could not run the provided system command, something bad happened. This part is quite tricky, since it involves aspects of the underlying expression language. I will do my best to help you in any way I can. +ERROR_RUN_INTERRUPTED_EXCEPTION=The provided system command execution was suddenly interrupted. Maybe there was an external interruption that forced the command to end abruptly. +ERROR_RUN_INVALID_EXIT_VALUE_EXCEPTION=The provided system command execution has returned an invalid exit value. +ERROR_RUN_IO_EXCEPTION=The system command execution has failed due to an IO error. Are you sure the provided system command exists in your path? It might be a good idea to check the path and see if the command is available. +ERROR_RUN_TIMEOUT_EXCEPTION=The system command execution reached the provided timeout value and was aborted. If the time was way too short, make sure to provide a longer value. +ERROR_RUN_TIMEOUT_INVALID_RANGE=The timeout value is probably missing (although timeout is enabled). This should be an easy fix. Please make sure to provide a positive long value. +ERROR_SAVE_COULD_NOT_SAVE_XML=I could not save the XML database named ''{0}''. I have no idea why it failed, though. Perhaps I do not have the proper permissions to write the XML file to disk. +ERROR_SESSION_OBTAIN_UNKNOWN_KEY=The ''obtain'' method has found an unknown key ''{0}'' in the session scope. I could not get something I do not have in the first place. Please enter a valid key and try again. +ERROR_SESSION_REMOVE_UNKNOWN_KEY=The ''remove'' method has found an unknown key ''{0}'' in the session scope. I could not remove something I do not have in the first place. Please enter a valid key and try again. +ERROR_TRIGGER_ACTION_NOT_FOUND=The trigger action ''{0}'' was not found. Make sure to take a look at the list of all available triggers and try again. +ERROR_TRIGGER_CALL_EXCEPTION=The trigger action ''{0}'' could not be called. Something really bad happened. +ERROR_VALIDATE_EMPTY_FILES_LIST=I read a directive {0} and found out that the provided ''files'' list is empty. This is an easy fix: make sure the list has at least one element and try again. +ERROR_VALIDATE_FILE_IS_RESERVED=I read a directive {0} and found out that the key ''file'' was used. This key is reserved, so you cannot use it. But do not worry, this should be an easy fix. Just replace it by another name. +ERROR_VALIDATE_FILES_IS_NOT_A_LIST=I read a directive {0} and found out that ''files'' requires a list. Please make sure to correct the type to a proper list and try again. +ERROR_VALIDATE_INVALID_DIRECTIVE_FORMAT=I spotted an invalid directive {0} in the provided file. Make sure to fix the directive and try again. +ERROR_VALIDATE_NO_DIRECTIVES_FOUND=It looks like no directives were found in the provided file. Make sure to include at least one directive and try again. +ERROR_VALIDATE_ORPHAN_LINEBREAK=Apparently there is an orphan directive line break in line {0}. I cannot proceed. Please correct the directive and try again. +ERROR_VALIDATE_REFERENCE_IS_RESERVED=I read a directive {0} and found out that the key ''reference'' was used. This key is reserved, so you cannot use it. But do not worry, this should be an easy fix. Just replace it by another name. +ERROR_VALIDATE_YAML_EXCEPTION=There was a problem with the provided YAML map in a directive {0}. This part is quite tricky, since it involves aspects of the underlying data serialization format. +ERROR_VALIDATEBODY_ARGUMENT_ID_IS_RESERVED=The argument identifier ''{0}'' is reserved, so you cannot use it. This should be an easy fix. Just replace it by another name. +ERROR_VALIDATEBODY_ARGUMENTS_LIST=I could not find the list of arguments. I need such list, even if it is empty. Make sure to fix this issue and try again. +ERROR_VALIDATEBODY_DUPLICATE_ARGUMENT_IDENTIFIERS=Apparently you have duplicate argument identifiers in your rule. Make sure to fix this issue and try again. +ERROR_VALIDATEBODY_MISSING_KEYS=When defining a rule argument scope, at least 'flag' or 'default' must be used. Please, make sure to use at least one of them. +ERROR_VALIDATEBODY_NULL_ARGUMENT_ID=I found out that one of the arguments has no identifier. Please, make sure to add a valid identifier to the argument and try again. +ERROR_VALIDATEBODY_NULL_COMMAND=I found a null command in the provided rule. This should be an easy fix. Make sure to add a valid command to the rule. +ERROR_VALIDATEBODY_NULL_COMMANDS_LIST=I need a list of commands. Make sure to fix this issue and try again. +ERROR_VALIDATEHEADER_NULL_ID=The provided rule has no identifier. This is a crucial information, please make sure to fix this issue and try again. Make sure the identifier has the same name of the rule file (without the extension, of course). +ERROR_VALIDATEHEADER_NULL_NAME=The provided rule has no name. This should be an easy fix. Make sure to add a valid name and try again. +ERROR_VALIDATEHEADER_WRONG_IDENTIFIER=The rule has a wrong identifier. I was expecting ''{0}'', but found ''{1}''. This should be an easy fix: just replace the wrong identifier by the correct one. +ERROR_VELOCITY_FILE_NOT_FOUND=The template engine was not able to find the provided input file. Make sure the location is correct and try again. +ERROR_VELOCITY_PARSE_EXCEPTION=There was a parse error in the provided input file. Make sure the file complies with the Velocity Template Language (VTL) specification and try again. +ERROR_VELOCITY_METHOD_INVOCATION_EXCEPTION=There was a method invocation error in the provided input file. Make sure the file complies with the Velocity Template Language (VTL) specification and try again. +ERROR_VELOCITY_IO_EXCEPTION=The template engine was not able to write the output file. Make sure the path has the proper permissions and try again. +INFO_DISPLAY_EXCEPTION_MORE_DETAILS=There are more details available on this exception: +INFO_DISPLAY_EXECUTION_TIME=Total: {0} seconds +INFO_DISPLAY_FILE_INFORMATION=Processing ''{0}'' (size: {1}, last modified: {2}), please wait. +INFO_INTERPRETER_DRYRUN_MODE_SYSTEM_COMMAND=About to run: {0} +INFO_INTERPRETER_DRYRUN_MODE_TRIGGER_MODE=Although executing in dry-run mode, this entry is always processed since it is a trigger. Note that the effects of a trigger might influence the current execution. +INFO_INTERPRETER_VERBOSE_MODE_TRIGGER_MODE=This entry is a trigger originated from the rule scope. Note that the effects of a trigger might influence the current execution. +INFO_LABEL_AUTHOR=Author: +INFO_LABEL_AUTHORS=Authors: +INFO_LABEL_CONDITIONAL=Conditional: +INFO_LABEL_NO_AUTHORS=No authors provided +INFO_LABEL_ON_DETAILS=DETAILS +INFO_LABEL_ON_ERROR=ERROR +INFO_LABEL_ON_FAILURE=FAILURE +INFO_LABEL_ON_SUCCESS=SUCCESS +INFO_LABEL_UNNAMED_TASK=Unnamed task +INFO_PARSER_ALL_RIGHTS_RESERVED=All rights reserved +INFO_PARSER_DRYRUN_MODE_DESCRIPTION=go through all the motions of running a command, but with no actual calls +INFO_PARSER_HELP_DESCRIPTION=print the help message +INFO_PARSER_LANGUAGE_DESCRIPTION=set the application language +INFO_PARSER_LOG_DESCRIPTION=generate a log output +INFO_PARSER_LOOPS_DESCRIPTION=set the maximum number of loops +INFO_PARSER_NOTES=This tool makes use of the following libraries and their respective licenses: CAL10N: MIT, Commons CLI: Apache 2.0, Commons Collections: Apache 2.0, Commons IO: Apache 2.0, Commons Lang: Apache 2.0, MVEL: Apache 2.0, Logback: dual licensing with EPL 1.0 and LGPL 2.1, Simple framework: Apache 2.0, SLF4J: MIT, SnakeYAML: Apache 2.0, Velocity: Apache 2.0, and ZT-Exec: Apache 2.0. At last but not least, arara itself is released under the New BSD license. +INFO_PARSER_ONLY_HEADER=extract directives only in the file header +INFO_PARSER_PREAMBLE_DESCRIPTION=set the file preamble based on the configuration file +INFO_PARSER_SILENT_MODE_DESCRIPTION=hide the command output +INFO_PARSER_TIMEOUT_DESCRIPTION=set the execution timeout (in milliseconds) +INFO_PARSER_VERBOSE_MODE_DESCRIPTION=print the command output +INFO_PARSER_VERSION_DESCRIPTION=print the application version +LOG_INFO_BEGIN_BUFFER=BEGIN OUTPUT BUFFER +LOG_INFO_DIRECTIVES_BLOCK=DIRECTIVES +LOG_INFO_END_BUFFER=END OUTPUT BUFFER +LOG_INFO_INTERPRET_RULE=I am ready to interpret rule ''{0}''. +LOG_INFO_INTERPRET_TASK=I am ready to interpret task ''{0}'' from rule ''{1}''. +LOG_INFO_POTENTIAL_DIRECTIVE_FOUND=I found a potential directive: {0} +LOG_INFO_POTENTIAL_PATTERN_FOUND=I found a potential pattern in line {0}: {1} +LOG_INFO_RULE_LOCATION=Rule location: ''{0}'' +LOG_INFO_SYSTEM_COMMAND=System command: {0} +LOG_INFO_TASK_RESULT=Task result: +LOG_INFO_VALIDATED_DIRECTIVES=All directives were validated. We are good to go. +LOG_INFO_WELCOME_MESSAGE=Welcome to arara {0} (revision {1})! diff --git a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages_de.properties b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages_de.properties new file mode 100644 index 00000000000..352259daf6c --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages_de.properties @@ -0,0 +1,149 @@ +# Arara, the cool TeX automation tool +# Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the project's author nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY +# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# --------------------------------------------------------------------- +# Language: German +# Translators: Marco Daniel +# --------------------------------------------------------------------- + +ERROR_BASENAME_NOT_A_FILE=Die Methode des ''Dateinamens'' (''basename'') benötigt eine Datei und kein Verzeichnis. Es scheint, als sei ''{0}'' keine Datei. Falls du Aufgaben auf ein Verzeichnis bzw. Ordner anwenden willst, kannst du eine Vielzahl von JAVA API-Methoden verwenden. +ERROR_CALCULATEHASH_IO_EXCEPTION=Aus was für einem Grund auch immer kann ich die Prüfziffer (checksum) nicht berechnen. Ich habe keine Idee, warum es fehlschlägt. Vielleicht wurde die Datei bevor oder während der Prüfziffer-Operation bewegt oder gelöscht. Möglicherweise habe ich nicht die geeigneten Rechte, um die Datei zu lesen. +ERROR_CHECKBOOLEAN_NOT_VALID_BOOLEAN=Es scheint, als sei ''{0}'' kein logischer Ausdruck (boolean value). Das sollte leicht zu beheben sein. Stelle sicher, dass der Eingabestring ein zugelassener logischer Ausdruck ist (''yes'' oder ''no'', ''true'' oder ''false'', ''1'' oder ''0'' sowie ''on'' oder ''off''). +ERROR_CHECKOS_INVALID_OPERATING_SYSTEM=Ich konnte dein Betriebssystem nicht überprüfen. Der ermittelte Wert ''{0}'' sieht nicht wie ein gültiges Betriebssystem in meiner Liste aus. (Ich kann natürlich auch falsch liegen.) Bitte korrigiere den Wert und versuche es erneut. +ERROR_CHECKREGEX_IO_EXCEPTION=Ich konnte den Inhalt der Datei ''{0}'' nicht lesen. Ich erhielt einen IO-Fehler. Ich habe keine Idee für die Fehlerursache, obwohl?. Vielleicht wurde die Datei bevor oder während des Leseprozesses bewegt oder gelöscht. Möglicherweise habe ich nicht die geeigneten Rechte, um die Datei zu lesen. +ERROR_CONFIGURATION_FILETYPE_MISSING_EXTENSION=In der Konfigurationsdatei hat einer deiner Einträge in der Liste für Dateitypen 'filetypes' keine Dateiendung 'extension'. Leider kann ich keinen neuen Dateitypen anwenden, wenn die Dateiendung nicht gesetzt ist. Dies sollte leicht zu beheben sein: Ergänze die neue Dateiendung und versuche es erneut. +ERROR_CONFIGURATION_GENERIC_ERROR=Ich konnte die Konfigurationsdatei nicht analysieren, etwas schlechtes passierte. Dieser Teil ist ziemlich knifflig, denn er bezieht das zugrundeliegende Datenserialisierungsformat mit ein. Ich werde mein Bestes tun, um dir in jeglicher Art und Weise zu helfen. +ERROR_CONFIGURATION_INVALID_YAML=Ich konnte die Konfigurationsdatei nicht analysieren. etwas schlechtes passierte. Anscheinend ist die bereitgestellte YAML-Datei ungültig. Ich werde mein Bestes tun, um dir in jeglicher Art und Weise zu helfen. +ERROR_CONFIGURATION_LOOPS_INVALID_RANGE=In der Konfigurationsdatei hat der eingegebenen Wert 'loops' zur Festlegung der maximalen Anzahl an Schleifendurchgängen einen ungültigen Bereich. Bitte stelle sicher, dass eine positive Zahl eingetragen wird. +ERROR_DISCOVERFILE_FILE_NOT_FOUND=Ich konnte die vorausgesetzte Datei ''{0}'' {1} nicht finden. Bitte stelle sicher, dass die Datei existiert und eine gültige Dateiendung hat. +ERROR_EVALUATE_COMPILATION_FAILED=Aus was für einen Grund auch immer kann ich den Ausdruck in der bereitgestellten Bedingung nicht kompilieren. Dieser Teil ist ziemlich knifflig, denn er bezieht die zugrundeliegende Sprache mit ein. Ich werde mein Bestes tun, um dir in jeglicher Art und Weise zu helfen. +ERROR_EVALUATE_NOT_BOOLEAN_VALUE=Die Auswertung der Bedingung (conditional) hat einen boolschen Ausdruck als Ergebnis erwartet. Das sollte leicht zu beheben sein. Stelle einfach sicher, dass die Bedingung einen booleschen Ausdruck ('yes' oder 'no', 'true' oder 'false', '1' oder '0' sowie 'on' oder 'off') als Ergebnis erhält. +ERROR_EXTRACTOR_IO_ERROR=Es gab einen IO-Fehler während ich versuchte, die Direktive zu extrahieren. Ich habe keine Idee, warum es fehlschlug. Vielleicht wurde die Datei bevor oder während der Prüfziffer-Operation bewegt oder gelöscht. Möglicherweise habe ich nicht die geeigneten Rechte, um die Datei zu lesen. +ERROR_FILETYPE_NOT_A_FILE=Die Methode der Dateitypen ''filetype'' fordert als Eingabe eine Datei und kein Verzeichnis. Es scheint, als sei ''{0}'' keine Datei. Falls du Aufgaben auf ein Verzeichnis bzw. Ordner anwenden willst, kannst du eine Vielzahl von JAVA API-Methoden verwenden. +ERROR_FILETYPE_UNKNOWN_EXTENSION=Ich kann ''{0}'' als keine vorgegebene Dateiendung erkennen. Falls du einen neuen Dateitypen definieren möchtest, stelle sich, dass die Dateiendung sowie die entsprechende Struktur bereitgestellt wird. Das sind die vordefinierten Dateiendungen: {1} +ERROR_GETAPPLICATIONPATH_ENCODING_EXCEPTION=Es gab ein Kodierungsproblem während ich versuchte den Anwendungspfad zu erhalten. Es gibt leider nicht viel, was ich tun kann. +ERROR_GETCANONICALFILE_IO_EXCEPTION=Ich konnte die vorschriftsmäßige Datei auf Grund eines IO-Fehlers nicht bekommen. Ich habe keine Idee für die Fehlerursache, obwohl?. Vielleicht wurde die Datei bevor oder während des Suchvorganges bewegt oder gelöscht. Möglicherweise habe ich nicht die geeigneten Rechte, um die Datei zu lesen. +ERROR_GETCANONICALPATH_IO_EXCEPTION=Ich konnte den vorschriftsmäßigen Pfad auf Grund eines IO-Fehlers nicht bekommen. Ich habe keine Idee für die Fehlerursache, obwohl?. Vielleicht wurde die Datei bevor oder während des Suchvorganges bewegt oder gelöscht. Möglicherweise habe ich nicht die geeigneten Rechte, um die Datei zu lesen. +ERROR_GETPARENTCANONICALPATH_IO_EXCEPTION=Ich konnte den vorschriftsmäßigen Elternpfad auf Grund eines IO-Fehlers nicht bekommen. Ich habe keine Idee für die Fehlerursache, obwohl?. Vielleicht wurde die Datei bevor oder während der Prüfziffer-Operation bewegt oder gelöscht. Möglicherweise habe ich nicht die geeigneten Rechte, um die Datei zu lesen. +ERROR_INTERPRETER_ARGUMENT_IS_REQUIRED=Es scheint, als sei ''{0}'' eine geforderte Eingabe in der Regel, aber ich kann sie in den Eingabeparametern nicht finden. Bitte stelle sicher, dass der Parameter in deiner Direktive ergänzt wird und versuche es erneut. +ERROR_INTERPRETER_COMMAND_RUNTIME_ERROR=Ich konnte eines der genutzten Kommandos nicht auswerten. Dieser Teil ist ziemlich knifflig, denn er bezieht Aspekte der zugrundeliegenden Sprache mit ein. Ich werde mein Bestes tun, um dir in jeglicher Art und Weise zu helfen. +ERROR_INTERPRETER_DEFAULT_VALUE_RUNTIME_ERROR=Ich konnte den Standardwert eines Argumentes nicht auswerten. Dieser Teil ist ziemlich knifflig, denn er bezieht Aspekte der zugrundeliegenden Sprache mit ein. Ich werde mein Bestes tun, um dir in jeglicher Art und Weise zu helfen. +ERROR_INTERPRETER_EXIT_RUNTIME_ERROR=Ich kann den Status der Fertigmeldung (exit status) von einer der genutzten Anweisungen nicht auswerten. Dieser Teil ist ziemlich knifflig, denn er bezieht Aspekte der zugrundeliegenden Sprache mit ein. Ich werde mein Bestes tun, um dir in jeglicher Art und Weise zu helfen. +ERROR_INTERPRETER_FLAG_RUNTIME_EXCEPTION=Ich kann den Statusindikator (flag expression) eines Argumentes nicht auswerten. Dieser Teil ist ziemlich knifflig, denn er bezieht Aspekte der zugrundeliegenden Sprache mit ein. Ich werde mein Bestes tun, um dir in jeglicher Art und Weise zu helfen. +ERROR_INTERPRETER_NULL_COMMAND=Es tut mir leid, aber eine der genutzten Anweisungen gibt einen Nullwert zurück. Bitte stelle sicher, dass die Anweisung gültig ist und versuche es erneut. +ERROR_INTERPRETER_RULE_NOT_FOUND=Ich konnte keine Regel mit dem Namen ''{0}'' in den hinterlegten Regelverzeichnissen finden. Vielleicht ein falsch geschriebenes Wort? Ich habe nach dem Dateinamen ''{0}.yaml'' in den nachstehenden Verzeichnissen mit entsprechender Priorität gesucht: {1} +ERROR_INTERPRETER_UNKNOWN_KEYS=Ich habe folgende unbekannte Keys in der Direktive gefunden: {0}. Das sollte leicht zu beheben sein, entferne sie einfach. +ERROR_INTERPRETER_WRONG_EXIT_CLOSURE_RETURN=Der Ausdruck 'exit' muss immer einen logischen Wert (boolean value) zurückgeben (sogar wenn es keine Berechnung in der Prozedur gibt). Das sollte leicht zu beheben sein: Stelle einen korrekten Rückgabewert sicher und versuche es erneut. +ERROR_LANGUAGE_INVALID_CODE=Der bereitgestellte Sprachauswahlcode ist ungültig. Derzeit kann ich folgende Sprachen sprechen: {0} +ERROR_LOAD_COULD_NOT_LOAD_XML=Ich konnte die XML-Datenbank mit dem Namen ''{0}'' nicht laden. Ich habe keine Idee für die Fehlerursache, obwohl? Vielleicht wurde die Datei bevor oder während der Leseoperation bewegt oder gelöscht. Möglicherweise habe ich nicht die geeigneten Rechte, um die Datei zu lesen. +ERROR_PARSER_INVALID_PREAMBLE=Leider konnte die Präambel ''{0}'' nicht gefunden werden. Bitte stelle sicher, dass dieser Schlüssel in der Konfigurationsdatei existiert. +ERROR_PARSER_LOOPS_INVALID_RANGE=Bei der Anweisungseingabe hat der Wert für die maximale Anzahl an Schleifendurchgängen einen ungültigen Wert. Bitte stelle sicher, dass eine positive Zahl eingetragen wird. +ERROR_PARSER_LOOPS_NAN=Die maximale Anzahl an Schleifendurchgängen erwartet eine Zahl als Argument. Das sollte leicht zu beheben sein. Bitte stelle sicher, dass eine positive Zahl eingetragen wird. +ERROR_PARSER_TIMEOUT_INVALID_RANGE=Bei der Anweisungseingabe hat der Wert für die Ausführungszeit einen ungültigen Wert. Bitte stelle sicher, dass eine positive Zahl (long) eingetragen wird. +ERROR_PARSER_TIMEOUT_NAN=Die Option für die Zeitbeschränkung 'timeout' erwartet eine Zahl als Argument. Das sollte leicht zu beheben sein. Bitte stelle sicher, dass eine positive Zahl eingetragen wird. +ERROR_PARSERULE_GENERIC_ERROR=Ich konnte die Regel nicht auswerten, etwas schlechtes passierte. Dieser Teil ist ziemlich knifflig, denn er bezieht Aspekte der zugrundeliegenden Serialisierung mit ein. Ich werde mein Bestes tun, um dir in jeglicher Art und Weise zu helfen. +ERROR_PARSERULE_INVALID_YAML=Ich konnte die Regel nicht auswerten, etwas schlechtes passierte. Anscheinend ist die bereitgestellte YAML-Datei ungültig. Ich werde mein Bestes tun, um dir in jeglicher Art und Weise zu helfen. +ERROR_REPLICATELIST_MISSING_FORMAT_ARGUMENTS_EXCEPTION=Ich konnte die Liste auf Grund eines fehlendes Formatargumentes nicht replizieren. Meine Vermutung ist, dass es weniger (oder mehr) Parameter als erwartet gibt. Stelle sicher, dass die korrekte Anzahl an Parametern übergeben wird und versuche es erneut. +ERROR_RULE_IDENTIFIER_AND_PATH=Ich habe einen Fehler in der Regel ''{0}'' an der Stellte ''{1}'' entdeckt. +ERROR_RUN_GENERIC_EXCEPTION=Ich konnte das geforderte Systemkommando nicht ausführen, etwas schlechtes passierte. Dieser Teil ist ziemlich knifflig, denn er bezieht Aspekte der zugrundeliegenden Sprache mit ein. Ich werde mein Bestes tun, um dir in jeglicher Art und Weise zu helfen. +ERROR_RUN_INTERRUPTED_EXCEPTION=Das aufgerufene Systemkommando ist plötzlich unterbrochen worden. Vielleicht gab es eine externe Unterbrechung, die das Kommando abrupt zur Beendigung zwang. +ERROR_RUN_INVALID_EXIT_VALUE_EXCEPTION=Das aufgerufene Systemkommando hat einen ungültigen Abschluss gemeldet. +ERROR_RUN_IO_EXCEPTION=Der Aufruf des Systemkommandos misslang auf Grund eines IO-Fehlers. Bist du dir sicher, dass das Systemkommando in deinem Pfad existiert? Es sollte eine gute Idee sein, die Systempfade sowie die Verfügbarkeit des Kommandos zu prüfen. +ERROR_RUN_TIMEOUT_EXCEPTION=Die Ausführung des Systemkommandos hat die Zeitbegrenzung erreicht und wurde abgebrochen. Falls die Zeit etwas zu kurz war, kannst du diese erhöhen. +ERROR_RUN_TIMEOUT_INVALID_RANGE=Der Wert für die Zeitbegrenzung ('timeout') fehlt vermutlich (obwohl die Zeitbegrenzung aktiviert ist). Das sollte leicht zu beheben sein. Bitte stelle sicher, dass eine positive Zahl eingetragen wird. +ERROR_SAVE_COULD_NOT_SAVE_XML=Ich konnte die XML-Datenbank mit dem Namen ''{0}'' nicht speichern. Ich habe keine Idee für die Fehlerursache, obwohl? Möglicherweise habe ich nicht die geeigneten Rechte, um die Datei XML-Datei auf der Festplatte zu speichern. +ERROR_SESSION_OBTAIN_UNKNOWN_KEY=Die ''obtain'' Methode hat den unbekannten Eintrag (key) ''{0}'' in der Session gefunden. Ich konnte nichts erhalten, was ich nicht bereits habe. Bitte gebe einen gültigen Key ein und versuche es erneut. +ERROR_SESSION_REMOVE_UNKNOWN_KEY=Die ''remove'' Methode hat den unbekannten Eintrag (key) ''{0}'' in der Session gefunden. Ich konnte nichts erhalten, was ich nicht bereits habe. Bitte gebe einen gültigen Key ein und versuche es erneut. +ERROR_TRIGGER_ACTION_NOT_FOUND=Die Aktion des Triggers ''{0}'' wurde nicht gefunden. Stelle bitte sicher, dass du einen Blick auf die Liste der verfügbaren Trigger wirfst und versuche es erneut. +ERROR_TRIGGER_CALL_EXCEPTION=Die Aktion des Triggers ''{0}'' konnte nicht aufgerufen werden. Etwas wirklich schlechtes ist passiert. +ERROR_VALIDATE_EMPTY_FILES_LIST=Ich habe die Direktive {0} gelesen und fand heraus, dass die bereitgestellte Dateienliste leer ist. Das sollte leicht zu beheben sein. Bitte stelle sicher, dass die Liste mindestens ein Element hat und versuche es erneut. +ERROR_VALIDATE_FILE_IS_RESERVED=Ich habe die Direktive {0} gelesen und fand heraus, dass der Key ''file'' genutzt wurde. Dieser Key ist reserviert, deshalb kannst du ihn nicht nutzen. Aber keine Sorge, dass sollte leicht zu beheben sein. Du musst nur einen anderen Namen verwenden. +ERROR_VALIDATE_FILES_IS_NOT_A_LIST=Ich habe die Direktive {0} gelesen und fand heraus, dass der Eintrag ''files'' keine Liste übergeben bekommen hat. Bitte stelle sicher, dass du eine passende Liste verwendest und versuche es erneut. +ERROR_VALIDATE_INVALID_DIRECTIVE_FORMAT=Ich entdecke eine ungültige Direktive namens {0} in der bereitgestellten Datei. Stellte sicher, dass die Direktive gültig ist und versuche es erneut. +ERROR_VALIDATE_NO_DIRECTIVES_FOUND=Es sieht so aus, als wurden keine Direktiven in der bereitgestellten Datei gefunden. Bitte stelle sicher, dass wenigstens eine Direktive enthalten ist und versuche es erneut. +ERROR_VALIDATE_ORPHAN_LINEBREAK=Anscheinend gibt es einen verwaisten Zeilenumbruch in der Direktive in der Zeile {0}. Ich kann nicht fortfahren. Bitte korrigiere die Direktive und versuche es erneut. +ERROR_VALIDATE_REFERENCE_IS_RESERVED=Ich las die Direktive {0} und fand heraus, dass der Key ''reference'' genutzt wurde. Dieser Key ist reserviert, deshalb kannst du ihn nicht nutzen. Aber keine Sorge, das sollte einfach zu beheben sein. Du musst nur einen anderen Namen verwenden. +ERROR_VALIDATE_YAML_EXCEPTION=Es gab ein Problem mit dem bereitgestellten YAML-Ausdruck in der Direktive {0}. Dieser Teil ist ziemlich knifflig, denn er bezieht Aspekte der zugrundeliegenden Serialisierung mit ein. +ERROR_VALIDATEBODY_ARGUMENT_ID_IS_RESERVED=Die Argumentenbezeichnung ''{0}'' ist reserviert, somit kannst du sie nicht nutzen. Dies sollte einfach zu beheben sein. Du musst nur einen anderen Namen verwenden. +ERROR_VALIDATEBODY_ARGUMENTS_LIST=Ich konnte die Liste der Argumente nicht finden. Ich benötige eine solche Liste, sogar wenn diese leer ist. Bitte behebe diesen Fehler und versuche es erneut. +ERROR_VALIDATEBODY_DUPLICATE_ARGUMENT_IDENTIFIERS=Anscheinend hast du Duplikate von Bezeichnern in deiner Regel. Bitte behebe diesen Fehler und versuche es erneut. +ERROR_VALIDATEBODY_MISSING_KEYS=Wenn du ein Argument einer Regel definierst, musst du mindestens 'flag' oder 'default' nutzen. Stelle bitte sicher, dass du mindestens eines nutzt. +ERROR_VALIDATEBODY_NULL_ARGUMENT_ID=Ich habe herausgefunden, dass eines der Argumente keinen Bezeichner hat. Bitte ergänze einen gültigen Bezeichner im Argument und versuche es erneut. +ERROR_VALIDATEBODY_NULL_COMMAND=Ich habe eine Nullanweisung in der vorgegebenen Regel gefunden. Bitte stelle sicher, dass ein gültiges Kommando zur Regel hinzugefügt wird. +ERROR_VALIDATEBODY_NULL_COMMANDS_LIST=Ich benötige eine Liste von Kommandos. Bitte behebe diesen Zustand und versuche es erneut. +ERROR_VALIDATEHEADER_NULL_ID=Die geforderte Regel hat keinen Bezeichner. Das ist eine wesentliche Information, bitte stelle sicher, dass du dies behebst und versuche es erneut. Beachte hierbei, dass der Bezeichner identisch zum Dateinamen (ohne Dateiendung natürlich) sein muss. +ERROR_VALIDATEHEADER_NULL_NAME=Die gewünschte Regel hat keinen Namen. Das sollte leicht zu beheben sein. Ergänze einen gültigen Namen und versuche es erneut. +ERROR_VALIDATEHEADER_WRONG_IDENTIFIER=Die Regel hat einen falschen Bezeichner. Ich erwartete ''{0}'' fand aber ''{1}''. Das solle leicht zu beheben sein: Ersetze einfach den falschen durch einen korrekten Bezeichner. +ERROR_VELOCITY_FILE_NOT_FOUND=Die Template-Engine konnte die angegebene Eingabe-Datei nicht finden. Bitte stelle sicher, dass der Pfad korrekt ist, und versuche es noch einmal. +ERROR_VELOCITY_PARSE_EXCEPTION=Es gab einen Lesefehler beim Verarbeiten der angegebenen Eingabe-Datei. Stelle sicher, dass sie die Spezifikationen der Velocity Template Language (VTL) erfüllt und versuche es noch einmal. +ERROR_VELOCITY_METHOD_INVOCATION_EXCEPTION=Es gibt einen fehlerhaften Metheodenaufruf in der angegebenen Eingabe-Datei. Stelle sicher, dass sie die Spezifikationen der Velocity Template Language (VTL) erfüllt und versuche es noch einmal. +ERROR_VELOCITY_IO_EXCEPTION=Die Template-Engine konnte die Ausgabe-Datei nicht schreiben. Stelle sicher, dass sie die nötigen Berechtigungen hat, und versuche es noch einmal. +INFO_DISPLAY_EXCEPTION_MORE_DETAILS=Es sind mehr Details für diese Ausnahme verfügbar. +INFO_DISPLAY_EXECUTION_TIME=Gesamt: {0} Sekunden +INFO_DISPLAY_FILE_INFORMATION=Verarbeitung ''{0}'' (Größe: {1}, letzte Modifikation: {2}), bitte warten. +INFO_INTERPRETER_DRYRUN_MODE_SYSTEM_COMMAND=Los geht''s: {0} +INFO_INTERPRETER_DRYRUN_MODE_TRIGGER_MODE=Obwohl du im 'dry-run-mode' ausführst, wird der Eintrag immer verarbeitet, da es einen Trigger ist. Beachte, dass der Effekt eines Triggers die aktuelle Ausführung beeinflussen kann. +INFO_INTERPRETER_VERBOSE_MODE_TRIGGER_MODE=Dieser Eintrag ist ein Trigger, welcher aus dem Regelumfeld entstand. Beachte, dass der Effekt eines Triggers die aktuelle Ausführung beeinflussen kann. +INFO_LABEL_AUTHOR=Autor: +INFO_LABEL_AUTHORS=Autoren: +INFO_LABEL_CONDITIONAL=Bedingung: +INFO_LABEL_NO_AUTHORS=Kein Autor berücksichtigt +INFO_LABEL_ON_DETAILS=DETAILS +INFO_LABEL_ON_ERROR=FEHLER +INFO_LABEL_ON_FAILURE=MISSERFOLG +INFO_LABEL_ON_SUCCESS=ERFOLGREICH +INFO_LABEL_UNNAMED_TASK=Namenlose Aufgabe +INFO_PARSER_ALL_RIGHTS_RESERVED=Alle Rechte vorbehalten. +INFO_PARSER_DRYRUN_MODE_DESCRIPTION=Tue so, als ob du durch alle Anweisungen gehst, aber mit keinem aktuellen Aufruf. +INFO_PARSER_HELP_DESCRIPTION=Gebe die Hilfe aus +INFO_PARSER_LANGUAGE_DESCRIPTION=Setze die Anwendungssprache +INFO_PARSER_LOG_DESCRIPTION=Erstelle einen log-Output +INFO_PARSER_LOOPS_DESCRIPTION=Setze die maximale Anzahl an Schleifendurchgängen +INFO_PARSER_NOTES=Dieses Tool nutzt die folgenden Bibliotheken und deren jeweilge Lizenz: CAL10N: MIT, Commons CLI: Apache 2.0, Commons Collections: Apache 2.0, Commons IO: Apache 2.0, Commons Lang: Apache 2.0, MVEL: Apache 2.0, Logback: dual licensing with EPL 1.0 and LGPL 2.1, Simple framework: Apache 2.0, SLF4J: MIT, SnakeYAML: Apache 2.0, Velocity: Apache 2.0, and ZT-Exec: Apache 2.0. Zu guter Letzt, arara selbst ist veröffentlicht nach der New BSD license. +INFO_PARSER_ONLY_HEADER=Extrahiere Direktiven nur im Datei-Kopf +INFO_PARSER_PREAMBLE_DESCRIPTION=Setze die Datei-Präambel basierend auf der Konfigurationsdatei +INFO_PARSER_SILENT_MODE_DESCRIPTION=Unterdrückt die Befehlsausgabe +INFO_PARSER_TIMEOUT_DESCRIPTION=Setze die Zeitabschaltung für die Ausführung (in Millisekunden). +INFO_PARSER_VERBOSE_MODE_DESCRIPTION=Gibt zusätzliche Statusinformationen aus +INFO_PARSER_VERSION_DESCRIPTION=Gebe die Anwendungsversion aus +LOG_INFO_BEGIN_BUFFER=BEGIN OUTPUT BUFFER +LOG_INFO_DIRECTIVES_BLOCK=DIREKTIVEN +LOG_INFO_END_BUFFER=END OUTPUT BUFFER +LOG_INFO_INTERPRET_RULE=Ich bin bereit, die Regel ''{0}'' zu interpretieren. +LOG_INFO_INTERPRET_TASK=Ich bin bereit, die Aufgabe ''{0}'' von der Regel ''{1}'' zu interpretieren. +LOG_INFO_POTENTIAL_DIRECTIVE_FOUND=Ich habe eine potentielle Direktive gefunden: {0} +LOG_INFO_POTENTIAL_PATTERN_FOUND=Ich habe ein potentielles Muster in der Linie {0} gefunden: {1} +LOG_INFO_RULE_LOCATION=Verzeichnis der Regel: ''{0}'' +LOG_INFO_SYSTEM_COMMAND=Systemkommando: {0} +LOG_INFO_TASK_RESULT=Resultat der Aufgabe: +LOG_INFO_VALIDATED_DIRECTIVES=Alle Direktiven sind gültig. Wir sind guter Dinge. +LOG_INFO_WELCOME_MESSAGE=Willkommen bei arara {0} (Revision {1})! diff --git a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages_en.properties b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages_en.properties new file mode 100644 index 00000000000..cdea39f1be1 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages_en.properties @@ -0,0 +1,149 @@ +# Arara, the cool TeX automation tool +# Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the project's author nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY +# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# --------------------------------------------------------------------- +# Language: English +# Translators: Paulo Roberto Massa Cereda +# --------------------------------------------------------------------- + +ERROR_BASENAME_NOT_A_FILE=The ''basename'' method requires a file, not a directory. It looks like ''{0}'' does not appear to be a file at all. If you need to perform tasks on a directory, you could use a couple of methods from the Java API. +ERROR_CALCULATEHASH_IO_EXCEPTION=For whatever reason, I could not calculate the hash. I have no idea why it failed, though. Perhaps the file was moved or deleted before or during the hashing operation. Or maybe I do not have the proper permissions to read the file. +ERROR_CHECKBOOLEAN_NOT_VALID_BOOLEAN=It looks like ''{0}'' is not a valid boolean value. This should be an easy fix. Make sure to use a valid string that represents boolean values (yes and no, true and false, 1 and 0, and on and off). +ERROR_CHECKOS_INVALID_OPERATING_SYSTEM=I could not check your operating system. The provided value ''{0}'' does not look like a valid operating system entry in my list (I might also be wrong, of course). Please correct the value and try again. +ERROR_CHECKREGEX_IO_EXCEPTION=I could not read the contents of the file ''{0}'', I got an IO error. I have no idea why it failed, though. Perhaps the file was moved or deleted before or during the reading operation. Or maybe I do not have the proper permissions to read the file. +ERROR_CONFIGURATION_FILETYPE_MISSING_EXTENSION=One of your entries in the 'filetypes' list in the configuration file has no 'extension'. Sadly, I cannot apply a new filetype if the extension is not set. This should be an easy fix: add a new extension and try again. +ERROR_CONFIGURATION_GENERIC_ERROR=I could not parse the configuration file, something bad happened. This part is quite tricky, since it involves aspects of the underlying data serialization format. I will do my best to help you in any way I can. +ERROR_CONFIGURATION_INVALID_YAML=I could not parse the configuration file, something bad happened. Apparently, the provided YAML file is invalid. I will do my best to help you in any way I can. +ERROR_CONFIGURATION_LOOPS_INVALID_RANGE=The value defined in the 'loops' key in the configuration file in order to denote the maximum number of loops has an invalid range. Please make sure to use a positive long value. +ERROR_DISCOVERFILE_FILE_NOT_FOUND=I could not find the provided file ''{0}'' {1}. Please make sure the file exists and it has a valid extension. +ERROR_EVALUATE_COMPILATION_FAILED=For whatever reason, I could not compile the expression in the provided conditional. This part is quite tricky, since it involves aspects of the underlying expression language. I will do my best to help you in any way I can. +ERROR_EVALUATE_NOT_BOOLEAN_VALUE=The conditional evaluation was expecting a boolean value as result. This should be an easy fix. Just make sure the conditional evaluation resolves to a boolean value in the end. +ERROR_EXTRACTOR_IO_ERROR=There was an IO error while I was trying to extract the directives. I have no idea why it failed, though. Perhaps the file was moved or deleted before or during the extraction operation. Or maybe I do not have the proper permissions to read the file. +ERROR_FILETYPE_NOT_A_FILE=The ''filetype'' method requires a file, not a directory. It looks like ''{0}'' does not appear to be a file at all. If you need to perform tasks on a directory, you could use a couple of methods from the Java API. +ERROR_FILETYPE_UNKNOWN_EXTENSION=I cannot recognize ''{0}'' as a default extension. If you want to define a new file type, make sure to provide the extension and pattern. These are the default extensions: {1} +ERROR_GETAPPLICATIONPATH_ENCODING_EXCEPTION=There was an encoding problem while trying to obtain the application path. There is nothing much I can do about it. +ERROR_GETCANONICALFILE_IO_EXCEPTION=I could not get the canonical file due to an IO error. I have no idea why it failed, though. Perhaps the file was moved or deleted before or during the lookup operation. Or maybe I do not have the proper permissions. +ERROR_GETCANONICALPATH_IO_EXCEPTION=I could not get the canonical path due to an IO error. I have no idea why it failed, though. Perhaps the file was moved or deleted before or during the lookup operation. Or maybe I do not have the proper permissions. +ERROR_GETPARENTCANONICALPATH_IO_EXCEPTION=I could not get the parent canonical path due to an IO error. I have no idea why it failed, though. Perhaps the file was moved or deleted before or during the hashing operation. Or maybe I do not have the proper permissions. +ERROR_INTERPRETER_ARGUMENT_IS_REQUIRED=It seems that ''{0}'' is marked as required in the rule, but I could not find it in the directive parameters. Please make sure to add it as parameter for your directive and try again. +ERROR_INTERPRETER_COMMAND_RUNTIME_ERROR=I could not evaluate one of the provided commands. This part is quite tricky, since it involves aspects of the underlying expression language. I will do my best to help you in any way I can. +ERROR_INTERPRETER_DEFAULT_VALUE_RUNTIME_ERROR=I could not evaluate the default value expression of one of the arguments. This part is quite tricky, since it involves aspects of the underlying expression language. I will do my best to help you in any way I can. +ERROR_INTERPRETER_EXIT_RUNTIME_ERROR=I could not evaluate the exit status expression of one of the provided commands. This part is quite tricky, since it involves aspects of the underlying expression language. I will do my best to help you in any way I can. +ERROR_INTERPRETER_FLAG_RUNTIME_EXCEPTION=I could not evaluate the flag expression of one of the arguments. This part is quite tricky, since it involves aspects of the underlying expression language. I will do my best to help you in any way I can. +ERROR_INTERPRETER_NULL_COMMAND=I am sorry, but apparently one of the provided commands resolved to a null value. Please make sure the command is valid and try again. +ERROR_INTERPRETER_RULE_NOT_FOUND=I could not find a rule named ''{0}'' in the provided rule paths. Perhaps a misspelled word? I was looking for a file named ''{0}.yaml'' in the following paths in order of priority: {1} +ERROR_INTERPRETER_UNKNOWN_KEYS=I found these unknown keys in the directive: {0}. This should be an easy fix, just remove them from your map. +ERROR_INTERPRETER_WRONG_EXIT_CLOSURE_RETURN=The 'exit' expression must always return a boolean value (even if there is no computation in the closure body). This should be an easy fix: make sure to correct the type return statement and try again. +ERROR_LANGUAGE_INVALID_CODE=The provided language code is invalid. Currently, I know how to speak the following languages: {0} +ERROR_LOAD_COULD_NOT_LOAD_XML=I could not load the XML database named ''{0}''. I have no idea why it failed, though. Perhaps the file was moved or deleted before or during the reading operation. Or maybe I do not have the proper permissions to read the file. By the way, make sure the XML file is well-formed. +ERROR_PARSER_INVALID_PREAMBLE=I am sorry, but the preamble ''{0}'' could not be found. Please make sure this key exists in the configuration file. +ERROR_PARSER_LOOPS_INVALID_RANGE=The value defined in the command line for the maximum number of loops has an invalid range. Please make sure to use a positive long value. +ERROR_PARSER_LOOPS_NAN=The maximum number of loops option expects a number as argument. This should be an easy fix. Just make sure to provide a positive long value. +ERROR_PARSER_TIMEOUT_INVALID_RANGE=The value defined in the command line for the execution timeout has an invalid range. Please make sure to use a positive long value. +ERROR_PARSER_TIMEOUT_NAN=The execution timeout option expects a number as argument. This should be an easy fix. Just make sure to provide a positive long value. +ERROR_PARSERULE_GENERIC_ERROR=I could not parse the rule, something bad happened. This part is quite tricky, since it involves aspects of the underlying data serialization format. I will do my best to help you in any way I can. +ERROR_PARSERULE_INVALID_YAML=I could not parse the rule, something bad happened. Apparently, the provided YAML file is invalid. I will do my best to help you in any way I can. +ERROR_REPLICATELIST_MISSING_FORMAT_ARGUMENTS_EXCEPTION=I could not replicate the list due to a missing format argument. My guess is that there are less (or more) parameters than expected. Make sure to correct the number of parameters and try again. +ERROR_RULE_IDENTIFIER_AND_PATH=I have spotted an error in rule ''{0}'' located at ''{1}''. +ERROR_RUN_GENERIC_EXCEPTION=I could not run the provided system command, something bad happened. This part is quite tricky, since it involves aspects of the underlying expression language. I will do my best to help you in any way I can. +ERROR_RUN_INTERRUPTED_EXCEPTION=The provided system command execution was suddenly interrupted. Maybe there was an external interruption that forced the command to end abruptly. +ERROR_RUN_INVALID_EXIT_VALUE_EXCEPTION=The provided system command execution has returned an invalid exit value. +ERROR_RUN_IO_EXCEPTION=The system command execution has failed due to an IO error. Are you sure the provided system command exists in your path? It might be a good idea to check the path and see if the command is available. +ERROR_RUN_TIMEOUT_EXCEPTION=The system command execution reached the provided timeout value and was aborted. If the time was way too short, make sure to provide a longer value. +ERROR_RUN_TIMEOUT_INVALID_RANGE=The timeout value is probably missing (although timeout is enabled). This should be an easy fix. Please make sure to provide a positive long value. +ERROR_SAVE_COULD_NOT_SAVE_XML=I could not save the XML database named ''{0}''. I have no idea why it failed, though. Perhaps I do not have the proper permissions to write the XML file to disk. +ERROR_SESSION_OBTAIN_UNKNOWN_KEY=The ''obtain'' method has found an unknown key ''{0}'' in the session scope. I could not get something I do not have in the first place. Please enter a valid key and try again. +ERROR_SESSION_REMOVE_UNKNOWN_KEY=The ''remove'' method has found an unknown key ''{0}'' in the session scope. I could not remove something I do not have in the first place. Please enter a valid key and try again. +ERROR_TRIGGER_ACTION_NOT_FOUND=The trigger action ''{0}'' was not found. Make sure to take a look at the list of all available triggers and try again. +ERROR_TRIGGER_CALL_EXCEPTION=The trigger action ''{0}'' could not be called. Something really bad happened. +ERROR_VALIDATE_EMPTY_FILES_LIST=I read a directive {0} and found out that the provided ''files'' list is empty. This is an easy fix: make sure the list has at least one element and try again. +ERROR_VALIDATE_FILE_IS_RESERVED=I read a directive {0} and found out that the key ''file'' was used. This key is reserved, so you cannot use it. But do not worry, this should be an easy fix. Just replace it by another name. +ERROR_VALIDATE_FILES_IS_NOT_A_LIST=I read a directive {0} and found out that ''files'' requires a list. Please make sure to correct the type to a proper list and try again. +ERROR_VALIDATE_INVALID_DIRECTIVE_FORMAT=I spotted an invalid directive {0} in the provided file. Make sure to fix the directive and try again. +ERROR_VALIDATE_NO_DIRECTIVES_FOUND=It looks like no directives were found in the provided file. Make sure to include at least one directive and try again. +ERROR_VALIDATE_ORPHAN_LINEBREAK=Apparently there is an orphan directive line break in line {0}. I cannot proceed. Please correct the directive and try again. +ERROR_VALIDATE_REFERENCE_IS_RESERVED=I read a directive {0} and found out that the key ''reference'' was used. This key is reserved, so you cannot use it. But do not worry, this should be an easy fix. Just replace it by another name. +ERROR_VALIDATE_YAML_EXCEPTION=There was a problem with the provided YAML map in a directive {0}. This part is quite tricky, since it involves aspects of the underlying data serialization format. +ERROR_VALIDATEBODY_ARGUMENT_ID_IS_RESERVED=The argument identifier ''{0}'' is reserved, so you cannot use it. This should be an easy fix. Just replace it by another name. +ERROR_VALIDATEBODY_ARGUMENTS_LIST=I could not find the list of arguments. I need such list, even if it is empty. Make sure to fix this issue and try again. +ERROR_VALIDATEBODY_DUPLICATE_ARGUMENT_IDENTIFIERS=Apparently you have duplicate argument identifiers in your rule. Make sure to fix this issue and try again. +ERROR_VALIDATEBODY_MISSING_KEYS=When defining a rule argument scope, at least 'flag' or 'default' must be used. Please, make sure to use at least one of them. +ERROR_VALIDATEBODY_NULL_ARGUMENT_ID=I found out that one of the arguments has no identifier. Please, make sure to add a valid identifier to the argument and try again. +ERROR_VALIDATEBODY_NULL_COMMAND=I found a null command in the provided rule. This should be an easy fix. Make sure to add a valid command to the rule. +ERROR_VALIDATEBODY_NULL_COMMANDS_LIST=I need a list of commands. Make sure to fix this issue and try again. +ERROR_VALIDATEHEADER_NULL_ID=The provided rule has no identifier. This is a crucial information, please make sure to fix this issue and try again. Make sure the identifier has the same name of the rule file (without the extension, of course). +ERROR_VALIDATEHEADER_NULL_NAME=The provided rule has no name. This should be an easy fix. Make sure to add a valid name and try again. +ERROR_VALIDATEHEADER_WRONG_IDENTIFIER=The rule has a wrong identifier. I was expecting ''{0}'', but found ''{1}''. This should be an easy fix: just replace the wrong identifier by the correct one. +ERROR_VELOCITY_FILE_NOT_FOUND=The template engine was not able to find the provided input file. Make sure the location is correct and try again. +ERROR_VELOCITY_PARSE_EXCEPTION=There was a parse error in the provided input file. Make sure the file complies with the Velocity Template Language (VTL) specification and try again. +ERROR_VELOCITY_METHOD_INVOCATION_EXCEPTION=There was a method invocation error in the provided input file. Make sure the file complies with the Velocity Template Language (VTL) specification and try again. +ERROR_VELOCITY_IO_EXCEPTION=The template engine was not able to write the output file. Make sure the path has the proper permissions and try again. +INFO_DISPLAY_EXCEPTION_MORE_DETAILS=There are more details available on this exception: +INFO_DISPLAY_EXECUTION_TIME=Total: {0} seconds +INFO_DISPLAY_FILE_INFORMATION=Processing ''{0}'' (size: {1}, last modified: {2}), please wait. +INFO_INTERPRETER_DRYRUN_MODE_SYSTEM_COMMAND=About to run: {0} +INFO_INTERPRETER_DRYRUN_MODE_TRIGGER_MODE=Although executing in dry-run mode, this entry is always processed since it is a trigger. Note that the effects of a trigger might influence the current execution. +INFO_INTERPRETER_VERBOSE_MODE_TRIGGER_MODE=This entry is a trigger originated from the rule scope. Note that the effects of a trigger might influence the current execution. +INFO_LABEL_AUTHOR=Author: +INFO_LABEL_AUTHORS=Authors: +INFO_LABEL_CONDITIONAL=Conditional: +INFO_LABEL_NO_AUTHORS=No authors provided +INFO_LABEL_ON_DETAILS=DETAILS +INFO_LABEL_ON_ERROR=ERROR +INFO_LABEL_ON_FAILURE=FAILURE +INFO_LABEL_ON_SUCCESS=SUCCESS +INFO_LABEL_UNNAMED_TASK=Unnamed task +INFO_PARSER_ALL_RIGHTS_RESERVED=All rights reserved +INFO_PARSER_DRYRUN_MODE_DESCRIPTION=go through all the motions of running a command, but with no actual calls +INFO_PARSER_HELP_DESCRIPTION=print the help message +INFO_PARSER_LANGUAGE_DESCRIPTION=set the application language +INFO_PARSER_LOG_DESCRIPTION=generate a log output +INFO_PARSER_LOOPS_DESCRIPTION=set the maximum number of loops +INFO_PARSER_NOTES=This tool makes use of the following libraries and their respective licenses: CAL10N: MIT, Commons CLI: Apache 2.0, Commons Collections: Apache 2.0, Commons IO: Apache 2.0, Commons Lang: Apache 2.0, MVEL: Apache 2.0, Logback: dual licensing with EPL 1.0 and LGPL 2.1, Simple framework: Apache 2.0, SLF4J: MIT, SnakeYAML: Apache 2.0, Velocity: Apache 2.0, and ZT-Exec: Apache 2.0. At last but not least, arara itself is released under the New BSD license. +INFO_PARSER_ONLY_HEADER=extract directives only in the file header +INFO_PARSER_PREAMBLE_DESCRIPTION=set the file preamble based on the configuration file +INFO_PARSER_SILENT_MODE_DESCRIPTION=hide the command output +INFO_PARSER_TIMEOUT_DESCRIPTION=set the execution timeout (in milliseconds) +INFO_PARSER_VERBOSE_MODE_DESCRIPTION=print the command output +INFO_PARSER_VERSION_DESCRIPTION=print the application version +LOG_INFO_BEGIN_BUFFER=BEGIN OUTPUT BUFFER +LOG_INFO_DIRECTIVES_BLOCK=DIRECTIVES +LOG_INFO_END_BUFFER=END OUTPUT BUFFER +LOG_INFO_INTERPRET_RULE=I am ready to interpret rule ''{0}''. +LOG_INFO_INTERPRET_TASK=I am ready to interpret task ''{0}'' from rule ''{1}''. +LOG_INFO_POTENTIAL_DIRECTIVE_FOUND=I found a potential directive: {0} +LOG_INFO_POTENTIAL_PATTERN_FOUND=I found a potential pattern in line {0}: {1} +LOG_INFO_RULE_LOCATION=Rule location: ''{0}'' +LOG_INFO_SYSTEM_COMMAND=System command: {0} +LOG_INFO_TASK_RESULT=Task result: +LOG_INFO_VALIDATED_DIRECTIVES=All directives were validated. We are good to go. +LOG_INFO_WELCOME_MESSAGE=Welcome to arara {0} (revision {1})! diff --git a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages_en_QN.properties b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages_en_QN.properties new file mode 100644 index 00000000000..db583d46694 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages_en_QN.properties @@ -0,0 +1,150 @@ +# Arara, the cool TeX automation tool +# Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the project's author nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY +# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# --------------------------------------------------------------------- +# Language: Broad Norfolk +# Translators: Nicola Talbot +# --------------------------------------------------------------------- +# With thanks to Keith Skipper for suggestions! + +ERROR_BASENAME_NOT_A_FILE=Yew''re gotta hev a file for the ''basename'', not a directory. That ''{0}'' yew give me ent a file. Do yew need ter do jarbs on a directory, yew myte try the Java API. +ERROR_CALCULATEHASH_IO_EXCEPTION=Thass a rum ole dew, bor, I can't work out th' hash. I ent got no idea why thass gorn wrong. Praps the file was hulled abowt afore or time the hashing operation was doing else maybe I're gotta he'some proper permissions to snout abowt in the file. +ERROR_CHECKBOOLEAN_NOT_VALID_BOOLEAN=That look like ''{0}'' ent a proper boolean value but dunt yew git yerself inta a rite ole puckaterry. Do yew jist make sure to use proper boolean values (yes and no, true and false, 1 and 0, and on and off). +ERROR_CHECKOS_INVALID_OPERATING_SYSTEM=Thass a rum un. I hent got no idear whass yar operating system. Wuh, that ole value ''{0}'' I got dunt look like thass a proper operating system (howsomever I might be sorft in the head and got that wrong). Do yew fix that value and try agin. +ERROR_CHECKREGEX_IO_EXCEPTION=Cor blast me, but I feel a bit ona tewl. I can''t read any ona file ''{0}'', thass giving me an IO error. I''re got no idear but praps the file was hulled abowt afore or time the reading operation was doing else maybe I''re gotta he''some proper permissions to snout abowt the file. +ERROR_CONFIGURATION_FILETYPE_MISSING_EXTENSION=One onyar entries in that ole list a 'filetypes' in the configuration file ent got no 'extension'. Thass a rum un cos I can't do a new filetype if the extension ent been set. That shoont be a problem: do yew jist add a new extension and try agin, bor. +ERROR_CONFIGURATION_GENERIC_ERROR=Thass hully gone wrong, ole partner. I coont unnerstand the configuration file. Wuh, yew're gotta he'sum idear wot this is orl abowt ter git th' hang o'this bit else yew myte be in a rite ole puckaterry but I'll help yew git it done if I can, my bewty. +ERROR_CONFIGURATION_INVALID_YAML=Thass a rum ole dew, I're got in a rite ole puckaterry trying to read the configuration file. That YAML do need some tricolating to git it rite but I'll lend yew a hand, tergether. +ERROR_CONFIGURATION_LOOPS_INVALID_RANGE=Atwin me, yew an' the geartepust that 'loops' key value ent rite. Yew're gotta giv' a number thass bigger than nuffin. +ERROR_DISCOVERFILE_FILE_NOT_FOUND=Dunt yew git yarself inta a rite ole puckaterry, but I can''t find yar file ''{0}'' {1}. Yew''re gotta find the file and do yew see that has a proper extension on the end onnit, tergether. +ERROR_EVALUATE_COMPILATION_FAILED=Wuh, I ent got no idear wass gorn on but I coont git the hang o'that conditional. Yew're gotta he'sum idear wot this is orl abowt else yew mite be in a rite ole puckaterry but I'll help yew git it done if I can, ole partner. +ERROR_EVALUATE_NOT_BOOLEAN_VALUE=That ent a yis or no answer for that conditional evaluation but dunt yew git in a puckaterry. Do yew jist git that conditional to giv a boolean value, my bewty. +ERROR_EXTRACTOR_IO_ERROR=Wuh, I was trying to get a hold onnem directives when suffin went hully wrong, howsomever I hent got no idear why thass gone wrong. Praps the file was hulled abowt afore or time the hashing operation was doing else maybe I're gotta he'sum proper permissions to read the file. +ERROR_FILETYPE_NOT_A_FILE=Yew gotta hev a file for the ''filetype'', not a directory. That ''{0}'' yew giv me dunt look like a file to me. Do yew need to do jarbs on a directory, yew myte try the Java API +ERROR_FILETYPE_UNKNOWN_EXTENSION=Cor blast me, ole partner, but I ent never heard of ''{0}'' as a default extension. Yew''re gotta giv me yer know about the match and that ole extension on the end onnit do you want a new file type. I ony know abowt the default extensions: {1} +ERROR_GETAPPLICATIONPATH_ENCODING_EXCEPTION=Dunt yew git yarself inta a rite ole puckaterry, my bewty, cos there's nuffin I can dew abowt it but I're gotta mobbing abowt th'encoding time I was trying to get the application path. +ERROR_GETCANONICALFILE_IO_EXCEPTION=Cor blast me, my bewty, I ent got no idear wass gorn on but I coont get the canonical file. Praps the file was hulled abowt afore or time the lookup operation was doing else maybe I're gotta he'sum proper permissions. +ERROR_GETCANONICALPATH_IO_EXCEPTION=Cor blast me, my bewty, I ent got no idear wass gorn on but I coont get the canonical path. Praps the file was hulled abowt afore or time the lookup operation was doing else maybe I're gotta he'sum proper permissions. +ERROR_GETPARENTCANONICALPATH_IO_EXCEPTION=Cor blast me, my bewty, I ent got no idear wass gorn on but I coont get the parent canonical path. Praps the file was hulled abowt afore or time the hashing operation was doing else maybe I're gotta he'sum proper permissions. +ERROR_INTERPRETER_ARGUMENT_IS_REQUIRED=That seem like the rule say yew gotta have ''{0}'', but I coont find it in the directive parameters. Dew yew add it as a parameter for yar directive and try agin. +ERROR_INTERPRETER_COMMAND_RUNTIME_ERROR=That ent gorn right wi' one onnem commands you giv' me. Wuh, yew're gotta he'sum idear wot this is orl abowt ter git th' hang o'this bit else yew myte be in a rite ole puckaterry but I'll help yew git it done if I can, my bewty. +ERROR_INTERPRETER_DEFAULT_VALUE_RUNTIME_ERROR=That ent gorn right wi' ter default value of one onnem arguments you giv' me. Wuh, yew're gotta he'sum idear wot this is orl abowt ter git th' hang o'this bit else yew myte be in a rite ole puckaterry but I'll help yew git it done if I can, tergether. +ERROR_INTERPRETER_EXIT_RUNTIME_ERROR=That ent gorn right wi' th' exit status of onnem commands you giv' me. Wuh, yew're gotta he'sum idear wot this is orl abowt ter git th' hang o'this bit else yew myte be in a rite ole puckaterry but I'll help yew git it done if I can, my bewty. +ERROR_INTERPRETER_FLAG_RUNTIME_EXCEPTION=That ent gorn right wi' th' flag for onnem arguments you giv' me. Wuh, yew're gotta he'sum idear wot this is orl abowt ter git th' hang o'this bit else yew myte be in a rite ole puckaterry but I'll help yew git it done if I can, my bewty. +ERROR_INTERPRETER_NULL_COMMAND=Thass a rum ole dew but one onnem commands have hulled me a null value. Do you check that and try agin, ole partner. +ERROR_INTERPRETER_RULE_NOT_FOUND=Thass a rum ole dew but there ent no ''{0}'' in any onnem rule paths. Praps you ent spelled that right. I coont find ''{0}.yaml'' in any onner paths: {1} +ERROR_INTERPRETER_UNKNOWN_KEYS=Atwin me, yew an'' the geartepost I ent got no idear abowt these keys in the directive: {0}. Howsomever, dunt you git yarself inta a rite ole puckaterry. Do you jist hull them outta yar map. +ERROR_INTERPRETER_WRONG_EXIT_CLOSURE_RETURN=Wuh, ole partner, that 'exit' expression ent givin' me a yis or no answer. Thass allus got to dew that even if there ent nuffin else to dew. Howsomever, dunt you git yarself inta a rite ole puckaterry, dew you jist tricolate the return statement and try agin. +ERROR_LANGUAGE_INVALID_CODE=Cor blast me, my bewty, but you hully copped me there wi'' that language code. I can ony mardle in these languages: {0} +ERROR_LOAD_COULD_NOT_LOAD_XML=Cor blast me, ole partner, but that XML database ''{0}'' ent half puttin'' on its parts but I ent got no idear wass gone wrong. Praps the file was hulled abowt afore or time the reading operation was doing else maybe I''re gotta he''sum proper permissions to snout abowt the file. Atwin yew, me an'' the geartepost, do yew make sure the XML is in good kelter. +ERROR_PARSER_INVALID_PREAMBLE=Thass a rum ole dew, ole partner, but I can''t find the preamble ''{0}''. Do yew make sure that key exist in the configuration file. +ERROR_PARSER_LOOPS_INVALID_RANGE=Wuh, I dunt want to hully mob you, my bewty, but that value you giv' me in the command line ent rite for the sight o' loops I mite hev to dew. Dew you giv' me a proper number what I can count to. +ERROR_PARSER_LOOPS_NAN=Wuh, I dunt want to hully mob you, ole partner, but that value you giv' me in the command line for the sight o' loops I mite hev to dew ent a number. Dew you giv' me a proper number what I can count to. +ERROR_PARSER_TIMEOUT_INVALID_RANGE=Cor blast me, my bewty, but that timeout value you giv' me in the command line ent rite. Dew you giv' me a proper number what I can count to. +ERROR_PARSER_TIMEOUT_NAN=Cor blast me, ole partner, but that timeout value you giv' me in the command line ent a number. Dew you giv' me a proper number what I can count to. +ERROR_PARSERULE_GENERIC_ERROR=Thass a rum ole dew, that rule is hully puttin' on its parts. Wuh, yew're gotta he'sum idear wot this is orl abowt ter git th' hang o'this bit else yew myte be in a rite ole puckaterry but I'll help yew git it done if I can, tergether. +ERROR_PARSERULE_INVALID_YAML=Thass a rum ole dew, that rule ent half putting on its parts. That YAML file is hully on the huh but dunt yew git yarself in a rite ole puckaterry. I'll help you if I can, my bewty. +ERROR_REPLICATELIST_MISSING_FORMAT_ARGUMENTS_EXCEPTION=Blast, bor, but I coont replicate that duzzy ole list cors you ent giv' me a format argument. I rackon there's a slight more or less parameters than yew giv' me. Dew yew go an' check it and try agin. +ERROR_RULE_IDENTIFIER_AND_PATH=Wuh, that ent right, ole partner. That rule ''{0}'' have gone on the slosh at ''{1}''. +ERROR_RUN_GENERIC_EXCEPTION=Thass a rum ole dew, my bewty, but I coont dew the system command but I ent got no idear wass gone wrong. Wuh, yew're gotta he'sum idear wot this is orl abowt ter git th' hang o'this bit else yew myte be in a rite ole puckaterry but I'll help yew git it done if I can, tergether. +ERROR_RUN_INTERRUPTED_EXCEPTION=Thass a rum ole dew, ole partner, suffin's hully thacked that system command aside the lug and thass croaked. +ERROR_RUN_INVALID_EXIT_VALUE_EXCEPTION=That system command is hully puttin' on its parts. That ent a proper exit value. +ERROR_RUN_IO_EXCEPTION=I rackon that system command have blundered over the troschel. Are yew sure that exist in yar path? Dew yew check the path, ole partner, to see where thass hidin'. Maybe thass gorn in the backus for some bread an' pullet. +ERROR_RUN_TIMEOUT_EXCEPTION=That slummockun gret system command have run on for too long so I gev it a clout round the lug. If thass hully short for yew, dew yew giv' me a longer timeout value. +ERROR_RUN_TIMEOUT_INVALID_RANGE=Hold yew hard, that timeout value ent here. I rackon thass gorn for some fourses. Dew yew giv' me a number wot I can count to. +ERROR_SAVE_COULD_NOT_SAVE_XML=Thass a rum ole dew, ole partner. I coont save that ole XML database that oughta be called ''{0}''. Howsomever I hent got no idea why thass gone wrong. Praps I''re gotta he''sum proper permissions to write the XML file to disk. +ERROR_SESSION_OBTAIN_UNKNOWN_KEY=Cor blast me, my bewty, but I hent got no idear wass that ''{0}'' key is dewun in that ''obtain'' method. I can''t giv'' you suffin I ent got. Dew yew ax for suffin I can git yew. +ERROR_SESSION_REMOVE_UNKNOWN_KEY=Cor blast me, ole partner, but I hent got no idear wass that ''{0}'' key is dewin in that ''remove'' method. I can''t remove suffin that ent there. Dew yew ax for suffin else. +ERROR_TRIGGER_ACTION_NOT_FOUND=Cor blast me, bor, but there ent no trigger action called ''{0}'' that I ever heard of. Dew yew hev'' a look at that list of trigger actions and try agin. +ERROR_TRIGGER_CALL_EXCEPTION=Thass a rum ole dew, my bewty, but that trigger action ''{0}'' is hully puttin'' on its parts and I ent got no idear what to dew. +ERROR_VALIDATE_EMPTY_FILES_LIST=Cor blast me, my bewty. I read a directive {0} but there ent nuffin in the provided ''files'' list. Do yew just make sure there''s at least one element in the list and try agin. +ERROR_VALIDATE_FILE_IS_RESERVED=Thass a rum ole dew, ole partner. I read a directive {0} but blast me if that key ''file'' ent used. That key is reserved, so yew can''t use it. But dunt yew git yarself in a rite ole puckaterry. Do yew give it another name. +ERROR_VALIDATE_FILES_IS_NOT_A_LIST=That ent rite, ole partner. I read a directive {0} and found out that ''files'' require a list. Do yew fix the type to a proper list and try agin. +ERROR_VALIDATE_INVALID_DIRECTIVE_FORMAT=That directive {0} in the provided file ent rite. But dunt git yarself into a puckaterry. Do yew just fix the directive and try agin. +ERROR_VALIDATE_NO_DIRECTIVES_FOUND=That look like no directives were found in the provided file. Do yew include at least one directive and try agin. +ERROR_VALIDATE_ORPHAN_LINEBREAK=Thass a rum ole dew, ole partner. There''s an orphan directive line break in line {0}. I can''t do nuffin abowt that. Dew yew giv'' that directive a bit o'' tricolatin'' and try agin. +ERROR_VALIDATE_REFERENCE_IS_RESERVED=That ain''t right, my bewty. You can''t use the key ''reference'' in {0}. Thass a reserved key, but there ain''t no use you gittin'' in a rite ole puckaterry abowt it. Dew yew giv'' it another name. +ERROR_VALIDATE_YAML_EXCEPTION=Thass a rum ole dew, my bewty. Suffin''s gone wrong in the YAML map in a directive {0}. Wuh, yew''re gotta he''sum idear wot this is orl abowt ter git th'' hang o''this bit else yew myte be in a rite ole puckaterry. +ERROR_VALIDATEBODY_ARGUMENT_ID_IS_RESERVED=That ent rite, ole partner. Yew can''t use ''{0}''. Thass reserved, but dunt yew git yarself into a rite ole puckaterry, dew yew jist giv'' it another name. +ERROR_VALIDATEBODY_ARGUMENTS_LIST=Thass a rum ole dew, my bewty, but there ent no list of arguments. I need that even if that ent got nuffin in it. Dew you fix it and try agin. +ERROR_VALIDATEBODY_DUPLICATE_ARGUMENT_IDENTIFIERS=Thass a rum ole dew, ole partner. You've got duplicate argument identifiers in yar rule. Dew you fix that and try agin. +ERROR_VALIDATEBODY_MISSING_KEYS=That ent rite, ole partner. You gotta use at least 'flag' or 'default' when you define a rule argument scope. Do yew make sure to use at least one onnem. +ERROR_VALIDATEBODY_NULL_ARGUMENT_ID=That ent rite, my bewty. You gotta hev an identifier but one onnem arguments ent for one. Dew yew add a valid identifier to the argument and try agin. +ERROR_VALIDATEBODY_NULL_COMMAND=Thass a rum dew, ole partner. Thass a null command in that ole rule. Do you add a proper command there. +ERROR_VALIDATEBODY_NULL_COMMANDS_LIST=Wuh, thass hully wrong. Do yew giv' me a list o' commands, my bewty, and try agin. +ERROR_VALIDATEHEADER_NULL_ID=Wuh, ole partner, I'm gornta hev to mob that rule o' yars. That ent got no identifier. Thass hully important and there ent no use putting on yar parts abowt it. That slummockin' gret rule oughta hev' an identifier what have the same name as that ole rule file (without the extension, dew yew dunt know that). +ERROR_VALIDATEHEADER_NULL_NAME=Cor blast me, bor, but that rule ent got no name, but dunt yew git yarself in a puckaterry, dew you jist giv' it a proper name and try agin. +ERROR_VALIDATEHEADER_WRONG_IDENTIFIER=My heart alive, my bewty, but that rule ent got the right identifier. That oughta be ''{0}'', not ''{1}'', but dunt yew git yarself in a puckaterry. Dew you jist fix that. +ERROR_VELOCITY_FILE_NOT_FOUND=Cor blast me, bor, but the template engine can't find the provided input file. Dew yew mearke sure the location is correct and try agin. +ERROR_VELOCITY_PARSE_EXCEPTION=Wuh, that ent roight, ole partner. There wus a parse error in the provided input file. Dew yew mearke hully sure the file comply wuth the Velocity Template Language (VTL) specification and try agin. +ERROR_VELOCITY_METHOD_INVOCATION_EXCEPTION=Thass a rum ole dew. There wus a method invocation error in the provided input file. Dew yew mearke sure the file comply with the Velocity Template Language (VTL) specification and try agin. +ERROR_VELOCITY_IO_EXCEPTION=That ent gorn right, my bewty. The template engine wunt able to write the output file. Dew yew mearke sure the path has the proper permissions and try agin. +INFO_DISPLAY_EXCEPTION_MORE_DETAILS=Hear's orl my know on that aggraweartin' exception: +INFO_DISPLAY_EXECUTION_TIME=Wuh that took {0} seconds but if thass a slight longer than you expected, dunt yew go mobbing me abowt it cors that ent my fault. My grandf''ar dint have none of these pearks. He had to use a pen and a bit o'' pearper, but thass bin nice mardling wi'' yew. Dew yew keep a troshin''! +INFO_DISPLAY_FILE_INFORMATION=Hold yew hard, ole partner, I''m gornta hev a look at ''{0}'' (thass {1} big, that is, and that was last chearnged on {2} in case yew dunt remember). +INFO_INTERPRETER_DRYRUN_MODE_SYSTEM_COMMAND=This is what I''m abowt to dew: {0} +INFO_INTERPRETER_DRYRUN_MODE_TRIGGER_MODE=Wuh, ole partner, I know this is a dry-run, but this entry has gorta be done cos thass a trigger. Thass hully important yew should know that might doss things on the huh. +INFO_INTERPRETER_VERBOSE_MODE_TRIGGER_MODE=Wuh, ole partner, this entry is one onem triggers what come from the rule scope. Thass hully important yew should know that might put this jarb hully on the huh. +INFO_LABEL_AUTHOR=Thass the one wot wrote this masterous jarb: +INFO_LABEL_AUTHORS=Here's the ones wot wrote this masterous jarb: +INFO_LABEL_CONDITIONAL=Conditional (thass a yis or no thing): +INFO_LABEL_NO_AUTHORS=Wuh thass a rum ole dew. There ent no names here. Yew're gotta guess who wrote this masterous jarb +INFO_LABEL_ON_DETAILS=DETAILS +INFO_LABEL_ON_ERROR=SUFFIN'S GORN WRONG +INFO_LABEL_ON_FAILURE=THAT ENT GORN RIGHT, OLE PARTNER +INFO_LABEL_ON_SUCCESS=THASS A MASTERLY JOB, MY BEWTY +INFO_LABEL_UNNAMED_TASK=That task ent got no name +INFO_PARSER_ALL_RIGHTS_RESERVED=Orl them rights are reserved, ole partner +INFO_PARSER_DRYRUN_MODE_DESCRIPTION=that'll look like I'm dewun suffin, but I ent +INFO_PARSER_HELP_DESCRIPTION=wuh, cor blast me, my bewty, but that'll tell me to dew jist what I'm dewun rite now +INFO_PARSER_LANGUAGE_DESCRIPTION=that'll tell me what language to mardle in +INFO_PARSER_LOG_DESCRIPTION=that'll make a log file wi' orl my know dew suffin go wrong +INFO_PARSER_LOOPS_DESCRIPTION=wuh, yew dunt want me to run on forever, dew you, so use this to say when you want me to stop +INFO_PARSER_NOTES=This masterous fine perk use orl these other perks and here's their licences an'orl: CAL10N: MIT, Commons CLI: Apache 2.0, Commons Collections: Apache 2.0, Commons IO: Apache 2.0, Commons Lang: Apache 2.0, MVEL: Apache 2.0, Logback: dual licensing with EPL 1.0 and LGPL 2.1, Simple framework: Apache 2.0, SLF4J: MIT, SnakeYAML: Apache 2.0, Velocity: Apache 2.0, and ZT-Exec: Apache 2.0. At last but not least, arara itself is released under the New BSD license. +INFO_PARSER_ONLY_HEADER=wuh, my bewty, that'll only peek at directives what are in the file header +INFO_PARSER_PREAMBLE_DESCRIPTION=dew yew git hold o' that preamble from the configuration file +INFO_PARSER_SILENT_MODE_DESCRIPTION=that'll make them system commands clam up and not run on about what's dewin +INFO_PARSER_TIMEOUT_DESCRIPTION=wuh, yew dunt want them system commands to run on forever dew suffin' go wrong, dew you, so use this to set the execution timeout (thass in milliseconds) +INFO_PARSER_VERBOSE_MODE_DESCRIPTION=thass dew you want ter system commands to hav' a mardle wi'yew an'orl +INFO_PARSER_VERSION_DESCRIPTION=dew yew use this dew you want my know abowt this version +LOG_INFO_BEGIN_BUFFER=BEGIN OUTPUT BUFFER +LOG_INFO_DIRECTIVES_BLOCK=DIRECTIVES +LOG_INFO_END_BUFFER=END OUTPUT BUFFER +LOG_INFO_INTERPRET_RULE=I''m orl ready, ole parter, to dew the rule ''{0}''. +LOG_INFO_INTERPRET_TASK=I''m orl ready, my bewty, to dew ''{0}'' from that ole rule ''{1}''. +LOG_INFO_POTENTIAL_DIRECTIVE_FOUND=I''re found what might be a directive: {0} +LOG_INFO_POTENTIAL_PATTERN_FOUND=I''re found what might be a pattern in line {0}: {1} +LOG_INFO_RULE_LOCATION=That ole rule come from: ''{0}'' +LOG_INFO_SYSTEM_COMMAND=System command: {0} +LOG_INFO_TASK_RESULT=Here's what that jarb say: +LOG_INFO_VALIDATED_DIRECTIVES=Thass a masterous jarb, orl the directives are in good kelter. We can git troshin'. +LOG_INFO_WELCOME_MESSAGE=Hello, my bewty. Welcome to arara {0} (revision {1})! (Thass one onnem hully big birds they git in Brazil.) diff --git a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages_it.properties b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages_it.properties new file mode 100644 index 00000000000..70afb93ec6a --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages_it.properties @@ -0,0 +1,149 @@ +# Arara, the cool TeX automation tool +# Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the project's author nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY +# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# --------------------------------------------------------------------- +# Language: Italian +# Translators: Enrico Gregorio +# --------------------------------------------------------------------- + +ERROR_BASENAME_NOT_A_FILE=Il metodo ''basename'' richiede un file, non una directory. ''{0}'' non sembra proprio essere un file. Se devi eseguire un compito su una directory, puoi adoperare uno dei metodi delle API Java. +ERROR_CALCULATEHASH_IO_EXCEPTION=Per qualche motivo, non ho potuto calcolare un hash. Purtroppo non ho idea del perché sia andata male. Forse il file è stato spostato o cancellato durante l'operazione di hashing. O forse non ho i permessi necessari per leggere il file. +ERROR_CHECKBOOLEAN_NOT_VALID_BOOLEAN=Sembra che ''{0}'' non sia un valore booleano valido. Penso che sia facile correggerlo. Assicurati di adoperare una stringa valida che rappresenti un valore booleano (yes e no, true e false, 1 e 0, oppure on e off). +ERROR_CHECKOS_INVALID_OPERATING_SYSTEM=Non sono riuscito a distinguere il tuo sistema operativo. Il valore dichiarato ''{0}'' non compare nella mia lista di sistemi operativi (potrei sbagliarmi, però). Per favore, correggi il valore e riprova. +ERROR_CHECKREGEX_IO_EXCEPTION=Non sono riuscito a leggere il contenuto del file ''{0}'' e ho ricevuto in errore di I/O. Purtroppo non ho idea del perché sia andata male. Forse il file è stato spostato o cancellato durante l''operazione di hashing. O forse non ho i permessi necessari per leggere il file. +ERROR_CONFIGURATION_FILETYPE_MISSING_EXTENSION=Uno degli oggetti nella lista di 'filetypes' nel file di configurazione è senza 'estensione'. Mi dispiace, non posso gestire un nuovo 'filetype' se l'estensione non è specificata. Dovrebbe essere facile correggerlo: aggiungi l'estensione e riprova. +ERROR_CONFIGURATION_GENERIC_ERROR=Non sono riuscito a leggere il file di configurazione, è successo qualcosa che non va. Questa parte è un po' complicata, perché riguarda aspetti del formato interno di serializzazione dei dati. Farò del mio meglio per darti una mano, per quanto posso. +ERROR_CONFIGURATION_INVALID_YAML=Non sono riuscito a leggere il file di configurazione, è successo qualcosa che non va. Sembra che il file YAML fornito non sia valido. Farò del mio meglio per darti una mano, per quanto posso. +ERROR_CONFIGURATION_LOOPS_INVALID_RANGE=Il valore definito nella chiave 'loops' del file di configurazione per stabilire il massimo numero di cicli ha un intervallo non valido. Assicurati che sia un valore 'lungo' e positivo. +ERROR_DISCOVERFILE_FILE_NOT_FOUND=Non sono riuscito a trovare il file ''{0}'' {1}. Assicurati che il file esista e abbia un''estensione valida. +ERROR_EVALUATE_COMPILATION_FAILED=Per qualche ragione, non sono riuscito a compilare l'espressione del condizionale fornito. Questa parte è un po' complicata, perché riguarda aspetti del linguaggio interno per le espressioni. Farò del mio meglio per darti una mano, per quanto posso. +ERROR_EVALUATE_NOT_BOOLEAN_VALUE=La valutazione del condizionale si aspettava un valore booleano come risultato. Dovrebbe essere facile correggerlo. Assicurati che la valutazione del condizionale fornisca alla fine un valore booleano. +ERROR_EXTRACTOR_IO_ERROR=C'è stato un errore di I/O mentre provavo a estrarre le direttive. Purtroppo non ho idea del perché sia andata male. Forse il file è stato spostato o cancellato prima o durante l'operazione di hashing. O forse non ho i permessi necessari per leggere il file. +ERROR_FILETYPE_NOT_A_FILE=Il metodo ''filetype'' richiede un file, non una directory. ''{0}'' non sembra proprio essere un file. Se devi eseguire un compito su una directory, puoi adoperare uno dei metodi delle API Java. +ERROR_FILETYPE_UNKNOWN_EXTENSION=Non riconosco ''{0}'' come un''estensione standard. Se vuoi definire un nuovo tipo di file, assicurati di fornire l''estensione e lo schema. Queste sono le estensioni standard: {1} +ERROR_GETAPPLICATIONPATH_ENCODING_EXCEPTION=C'è stato un problema di codifica mentre tentavo di ottenere il percorso dell'applicazione. Non c'è molto che possa fare al riguardo. +ERROR_GETCANONICALFILE_IO_EXCEPTION=Non sono riuscito ad accedere al file canonico per via di un errore di I/O. Purtroppo non ho idea del perché sia andata male. Forse il file è stato spostato o cancellato prima o durante l'operazione di hashing. O forse non ho i permessi necessari per leggere il file. +ERROR_GETCANONICALPATH_IO_EXCEPTION=Non sono riuscito a ottenere il percorso canonico per via di un errore di I/O. Purtroppo non ho idea del perché sia andata male. Forse il file è stato spostato o cancellato prima o durante l'operazione di hashing. O forse non ho i permessi necessari per leggere il file. +ERROR_GETPARENTCANONICALPATH_IO_EXCEPTION=Non sono riuscito a ottenere il percorso canonico progenitore per via di un errore di I/O. Purtroppo non ho idea del perché sia andata male. Forse il file è stato spostato o cancellato prima o durante l'operazione di hashing. O forse non ho i permessi necessari per leggere il file. +ERROR_INTERPRETER_ARGUMENT_IS_REQUIRED=Sembra che ''{0}'' sia contrassegnato come obbligatorio nella regola, ma non l''ho trovato nei parametri della direttiva. Assicurati di aggiungerlo come parametro nella direttiva e riprova. +ERROR_INTERPRETER_COMMAND_RUNTIME_ERROR=Non ho potuto valutare uno dei comandi forniti. Questa parte è un po' complicata perché coinvolge aspetti del linguaggio per le espressioni sottostante. Farò del mio meglio per darti una mano, per quanto posso. +ERROR_INTERPRETER_DEFAULT_VALUE_RUNTIME_ERROR=Non ho potuto valutare il valore di default dell'espressione in uno degli argomenti. Questa parte è un po' complicata perché coinvolge aspetti del linguaggio per le espressioni sottostante. Farò del mio meglio per darti una mano, per quanto posso. +ERROR_INTERPRETER_EXIT_RUNTIME_ERROR=Non sono riuscito a valutare lo stato di uscita di uno dei comandi forniti. Questa parte è un po' complicata perché coinvolge aspetti del linguaggio per le espressioni sottostante. Farò del mio meglio per darti una mano, per quanto posso. +ERROR_INTERPRETER_FLAG_RUNTIME_EXCEPTION=Non ho potuto valutare la flag di uno degli argomenti. Questa parte è un po' complicata perché coinvolge aspetti del linguaggio per le espressioni sottostante. Farò del mio meglio per darti una mano, per quanto posso. +ERROR_INTERPRETER_NULL_COMMAND=Sono spiacente, ma a quanto pare il risultato di uno dei comandi forniti è un valore nullo. Assicurati che il comando sia valido e riprova. +ERROR_INTERPRETER_RULE_NOT_FOUND=Non sono riuscito a trovare una regola chiamata ''{0}'' nei percorsi per le regole impostati. Forse una parola scritta sbagliata? Stavo cercando un file con il nome ''{0}.yaml'' nei seguenti percorsi in ordine di priorità: {1} +ERROR_INTERPRETER_UNKNOWN_KEYS=Ho trovato queste chiavi sconosciute nella direttiva: {0}. Dovrebbbe essere facile correggere, toglile dalla mappa. +ERROR_INTERPRETER_WRONG_EXIT_CLOSURE_RETURN=L'espressione di 'uscita' deve essere sempre un valore booleano (anche se non c'è alcun calcolo nella parte di chiusura). Dovrebbe essere facile correggere: assicurati che l'asserzione del 'type return' sia giusta e riprova. +ERROR_LANGUAGE_INVALID_CODE=La lingua richiesta non è valida. Al momento, so parlare le seguenti lingue: {0} +ERROR_LOAD_COULD_NOT_LOAD_XML=Non ho potuto caricare il database XML di nome ''{0}''. Purtroppo non ho idea del perché sia andata male. Forse il file è stato spostato o cancellato prima o durante l''operazione di lettura. O forse non ho i permessi necessari per leggere il file. Già che ci siamo, assicurati che il file XML sia ben formato. +ERROR_PARSER_INVALID_PREAMBLE=Mi dispiace, ma non è stato possibile trovare il preambolo ''{0}''. Assicurati che questa chiave esista nel file di configurazione. +ERROR_PARSER_LOOPS_INVALID_RANGE=Il valore definito nella linea di comando per il massimo numero di cicli ha un intervallo non valido. Assicurati di adoperare un valore 'lungo' e positivo. +ERROR_PARSER_LOOPS_NAN=Il numero massimo di cicli deve essere specificato come un intero. È facile correggerlo: assicurati di adoperare un valore 'lungo' e positivo. +ERROR_PARSER_TIMEOUT_INVALID_RANGE=Il valore definito nella linea di comando per il timeout in esecuzione non è nell'intervallo valido. Assicurati di adoperare un valore 'lungo' e positivo. +ERROR_PARSER_TIMEOUT_NAN=Il valore dell'opzione per il timeout in esecuzione deve essere un numero. Assicurati di adoperare un valore 'lungo' e positivo. +ERROR_PARSERULE_GENERIC_ERROR=Non ho potuto analizzare la regola, qualcosa è andato storto. Questa parte è un po' complicata, perché riguarda aspetti del formato interno di serializzazione dei dati. Farò del mio meglio per darti una mano, per quanto posso. +ERROR_PARSERULE_INVALID_YAML=Non ho potuto analizzare la regola, qualcosa è andato storto. Sembra che il file YAML fornito non sia valido. Farò del mio meglio per darti una mano, per quanto posso. +ERROR_REPLICATELIST_MISSING_FORMAT_ARGUMENTS_EXCEPTION=Non sono riuscito a replicare la lista perché manca un argomento per il formato. Penso che si tratti di un numero sbagliato di parametri. Assicurati che il numero di parametri sia corretto e riprova. +ERROR_RULE_IDENTIFIER_AND_PATH=Ho trovato un errore nella regola ''{0}'' alla posizione ''{1}''. +ERROR_RUN_GENERIC_EXCEPTION=Non ho potuto lanciare il comando di sistema richiesto, qualcosa è andato storto. Questa parte è un po' complicata, perché riguarda aspetti del linguaggio interno per le espressioni. Farò del mio meglio per darti una mano, per quanto posso. +ERROR_RUN_INTERRUPTED_EXCEPTION=L'esecuzione del comando di sistema richiesto si è interrotta inaspettatamente. Forse un'interruzione esterna ha forzato il comando a terminare. +ERROR_RUN_INVALID_EXIT_VALUE_EXCEPTION=Il comando di sistema richiesto ha restituito un valore di uscita non valido. +ERROR_RUN_IO_EXCEPTION=L'esecuzione del comando di sistema è fallita per via di un errore di I/O. Sei sicuro che il programma esista nei tuoi percorsi? Meglio controllare se il programma è davvero disponibile. +ERROR_RUN_TIMEOUT_EXCEPTION=L'esecuzione del comando di sistema ha raggiunto il valore di timeout impostato ed è stata interrotta. Se il tempo è troppo breve, assicurati di impostarne uno più lungo. +ERROR_RUN_TIMEOUT_INVALID_RANGE=Il valore di timeout probabilmente manca (sebbene il timeout sia abilitato). È facile correggerlo: assicurati di adoperare un valore 'lungo' e positivo. +ERROR_SAVE_COULD_NOT_SAVE_XML=Non ho potuto salvare il database XML con il nome ''{0}''. Purtroppo non ho idea del perché sia successo. Forse non ho i permessi appropriati per scrivere il file XML sul disco. +ERROR_SESSION_OBTAIN_UNKNOWN_KEY=Il metodo ''obtain'' ha trovato una chiave sconosciuta ''{0}'' nell''ambito della sessione. Non posso ottenere qualcosa che non ho da nessuna parte. Specifica una chiave valida e riprova. +ERROR_SESSION_REMOVE_UNKNOWN_KEY=Il metodo ''remove'' ha trovato una chiave sconosciuta ''{0}'' nell''ambito della sessione. Non posso ottenere qualcosa che non ho da nessuna parte. Specifica una chiave valida e riprova. +ERROR_TRIGGER_ACTION_NOT_FOUND=Non ho trovato l''azione ''trigger'' ''{0}''. Da'' un''occhiata alla lista dei ''trigger'' disponibili e riprova. +ERROR_TRIGGER_CALL_EXCEPTION=Non ho potuto eseguire l''azione ''trigger'' ''{0}''. Qualcosa è andata proprio storta. +ERROR_VALIDATE_EMPTY_FILES_LIST=Ho letto la direttiva {0}, ma la lista ''files'' fornita è vuota. Puoi correggerlo facilmente assicurandoti che la lista abbia almeno un elemento, poi riprova. +ERROR_VALIDATE_FILE_IS_RESERVED=Ho letto la direttiva {0} dove è stata usata la chiave ''file''. Questa chiave è riservata e non puoi usarla. Non preoccuparti, lo metti facilmente a posto dando un altro nome. +ERROR_VALIDATE_FILES_IS_NOT_A_LIST=Ho letto la direttiva {0} e ho scoperto che ''files'' richiede una lista. Assicurati di correggere il tipo a una lista appropriata e riprova. +ERROR_VALIDATE_INVALID_DIRECTIVE_FORMAT=Ho visto nel file fornito la direttiva {0} che non è valida. Assicurati di correggere la direttiva e riprova. +ERROR_VALIDATE_NO_DIRECTIVES_FOUND=Sembra che nel file fornito non ci siano direttive. Assicurati che ce ne sia almeno una e riprova. +ERROR_VALIDATE_ORPHAN_LINEBREAK=Sembra che ci sia un fine riga che lascia orfana una direttiva alla riga {0}. Non posso andare avanti. Correggi la direttiva e riprova. +ERROR_VALIDATE_REFERENCE_IS_RESERVED=Ho letto la direttiva {0} dove è stata usata la chiave ''reference''. Questa chiave è riservata e non puoi usarla. Non preoccuparti, lo metti facilmente a posto dando un altro nome. +ERROR_VALIDATE_YAML_EXCEPTION=C''è stato un problema con la mappa YAML fornita con la direttiva {0}. Questa parte è un po'' complicata, perché riguarda aspetti del formato interno di serializzazione dei dati. Farò del mio meglio per darti una mano, per quanto posso. +ERROR_VALIDATEBODY_ARGUMENT_ID_IS_RESERVED=L''identificatore dell''argomento ''{0}'' è riservato, quindi non puoi adoperarlo. È facile correggerlo: chiamalo in modo diverso. +ERROR_VALIDATEBODY_ARGUMENTS_LIST=Non ho potuto trovare la lista degli argomenti. La lista mi serve anche se è vuota. Correggi e riprova. +ERROR_VALIDATEBODY_DUPLICATE_ARGUMENT_IDENTIFIERS=Sembra che tu abbia identificatori di argomenti duplicati nella tua regola. Correggi e riprova. +ERROR_VALIDATEBODY_MISSING_KEYS=Quando si definisce un ambito per l'argomento in una regola bisogna adoperare almeno 'flag' o 'default'. Assicurati che ci sia uno di questi. +ERROR_VALIDATEBODY_NULL_ARGUMENT_ID=Ho trovato che uno degli argomenti non ha identificatore. Assicurati di assegnare un identificatore all'argomento e riprova. +ERROR_VALIDATEBODY_NULL_COMMAND=Ho trovato un comando 'nullo' nella regola fornita. Dovrebbe essere facile correggere: aggiungi un comando valido alla regola. +ERROR_VALIDATEBODY_NULL_COMMANDS_LIST=Mi serve una lista di comandi. Specificala e riprova. +ERROR_VALIDATEHEADER_NULL_ID=La regola fornita non ha un identificatore. Quest'informazione è cruciale, assicurati di sistemarla e riprova. L'identificatore deve avere lo stesso nome della regola (senza estensione, ovviamente). +ERROR_VALIDATEHEADER_NULL_NAME=La regola fornita non ha nome. È facile correggere: specifica un nome valido e riprova. +ERROR_VALIDATEHEADER_WRONG_IDENTIFIER=La regola ha un identificatore sbagliato. Mi sarei aspettato ''{0}'', ma ho trovato ''{1}''. È facile correggere: correggi l''identificatore sbagliato con quello giusto. +ERROR_VELOCITY_FILE_NOT_FOUND=Il motore per i 'template' non è riuscito a trovare il file di input richiesto. Assicurati che la posizione del file sia giusta e riprova. +ERROR_VELOCITY_PARSE_EXCEPTION=C'è stato un errore durante l'analisi del file di input indicato. Assicurati che il file segua le specifiche del Velocity Template Language (VTL) e riprova. +ERROR_VELOCITY_METHOD_INVOCATION_EXCEPTION=Il file di input indicato ha un errore nella chiamata del metodo. Assicurati che il file segua le specifiche del Velocity Template Language (VTL) e riprova. +ERROR_VELOCITY_IO_EXCEPTION=Il motore per i 'template' non è riuscito a scrivere il file di output. Assicurati che il percorso abbia i permessi appropriati e riprova. +INFO_DISPLAY_EXCEPTION_MORE_DETAILS=Ci sono altri dettagli riguardo a questa eccezione: +INFO_DISPLAY_EXECUTION_TIME=Totale: {0} secondi +INFO_DISPLAY_FILE_INFORMATION=Elaborazione ''{0}'' (totale: {1}, modificato il: {2}), attendere. +INFO_INTERPRETER_DRYRUN_MODE_SYSTEM_COMMAND=Sto per lanciare: {0} +INFO_INTERPRETER_DRYRUN_MODE_TRIGGER_MODE=Sebbene stia eseguendo in modo 'dry-run', questo elemento è sempre elaborato perché è un 'trigger'. Nota che gli effetti di un 'trigger' possono influenzare l'esecuzione. +INFO_INTERPRETER_VERBOSE_MODE_TRIGGER_MODE=Questo elemento è un 'trigger' generato nell'ambito della regola. Nota che gli effetti di un 'trigger' possono influenzare l'esecuzione. +INFO_LABEL_AUTHOR=Autore: +INFO_LABEL_AUTHORS=Autori: +INFO_LABEL_CONDITIONAL=Condizionale: +INFO_LABEL_NO_AUTHORS=Nessun autore specificato +INFO_LABEL_ON_DETAILS=DETAILS +INFO_LABEL_ON_ERROR=ERROR +INFO_LABEL_ON_FAILURE=FAILURE +INFO_LABEL_ON_SUCCESS=SUCCESS +INFO_LABEL_UNNAMED_TASK=Compito senza nome +INFO_PARSER_ALL_RIGHTS_RESERVED=Tutti i diritti riservati +INFO_PARSER_DRYRUN_MODE_DESCRIPTION=procedi lungo tutte le fasi dell'esecuzione di un comando, ma senza chiamarne alcuno in modo effettivo +INFO_PARSER_HELP_DESCRIPTION=mostra il messaggio di aiuto +INFO_PARSER_LANGUAGE_DESCRIPTION=imposta la lingua del programma +INFO_PARSER_LOG_DESCRIPTION=genera un file di log +INFO_PARSER_LOOPS_DESCRIPTION=imposta il massimo numero di cicli +INFO_PARSER_NOTES=Questo programma usa le seguenti librerie e le rispettive licenze: CAL10N: MIT, Commons CLI: Apache 2.0, Commons Collections: Apache 2.0, Commons IO: Apache 2.0, Commons Lang: Apache 2.0, MVEL: Apache 2.0, Logback: licenza duale con EPL 1.0 and LGPL 2.1, Simple framework: Apache 2.0, SLF4J: MIT, SnakeYAML: Apache 2.0, Velocity: Apache 2.0, e ZT-Exec: Apache 2.0. Per ultimo e non ultimo, arara stesso è rilasciato in accordo con la licenza New BSD. +INFO_PARSER_ONLY_HEADER=estrai le direttive solo nel 'file header' +INFO_PARSER_PREAMBLE_DESCRIPTION=imposta il preambolo del file sulla base del file di configurazione +INFO_PARSER_SILENT_MODE_DESCRIPTION=nascondi l'output del comando +INFO_PARSER_TIMEOUT_DESCRIPTION=imposta il timeout di esecuzione (in millisecondi) +INFO_PARSER_VERBOSE_MODE_DESCRIPTION=mostra l'outout del comando +INFO_PARSER_VERSION_DESCRIPTION=mostra la versione dell'applicazione +LOG_INFO_BEGIN_BUFFER=BEGIN OUTPUT BUFFER +LOG_INFO_DIRECTIVES_BLOCK=DIRECTIVES +LOG_INFO_END_BUFFER=END OUTPUT BUFFER +LOG_INFO_INTERPRET_RULE=Sono pronto a interpretare la regola ''{0}''. +LOG_INFO_INTERPRET_TASK=Sono pronto a interpretare il compito ''{0}'' della regola ''{1}''. +LOG_INFO_POTENTIAL_DIRECTIVE_FOUND=Ho trovato una potenziale direttiva: {0} +LOG_INFO_POTENTIAL_PATTERN_FOUND=Ho trovato un potenziale schema alla riga {0}: {1} +LOG_INFO_RULE_LOCATION=Posizione della regola: ''{0}'' +LOG_INFO_SYSTEM_COMMAND=Comando di sistema: {0} +LOG_INFO_TASK_RESULT=Risultato del compito: +LOG_INFO_VALIDATED_DIRECTIVES=Tutte le direttive erano valide. Pronti a partire. +LOG_INFO_WELCOME_MESSAGE=Benvenuto in arara {0} (revisione {1})! diff --git a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages_nl.properties b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages_nl.properties new file mode 100644 index 00000000000..9403078b981 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages_nl.properties @@ -0,0 +1,149 @@ +# Arara, the cool TeX automation tool +# Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the project's author nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY +# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# --------------------------------------------------------------------- +# Language: Dutch +# Translators: Marijn Schraagen +# --------------------------------------------------------------------- + +ERROR_BASENAME_NOT_A_FILE=De ''basename''-methode vereist een bestand, geen directory. Het lijkt erop dat ''{0}'' geen bestand is. Als je taken wil uitvoeren met een directory kan je een aantal methodes uit de Java API gebruiken. +ERROR_CALCULATEHASH_IO_EXCEPTION=Om een of andere reden kan ik de hash niet berekenen. Ik weet niet waarom het precies fout ging. Misschien is het bestand verplaatst of verwijderd voor of tijdens de hashing, of misschien heb ik niet de juiste rechten om het bestand te lezen. +ERROR_CHECKBOOLEAN_NOT_VALID_BOOLEAN=Het lijkt erop dat ''{0}'' geen boolean-waarde is. Dit zou makkelijk op te lossen moeten zijn. Gebruik een geldige representatie voor een boolean (yes en no, true en false, 1 en 0, on en off). +ERROR_CHECKOS_INVALID_OPERATING_SYSTEM=Ik kon het besturingssysteem niet achterhalen. De opgegeven waarde ''{0}'' staat niet in mijn lijst van geldige besturingssystemen (ik kan het natuurlijk mishebben). Controleer de waarde alsjeblieft en probeer het opnieuw. +ERROR_CHECKREGEX_IO_EXCEPTION=Ik kon de inhoud van het bestand ''{0}'' niet lezen vanwege een IO-fout. Ik weet niet waarom het precies fout ging. Misschien is het bestand verplaatst of verwijderd voor of tijdens de leesoperatie, of misschien heb ik niet de juiste rechten om het bestand te lezen. +ERROR_CONFIGURATION_FILETYPE_MISSING_EXTENSION=Een van de elementen in de 'filetypes'-lijst in het configuratiebestand heeft geen 'extension'. Helaas kan ik een nieuw bestandstype niet gebruiken als de extensie niet bekend is. Dit zou makkelijk op te lossen moeten zijn: voeg een extensie toe en probeer het opnieuw. +ERROR_CONFIGURATION_GENERIC_ERROR=Ik kon het configuratiebestand niet verwerken, er is iets verkeerd gegaan. Dit probleem is ingewikkeld, omdat het te maken heeft met aspecten van de onderliggende serialisatiesyntax. Ik zal mijn best doen om je zoveel mogelijk hiermee te helpen. +ERROR_CONFIGURATION_INVALID_YAML=Ik kon het configuratiebestand niet verwerken, er is iets verkeerd gegaan. Het lijkt erop dat het YAML-bestand een fout bevat. Ik zal mijn best doen om je zoveel mogelijk hiermee te helpen. +ERROR_CONFIGURATION_LOOPS_INVALID_RANGE=De waarde gedefinieerd in de 'loops'-optie in het configuratiebestand om het maximumaantal herhalingen te specificeren heeft een ongeldig bereik. Geef alsjeblieft een positieve long integer-waarde op. +ERROR_DISCOVERFILE_FILE_NOT_FOUND=Ik kon het opgegeven bestand ''{0}'' {1} niet vinden. Zorg ervoor dat het bestand bestaat en dat het een geldige extensie heeft. +ERROR_EVALUATE_COMPILATION_FAILED=Om een of andere reden kon ik de expressie in de opgegeven voorwaarde niet compileren. Dit is een ingewikkeld probleem, omdat het te maken heeft met aspecten van de onderliggende expressietaal. Ik zal mijn best doen om je zoveel mogelijk hiermee te helpen. +ERROR_EVALUATE_NOT_BOOLEAN_VALUE=De evaluatie van de voorwaarde verwachtte een boolean als resultaat. Dit zou makkelijk op te lossen moeten zijn. Zorg ervoor dat de evaluatie uiteindelijk een boolean oplevert. +ERROR_EXTRACTOR_IO_ERROR=Er was een IO-probleem bij het verwerken van de directives. Ik weet niet waarom het precies fout ging. Misschien is het bestand verplaatst of verwijderd voor of tijdens het hashen, of misschien heb ik niet de juiste rechten om het bestand te lezen. +ERROR_FILETYPE_NOT_A_FILE=De ''filetype''-methode vereist een bestand, geen directory. Het lijkt erop dat ''{0}'' geen bestand is. Als je taken wil uitvoeren met een directory kan je een aantal methodes uit de Java API gebruiken. +ERROR_FILETYPE_UNKNOWN_EXTENSION=De extensie ''{0}'' is niet herkend als een standaardextensie. Als je een nieuw bestandstype wil definiëren zorg dan dat de extensie en het patroon zijn opgegeven. De volgende extensies zijn standaard: {1} +ERROR_GETAPPLICATIONPATH_ENCODING_EXCEPTION=Er was een coderingsprobleem bij het verkrijgen van het applicatiepad. Daar kan ik niet zo veel aan doen. +ERROR_GETCANONICALFILE_IO_EXCEPTION=Ik kon het canonical-pad niet lezen vanwege een IO-fout. Ik weet niet waarom het precies fout ging. Misschien is het bestand verplaatst of verwijderd, of misschien heb ik niet de juiste rechten om het bestand te lezen. +ERROR_GETCANONICALPATH_IO_EXCEPTION=Ik kon het canonical-bestand niet lezen vanwege een IO-fout. Ik weet niet waarom het precies fout ging. Misschien is het bestand verplaatst of verwijderd, of misschien heb ik niet de juiste rechten om het bestand te lezen. +ERROR_GETPARENTCANONICALPATH_IO_EXCEPTION=Ik kon het canonical ouderpad niet lezen vanwege een IO-fout. Ik weet niet waarom het precies fout ging. Misschien is het pad veranderd, of misschien heb ik niet de juiste leesrechten. +ERROR_INTERPRETER_ARGUMENT_IS_REQUIRED=Het argument ''{0}'' is gemarkeerd als verplicht in de regel, maar ik kon het niet vinden in de parameters van de directive. Zorg ervoor dat het als parameter voor de directive wordt toegevoegd en probeer het opnieuw. +ERROR_INTERPRETER_COMMAND_RUNTIME_ERROR=Ik kon een van de opgegeven opdrachten niet evalueren. Dit is een ingewikkeld probleem, omdat het te maken heeft met aspecten van de onderliggende expressietaal. Ik zal mijn best doen om je zoveel mogelijk hiermee te helpen. +ERROR_INTERPRETER_DEFAULT_VALUE_RUNTIME_ERROR=Ik kon de standaardwaarde van een van de argumenten niet evalueren. Dit is een ingewikkeld probleem, omdat het te maken heeft met aspecten van de onderliggende expressietaal. Ik zal mijn best doen om je zoveel mogelijk hiermee te helpen. +ERROR_INTERPRETER_EXIT_RUNTIME_ERROR=Ik kon de exitwaardemelding van een van de opgegeven opdrachten niet evalueren. Dit is een ingewikkeld probleem, omdat het te maken heeft met aspecten van de onderliggende expressietaal. Ik zal mijn best doen om je zoveel mogelijk hiermee te helpen. +ERROR_INTERPRETER_FLAG_RUNTIME_EXCEPTION=Ik kon de optie-expressie van een van de argumenten niet evalueren. Dit is een ingewikkeld probleem, omdat het te maken heeft met aspecten van de onderliggende expressietaal. Ik zal mijn best doen om je zoveel mogelijk hiermee te helpen. +ERROR_INTERPRETER_NULL_COMMAND=Het spijt me, maar een van de opgegeven opdrachten heeft een null-waarde teruggegeven. Zorg ervoor dat de opdracht valide is en probeer het opnieuw. +ERROR_INTERPRETER_RULE_NOT_FOUND=Ik kon de regel met de naam ''{0}'' niet vinden in de opgegeven regelpaden. Misschien een spelfout? Ik heb geprobeerd het bestand ''{0}.yaml'' te vinden in de volgende paden in volgorde van prioriteit: {1} +ERROR_INTERPRETER_UNKNOWN_KEYS=Ik heb de volgende onbekende verwijzingen gevonden in de directive: {0}. Dit zou makkelijk op te lossen moeten zijn: verwijder deze uit de verwijzingstabel. +ERROR_INTERPRETER_WRONG_EXIT_CLOSURE_RETURN=De 'exit'-expressie moet altijd een boolean waarde teruggeven (zelfs als er geen berekening heeft plaatsgevonden). Dit zou makkelijk op te lossen moeten zijn: pas het type van de return-regel aan en probeer het opnieuw. +ERROR_LANGUAGE_INVALID_CODE=De opgegeven taalcode is ongeldig. Op het moment accepteer ik de volgende talen: {0} +ERROR_LOAD_COULD_NOT_LOAD_XML=Ik kon de XML-database met de naam ''{0}'' niet laden. Ik weet niet waarom het precies fout ging. Misschien was het bestand verplaatst of verwijderd tijdens de leesoperatie. Of misschien heb ik niet de juiste rechten om het bestand te lezen. Overigens: zorg ervoor dat het XML-bestand welgevormd is. +ERROR_PARSER_INVALID_PREAMBLE=Het spijt me, maar de preamble ''{0}'' is niet gevonden. Zorg ervoor dat deze verwijzing bestaat in het configuratiebestand. +ERROR_PARSER_LOOPS_INVALID_RANGE=De waarde gedefinieerd in de opdrachtregel voor het maximumaantal herhalingen heeft een ongeldig bereik. Geef alsjeblieft een positieve long integer-waarde op. +ERROR_PARSER_LOOPS_NAN=De optie voor het maximumaantal herhalingen verwacht een getal als argument. Dit zou makkelijk op te lossen moeten zijn. Zorg ervoor dat je een positieve long integer-waarde opgeeft. +ERROR_PARSER_TIMEOUT_INVALID_RANGE=De maximum uitvoeringsduur zoals opgegeven op de opdrachtregel heeft een ongeldige waarde. Zorg ervoor dat je een positieve long integer-waarde opgeeft. +ERROR_PARSER_TIMEOUT_NAN=De optie voor maximum uitvoeringsduur verwacht een getal als argument. Dit zou makkelijk op te lossen moeten zijn. Zorg ervoor dat je een positieve long integer-waarde opgeeft. +ERROR_PARSERULE_GENERIC_ERROR=Ik kon de regel niet verwerken, er is iets verkeerd gegaan. Dit probleem is ingewikkeld, omdat het te maken heeft met aspecten van de onderliggende dataserialisatiesyntax. Ik zal mijn best doen om je zoveel mogelijk hiermee te helpen. +ERROR_PARSERULE_INVALID_YAML=Ik kon de regel niet verwerken, er is iets verkeerd gegaan. Het lijkt erop dat het YAML-bestand ongeldig is. Ik zal mijn best doen om je zoveel mogelijk hiermee te helpen. +ERROR_REPLICATELIST_MISSING_FORMAT_ARGUMENTS_EXCEPTION=Ik kon de lijst niet genereren vanwege een ontbrekend format-argument. Ik denk dat er minder (of meer) parameters zijn dan verwacht. Geef het juiste aantal argumenten op en probeer het opnieuw. +ERROR_RULE_IDENTIFIER_AND_PATH=Ik heb een fout gevonden in regel ''{0}'' op positie ''{1}''. +ERROR_RUN_GENERIC_EXCEPTION=Ik kon het opgegeven systeemcommando niet uitvoeren, er is iets misgegaan. Dit is een ingewikkeld probleem, omdat het te maken heeft met aspecten van de onderliggende expressietaal. Ik zal mijn best doen om je zoveel mogelijk hiermee te helpen. +ERROR_RUN_INTERRUPTED_EXCEPTION=Het uitvoeren van het opgegeven systeemcommando is onverwacht onderbroken. Misschien was er een externe onderbreking die ervoor gezorgd heeft dat het commando gestopt is. +ERROR_RUN_INVALID_EXIT_VALUE_EXCEPTION=Het opgegeven systeemcommando heeft een ongeldige exit-waarde teruggegeven. +ERROR_RUN_IO_EXCEPTION=Het uitvoeren van het systeemcommando is mislukt vanwege een IO-fout. Weet je zeker dat het commando bestaat in het pad? Het is misschien een goed idee om het pad te controleren en te kijken of het commando beschikbaar is. +ERROR_RUN_TIMEOUT_EXCEPTION=Het uitvoeren van het systeemcommando is onderbroken omdat de maximale uitvoeringsduur overschreden is. Als de tijd te kort was, pas dan de maximale uitvoeringsduur aan. +ERROR_RUN_TIMEOUT_INVALID_RANGE=De maximale uitvoeringsduur ontbreekt (hoewel deze optie wel actief is). Dit zou makkelijk op te lossen moeten zijn. Zorg ervoor dat je een positieve long integer-waarde opgeeft. +ERROR_SAVE_COULD_NOT_SAVE_XML=Ik kon de XML-database met de naam ''{0}'' niet opslaan. Ik weet niet precies waarom het fout ging. Misschien heb ik niet de juiste schrijfrechten om het XML-bestand op te slaan. +ERROR_SESSION_OBTAIN_UNKNOWN_KEY=De ''obtain''-methode heeft een onbekende verwijzing gevonden in de sessie: ''{0}''. Als ik iets niet heb kan ik het ook niet gebruiken. Geef een bestaande verwijzing op en probeer het opnieuw. +ERROR_SESSION_REMOVE_UNKNOWN_KEY=De ''remove''-methode heeft een onbekende verwijzing gevonden in de sessie: ''{0}''. Als ik iets niet heb kan ik het ook niet verwijderen. Geef een bestaande verwijzing op en probeer het opnieuw. +ERROR_TRIGGER_ACTION_NOT_FOUND=De trigger-actie ''{0}'' is niet gevonden. Controleer de lijst met beschikbare triggers en probeer het opnieuw. +ERROR_TRIGGER_CALL_EXCEPTION=De trigger-actie ''{0}'' kon niet worden aangeroepen. Er is iets misgegaan. +ERROR_VALIDATE_EMPTY_FILES_LIST=Ik heb een directive {0} gelezen en kwam erachter dat de opgegeven ''files''-lijst leeg is. Dit zou makkelijk op te lossen moeten zijn: zorg ervoor dat de lijst tenminste een element heeft en probeer het opnieuw. +ERROR_VALIDATE_FILE_IS_RESERVED=Ik heb een directive {0} gelezen en kwam erachter dat de verwijzing ''file'' gebruikt is. Deze verwijzing is gereserveerd, dus je kan het niet gebruiken. Maar maak je geen zorgen, dit zou makkelijk op te lossen moeten zijn: gebruik een andere naam. +ERROR_VALIDATE_FILES_IS_NOT_A_LIST=Ik heb een directive {0} gelezen en kwam erachter dat ''files'' een lijst nodig heeft. Zorg dat je het type aanpast naar een lijst en probeer het opnieuw. +ERROR_VALIDATE_INVALID_DIRECTIVE_FORMAT=Ik heb een ongeldige directive {0} gevonden in het opgegeven bestand. Pas de directive aan en probeer het opnieuw. +ERROR_VALIDATE_NO_DIRECTIVES_FOUND=Er zijn geen directives gevonden in het opgegeven bestand. Zorg ervoor dat er tenminste een directive in het bestand staat en probeer het opnieuw. +ERROR_VALIDATE_ORPHAN_LINEBREAK=Er is een ongeldig directive-regeleinde in regel {0}. Ik kan niet verder. Pas de directive aan en probeer het opnieuw. +ERROR_VALIDATE_REFERENCE_IS_RESERVED=Ik heb een directive {0} gelezen en kwam erachter dat de verwijzing ''reference'' gebruikt is. Deze verwijzing is gereserveerd, en kan dus niet gebruikt worden. Maar maak je geen zorgen, dit zou makkelijk op te lossen moeten zijn: gebruik een andere naam. +ERROR_VALIDATE_YAML_EXCEPTION=Er is een probleem met de opgegeven YAML-omzetting in directive {0}. Dit probleem is ingewikkeld, omdat het te maken heeft met aspecten van de onderliggende serialisatiesyntax. +ERROR_VALIDATEBODY_ARGUMENT_ID_IS_RESERVED=De argumentverwijzing ''{0}'' is gereserveerd, en kan dus niet gebruikt worden. Dit zou makkelijk op te lossen moeten zijn: gebruik een andere naam. +ERROR_VALIDATEBODY_ARGUMENTS_LIST=Ik kon de lijst met argumenten niet vinden. Ik heb de lijst nodig, zelfs als deze leeg is. Pas dit aan en probeer het opnieuw. +ERROR_VALIDATEBODY_DUPLICATE_ARGUMENT_IDENTIFIERS=Blijkbaar zijn er dubbele argumentnamen in de regel. Pas dit aan en probeer het opnieuw. +ERROR_VALIDATEBODY_MISSING_KEYS=Bij het definiëren van het argumentbereik van een regel moet tenminste 'flag' of 'default' worden gebruikt. Zorg ervoor dat je in ieder geval een van deze gebruikt. +ERROR_VALIDATEBODY_NULL_ARGUMENT_ID=Ik kwam erachter dat een van de argumenten geen verwijsnaam heeft. Zorg ervoor dat een geldige naam aan het argument wordt toegewezen en probeer het opnieuw. +ERROR_VALIDATEBODY_NULL_COMMAND=Ik heb een null-opdracht in de opgegeven regel gevonden. Dit zou makkelijk op te lossen moeten zijn: geef een geldige opdracht op voor deze regel. +ERROR_VALIDATEBODY_NULL_COMMANDS_LIST=Ik heb een lijst opdrachten nodig. Pas dit aan en probeer het opnieuw. +ERROR_VALIDATEHEADER_NULL_ID=De opgegeven regel heeft geen verwijsnaam. Dit is cruciale informatie, pas dit aan en probeer het opnieuw. Zorg ervoor dat de naam hetzelfde is als de bestandsnaam (zonder extensie). +ERROR_VALIDATEHEADER_NULL_NAME=De opgegeven regel heeft geen naam. Dit zou makkelijk op te lossen moeten zijn: geef een geldige naam op en probeer het opnieuw. +ERROR_VALIDATEHEADER_WRONG_IDENTIFIER=De regel heeft een verkeerde verwijsnaam. Ik verwachtte ''{0}'', maar vond ''{1}''. Dit zou makkelijk op te lossen moeten zijn: vervang de verkeerde verwijsnaam met de correcte naam. +ERROR_VELOCITY_FILE_NOT_FOUND=De template-verwerking kon het opgegeven invoerbestand niet vinden. Zorg dat de locatie correct is en probeer het opnieuw. +ERROR_VELOCITY_PARSE_EXCEPTION=Er was een parseerfout in het opgegeven invoerbestand. Zorg dat het bestand voldoet aan de specificatie van de Velocity Template Language (VLT) en probeer het opnieuw. +ERROR_VELOCITY_METHOD_INVOCATION_EXCEPTION=Er was een fout in een methode-aanroep in het opgegeven invoerbestand. Zorg dat het bestand voldoet aan de specificatie van de Velocity Template Language (VLT) en probeer het opnieuw. +ERROR_VELOCITY_IO_EXCEPTION=De template-verwerking kon niet naar het uitvoerbestand schrijven. Zorg ervoor dat het pad de juiste permissies heeft en probeer het opnieuw. +INFO_DISPLAY_EXCEPTION_MORE_DETAILS=Er zijn meer details beschikbaar voor deze exception: +INFO_DISPLAY_EXECUTION_TIME=Totaal: {0} seconden +INFO_DISPLAY_FILE_INFORMATION=Verwerken van ''{0}'' (grootte: {1}, laatst gewijzigd: {2}), een ogenblik geduld. +INFO_INTERPRETER_DRYRUN_MODE_SYSTEM_COMMAND=Begin met uitvoeren: {0} +INFO_INTERPRETER_DRYRUN_MODE_TRIGGER_MODE=Ondanks het uitvoeren in dry-runmodus wordt dit onderdeel altijd uitgevoerd omdat het een trigger is. Merk op dat de effecten van een trigger de huidige uitvoering kunnen beïnvloeden. +INFO_INTERPRETER_VERBOSE_MODE_TRIGGER_MODE=Dit onderdeel is een trigger die binnen het bereik van de regel valt. Merk op dat de effecten van een trigger de huidige uitvoering kunnen beïnvloeden. +INFO_LABEL_AUTHOR=Auteur: +INFO_LABEL_AUTHORS=Auteurs: +INFO_LABEL_CONDITIONAL=Voorwaarde: +INFO_LABEL_NO_AUTHORS=Geen auteurs opgegeven +INFO_LABEL_ON_DETAILS=DETAILS +INFO_LABEL_ON_ERROR=FOUT +INFO_LABEL_ON_FAILURE=MISLUKT +INFO_LABEL_ON_SUCCESS=SUCCESVOL +INFO_LABEL_UNNAMED_TASK=Naamloze taak +INFO_PARSER_ALL_RIGHTS_RESERVED=Alle rechten voorbehouden +INFO_PARSER_DRYRUN_MODE_DESCRIPTION=Controleer alle onderdelen van een opdracht, maar voer niets uit +INFO_PARSER_HELP_DESCRIPTION=toon het hulpbericht +INFO_PARSER_LANGUAGE_DESCRIPTION=stel de applicatietaal in +INFO_PARSER_LOG_DESCRIPTION=genereer een loguitvoer +INFO_PARSER_LOOPS_DESCRIPTION=stel het maximumaantal herhalingen in +INFO_PARSER_NOTES=Deze applicatie gebruikt de volgende libraries en hun respectievelijke licenties: CAL10N: MIT, Commons CLI: Apache 2.0, Commons Collections: Apache 2.0, Commons IO: Apache 2.0, Commons Lang: Apache 2.0, MVEL: Apache 2.0, Logback: dubbele licentie met EPL 1.0 en LGPL 2.1, Simple framework: Apache 2.0, SLF4J: MIT, SnakeYAML: Apache 2.0, Velocity: Apache 2.0, and ZT-Exec: Apache 2.0. Als laatste is arara zelf uitgebracht onder de New BSD licentie. +INFO_PARSER_ONLY_HEADER=lees directives alleen in de bestandsheader +INFO_PARSER_PREAMBLE_DESCRIPTION=stel de preamble in op basis van het configuratiebestand +INFO_PARSER_SILENT_MODE_DESCRIPTION=dempt de opdrachtuitvoer +INFO_PARSER_TIMEOUT_DESCRIPTION=stel de maximale uitvoeringsduur in (in milliseconden) +INFO_PARSER_VERBOSE_MODE_DESCRIPTION=toon de opdrachtuitvoer +INFO_PARSER_VERSION_DESCRIPTION=toon de applicatieversie +LOG_INFO_BEGIN_BUFFER=OPEN UITVOER +LOG_INFO_DIRECTIVES_BLOCK=DIRECTIVES +LOG_INFO_END_BUFFER=SLUIT UITVOER +LOG_INFO_INTERPRET_RULE=Ik ben klaar om regel ''{0}'' te verwerken. +LOG_INFO_INTERPRET_TASK=Ik ben klaar om taak ''{0}'' uit regel ''{1}'' te verwerken. +LOG_INFO_POTENTIAL_DIRECTIVE_FOUND=Ik heb een mogelijke directive gevonden: {0} +LOG_INFO_POTENTIAL_PATTERN_FOUND=Ik heb een mogelijk patroon gevonden in regel {0}: {1} +LOG_INFO_RULE_LOCATION=Regellocatie: ''{0}'' +LOG_INFO_SYSTEM_COMMAND=Systeemopdracht: {0} +LOG_INFO_TASK_RESULT=Taakresultaat: +LOG_INFO_VALIDATED_DIRECTIVES=Alle directives zijn gevalideerd, we kunnen beginnen. +LOG_INFO_WELCOME_MESSAGE=Welkom bij arara {0} (revisie {1})! diff --git a/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages_pt_BR.properties b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages_pt_BR.properties new file mode 100644 index 00000000000..272a2f3ce9b --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/main/resources/com/github/cereda/arara/localization/messages_pt_BR.properties @@ -0,0 +1,149 @@ +# Arara, the cool TeX automation tool +# Copyright (c) 2012 -- 2018, Paulo Roberto Massa Cereda +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the project's author nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY +# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# --------------------------------------------------------------------- +# Language: Brazilian Portuguese +# Translators: Paulo Roberto Massa Cereda +# --------------------------------------------------------------------- + +ERROR_BASENAME_NOT_A_FILE=O método ''basename'' requer um arquivo, não um diretório. Observe que ''{0}'' não parece ser um arquivo. Se você precisa realizar alguma tarefa em um diretório, experimente os métodos disponíveis na API Java. +ERROR_CALCULATEHASH_IO_EXCEPTION=Por alguma razão, eu não pude calcular o hash. Não tenho ideia porque não deu certo. Talvez o arquivo tenha sido movido ou removido antes ou durante a operação de hash. Ou talvez eu não tenha as permissões corretas para leitura do arquivo. +ERROR_CHECKBOOLEAN_NOT_VALID_BOOLEAN=Observe que ''{0}'' não é um valor lógico. Isso é fácil de resolver. Certifique-se de usar uma palavra válida que represente valores lógicos (''yes'' e ''no'', ''true'' e ''false'', ''1'' e ''0'', e ''on'' e ''off''). +ERROR_CHECKOS_INVALID_OPERATING_SYSTEM=Não consegui descobrir qual é o seu sistema operacional. O valor ''{0}'' não parece ser uma entrada válida de sistema operacional na minha lista (Eu posso também estar errado, é claro). Por favor, corrija o valor e tente novamente. +ERROR_CHECKREGEX_IO_EXCEPTION=Não consegui ler o conteúdo do arquivo ''{0}'', houve um erro de entrada e saída. Não tenho ideia porque não deu certo. Talvez o arquivo tenha sido movido ou removido antes ou durante a operação de leitura. Ou talvez eu não tenha as permissões corretas para leitura do arquivo. +ERROR_CONFIGURATION_FILETYPE_MISSING_EXTENSION=Uma de suas entradas na lista de 'filetypes' no arquivo de configuração não tem a chave 'extension'. Infelizmente, eu não posso definir um novo tipo de arquivo se a extensão correspondente não é informada. Isso é fácil de resolver: adicione uma nova extensão e tente novamente. +ERROR_CONFIGURATION_GENERIC_ERROR=Não consegui analisar o arquivo de configuração, alguma coisa de errado aconteceu. Esta parte é complicada, pois envolve aspectos do formato de serialização de dados subjacente. Eu farei o possível para te ajudar da melhor forma que puder. +ERROR_CONFIGURATION_INVALID_YAML=Não consegui analisar o arquivo de configuração, alguma coisa de errado aconteceu. Aparentemente, o arquivo YAML especificado é inválido. Eu farei o possível para te ajudar da melhor forma que puder. +ERROR_CONFIGURATION_LOOPS_INVALID_RANGE=O valor definido na chave 'loops' no arquivo de configuração, que define o número máximo de iterações, possui um intervalo inválido. Por favor, certifique-se de especificar um valor inteiro positivo. +ERROR_DISCOVERFILE_FILE_NOT_FOUND=Não consegui encontrar o arquivo especificado ''{0}'' {1}. Por favor, certifique-se de que o arquivo existe e que possui uma extensão válida. +ERROR_EVALUATE_COMPILATION_FAILED=Por alguma razão, eu não consegui compilar a expressão condicional especificada. Esta parte é complicada, pois envolve aspectos da linguagem de expressão subjacente. Eu farei o possível para te ajudar da melhor forma que puder. +ERROR_EVALUATE_NOT_BOOLEAN_VALUE=A avaliação da expressão condicional deveria retornar um valor lógico como resultado. Isso é fácil de resolver. Apenas certifique-se de que a avaliação da expressão condicional retorne um valor lógico no final. +ERROR_EXTRACTOR_IO_ERROR=Ocorreu um erro de entrada e saída enquanto eu tentava extrair as diretivas. Não tenho ideia porque não deu certo. Talvez o arquivo tenha sido movido ou removido antes ou durante a operação de extração. Ou talvez eu não tenha as permissões corretas para leitura do arquivo. +ERROR_FILETYPE_NOT_A_FILE=O método ''filetype'' requer um arquivo, não um diretório. Observe que ''{0}'' não parece ser um arquivo. Se você precisa realizar alguma tarefa em um diretório, experimente os métodos disponíveis na API Java. +ERROR_FILETYPE_UNKNOWN_EXTENSION=Não consegui reconhecer ''{0}'' como uma extensão padrão. Se você quiser definir um novo tipo de arquivo, certifique-se de especificar a extensão e o padrão. Estas são as extensões definidas por padrão: {1} +ERROR_GETAPPLICATIONPATH_ENCODING_EXCEPTION=Houve um problema de codificação enquanto eu tentava obter o caminho da aplicação. Não há muito o que eu possa fazer sobre isso. +ERROR_GETCANONICALFILE_IO_EXCEPTION=Não consegui obter o arquivo canônico por causa de um erro de entrada e saída. Talvez o arquivo tenha sido movido ou removido antes ou durante a operação de busca. Ou talvez eu não tenha as permissões corretas. +ERROR_GETCANONICALPATH_IO_EXCEPTION=Não consegui obter o caminho canônico por causa de um erro de entrada e saída. Talvez o arquivo tenha sido movido ou removido antes ou durante a operação de busca. Ou talvez eu não tenha as permissões corretas. +ERROR_GETPARENTCANONICALPATH_IO_EXCEPTION=Não consegui obter o caminho canônico ascendente por causa de um erro de entrada e saída. Talvez o arquivo tenha sido movido ou removido antes ou durante a operação de busca. Ou talvez eu não tenha as permissões corretas. +ERROR_INTERPRETER_ARGUMENT_IS_REQUIRED=Parece que o argumento ''{0}'' está marcado como obrigatório na regra, mas eu não consegui encontrá-lo nos parâmetros da diretiva correspondente. Por favor, certifique-se de adicioná-lo como parâmetro em sua diretiva e tente novamente. +ERROR_INTERPRETER_COMMAND_RUNTIME_ERROR=Não consegui avaliar um dos comandos disponibilizados. Esta parte é complicada, pois envolve aspectos da linguagem de expressão subjacente. Eu farei o possível para te ajudar da melhor forma que puder. +ERROR_INTERPRETER_DEFAULT_VALUE_RUNTIME_ERROR=Não consegui avaliar a expressão associada ao valor padrão de um dos argumentos. Esta parte é complicada, pois envolve aspectos da linguagem de expressão subjacente. Eu farei o possível para te ajudar da melhor forma que puder. +ERROR_INTERPRETER_EXIT_RUNTIME_ERROR=Não consegui avaliar a expressão associada ao código de saída de um dos comandos disponibilizados. Esta parte é complicada, pois envolve aspectos da linguagem de expressão subjacente. Eu farei o possível para te ajudar da melhor forma que puder. +ERROR_INTERPRETER_FLAG_RUNTIME_EXCEPTION=Não consegui avaliar a expressão associada à presença de um dos argumentos. Esta parte é complicada, pois envolve aspectos da linguagem de expressão subjacente. Eu farei o possível para te ajudar da melhor forma que puder. +ERROR_INTERPRETER_NULL_COMMAND=Sinto muito, mas, aparentemente, um dos comandos disponibilizados retornou um valor nulo. Por favor, certifique-se de que o comando é válido e tente novamente. +ERROR_INTERPRETER_RULE_NOT_FOUND=Não consegui encontrar uma regra chamada ''{0}'' nos caminhos de regras especificados. Talvez uma palavra digitada incorretamente? Eu estava procurando por um arquivo chamado ''{0}.yaml'' nos seguintes caminhos, em ordem de prioridade: {1} +ERROR_INTERPRETER_UNKNOWN_KEYS=Encontrei as seguintes chaves desconhecidas na diretiva: {0}. Isso é fácil de resolver, apenas remova essas chaves do seu mapa. +ERROR_INTERPRETER_WRONG_EXIT_CLOSURE_RETURN=A expressão 'exit' referente ao código de saída deve sempre retornar um valor lógico (mesmo se não há computação propriamente dita). Isso é fácil de resolver: apenas certifique-se de corrigir o tipo de retorno e tente novamente. +ERROR_LANGUAGE_INVALID_CODE=O código de idioma especificado é inválido. No momento, eu sei falar os seguintes idiomas: {0} +ERROR_LOAD_COULD_NOT_LOAD_XML=Não consegui carregar o banco de dados XML chamado ''{0}''. Não tenho ideia porque não deu certo. Talvez o arquivo tenha sido movido ou removido antes ou durante a operação de leitura. Ou talvez eu não tenha as permissões corretas para leitura do arquivo. A propósito, certifique-se de que o arquivo XML esteja correto. +ERROR_PARSER_INVALID_PREAMBLE=Sinto muito, mas o preâmbulo ''{0}'' não foi encontrado. Por favor, certifique-se de que esta chave existe no arquivo de configuração. +ERROR_PARSER_LOOPS_INVALID_RANGE=O valor definido na linha de comando para o número máximo de iterações possui um intervalo inválido. Por favor, certifique-se de especificar um valor inteiro positivo. +ERROR_PARSER_LOOPS_NAN=A opção referente ao número máximo de iterações requer, é claro, um número como argumento. Isso é fácil de resolver. Apenas certifique-se de especificar um valor inteiro positivo. +ERROR_PARSER_TIMEOUT_INVALID_RANGE=O valor definido na linha de comando para o timeout de execução possui um intervalo inválido. Por favor, certifique-se de especificar um valor inteiro positivo. +ERROR_PARSER_TIMEOUT_NAN=A opção referente ao timeout de execução requer um número como argumento. Isso é fácil de resolver. Apenas certifique-se de especificar um valor inteiro positivo. +ERROR_PARSERULE_GENERIC_ERROR=Não consegui analisar a regra, alguma coisa de errado aconteceu. Esta parte é complicada, pois envolve aspectos do formato de serialização de dados subjacente. Eu farei o possível para te ajudar da melhor forma que puder. +ERROR_PARSERULE_INVALID_YAML=Não consegui analisar a regra, alguma coisa de errado aconteceu. Aparentemente, o arquivo YAML especificado é inválido. Eu farei o possível para te ajudar da melhor forma que puder. +ERROR_REPLICATELIST_MISSING_FORMAT_ARGUMENTS_EXCEPTION=Não consegui replicar a lista por causa de um formato de argumento faltante. Meu palpite é que existem menos (ou mais) parâmetros do que o esperado. Certifique-se de corrigir o número de parâmetros e tente novamente. +ERROR_RULE_IDENTIFIER_AND_PATH=Encontrei um erro na regra ''{0}'' localizada em ''{1}''. +ERROR_RUN_GENERIC_EXCEPTION=Não consegui executar o comando de sistema disponibilizado, alguma coisa de errado aconteceu. Esta parte é complicada, pois envolve aspectos da linguagem de expressão subjacente. Eu farei o possível para te ajudar da melhor forma que puder. +ERROR_RUN_INTERRUPTED_EXCEPTION=A execução do comando de sistema disponibilizado foi inesperadamente interrompida. Talvez tenha ocorrido uma interrupção externa que forçou o comando a encerrar abruptamente. +ERROR_RUN_INVALID_EXIT_VALUE_EXCEPTION=A execução do comando de sistema retornou um código de saída inválido. +ERROR_RUN_IO_EXCEPTION=A execução do comando de sistema falhou por causa de um erro de entrada e saída. Você tem certeza de que o comando de sistema especificado existe no seu caminho? Pode ser uma boa ideia verificar o caminho do sistema e confirmar se o comando realmente está disponível. +ERROR_RUN_TIMEOUT_EXCEPTION=A execução do comando de sistema atingiu o timeout especificado e foi abortada. Se o tempo foi muito curto, certifique-se de especificar um valor maior. +ERROR_RUN_TIMEOUT_INVALID_RANGE=O valor de timeout provavelmente está faltando (apesar de estar habilitado). Isso é fácil de resolver. Por favor, certifique-se de especificar um valor positivo inteiro. +ERROR_SAVE_COULD_NOT_SAVE_XML=Não consegui salvar o banco de dados XML chamado ''{0}''. Não tenho ideia porque não deu certo. Talvez eu não tenha as permissões corretas para escrever o arquivo XML no disco. +ERROR_SESSION_OBTAIN_UNKNOWN_KEY=O método ''obtain'' encontrou a chave desconhecida ''{0}'' no escopo de sessão. Não posso obter um valor que não existe na sessão. Por favor, especifique uma chave válida e tente novamente. +ERROR_SESSION_REMOVE_UNKNOWN_KEY=O método ''remove'' encontrou a chave desconhecida ''{0}'' no escopo de sessão. Não posso remover um valor que não existe na sessão. Por favor, especifique uma chave válida e tente novamente. +ERROR_TRIGGER_ACTION_NOT_FOUND=A ação de gatilho ''{0}'' não foi encontrada. Certifique-se de consultar a lista de gatilhos disponíveis e tente novamente. +ERROR_TRIGGER_CALL_EXCEPTION=A ação de gatilho ''{0}'' não pôde ser executada. Alguma coisa de errado aconteceu. +ERROR_VALIDATE_EMPTY_FILES_LIST=Li uma diretiva {0} e descobri que a lista ''files'' especificada está vazia. Isso é fácil de resolver: certifique-se de que a lista possua, pelo menos, um elemento e tente novamente. +ERROR_VALIDATE_FILE_IS_RESERVED=Li uma diretiva {0} e descobri que a chave ''file'' foi utilizada. Esta chave é reservada, portanto você não pode utilizá-la! Mas não se preocupe, isso é fácil de resolver. Apenas substitua esse nome por outro. +ERROR_VALIDATE_FILES_IS_NOT_A_LIST=Li uma diretiva {0} e descobri que ''files'' requer uma lista. Por favor, certifique-se de corrigir o tipo para uma lista adequada e tente novamente. +ERROR_VALIDATE_INVALID_DIRECTIVE_FORMAT=Encontrei uma diretiva inválida {0} no arquivo especificado. Certifique-se de corrigir a diretiva e tente novamente. +ERROR_VALIDATE_NO_DIRECTIVES_FOUND=Parece que o arquivo especificado não possui diretivas! Certifique-se de incluir, pelo menos, uma diretiva e tente novamente. +ERROR_VALIDATE_ORPHAN_LINEBREAK=Aparentemente, existe uma quebra de linha de uma diretiva órfã na linha {0}. Não posso continuar. Por favor, corrija a diretiva e tente novamente. +ERROR_VALIDATE_REFERENCE_IS_RESERVED=Li uma diretiva {0} e descobri que a chave ''reference'' foi utilizada. Esta chave é reservada, portanto você não pode utilizá-la! Mas não se preocupe, isso é fácil de resolver. Apenas substitua esse nome por outro. +ERROR_VALIDATE_YAML_EXCEPTION=Ocorreu um problema com o mapa YAML especificado em uma diretiva {0}. Esta parte é complicada, pois envolve aspectos do formato de serialização de dados subjacente. +ERROR_VALIDATEBODY_ARGUMENT_ID_IS_RESERVED=O identificador de argumento ''{0}'' está reservado, portanto você não pode utilizá-lo. Isso é fácil de resolver. Apenas substitua esse nome por outro. +ERROR_VALIDATEBODY_ARGUMENTS_LIST=Não consegui encontrar a lista de argumentos. Preciso dessa lista, mesmo que ela esteja vazia. Certifique-se de corrigir esse erro e tente novamente. +ERROR_VALIDATEBODY_DUPLICATE_ARGUMENT_IDENTIFIERS=Aparentemente, você possui identificadores de argumentos duplicados em sua regra. Certifique-se de corrigir esse erro e tente novamente. +ERROR_VALIDATEBODY_MISSING_KEYS=Ao definir um escopo de argumento de regra, ao menos a chave 'flag' ou 'default' deve ser utilizada. Por favor, certifique-se de utilizar, pelo menos, uma delas. +ERROR_VALIDATEBODY_NULL_ARGUMENT_ID=Descobri que um dos argumentos não possui identificador associado. Por favor, certifique-se de adicionar um identificador válido ao argumento e tente novamente. +ERROR_VALIDATEBODY_NULL_COMMAND=Encontrei um comando nulo na regra especificada. Isso é fácil de resolver. Certifique-se de adicionar um comando válido na regra. +ERROR_VALIDATEBODY_NULL_COMMANDS_LIST=Preciso de uma lista de comandos. Certifique-se de corrigir esse erro e tente novamente. +ERROR_VALIDATEHEADER_NULL_ID=A regra especificada não possui identificador. É uma informação crucial, portanto, certifique-se de corrigir esse erro e tente novamente. Lembre-se de que o identificador deve possuir o mesmo nome do arquivo da regra (sem a extensão, é claro). +ERROR_VALIDATEHEADER_NULL_NAME=A regra especificada não possui nome. Isso é fácil de resolver. Certifique-se de adicionar um nome válido e tente novamente. +ERROR_VALIDATEHEADER_WRONG_IDENTIFIER=A regra possui um identificador incorreto. Eu estava esperando ''{0}'', mas encontrei ''{1}''. Isso é fácil de resolver: apenas substitua o identificador incorreto pelo valor correto. +ERROR_VELOCITY_FILE_NOT_FOUND=O motor de modelo não conseguiu encontrar o arquivo de entrada especificado. Certifique-se de que a localização está correta e tente novamente. +ERROR_VELOCITY_PARSE_EXCEPTION=Ocorreu um erro de análise no arquivo de entrada especificado. Certifique-se de que o arquivo esteja aderente ao formato Velocity Template Language (VTL) e tente novamente. +ERROR_VELOCITY_METHOD_INVOCATION_EXCEPTION=Ocorreu um erro de invocação de método no arquivo de entrada especificado. Certifique-se de que o arquivo esteja aderente ao formato Velocity Template Language (VTL) e tente novamente. +ERROR_VELOCITY_IO_EXCEPTION=O motor de modelo não conseguiu escrever no arquivo de saída. Certifique-se de que o caminho possui as permissões corretas e tente novamente. +INFO_DISPLAY_EXCEPTION_MORE_DETAILS=Detalhes adicionais estão disponíveis para esta exceção: +INFO_DISPLAY_EXECUTION_TIME=Total: {0} segundos +INFO_DISPLAY_FILE_INFORMATION=Processando ''{0}'' (tamanho: {1}, última modificação: {2}), por favor, aguarde. +INFO_INTERPRETER_DRYRUN_MODE_SYSTEM_COMMAND=A executar: {0} +INFO_INTERPRETER_DRYRUN_MODE_TRIGGER_MODE=Apesar da execução em modo dry-run, esta entrada é sempre processada por tratar-se de um gatilho. Observe que os efeitos de um gatilho podem influenciar a execução corrente. +INFO_INTERPRETER_VERBOSE_MODE_TRIGGER_MODE=Esta entrada é um gatilho originado a partir do escopo da regra. Observe que os efeitos de um gatilho podem influenciar a execução corrente. +INFO_LABEL_AUTHOR=Autor: +INFO_LABEL_AUTHORS=Autores: +INFO_LABEL_CONDITIONAL=Expressão condicional: +INFO_LABEL_NO_AUTHORS=Nenhum autor informado +INFO_LABEL_ON_DETAILS=DETALHES +INFO_LABEL_ON_ERROR=ERRO +INFO_LABEL_ON_FAILURE=FRACASSO +INFO_LABEL_ON_SUCCESS=SUCESSO +INFO_LABEL_UNNAMED_TASK=Tarefa sem nome +INFO_PARSER_ALL_RIGHTS_RESERVED=Todos os direitos reservados +INFO_PARSER_DRYRUN_MODE_DESCRIPTION=passa por todas as preparações para executar um comando, mas sem chamadas reais +INFO_PARSER_HELP_DESCRIPTION=imprime a mensagem de ajuda +INFO_PARSER_LANGUAGE_DESCRIPTION=define o idioma da aplicação +INFO_PARSER_LOG_DESCRIPTION=gera uma saída para registro +INFO_PARSER_LOOPS_DESCRIPTION=define o número máximo de iterações +INFO_PARSER_NOTES=Esta ferramenta utiliza as seguintes bibliotecas e suas respectivas licenças: CAL10N: MIT, Commons CLI: Apache 2.0, Commons Collections: Apache 2.0, Commons IO: Apache 2.0, Commons Lang: Apache 2.0, MVEL: Apache 2.0, Logback: licença dupla com EPL 1.0 e LGPL 2.1, Simple framework: Apache 2.0, SLF4J: MIT, SnakeYAML: Apache 2.0, Velocity: Apache 2.0, and ZT-Exec: Apache 2.0. Por fim, mas não menos importante, arara é distribuída sob a licença New BSD. +INFO_PARSER_ONLY_HEADER=extrai diretivas apenas no cabeçalho do arquivo +INFO_PARSER_PREAMBLE_DESCRIPTION=define o preâmbulo de arquivo de acordo com o arquivo de configuração +INFO_PARSER_SILENT_MODE_DESCRIPTION=oculta a saída do comando +INFO_PARSER_TIMEOUT_DESCRIPTION=define o timeout de execução (em milissegundos) +INFO_PARSER_VERBOSE_MODE_DESCRIPTION=imprime a saída do comando +INFO_PARSER_VERSION_DESCRIPTION=imprime a versão da aplicação +LOG_INFO_BEGIN_BUFFER=INÍCIO DO BUFFER DE SAÍDA +LOG_INFO_DIRECTIVES_BLOCK=DIRETIVAS +LOG_INFO_END_BUFFER=FINAL DO BUFFER DE SAÍDA +LOG_INFO_INTERPRET_RULE=Estou pronto para interpretar a regra ''{0}''. +LOG_INFO_INTERPRET_TASK=Estou pronto para interpretar a tarefa ''{0}'' da regra ''{1}''. +LOG_INFO_POTENTIAL_DIRECTIVE_FOUND=Encontrei uma diretiva em potencial: {0} +LOG_INFO_POTENTIAL_PATTERN_FOUND=Encontrei um padrão em potencial na linha {0}: {1} +LOG_INFO_RULE_LOCATION=Localização da regra: ''{0}'' +LOG_INFO_SYSTEM_COMMAND=Comando de sistema: {0} +LOG_INFO_TASK_RESULT=Resultado da tarefa: +LOG_INFO_VALIDATED_DIRECTIVES=Todas as diretivas foram validadas. Estamos prontos para continuar. +LOG_INFO_WELCOME_MESSAGE=Olá, eu sou o arara {0} (revisão {1})! diff --git a/Master/texmf-dist/source/support/arara/src/test/java/com/github/arara/AraraTest.java b/Master/texmf-dist/source/support/arara/src/test/java/com/github/arara/AraraTest.java deleted file mode 100644 index 36a9f9b3208..00000000000 --- a/Master/texmf-dist/source/support/arara/src/test/java/com/github/arara/AraraTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * \cond LICENSE - * Arara -- the cool TeX automation tool - * Copyright (c) 2012, Paulo Roberto Massa Cereda - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the project's author nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY - * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * \endcond - * - * AraraTest: This class checks if the localization files are in place in order - * to Maven correctly build the application. - */ -// package definition -package com.github.arara; - -// needed imports -import java.net.URL; -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * Checks if the localization files are in place in order to Maven correctly - * build the application. - * - * @author Paulo Roberto Massa Cereda - * @version 3.0a - * @since 3.0 - */ -public class AraraTest extends TestCase { - - /** - * Create the test case. - * - * @param testName The name of the test case. - */ - public AraraTest(String testName) { - super(testName); - } - - /** - * @return The suite of tests being tested. - */ - public static Test suite() { - return new TestSuite(AraraTest.class); - } - - /** - * Checks if the localization resource exists. - */ - public void testLocalizationFile() { - URL url = Arara.class.getResource("/com/github/arara/localization/Messages.properties"); - if (url == null) { - fail("arara requires at least the default localization file Messages.properties " + - "located at the translations/ directory in the project repository. Rename " + - "Messages.input to Messages.properties and copy the new file to the src/ " + - "directory, under com/github/arara/localization, and build arara again."); - - } - } -} diff --git a/Master/texmf-dist/source/support/arara/src/test/java/com/github/cereda/arara/tests/LocalizationTest.java b/Master/texmf-dist/source/support/arara/src/test/java/com/github/cereda/arara/tests/LocalizationTest.java new file mode 100644 index 00000000000..ab5978265d5 --- /dev/null +++ b/Master/texmf-dist/source/support/arara/src/test/java/com/github/cereda/arara/tests/LocalizationTest.java @@ -0,0 +1,115 @@ +/** + * Arara, the cool TeX automation tool + * Copyright (c) 2012, Paulo Roberto Massa Cereda + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the project's author nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.github.cereda.arara.tests; + +import ch.qos.cal10n.verifier.Cal10nError; +import ch.qos.cal10n.verifier.IMessageKeyVerifier; +import ch.qos.cal10n.verifier.MessageKeyVerifier; +import com.github.cereda.arara.model.Messages; +import java.util.List; +import java.util.Locale; +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +/** + * Tests the localizated messages, checking if all keys are set. + * @author Paulo Roberto Massa Cereda + * @version 4.0 + * @since 4.0 + */ +public class LocalizationTest { + + /** + * Helper method, checks the provided locale. + * @param locale The locale. + * @return The size of the error list. + */ + private int check(Locale locale) { + IMessageKeyVerifier verifier = new MessageKeyVerifier(Messages.class); + List<Cal10nError> errors = verifier.verify(locale); + for(Cal10nError error : errors) { + System.err.println(error); + } + return errors.size(); + } + + /** + * Verifies the English localization (provided by Paulo). + */ + @Test + public void verifyEnglish() { + assertEquals(0, check(new Locale("en"))); + } + + /** + * Verifies the German localization (provided by Marco). + */ + @Test + public void verifyGerman() { + assertEquals(0, check(new Locale("de"))); + } + + /** + * Verifies the Broad Norfolk localization (provided by Nicola). + */ + @Test + public void verifyBroadNorfolk() { + assertEquals(0, check(new Locale("en", "QN"))); + } + + /** + * Verifies the Dutch localization (provided by Marijn). + */ + @Test + public void verifyDutch() { + assertEquals(0, check(new Locale("nl"))); + } + + /** + * Verifies the Brazilian Portuguese localization (provided by Paulo). + */ + @Test + public void verifyBrazilianPortuguese() { + assertEquals(0, check(new Locale("pt", "BR"))); + } + + /** + * Verifies the Italian localization (provided by Enrico). + */ + @Test + public void verifyItalian() { + assertEquals(0, check(new Locale("it"))); + } + +} |