Skip to content

Commit

Permalink
Refactor uniffi structure
Browse files Browse the repository at this point in the history
  • Loading branch information
eoger committed Aug 6, 2020
1 parent f727a57 commit 0492693
Show file tree
Hide file tree
Showing 85 changed files with 886 additions and 946 deletions.
10 changes: 9 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

version: 2.1

commands:
make_install_uniffi_bindgen:
steps:
- run:
name: Build and install uniffi-bindgen
command: cargo install --path uniffi_bindgen
jobs:
Check Rust formatting:
docker:
Expand All @@ -19,6 +25,7 @@ jobs:
steps:
- checkout
- run: rustup component add clippy
- make_install_uniffi_bindgen
- run: cargo clippy --version
- run: cargo clippy --all --all-targets
Rust and Foreign Language tests:
Expand All @@ -28,6 +35,7 @@ jobs:
steps:
- run: cat ~/.profile >> $BASH_ENV
- checkout
- make_install_uniffi_bindgen
- run: cargo test

workflows:
Expand All @@ -40,4 +48,4 @@ workflows:
- Lint Rust with clippy
run-tests:
jobs:
- Rust and Foreign Language tests
- Rust and Foreign Language tests
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[workspace]
members = [
"uniffi",
"uniffi_bindgen",
"uniffi_build",
"uniffi_macros",
"uniffi",
"examples/arithmetic",
"examples/geometry",
"examples/rondpoint",
Expand Down
7 changes: 2 additions & 5 deletions examples/arithmetic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ crate-type = ["cdylib"]
name = "uniffi_arithmetic"

[dependencies]
anyhow = "1.0"
log = "0.4"
ffi-support = "0.4"
uniffi = {path = "../../uniffi"}
uniffi_macros = {path = "../../uniffi_macros"}
uniffi = {path = "../../uniffi"}

[build-dependencies]
uniffi = {path = "../../uniffi"}
uniffi_build = {path = "../../uniffi_build"}
2 changes: 1 addition & 1 deletion examples/arithmetic/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

fn main() {
uniffi::generate_component_scaffolding("./src/arithmetic.idl").unwrap();
uniffi_build::generate_scaffolding("./src/arithmetic.idl").unwrap();
}
7 changes: 0 additions & 7 deletions examples/arithmetic/src/main.rs

This file was deleted.

9 changes: 6 additions & 3 deletions examples/arithmetic/tests/test_generated_bindings.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
uniffi_macros::build_foreign_language_testcases!(
"tests/bindings/test_arithmetic.py",
"tests/bindings/test_arithmetic.kts",
"tests/bindings/test_arithmetic.swift",
"src/arithmetic.idl",
[
"tests/bindings/test_arithmetic.py",
"tests/bindings/test_arithmetic.kts",
"tests/bindings/test_arithmetic.swift",
]
);
7 changes: 2 additions & 5 deletions examples/geometry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ crate-type = ["cdylib"]
name = "uniffi_geometry"

[dependencies]
anyhow = "1.0"
log = "0.4"
ffi-support = "0.4"
uniffi = {path = "../../uniffi"}
uniffi_macros = {path = "../../uniffi_macros"}
uniffi = {path = "../../uniffi"}

[build-dependencies]
uniffi = {path = "../../uniffi"}
uniffi_build = {path = "../../uniffi_build"}
2 changes: 1 addition & 1 deletion examples/geometry/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

fn main() {
uniffi::generate_component_scaffolding("./src/geometry.idl").unwrap();
uniffi_build::generate_scaffolding("./src/geometry.idl").unwrap();
}
7 changes: 0 additions & 7 deletions examples/geometry/src/main.rs

This file was deleted.

9 changes: 6 additions & 3 deletions examples/geometry/tests/test_generated_bindings.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
uniffi_macros::build_foreign_language_testcases!(
"tests/bindings/test_geometry.py",
"tests/bindings/test_geometry.kts",
"tests/bindings/test_geometry.swift",
"src/geometry.idl",
[
"tests/bindings/test_geometry.py",
"tests/bindings/test_geometry.kts",
"tests/bindings/test_geometry.swift",
]
);
8 changes: 2 additions & 6 deletions examples/rondpoint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ crate-type = ["cdylib"]
name = "uniffi_rondpoint"

[dependencies]
anyhow = "1.0"
log = "0.4"
ffi-support = "0.4"
lazy_static = "1.4"
uniffi = {path = "../../uniffi"}
uniffi_macros = {path = "../../uniffi_macros"}
uniffi = {path = "../../uniffi"}

[build-dependencies]
uniffi = {path = "../../uniffi"}
uniffi_build = {path = "../../uniffi_build"}
2 changes: 1 addition & 1 deletion examples/rondpoint/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

fn main() {
uniffi::generate_component_scaffolding("./src/rondpoint.idl").unwrap();
uniffi_build::generate_scaffolding("./src/rondpoint.idl").unwrap();
}
7 changes: 0 additions & 7 deletions examples/rondpoint/src/main.rs

This file was deleted.

9 changes: 6 additions & 3 deletions examples/rondpoint/tests/test_generated_bindings.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
uniffi_macros::build_foreign_language_testcases!(
"tests/bindings/test_rondpoint.kts",
"tests/bindings/test_rondpoint.swift",
// "tests/bindings/test_rondpoint.py"
"src/rondpoint.idl",
[
"tests/bindings/test_rondpoint.kts",
"tests/bindings/test_rondpoint.swift",
// "tests/bindings/test_rondpoint.py",
]
);
8 changes: 2 additions & 6 deletions examples/sprites/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ crate-type = ["cdylib"]
name = "uniffi_sprites"

[dependencies]
anyhow = "1.0"
log = "0.4"
ffi-support = "0.4"
lazy_static = "1.4"
uniffi = {path = "../../uniffi"}
uniffi_macros = {path = "../../uniffi_macros"}
uniffi = {path = "../../uniffi"}

[build-dependencies]
uniffi = {path = "../../uniffi"}
uniffi_build = {path = "../../uniffi_build"}
2 changes: 1 addition & 1 deletion examples/sprites/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

fn main() {
uniffi::generate_component_scaffolding("./src/sprites.idl").unwrap();
uniffi_build::generate_scaffolding("./src/sprites.idl").unwrap();
}
7 changes: 0 additions & 7 deletions examples/sprites/src/main.rs

This file was deleted.

9 changes: 6 additions & 3 deletions examples/sprites/tests/test_generated_bindings.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
uniffi_macros::build_foreign_language_testcases!(
// "tests/bindings/test_sprites.py",
"tests/bindings/test_sprites.kts",
"tests/bindings/test_sprites.swift",
"src/sprites.idl",
[
// "tests/bindings/test_sprites.py",
"tests/bindings/test_sprites.kts",
"tests/bindings/test_sprites.swift",
]
);
8 changes: 2 additions & 6 deletions examples/todolist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@ crate-type = ["cdylib"]
name = "uniffi_todolist"

[dependencies]
anyhow = "1.0"
log = "0.4"
ffi-support = "0.4"
lazy_static = "1.4"
uniffi = {path = "../../uniffi"}
uniffi_macros = {path = "../../uniffi_macros"}
uniffi = {path = "../../uniffi"}
thiserror = "1.0"

[build-dependencies]
uniffi = {path = "../../uniffi"}
uniffi_build = {path = "../../uniffi_build"}
2 changes: 1 addition & 1 deletion examples/todolist/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

fn main() {
uniffi::generate_component_scaffolding("./src/todolist.idl").unwrap();
uniffi_build::generate_scaffolding("./src/todolist.idl").unwrap();
}
7 changes: 0 additions & 7 deletions examples/todolist/src/main.rs

This file was deleted.

9 changes: 6 additions & 3 deletions examples/todolist/tests/test_generated_bindings.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
uniffi_macros::build_foreign_language_testcases!(
"tests/bindings/test_todolist.kts",
"tests/bindings/test_todolist.swift",
// "tests/bindings/test_todolist.py"
"src/todolist.idl",
[
"tests/bindings/test_todolist.kts",
"tests/bindings/test_todolist.swift",
// "tests/bindings/test_todolist.py"
]
);
18 changes: 5 additions & 13 deletions uniffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,12 @@ authors = ["Firefox Sync Team <sync-team@mozilla.com>"]
license = "MPL-2.0"
edition = "2018"

[[bin]]
name = "uniffi-bindgen"
path = "src/main.rs"

[dependencies]
weedle = "0.11"
# Re-exported dependencies used in generated Rust scaffolding files.
anyhow = "1"
bytes = "0.5"
ffi-support = "0.4"
anyhow = "1.0"
askama = "0.9"
heck = "0.3"
clap = "2.33"
object = "0.20"
serde = "1.0"
bincode = "1.3"
cargo_metadata = "0.10.0"
lazy_static = "1.4"
log = "0.4"
# Regular dependencies
cargo_metadata = "0.11"
Loading

0 comments on commit 0492693

Please sign in to comment.