BadScript

Bad Script Console project Subsystems

Subsystem new

Creates a new Project from a selected Template

Optional Arguments

Default Templates

Examples

Creates a new Project based on the app template in the current working directory.

bs project new -t app

Creates a new Project with name MyApp based on the app template in the current working directory.

bs project new -t app -n MyApp

Subsystem make

Runs a selected build target

Optional Arguments

Examples

Run the default target of the project in the current working directory

project make

Run the build target of the project in the current working directory

project make -t build

Project Build Settings

The Project Information gets stored in the file build-settings.json in the root of the project directory.

App Template Build Settings Example

App Info

Contains the Name and Version of the Project

"AppInfo": {
    "Name": "App",
    "Version": "0.0.0.1"
  }

Build Targets

Contains a list of all build targets that are defined for this project.

"BuildTargets": {
    "Targets": [
    	...
    ]
}

Build Target

A build target defines the way a project gets built.

{
	"Name": "build",
	"OutputFormat": "text",
	"OutputFile": "./bin/build/App.bs",
	"Include": [
		"./src/*.bs"
	],
	"SubTarget": "",
	"References": [],
	"PreEvents": [],
	"PostEvents": [],
	"PreprocessorDirectives": ""
}

Sub Targets

It is possible to specify a sub target that will get executed before the current target is running.

Preprocessor Directives

A List of Directives that will be defined in the preprocessor during execution of the build target.

"PreprocessorDirectives":
	"TARGET=\"build\" NAME=\"App\" VERSION=\"1.0.0.0\" FULLNAME=\"App@1.0.0.0\""

Reflected Properties

The Project Settings have a feature that enables writing properties that get resolved at runtime

Instead of Explicitly writing out the Output Path of the build target, the output path can be specified dynamically like so:

"OutputFile": "./bin/%Target.Name%/%AppInfo.Name%%AppInfo.Version%.%Target.Output.OutputExtension%"

During Runtime the OutputFile property will have this value:

It is also possible to use the properties from subtargets inside the current target. Which enables one to pass through the output file and other information of the subtarget.

"OutputFile": "%SubTarget.OutputFile%",

The Properties of the Settings file will resolve recursively.


List of all Console Subsystems