NoMake
NoMake is a build system for multi-language and multi-platform projects with the following highlighted practical features:
- Type-safe build scripts
- Intellisense support
- Minimal learning curve
- Url-based ruleset sharing
- Incremental, asynchronous, and distributed building
Why is NoMake created with TypeScript & Deno?
NoMake achieves most of these features by using TypeScript, a statically typed language that is widely adopted in the industry and has been proven to have a good trade-off between static typing and real-world usability.
Deno fundamentally eases the sharing and reusing of build scripts and ruleset libraries. It also allows distributing the build process across multiple machines by cross-compiling and single-file bundling.
Installation
-
Install NoMake for your platform.
Supported platforms:
win-x64,linux-x64,macos-x64,linux-arm64,macos-arm64.Download the binaries and add them to your PATH: https://github.com/thautwarm/nomake/releases
import * as NM from 'https://github.com/thautwarm/nomake/raw/v0.1.12/mod.ts' -
Run your build script (requires a
build.tsfile as an entry point).nomake help nomake <build target> ## or if you're using nomake as a Deno library: # deno run -A build.ts help # deno run -A build.ts <build target>
See examples at NoMake Examples.
Preview
// build.ts
import * as NM from 'https://github.com/thautwarm/nomake/raw/v0.1.12/mod.ts'
// define options
NM.option('legacy', ({ value }) => { /* do stuff with value */ })
// parse options
NM.parseOptions()
// define one or more targets
NM.target(
{
name: 'output.txt',
deps: { file: 'input.txt' },
async build({ deps, target })
{
const input = await new NM.Path(deps.file).readText();
await new NM.Path(target).writeText(
'Hello, ' + input
)
}
})
// trigger the build process
await NM.makefile()
Namespaces
Functionality in NoMake is organized into namespaces. Here are some of the most important ones:
NM.Platform: Platform detection and manipulationNM.Env: Type-safe environment variable accessNM.Path: Filesystem operations (similar to Pythonpathlib)NM.Log: Logging utilitiesNM.Repo: Git repository operationsNM.CC: C/C++ compilation toolchainNM.Bflat: C# native compilation toolchain without .NET SDKs & Visual Studio (Linux/Windows only; for macOS support, use .NET SDKs by Microsoft)
The core operations are directly defined in the NM namespace, including:
NM.target(): Define a build targetNM.option(): Define a build optionNM.parseOptions(): Parse the build optionsNM.makefile(): Invoke the build process
Patterns
NoMake provides a set of patterns assign type safety for many common jobs in build systems, such as:
- Defining and organizing artifacts
- Platform-specific build rules
- Environment variables of interest
- Grouping and retrieving target dependencies