Skip to content

Commit

Permalink
test: cel spec
Browse files Browse the repository at this point in the history
  • Loading branch information
thesayyn committed Feb 18, 2024
1 parent e0d8f85 commit 46b39a4
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "conformance_tests/cel-spec"]
path = conformance_tests/cel-spec
url = [email protected]:google/cel-spec.git
[submodule "conformance_tests/googleapis"]
path = conformance_tests/googleapis
url = [email protected]:googleapis/googleapis.git
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[workspace]
members = ["parser", "program", "web"]
members = ["parser", "program", "web", "cel_spec"]
14 changes: 14 additions & 0 deletions cel_spec/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "cel_spec"
version = "0.1.0"
edition = "2021"

[lib]
crate-type = ["lib"]

[dependencies]
prost = "0.12"
prost-types = "0.12"

[build_dependencies]
prost-build = "0.12.3"
10 changes: 10 additions & 0 deletions cel_spec/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use std::io::Result;

fn main() -> Result<()> {
let mut config = prost_build::Config::new();
config.disable_comments(&["."]);
config.compile_protos(
&["cel-spec/proto/test/v1/simple.proto"],
&["cel-spec/proto/", "googleapis/"],
)
}
21 changes: 21 additions & 0 deletions cel_spec/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@




pub mod google {
pub mod rpc {
include!(concat!(env!("OUT_DIR"), "/google.rpc.rs"));
}
pub mod api {
pub mod expr {
pub mod v1alpha1 {
include!(concat!(env!("OUT_DIR"), "/google.api.expr.v1alpha1.rs"));
}
pub mod test {
pub mod v1 {
include!(concat!(env!("OUT_DIR"), "/google.api.expr.test.v1.rs"));
}
}
}
}
}
3 changes: 3 additions & 0 deletions program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ edition = "2021"
parser = {path = "../parser"}
ordered-float = "4.2.0"
ordered_hash_map = "0.4.0"

[build_dependencies]
cel_spec = {path = "../cel_spec"}
5 changes: 5 additions & 0 deletions program/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use cel_spec::*;

fn main() {

}
3 changes: 0 additions & 3 deletions web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,3 @@ crate-type = ["cdylib"]
[dependencies]
program = {path = "../program"}
wasm-bindgen = "0.2"

[profile.release]
panic = "unwind"

0 comments on commit 46b39a4

Please sign in to comment.