Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 3 additions & 3 deletions docs/NIC-Syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Each NIC template <span class="required">requires</span> a control file. The con
- <span class="optional">optional</span>
- 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 <code class="highlighter-rouge">~/.nicrc</code>.
- The user is given a chance to override the prompt variable with their <code class="highlighter-rouge">nicrc</code>.

<code class="highlighter-rouge"><strong>constrain</strong> "<span class="required">path</span>" to <span class="required">constraint</span></code>

Expand All @@ -62,7 +62,7 @@ Each NIC template <span class="required">requires</span> 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 <code class="highlighter-rouge">NIC/control</code>
Expand Down Expand Up @@ -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`.

- <code class="highlighter-rouge">NIC->setConstraint(<span class="required">$constraint</span>)</code>

Expand Down
9 changes: 7 additions & 2 deletions docs/NIC.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 it is a number.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Know this is unrelated to your changes, but the tense here bugs me:

Suggested change
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 it is a number.
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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.


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`.
Expand Down
2 changes: 1 addition & 1 deletion docs/Parallel-Building.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
2 changes: 1 addition & 1 deletion docs/Upgrading-from-legacy-Theos.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down