A Command Line Interface for the Bridge.NET compiler.
bridge [commands] [options]
bridge [options] (<name>|<path>|<list>)
bridge [-h|--help]
The following steps outline the commands for creating a new C# project using the Bridge CLI, then opening the project in Visual Studio Code, and then running your app in a web browser. Here's what we'll do:
- Create a new folder called Demo1 (rename to whatever you want)
- Move the command prompt into the folder
- Create a new Bridge project using the default project template
- Open the project in Visual Studio Code
- Build (compile) the project
- Run the app in your default web browser
Bridge CLI and Visual Studio Code must have already been installed for this sample to work. We use Visual Studio Code in this sample, but you can substitue for your editor of choice.
md Demo1 // Create a new folder
cd Demo1 // Move into the folder
bridge new // Create a new project
code . // Open in Visual Studio Code
bridge build // Build the project, or
bridge run // Build and Run the index.html
mkdir Demo1 // Create a new folder
cd Demo1 // Move into the folder
bridge new // Create a new project
code . // Open in Visual Studio Code
bridge build // Build the project, or
bridge run // Build and Run the index.html
After successfully building your project, you should see a new /dist folder in your project root. These are the Bridge generated files, including your index.html file which can be opened in a browser, or just use the bridge run
command from the Windows Command line or Mac Terminal.
PRO TIP: If you're using Visual Studio Code, after opening the project you can use Ctrl + Shift + B to build your project without leaving VS Code.
Command | Description |
---|---|
new | Initialize a valid Bridge C# Class Library project. |
new <template> | Initialize a new project based on the named Template. Default is classlib. |
build | Builds the Bridge project. |
run | Compiles and immediately runs the index.html file. |
add package <name> | Add a package from NuGet.org to the project. |
remove package <name> | Removes a Nuget package from the project. |
add repo "<path>" | Add a package source location. |
restore | Restores all NuGet packages. |
Option | Description |
---|---|
-h or --help | Show help. |
-v or --version | Show version. |
Option | Description |
---|---|
-c --configuration <name> | Configuration name (Debug/Release etc). |
-D --define <list> | Semicolon-delimited list of project constants. |
-f --folder <path> | Builder working directory relative to current dir. |
-h --help | Show help. |
-p --project <path> | The .csproj file location. |
-P --platform <name> | Platform name (AnyCPU etc). |
-r --rebuild | Force Assembly rebuilding. |
-R --recursive | Recursively search for .cs source files. |
-s --source <file> | Source files name/pattern [default: *.cs]. |
-S --settings <name:value> Comma-delimited list of project settings. | |
-v --version | Show version. |
--nocore | Do not extract core javascript files. |
--norecursive | Non-recursive search for .cs source files. |
--notimestamp | Do not show timestamp in log messages. |
More information on getting started with Bridge.NET at https://bridge.net/docs.