Skip to content

Commit

Permalink
rename linera-examples into examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ma2bd committed Apr 30, 2023
1 parent 45b6385 commit 12aa32e
Show file tree
Hide file tree
Showing 89 changed files with 20 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ jobs:
cargo build --locked --bin test-runner
- name: Run WASM application tests
run: |
cd linera-examples
cd examples
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER=../target/debug/test-runner cargo test --target wasm32-unknown-unknown
cargo test --target x86_64-unknown-linux-gnu
- name: Build example applications
run: |
cd linera-examples
cd examples
cargo build --release --target wasm32-unknown-unknown
- name: Compile the workspace with the default features (test)
run: |
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
cargo machete
- name: Run WASM application lints
run: |
cd linera-examples
cd examples
cargo fmt -- --check --config unstable_features=true --config imports_granularity=Crate
cargo clippy --all-targets --all-features --target wasm32-unknown-unknown --locked
- name: Run clippy
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ cargo build --release --bin test-runner
After that, the WASM tests can be executed with:

```
cd linera-examples
cd examples
cargo test --target wasm32-unknown-unknown
```

Expand All @@ -132,10 +132,10 @@ runner = "/path/to/repository/target/release/test-runner"
```
(See the [documentation of Cargo](https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure) for more context.)

Some tests require the application examples from `linera-examples` to be compiled. If needed, this
Some tests require the application examples from `examples` to be compiled. If needed, this
can be done manually with
```
cd linera-examples
cd examples
cargo build --release --target wasm32-unknown-unknown
```
The Rust flags are suggested to reduce the size of the WASM bytecodes.
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ members = [
"linera-views-derive",
]
exclude = [
"linera-examples",
"examples",
]
resolver = "2"

Expand Down Expand Up @@ -109,8 +109,8 @@ linera-storage = { version = "0.1.0", path = "./linera-storage", default-feature
linera-views = { version = "0.1.0", path = "./linera-views" }
linera-views-derive = { version = "0.1.0", path = "./linera-views-derive" }

fungible = { path = "./linera-examples/fungible" }
social = { path = "./linera-examples/social" }
fungible = { path = "./examples/fungible" }
social = { path = "./examples/social" }

[profile.release]
debug = true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The Linera protocol repository is broken down into the following crates and subd

9. [`linera-sdk`](https://linera-io.github.io/linera-protocol/364a04086bc8f2bf91ec3406a2aac5f7e4e675b9/linera_sdk/index.html) The library to develop Linera applications written in Rust for the WASM virtual machine.

10. [`linera-examples`](./linera-examples) Examples of Linera applications written in Rust.
10. [`examples`](./examples) Examples of Linera applications written in Rust.

## Quickstart with the Linera service CLI

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions linera-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ tokio-stream = "0.1.11"
[dev-dependencies]
bcs = "0.1.3"
criterion = { version = "0.4.0", features = ["async_tokio"] }
fungible = { path = "../linera-examples/fungible" }
fungible = { path = "../examples/fungible" }
linera-core = { path = ".", default-features = false, features = ["test"] }
metrics = "0.20.1"
metrics-util = "0.14.0"
portable-atomic = "0.3.19"
serde_json = "1.0.93"
social = { path = "../linera-examples/social" }
social = { path = "../examples/social" }
test-case = "3.0.0"
tracing-subscriber = { version = "0.3.16", default-features = false, features = ["env-filter", "fmt"] }

Expand Down
8 changes: 3 additions & 5 deletions linera-execution/src/wasm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ pub mod test {
fn build_applications() -> Result<(), std::io::Error> {
tracing::info!("Building example applications with cargo");
let output = std::process::Command::new("cargo")
.current_dir("../linera-examples")
.current_dir("../examples")
.args(["build", "--release", "--target", "wasm32-unknown-unknown"])
.output()?;
if !output.status.success() {
Expand All @@ -282,10 +282,8 @@ pub mod test {
static INSTANCE: OnceCell<()> = OnceCell::new();
INSTANCE.get_or_try_init(build_applications)?;
Ok((
format!(
"../linera-examples/target/wasm32-unknown-unknown/release/{name}_contract.wasm"
),
format!("../linera-examples/target/wasm32-unknown-unknown/release/{name}_service.wasm"),
format!("../examples/target/wasm32-unknown-unknown/release/{name}_contract.wasm"),
format!("../examples/target/wasm32-unknown-unknown/release/{name}_service.wasm"),
))
}

Expand Down
4 changes: 2 additions & 2 deletions linera-execution/update_wasm_fixtures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

cd `dirname $0`/..

(cd linera-examples && cargo build --release)
(cd examples && cargo build --release)

cp linera-examples/target/wasm32-unknown-unknown/release/counter_{contract,service}.wasm linera-execution/tests/fixtures
cp examples/target/wasm32-unknown-unknown/release/counter_{contract,service}.wasm linera-execution/tests/fixtures
2 changes: 1 addition & 1 deletion linera-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ endpoints implemented via the [`Service`](https://docs.rs/linera-sdk/latest/line

# Examples

The [`linera-examples`](https://github.com/linera-io/linera-protocol/tree/main/linera-examples)
The [`examples`](https://github.com/linera-io/linera-protocol/tree/main/examples)
directory contains some example applications.

<!-- cargo-rdme end -->
Expand Down
2 changes: 1 addition & 1 deletion linera-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
//!
//! # Examples
//!
//! The [`linera-examples`](https://github.com/linera-io/linera-protocol/tree/main/linera-examples)
//! The [`examples`](https://github.com/linera-io/linera-protocol/tree/main/examples)
//! directory contains some example applications.
#![deny(missing_docs)]
Expand Down
2 changes: 1 addition & 1 deletion linera-service/tests/end_to_end_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ impl TestRunner {
}

async fn build_application(&self, name: &str) -> (PathBuf, PathBuf) {
let examples_dir = env::current_dir().unwrap().join("../linera-examples/");
let examples_dir = env::current_dir().unwrap().join("../examples/");
Command::new("cargo")
.current_dir(self.tmp_dir.path().canonicalize().unwrap())
.arg("build")
Expand Down

0 comments on commit 12aa32e

Please sign in to comment.