moved platform-switching

This commit is contained in:
Anton-4 2022-10-17 15:22:20 +02:00
parent dc205eab66
commit 3dad6aba7c
No known key found for this signature in database
GPG Key ID: A13F4A6E21141925
34 changed files with 25 additions and 25 deletions

View File

@ -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

View File

@ -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",

View File

@ -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]

View File

@ -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
```

View File

@ -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
```

View File

@ -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
```

View File

@ -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
```

View File

@ -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
```