mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
moved platform-switching
This commit is contained in:
parent
dc205eab66
commit
3dad6aba7c
34 changed files with 25 additions and 25 deletions
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
cp target/release/roc ./roc # to be able to exclude "target" later in the tar command
|
cp target/release/roc ./roc # to be able to exclude "target" later in the tar command
|
||||||
cp -r target/release/lib ./lib
|
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
|
||||||
|
|
|
@ -401,7 +401,7 @@ mod cli_run {
|
||||||
// uses C platform
|
// uses C platform
|
||||||
fn platform_switching_main() {
|
fn platform_switching_main() {
|
||||||
test_roc_app_slim(
|
test_roc_app_slim(
|
||||||
"crates/cli_testing_examples/platform-switching",
|
"examples/platform-switching",
|
||||||
"main.roc",
|
"main.roc",
|
||||||
"rocLovesPlatforms",
|
"rocLovesPlatforms",
|
||||||
"Which platform am I running on now?\n",
|
"Which platform am I running on now?\n",
|
||||||
|
@ -416,7 +416,7 @@ mod cli_run {
|
||||||
#[test]
|
#[test]
|
||||||
fn platform_switching_rust() {
|
fn platform_switching_rust() {
|
||||||
test_roc_app_slim(
|
test_roc_app_slim(
|
||||||
"crates/cli_testing_examples/platform-switching",
|
"examples/platform-switching",
|
||||||
"rocLovesRust.roc",
|
"rocLovesRust.roc",
|
||||||
"rocLovesRust",
|
"rocLovesRust",
|
||||||
"Roc <3 Rust!\n",
|
"Roc <3 Rust!\n",
|
||||||
|
@ -427,7 +427,7 @@ mod cli_run {
|
||||||
#[test]
|
#[test]
|
||||||
fn platform_switching_zig() {
|
fn platform_switching_zig() {
|
||||||
test_roc_app_slim(
|
test_roc_app_slim(
|
||||||
"crates/cli_testing_examples/platform-switching",
|
"examples/platform-switching",
|
||||||
"rocLovesZig.roc",
|
"rocLovesZig.roc",
|
||||||
"rocLovesZig",
|
"rocLovesZig",
|
||||||
"Roc <3 Zig!\n",
|
"Roc <3 Zig!\n",
|
||||||
|
@ -438,7 +438,7 @@ mod cli_run {
|
||||||
#[test]
|
#[test]
|
||||||
fn platform_switching_wasm() {
|
fn platform_switching_wasm() {
|
||||||
test_roc_app_slim(
|
test_roc_app_slim(
|
||||||
"crates/cli_testing_examples/platform-switching",
|
"examples/platform-switching",
|
||||||
"rocLovesWebAssembly.roc",
|
"rocLovesWebAssembly.roc",
|
||||||
"rocLovesWebAssembly",
|
"rocLovesWebAssembly",
|
||||||
"Roc <3 Web Assembly!\n",
|
"Roc <3 Web Assembly!\n",
|
||||||
|
@ -449,7 +449,7 @@ mod cli_run {
|
||||||
#[test]
|
#[test]
|
||||||
fn platform_switching_swift() {
|
fn platform_switching_swift() {
|
||||||
test_roc_app_slim(
|
test_roc_app_slim(
|
||||||
"crates/cli_testing_examples/platform-switching",
|
"examples/platform-switching",
|
||||||
"rocLovesSwift.roc",
|
"rocLovesSwift.roc",
|
||||||
"rocLovesSwift",
|
"rocLovesSwift",
|
||||||
"Roc <3 Swift!\n",
|
"Roc <3 Swift!\n",
|
||||||
|
|
|
@ -16,7 +16,7 @@ name = "host"
|
||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
roc_std = { path = "../../../../crates/roc_std" }
|
roc_std = { path = "../../../crates/roc_std" }
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
|
@ -3,12 +3,12 @@
|
||||||
To run this website, first compile either of these identical apps:
|
To run this website, first compile either of these identical apps:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Option A: Compile crates/cli_testing_examples/platform-switching/rocLovesWebAssembly.roc
|
# Option A: Compile examples/platform-switching/rocLovesWebAssembly.roc
|
||||||
cargo run -- build --target=wasm32 crates/cli_testing_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
|
# Option B: Compile 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
|
cargo run -- build --target=wasm32 examples/platform-switching/main.roc
|
||||||
(cd crates/cli_testing_examples/platform-switching && mv rocLovesPlatforms.wasm web-assembly-platform/rocLovesWebAssembly.wasm)
|
(cd examples/platform-switching && mv rocLovesPlatforms.wasm web-assembly-platform/rocLovesWebAssembly.wasm)
|
||||||
```
|
```
|
||||||
|
|
||||||
Then `cd` into the website directory
|
Then `cd` into the website directory
|
||||||
|
@ -16,7 +16,7 @@ and run any web server that can handle WebAssembly.
|
||||||
For example, with `http-server`:
|
For example, with `http-server`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd crates/cli_testing_examples/platform-switching/web-assembly-platform
|
cd examples/platform-switching/web-assembly-platform
|
||||||
npm install -g http-server
|
npm install -g http-server
|
||||||
http-server
|
http-server
|
||||||
```
|
```
|
|
@ -45,9 +45,9 @@ you need to install one or more of these platform language compilers, too.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Note: If you installed Rust in this terminal session, you'll need to open a new one first!
|
# 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
|
||||||
```
|
```
|
||||||
|
|
|
@ -48,9 +48,9 @@ you need to install one or more of these platform language compilers, too.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Note: If you installed rust in this terminal session, you'll need to open a new one first!
|
# 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
|
||||||
```
|
```
|
||||||
|
|
|
@ -42,9 +42,9 @@ you need to install one or more of these platform language compilers, too.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Note: If you installed rust in this terminal session, you'll need to open a new one first!
|
# 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
|
||||||
```
|
```
|
||||||
|
|
|
@ -7,11 +7,11 @@
|
||||||
1. Run examples:
|
1. Run examples:
|
||||||
|
|
||||||
```sh
|
```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.
|
# 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.
|
# 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
|
||||||
```
|
```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue