Skip to content
Merged
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
},
"homepage": "https://github.com/bytecodealliance/jco#readme",
"scripts": {
"build": "cargo xtask build",
"build:types:preview2-shim": "cargo xtask build-shims",
"build": "cargo xtask build workspace",
"build:types:preview2-shim": "cargo xtask build shims",
"lint": "eslint -c eslintrc.cjs lib/**/*.js packages/*/lib/**/*.js",
"test": "mocha -u tdd test/test.js --timeout 120000"
},
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions xtask/src/build/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub(crate) mod jco;
pub(crate) mod shims;
pub(crate) mod workspace;
File renamed without changes.
File renamed without changes.
30 changes: 17 additions & 13 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
use structopt::StructOpt;

mod build;
mod build_self;
mod build_shims;
mod test;

#[derive(StructOpt)]
enum Opts {
/// Build the `jco` tools
BuildSelf,
/// Build
Build,
/// Build the shims
BuildShims,
/// Build the project
Build(Build),
/// Run tests
Test,
}

#[derive(StructOpt)]
enum Build {
/// Build and transpile the `jco` tools
Jco,
/// Build the shims
Shims,
/// Build the project and copy the binaries
Workspace,
}

fn main() -> anyhow::Result<()> {
match Opts::from_args() {
Opts::BuildSelf => build_self::run(),
Opts::Build => {
build::run()?;
build_self::run()?;
Opts::Build(Build::Jco) => build::jco::run(),
Opts::Build(Build::Shims) => build::shims::run(),
Opts::Build(Build::Workspace) => {
build::workspace::run()?;
build::jco::run()?;
Ok(())
}
Opts::BuildShims => build_shims::run(),
Opts::Test => test::run(),
}
}