From 9a2df340a78c10d092599cf5b0222eea5ecb67f2 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 15 Jan 2012 13:54:28 +0100 Subject: [PATCH] project wide configuration file now with suffix '.nimrod.cfg' --- compiler/nimconf.nim | 5 ++++- doc/nimrodc.txt | 7 ++++--- lib/{nimrtl.cfg => nimrtl.nimrod.cfg} | 0 tools/{nimgrep.cfg => nimgrep.nimrod.cfg} | 0 4 files changed, 8 insertions(+), 4 deletions(-) rename lib/{nimrtl.cfg => nimrtl.nimrod.cfg} (100%) rename tools/{nimgrep.cfg => nimgrep.nimrod.cfg} (100%) diff --git a/compiler/nimconf.nim b/compiler/nimconf.nim index 971ce6127f..c3592e03ae 100755 --- a/compiler/nimconf.nim +++ b/compiler/nimconf.nim @@ -241,4 +241,7 @@ proc LoadConfigs*(cfg: string) = if conffile != pd / cfg and existsFile(conffile): readConfigFile(conffile) rawMessage(warnConfigDeprecated, conffile) - + + # new project wide config file: + readConfigFile(changeFileExt(gProjectFull, "nimrod.cfg")) + diff --git a/doc/nimrodc.txt b/doc/nimrodc.txt index 53efb6a223..fd7d9d2263 100755 --- a/doc/nimrodc.txt +++ b/doc/nimrodc.txt @@ -43,14 +43,15 @@ Configuration files **Note:** The *project file name* is the name of the ``.nim`` file that is passed as a command line argument to the compiler. -All configuration files have the name ``nimrod.cfg``. The ``nimrod`` -executable processes configuration files in the following directories -(in this order; later files overwrite previous settings): + +The ``nimrod`` executable processes configuration files in the following +directories (in this order; later files overwrite previous settings): 1) ``$nimrod/config/nimrod.cfg``, ``/etc/nimrod.cfg`` (UNIX) or ``%NIMROD%/config/nimrod.cfg`` (Windows). This file can be skipped with the ``--skipCfg`` command line option. 2) ``/home/$user/.config/nimrod.cfg`` (UNIX) or ``%APPDATA%/nimrod.cfg`` (Windows). This file can be skipped with the ``--skipUserCfg`` command line option. 3) ``$parentDir/nimrod.cfg`` where ``$parentDir`` stands for any parent directory of the project file's path. These files can be skipped with the ``--skipParentCfg`` command line option. 4) ``$projectDir/nimrod.cfg`` where ``$projectDir`` stands for the project file's path. This file can be skipped with the ``--skipProjCfg`` command line option. +5) A project can also have a project specific configuration file named ``$project.nimrod.cfg`` that resides in the same directory as ``$project.nim``. This file can be skipped with the ``--skipProjCfg`` command line option. Command line settings have priority over configuration file settings. diff --git a/lib/nimrtl.cfg b/lib/nimrtl.nimrod.cfg similarity index 100% rename from lib/nimrtl.cfg rename to lib/nimrtl.nimrod.cfg diff --git a/tools/nimgrep.cfg b/tools/nimgrep.nimrod.cfg similarity index 100% rename from tools/nimgrep.cfg rename to tools/nimgrep.nimrod.cfg