Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nightroman/Invoke-Build.template
Invoke-Build script template
https://github.com/nightroman/Invoke-Build.template
Last synced: 3 months ago
JSON representation
Invoke-Build script template
- Host: GitHub
- URL: https://github.com/nightroman/Invoke-Build.template
- Owner: nightroman
- License: apache-2.0
- Created: 2020-10-01T17:46:17.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-06T15:34:48.000Z (almost 2 years ago)
- Last Synced: 2024-08-09T22:51:29.442Z (3 months ago)
- Language: PowerShell
- Homepage:
- Size: 26.4 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - nightroman/Invoke-Build.template - Invoke-Build script template (PowerShell)
README
# Invoke-Build.template
Build script template for [Invoke-Build](https://github.com/nightroman/Invoke-Build)
NuGet package [Invoke-Build.template](https://www.nuget.org/packages/Invoke-Build.template/)
## Install
Install the template by this command:
dotnet new install Invoke-Build.template
and uninstall by:
dotnet new uninstall Invoke-Build.template
## Create
Change to the target directory and invoke
dotnet new ib [options]
in order to create `.build.ps1` in this directory.
## Samples
Generated build script samples:
- [Script1](https://github.com/nightroman/Invoke-Build.template/blob/main/samples/Script1/Script1.build.ps1) by `dotnet new ib`
- [Script2](https://github.com/nightroman/Invoke-Build.template/blob/main/samples/Script2/Script2.build.ps1) by `dotnet new ib --restore`
- [Script3](https://github.com/nightroman/Invoke-Build.template/blob/main/samples/Script3/Script3.build.ps1) by `dotnet new ib --bootstrap *`
- [Script4](https://github.com/nightroman/Invoke-Build.template/blob/main/samples/Script4/Script4.build.ps1) by `dotnet new ib --bootstrap 5.7.3 --scope AllUsers`## Options
Use the following command for the list of options:
```
dotnet new ib --help
```#### Option `-b|--bootstrap *|version`
It creates the standalone script with automatic installation of `InvokeBuild` and specifies the required module version.
The script may be invoked on its own directly, i.e. not by `Invoke-Build` command.
In this case, the script checks for the `InvokeBuild` module
and installs its required version if the module is missing.The version value `*` stands for the command `Invoke-Build`, i.e. any installed module or script.
If the command is missing then the latest module version is installed.Otherwise, the version value specifies the required module version.
This version is hardcoded (pinned) in the generated script.
Change it manually later in order to upgrade.If `bootstrap` is omitted then the generated script is supposed to be invoked by `Invoke-Build` as usual.
This scenario requires installed `InvokeBuild` module or `Invoke-Build.ps1` script.#### Option `-s|--scope CurrentUser|AllUsers`
This option is used together with `-b|--bootstrap`.
It tells where the `InvokeBuild` module should be installed if the required version is missing.
Available values are:- `CurrentUser` (default) Installs in a location for the current user.
- `AllUsers` (run elevated) Installs in a location for all users.#### Switch `-r|--restore`
This switch tells to add the task `restore`, to restore packages.
This task is supposed to be called explicitly.
The task `build` runs without restoring.