diff --git a/docs/Configuration.md b/docs/Configuration.md index b3db87e..784eaef 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -8,11 +8,14 @@ Theos, and your project(s), can be configured in a few differents ways: - At runtime via project Makefiles - At runtime by passing variables to `make` -## `.theosrc` +## Config File -Variables that are specific to your own setup (e.g., Xcode/an SDK, device IP, etc) should not be placed in your project makefile as it may hinder others from building your project. Instead, these variables should be placed in `.theosrc`, a makefile that is read and executed during an early stage of Theos’ `common.mk`. +Variables that are specific to your own setup (e.g., Xcode/an SDK, device IP, etc) should not be placed in your project makefile as it may hinder others from building your project. Instead, these variables should be placed in a user created makefile that is read and executed during an early stage of Theos’ `common.mk`. -`.theosrc` must be created by the user at `$HOME/.theosrc` or `~/.theosrc`. +The first matching file is `-include`d: +1. `$(XDG_CONFIG_HOME)/theos/rc.mk` +2. `$(HOME)/.config/theos/rc.mk` +3. `$(HOME)/.theosrc` ## Utilizing Theos' makefile rules diff --git a/docs/FAQ.md b/docs/FAQ.md index 0495396..3fa4d13 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -20,10 +20,10 @@ export THEOS=/usr/local/theos If this is undesirable, you can tell NIC to revert to symlinking `theos`: ```console -$ echo 'link_theos = "1"' >> ~/.nicrc +$ echo 'link_theos = "1"' >> ~/.config/theos/nicrc ``` -See [here](/docs/NIC.html#nicrc) for more details on `.nicrc`. +See [here](/docs/NIC.html#nicrc) for more details on `nicrc`. ## How do I use Swift in my projects? This information has moved to the [Swift](/docs/Swift.html) page. diff --git a/docs/NIC-Syntax.md b/docs/NIC-Syntax.md index 04cb066..228dc3b 100644 --- a/docs/NIC-Syntax.md +++ b/docs/NIC-Syntax.md @@ -41,7 +41,7 @@ Each NIC template requires a control file. The con - optional - Prompts the user for additional information, which will be stored in *variable*. - Optionally supports the inclusion of a default value, which the user can accept by entering nothing. -- The user is given a chance to override the prompt variable with their ~/.nicrc. +- The user is given a chance to override the prompt variable with their nicrc. constrain "path" to constraint @@ -62,7 +62,7 @@ Each NIC template requires a control file. The con - The NIC templates that ship with Theos use the `package` constraint to avoid creating unnecessary `control` files. `link_theos` -- Used in some templates to include an optional link to theos. Set/overridden by `link_theos` in the user's `~/.nicrc`. +- Used in some templates to include an optional link to theos. Set/overridden by `link_theos` in the user's `nicrc`. - The NIC templates that ship with Theos use this constraint to avoid creating unnecessary `theos/` symlinks. ### Example NIC/control @@ -130,7 +130,7 @@ The `NIC` object represents the current template. - Prompt the user for additional information, attaching the user's response to the provided NIC variable. - The default value is optional. - If *$variable* is not specified, `NIC->prompt(...)` will return the user's response, and will not store it in the template. - - The key difference between `prompt(...)` and `NIC->prompt(...)` is that the user is given a chance to override the prompt variable with their `~/.nicrc`. + - The key difference between `prompt(...)` and `NIC->prompt(...)` is that the user is given a chance to override the prompt variable with their `nicrc`. - NIC->setConstraint($constraint) diff --git a/docs/NIC.md b/docs/NIC.md index d272d53..149d95c 100644 --- a/docs/NIC.md +++ b/docs/NIC.md @@ -97,8 +97,13 @@ The templates included in this legacy templates module: * **notification_center_widget-7up**: an iOS 7 – 9 Notification Center Today widget. * **xpc_service**: a C-based [XPC](https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingXPCServices.html) service. -## .nicrc -NIC reads configuration data from `~/.nicrc`. This file uses a simple key-value format, `key = "value"`. Values must be enclosed in quotes, even if it is a number. +## nicrc +NIC configuration data can be stored in a config file to pre-fill values for templates. A simple key-value format is used: `key = "value"`. Values must be enclosed in quotes, even if they are numbers. + +The first matching file is sourced: +1. `$(XDG_CONFIG_HOME)/theos/nicrc` +2. `$(HOME)/.config/theos/nicrc` +3. `$(HOME)/.nicrc` ### Instance Metadata * **`package_prefix`** *string*. The prefix to use by default for reverse DNS package identifiers. The default is `com.yourcompany`. For example, setting `package_prefix = "ws.hbang"` and creating a new project called "Example Instance" will make the default package identifier `ws.hbang.exampleinstance`. diff --git a/docs/Parallel-Building.md b/docs/Parallel-Building.md index ba3dd1c..be0bfbf 100644 --- a/docs/Parallel-Building.md +++ b/docs/Parallel-Building.md @@ -38,5 +38,5 @@ These instructions assume you use Homebrew and have installed Theos as outlined If you’d rather not perform these steps, you can permanently ignore this notice by using the following: ```bash -echo 'THEOS_IGNORE_PARALLEL_BUILDING_NOTICE = yes' >> ~/.theosrc +echo 'THEOS_IGNORE_PARALLEL_BUILDING_NOTICE = yes' >> ~/.config/theos/rc.mk ``` diff --git a/docs/Upgrading-from-legacy-Theos.md b/docs/Upgrading-from-legacy-Theos.md index 29aa315..12bc045 100644 --- a/docs/Upgrading-from-legacy-Theos.md +++ b/docs/Upgrading-from-legacy-Theos.md @@ -27,7 +27,7 @@ Changes made since [legacy Theos](https://github.com/theos/theos/tree/legacy) ma * **Theos heavily relies on Git.** Always install Theos [as directed](/docs/Installation.html); do not download it as a ZIP. * **The `theos` symlink is no longer created by NIC in new projects.** The destination of this symlink can vary between computers, as Theos does not impose requirements on where it must be stored. The symlink is also often committed to source control (i.e., Git) unintentionally. As it was already highly recommended to set the `$THEOS` variable in your environment, we have opted to switch new makefiles to use `$THEOS` instead of the symlink. Changing this in your existing projects is recommended. Refer to [this FAQ entry](/docs/FAQ.html#wheres-the-theos-symlink). -* **Configuration related to your environment, rather than the project, should be in `~/.theosrc`.** If you set variables that are specific to your own setup, such as the location of Xcode/an SDK, device IP, etc., you should avoid placing it in your project makefile, as these types of things can vary between users. Move these to `~/.theosrc`, a makefile that is read and executed during an early stage of Theos’ `common.mk`. +* **Configuration related to your environment, rather than the project, should be in `~/.config/theos/rc.mk`.** If you set variables that are specific to your own setup, such as the location of Xcode/an SDK, device IP, etc., you should avoid placing it in your project makefile, as these types of things can vary between users. Move these to `~/.config/theos/rc.mk`, a makefile that is read and executed during an early stage of Theos’ `common.mk`. * **Built packages have been moved to a directory called `packages`.** The intent here is to reduce clutter in the root project directory and separate build output from the project source. * **The `obj` directory has been moved to inside `.theos`.** Again, this is for cleanliness. You may need to enable displaying of hidden files in your operating system/file manager to see this directory. * **The linker flag required for tweaks to run in 32-bit processes on 64-bit devices running iOS 9 is not necessary.** Theos already applies it for you.