Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove DTDL Parser #50

Merged
merged 28 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/actions/install-rust-toolchain/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Install Rust Toolchain
description: |
Installs the Rust toolchain.
Relies on the fact that rustup show will install a toolchain. The installed version is based on a toolchain file, or stable if no such file is found.
inputs:
components:
description: A list of additional components to install
required: false
default: null
runs:
using: "composite"
steps:
- name: Install Rust Toolchain
# A note on using rustup show to do this (from https://rust-lang.github.io/rustup/overrides.html):
# To verify which toolchain is active, you can use rustup show,
# which will also try to install the corresponding toolchain if the current one has not been installed [...].
# (Please note that this behavior is subject to change, as detailed in issue #1397 [https://github.com/rust-lang/rustup/issues/1397].)
run: rustup show
shell: bash
- name: Install Additional Components
run: rustup component add ${{ inputs.components }}
shell: bash
if: ${{ inputs.components != null }}
4 changes: 2 additions & 2 deletions .github/workflows/notice-generation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install stable toolchain
run: rustup show
- name: Install toolchain
uses: ./.github/actions/install-rust-toolchain
- name: Cache Dependencies
uses: Swatinem/rust-cache@v1
- name: Generate the Notice
Expand Down
27 changes: 12 additions & 15 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,20 @@ jobs:
submodules: recursive
ashbeitz marked this conversation as resolved.
Show resolved Hide resolved
- name: Install protobuf-compiler
run: sudo apt-get install -y protobuf-compiler
- name: Install nightly Rust toolchain
uses: actions-rs/toolchain@v1
- name: Install .NET 7.0
uses: actions/setup-dotnet@v3
with:
toolchain: nightly-2022-08-11
default: true
override: true
components: clippy, rustfmt
dotnet-version: 7.0
- name: Install Rust toolchain
uses: ./.github/actions/install-rust-toolchain
with:
components: clippy rustfmt
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2
- run: cargo check --workspace
# Note: cargo check should use the --locked option
# Excluding it because of this known issue: https://github.com/mozilla/uniffi-rs/issues/1032
- run: cargo clippy --all-targets --all-features --workspace --no-deps -- -D warnings
- run: cargo fmt --all -- --check
- name: Run doctest only
# we run doctests here as cargo tarpaulin (our test runner)
# requires nightly toolchain to do so
uses: actions-rs/cargo@v1
with:
command: test
Expand All @@ -58,12 +55,12 @@ jobs:
submodules: recursive
- name: Install protobuf-compiler
run: sudo apt-get install -y protobuf-compiler
- name: Install nightly Rust toolchain
uses: actions-rs/toolchain@v1
- name: Install .NET 7.0
uses: actions/setup-dotnet@v3
with:
toolchain: nightly-2022-08-11
default: true
override: true
dotnet-version: 7.0
- name: Install Rust toolchain
uses: ./.github/actions/install-rust-toolchain
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2
- name: Build
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ members = [
# extension
"core/module/managed_subscribe",

# DTDL tools
"dtdl-tools",

# digital twin model
"digital-twin-model",

# DTDL parser
"dtdl-parser",

# samples
"samples/common",
"samples/protobuf_data_access",
Expand All @@ -31,7 +31,7 @@ members = [
"samples/mixed",
"samples/property",
"samples/seat_massager",
"samples/streaming",
# "samples/streaming",
wilyle marked this conversation as resolved.
Show resolved Hide resolved
]

[workspace.dependencies]
Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
- [Cloning the Repo](#cloning-the-repo)
- [Developer Notes](#developer-notes)
- [JSON-LD Crate](#json-ld-crate)
- [DTDL Parser](#dtdl-parser)
- [Building](#building)
- [Running the Tests](#running-the-tests)
- [Running the Samples](#running-the-samples)
Expand Down Expand Up @@ -96,10 +95,6 @@ However, it currently has a build issue that is discussed [here](https://github.
To work around this issue you will need to use git clone to obtain the source from [here](https://github.com/blast-hardcheese/json-ld)
and checkout its "resolve-issue-40" branch. It should be cloned to a directory that is a sibling to ibeji.

### <a name="dtdl-parser">DTDL Parser</a>

There is no existing DTDL Parser for Rust, so we have provided a minimalistic one for DTDL v2 that is based on the [JavaScript DTDL Parser](https://github.com/Azure/azure-sdk-for-js/tree/%40azure/dtdl-parser_1.0.0-beta.2/sdk/digitaltwins/dtdl-parser).

## <a name="building">Building</a>

Once you have installed the prerequisites, go to your enlistment's root directory and run:
Expand Down
8 changes: 3 additions & 5 deletions core/invehicle-digital-twin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
// Module references behind feature flags. Add any necessary module references here.
// Start: Module references.

// Add a new feature to all() so the use statement is active for the feature.
// ex. #[cfg(all(feature = "feature_1", feature = "feature_2"))]
#[cfg(all(feature = "managed_subscribe"))]
use common::grpc_interceptor::GrpcInterceptorLayer;

#[cfg(feature = "managed_subscribe")]
use managed_subscribe::managed_subscribe_module::ManagedSubscribeModule;

// End: Module references.

#[allow(unused_imports)]
use common::grpc_interceptor::GrpcInterceptorLayer;

use common::grpc_server::GrpcServer;
use core_protobuf_data_access::chariott::service_discovery::core::v1::service_registry_client::ServiceRegistryClient;
use core_protobuf_data_access::chariott::service_discovery::core::v1::{
Expand Down
5 changes: 5 additions & 0 deletions devops/cg/license_url_to_type.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"https://raw.githubusercontent.com/moq/moq4/main/License.txt": "BSD 3-Clause",
"https://www.nuget.org/packages/NUnit/3.13.3/License": "MIT",
"https://www.nuget.org/packages/NUnit.Analyzers/3.3.0/License": "MIT"
}
12 changes: 0 additions & 12 deletions dtdl-parser/.accepted_words.txt

This file was deleted.

26 changes: 0 additions & 26 deletions dtdl-parser/Cargo.toml

This file was deleted.

6 changes: 0 additions & 6 deletions dtdl-parser/README.md
ashbeitz marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

19 changes: 0 additions & 19 deletions dtdl-parser/dtdl/samples/building.json

This file was deleted.

42 changes: 0 additions & 42 deletions dtdl-parser/dtdl/samples/demo_resources.json

This file was deleted.

23 changes: 0 additions & 23 deletions dtdl-parser/dtdl/samples/phone.json

This file was deleted.

19 changes: 0 additions & 19 deletions dtdl-parser/dtdl/samples/thermostat.json

This file was deleted.

15 changes: 0 additions & 15 deletions dtdl-parser/src/command_info.rs

This file was deleted.

Loading
Loading