diff --git a/ci/package_release.sh b/ci/package_release.sh index 4c03da969e..646c39e9bd 100755 --- a/ci/package_release.sh +++ b/ci/package_release.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash cp target/release/roc ./roc # to be able to exclude "target" later in the tar command cp -r target/release/lib ./lib -tar -czvf $1 --exclude="target" --exclude="zig-cache" roc lib LICENSE LEGAL_DETAILS examples/helloWorld.roc examples/cli crates/roc_std +tar -czvf $1 --exclude="target" --exclude="zig-cache" roc lib LICENSE LEGAL_DETAILS examples/helloWorld.roc examples/platform-switching examples/cli crates/roc_std diff --git a/crates/cli/tests/cli_run.rs b/crates/cli/tests/cli_run.rs index b84808f41f..538dd0cb5a 100644 --- a/crates/cli/tests/cli_run.rs +++ b/crates/cli/tests/cli_run.rs @@ -401,7 +401,7 @@ mod cli_run { // uses C platform fn platform_switching_main() { test_roc_app_slim( - "crates/cli_testing_examples/platform-switching", + "examples/platform-switching", "main.roc", "rocLovesPlatforms", "Which platform am I running on now?\n", @@ -416,7 +416,7 @@ mod cli_run { #[test] fn platform_switching_rust() { test_roc_app_slim( - "crates/cli_testing_examples/platform-switching", + "examples/platform-switching", "rocLovesRust.roc", "rocLovesRust", "Roc <3 Rust!\n", @@ -427,7 +427,7 @@ mod cli_run { #[test] fn platform_switching_zig() { test_roc_app_slim( - "crates/cli_testing_examples/platform-switching", + "examples/platform-switching", "rocLovesZig.roc", "rocLovesZig", "Roc <3 Zig!\n", @@ -438,7 +438,7 @@ mod cli_run { #[test] fn platform_switching_wasm() { test_roc_app_slim( - "crates/cli_testing_examples/platform-switching", + "examples/platform-switching", "rocLovesWebAssembly.roc", "rocLovesWebAssembly", "Roc <3 Web Assembly!\n", @@ -449,7 +449,7 @@ mod cli_run { #[test] fn platform_switching_swift() { test_roc_app_slim( - "crates/cli_testing_examples/platform-switching", + "examples/platform-switching", "rocLovesSwift.roc", "rocLovesSwift", "Roc <3 Swift!\n", diff --git a/crates/cli_testing_examples/platform-switching/.gitignore b/examples/platform-switching/.gitignore similarity index 100% rename from crates/cli_testing_examples/platform-switching/.gitignore rename to examples/platform-switching/.gitignore diff --git a/crates/cli_testing_examples/platform-switching/README.md b/examples/platform-switching/README.md similarity index 100% rename from crates/cli_testing_examples/platform-switching/README.md rename to examples/platform-switching/README.md diff --git a/crates/cli_testing_examples/platform-switching/c-platform/host.c b/examples/platform-switching/c-platform/host.c similarity index 100% rename from crates/cli_testing_examples/platform-switching/c-platform/host.c rename to examples/platform-switching/c-platform/host.c diff --git a/crates/cli_testing_examples/platform-switching/c-platform/main.roc b/examples/platform-switching/c-platform/main.roc similarity index 100% rename from crates/cli_testing_examples/platform-switching/c-platform/main.roc rename to examples/platform-switching/c-platform/main.roc diff --git a/crates/cli_testing_examples/platform-switching/main.roc b/examples/platform-switching/main.roc similarity index 100% rename from crates/cli_testing_examples/platform-switching/main.roc rename to examples/platform-switching/main.roc diff --git a/crates/cli_testing_examples/platform-switching/rocLovesC.roc b/examples/platform-switching/rocLovesC.roc similarity index 100% rename from crates/cli_testing_examples/platform-switching/rocLovesC.roc rename to examples/platform-switching/rocLovesC.roc diff --git a/crates/cli_testing_examples/platform-switching/rocLovesRust.roc b/examples/platform-switching/rocLovesRust.roc similarity index 100% rename from crates/cli_testing_examples/platform-switching/rocLovesRust.roc rename to examples/platform-switching/rocLovesRust.roc diff --git a/crates/cli_testing_examples/platform-switching/rocLovesSwift.roc b/examples/platform-switching/rocLovesSwift.roc similarity index 100% rename from crates/cli_testing_examples/platform-switching/rocLovesSwift.roc rename to examples/platform-switching/rocLovesSwift.roc diff --git a/crates/cli_testing_examples/platform-switching/rocLovesWebAssembly.roc b/examples/platform-switching/rocLovesWebAssembly.roc similarity index 100% rename from crates/cli_testing_examples/platform-switching/rocLovesWebAssembly.roc rename to examples/platform-switching/rocLovesWebAssembly.roc diff --git a/crates/cli_testing_examples/platform-switching/rocLovesZig.roc b/examples/platform-switching/rocLovesZig.roc similarity index 100% rename from crates/cli_testing_examples/platform-switching/rocLovesZig.roc rename to examples/platform-switching/rocLovesZig.roc diff --git a/crates/cli_testing_examples/platform-switching/rust-platform/Cargo.lock b/examples/platform-switching/rust-platform/Cargo.lock similarity index 100% rename from crates/cli_testing_examples/platform-switching/rust-platform/Cargo.lock rename to examples/platform-switching/rust-platform/Cargo.lock diff --git a/crates/cli_testing_examples/platform-switching/rust-platform/Cargo.toml b/examples/platform-switching/rust-platform/Cargo.toml similarity index 85% rename from crates/cli_testing_examples/platform-switching/rust-platform/Cargo.toml rename to examples/platform-switching/rust-platform/Cargo.toml index 29083ca183..8d10ce6eea 100644 --- a/crates/cli_testing_examples/platform-switching/rust-platform/Cargo.toml +++ b/examples/platform-switching/rust-platform/Cargo.toml @@ -16,7 +16,7 @@ name = "host" path = "src/main.rs" [dependencies] -roc_std = { path = "../../../../crates/roc_std" } +roc_std = { path = "../../../crates/roc_std" } libc = "0.2" [workspace] diff --git a/crates/cli_testing_examples/platform-switching/rust-platform/build.rs b/examples/platform-switching/rust-platform/build.rs similarity index 100% rename from crates/cli_testing_examples/platform-switching/rust-platform/build.rs rename to examples/platform-switching/rust-platform/build.rs diff --git a/crates/cli_testing_examples/platform-switching/rust-platform/host.c b/examples/platform-switching/rust-platform/host.c similarity index 100% rename from crates/cli_testing_examples/platform-switching/rust-platform/host.c rename to examples/platform-switching/rust-platform/host.c diff --git a/crates/cli_testing_examples/platform-switching/rust-platform/main.roc b/examples/platform-switching/rust-platform/main.roc similarity index 100% rename from crates/cli_testing_examples/platform-switching/rust-platform/main.roc rename to examples/platform-switching/rust-platform/main.roc diff --git a/crates/cli_testing_examples/platform-switching/rust-platform/src/lib.rs b/examples/platform-switching/rust-platform/src/lib.rs similarity index 100% rename from crates/cli_testing_examples/platform-switching/rust-platform/src/lib.rs rename to examples/platform-switching/rust-platform/src/lib.rs diff --git a/crates/cli_testing_examples/platform-switching/rust-platform/src/main.rs b/examples/platform-switching/rust-platform/src/main.rs similarity index 100% rename from crates/cli_testing_examples/platform-switching/rust-platform/src/main.rs rename to examples/platform-switching/rust-platform/src/main.rs diff --git a/crates/cli_testing_examples/platform-switching/swift-platform/host.h b/examples/platform-switching/swift-platform/host.h similarity index 100% rename from crates/cli_testing_examples/platform-switching/swift-platform/host.h rename to examples/platform-switching/swift-platform/host.h diff --git a/crates/cli_testing_examples/platform-switching/swift-platform/host.swift b/examples/platform-switching/swift-platform/host.swift similarity index 100% rename from crates/cli_testing_examples/platform-switching/swift-platform/host.swift rename to examples/platform-switching/swift-platform/host.swift diff --git a/crates/cli_testing_examples/platform-switching/swift-platform/main.roc b/examples/platform-switching/swift-platform/main.roc similarity index 100% rename from crates/cli_testing_examples/platform-switching/swift-platform/main.roc rename to examples/platform-switching/swift-platform/main.roc diff --git a/crates/cli_testing_examples/platform-switching/web-assembly-platform/README.md b/examples/platform-switching/web-assembly-platform/README.md similarity index 77% rename from crates/cli_testing_examples/platform-switching/web-assembly-platform/README.md rename to examples/platform-switching/web-assembly-platform/README.md index a1dba338dc..76f5720e29 100644 --- a/crates/cli_testing_examples/platform-switching/web-assembly-platform/README.md +++ b/examples/platform-switching/web-assembly-platform/README.md @@ -3,12 +3,12 @@ To run this website, first compile either of these identical apps: ```bash -# Option A: Compile crates/cli_testing_examples/platform-switching/rocLovesWebAssembly.roc -cargo run -- build --target=wasm32 crates/cli_testing_examples/platform-switching/rocLovesWebAssembly.roc +# Option A: Compile examples/platform-switching/rocLovesWebAssembly.roc +cargo run -- build --target=wasm32 examples/platform-switching/rocLovesWebAssembly.roc -# Option B: Compile crates/cli_testing_examples/platform-switching/main.roc with `pf: "web-assembly-platform/main.roc"` and move the result -cargo run -- build --target=wasm32 crates/cli_testing_examples/platform-switching/main.roc -(cd crates/cli_testing_examples/platform-switching && mv rocLovesPlatforms.wasm web-assembly-platform/rocLovesWebAssembly.wasm) +# Option B: Compile examples/platform-switching/main.roc with `pf: "web-assembly-platform/main.roc"` and move the result +cargo run -- build --target=wasm32 examples/platform-switching/main.roc +(cd examples/platform-switching && mv rocLovesPlatforms.wasm web-assembly-platform/rocLovesWebAssembly.wasm) ``` Then `cd` into the website directory @@ -16,7 +16,7 @@ and run any web server that can handle WebAssembly. For example, with `http-server`: ```bash -cd crates/cli_testing_examples/platform-switching/web-assembly-platform +cd examples/platform-switching/web-assembly-platform npm install -g http-server http-server ``` diff --git a/crates/cli_testing_examples/platform-switching/web-assembly-platform/host.js b/examples/platform-switching/web-assembly-platform/host.js similarity index 100% rename from crates/cli_testing_examples/platform-switching/web-assembly-platform/host.js rename to examples/platform-switching/web-assembly-platform/host.js diff --git a/crates/cli_testing_examples/platform-switching/web-assembly-platform/host.test.js b/examples/platform-switching/web-assembly-platform/host.test.js similarity index 100% rename from crates/cli_testing_examples/platform-switching/web-assembly-platform/host.test.js rename to examples/platform-switching/web-assembly-platform/host.test.js diff --git a/crates/cli_testing_examples/platform-switching/web-assembly-platform/host.zig b/examples/platform-switching/web-assembly-platform/host.zig similarity index 100% rename from crates/cli_testing_examples/platform-switching/web-assembly-platform/host.zig rename to examples/platform-switching/web-assembly-platform/host.zig diff --git a/crates/cli_testing_examples/platform-switching/web-assembly-platform/index.html b/examples/platform-switching/web-assembly-platform/index.html similarity index 100% rename from crates/cli_testing_examples/platform-switching/web-assembly-platform/index.html rename to examples/platform-switching/web-assembly-platform/index.html diff --git a/crates/cli_testing_examples/platform-switching/web-assembly-platform/main.roc b/examples/platform-switching/web-assembly-platform/main.roc similarity index 100% rename from crates/cli_testing_examples/platform-switching/web-assembly-platform/main.roc rename to examples/platform-switching/web-assembly-platform/main.roc diff --git a/crates/cli_testing_examples/platform-switching/zig-platform/host.zig b/examples/platform-switching/zig-platform/host.zig similarity index 100% rename from crates/cli_testing_examples/platform-switching/zig-platform/host.zig rename to examples/platform-switching/zig-platform/host.zig diff --git a/crates/cli_testing_examples/platform-switching/zig-platform/main.roc b/examples/platform-switching/zig-platform/main.roc similarity index 100% rename from crates/cli_testing_examples/platform-switching/zig-platform/main.roc rename to examples/platform-switching/zig-platform/main.roc diff --git a/getting_started/linux_x86_64.md b/getting_started/linux_x86_64.md index 3b390d5b23..35d12d8740 100644 --- a/getting_started/linux_x86_64.md +++ b/getting_started/linux_x86_64.md @@ -45,9 +45,9 @@ you need to install one or more of these platform language compilers, too. ```sh # Note: If you installed Rust in this terminal session, you'll need to open a new one first! - ./roc crates/cli_testing_examples/platform-switching/rocLovesRust.roc + ./roc examples/platform-switching/rocLovesRust.roc - ./roc crates/cli_testing_examples/platform-switching/rocLovesZig.roc + ./roc examples/platform-switching/rocLovesZig.roc - ./roc crates/cli_testing_examples/platform-switching/rocLovesC.roc + ./roc examples/platform-switching/rocLovesC.roc ``` diff --git a/getting_started/macos_apple_silicon.md b/getting_started/macos_apple_silicon.md index ed54cded01..2101c22da0 100644 --- a/getting_started/macos_apple_silicon.md +++ b/getting_started/macos_apple_silicon.md @@ -48,9 +48,9 @@ you need to install one or more of these platform language compilers, too. ```sh # Note: If you installed rust in this terminal session, you'll need to open a new one first! - ./roc crates/cli_testing_examples/platform-switching/rocLovesRust.roc + ./roc examples/platform-switching/rocLovesRust.roc - ./roc crates/cli_testing_examples/platform-switching/rocLovesZig.roc + ./roc examples/platform-switching/rocLovesZig.roc - ./roc crates/cli_testing_examples/platform-switching/rocLovesC.roc + ./roc examples/platform-switching/rocLovesC.roc ``` diff --git a/getting_started/macos_x86_64.md b/getting_started/macos_x86_64.md index 23aecdb905..7826aca997 100644 --- a/getting_started/macos_x86_64.md +++ b/getting_started/macos_x86_64.md @@ -42,9 +42,9 @@ you need to install one or more of these platform language compilers, too. ```sh # Note: If you installed rust in this terminal session, you'll need to open a new one first! - ./roc crates/cli_testing_examples/platform-switching/rocLovesRust.roc + ./roc examples/platform-switching/rocLovesRust.roc - ./roc crates/cli_testing_examples/platform-switching/rocLovesZig.roc + ./roc examples/platform-switching/rocLovesZig.roc - ./roc crates/cli_testing_examples/platform-switching/rocLovesC.roc + ./roc examples/platform-switching/rocLovesC.roc ``` diff --git a/getting_started/other.md b/getting_started/other.md index 13c5c79db7..70f01dd2e5 100644 --- a/getting_started/other.md +++ b/getting_started/other.md @@ -7,11 +7,11 @@ 1. Run examples: ```sh - cargo run crates/cli_testing_examples/platform-switching/rocLovesRust.roc + cargo run examples/platform-switching/rocLovesRust.roc # This requires installing the Zig compiler, too. - cargo run crates/cli_testing_examples/platform-switching/rocLovesZig.roc + cargo run examples/platform-switching/rocLovesZig.roc # This requires installing the `clang` C compiler, too. - cargo run crates/cli_testing_examples/platform-switching/rocLovesC.roc + cargo run examples/platform-switching/rocLovesC.roc ```