diff --git a/bundle.json b/bundle.json index f58c16851988473adb5a14d1d0ee17fc54936c78..e79da51588b23674b48e183b67622631966b8147 100644 --- a/bundle.json +++ b/bundle.json @@ -28,6 +28,13 @@ "build": { "sub_component": [], "inner_kits": [ + { + "header": { + "header_base": [], + "header_files": [] + }, + "name": "//commonlibrary/rust/ylong_http/ylong_http:lib" + }, { "header": { "header_base": [], diff --git a/ylong_http/BUILD.gn b/ylong_http/BUILD.gn index 0fb5f926bdb4db3bacfe1ff3e88a865a4dbfecf5..b63392f395909ddd754d61ff8a9d09d66a361a59 100644 --- a/ylong_http/BUILD.gn +++ b/ylong_http/BUILD.gn @@ -12,10 +12,11 @@ # limitations under the License. import("//build/ohos.gni") +import("//build/test.gni") -ohos_rust_static_library("lib") { +ohos_rust_shared_library("lib") { crate_name = "ylong_http" - crate_type = "rlib" + crate_type = "dylib" crate_root = "src/lib.rs" subsystem_name = "commonlibrary" @@ -29,3 +30,17 @@ ohos_rust_static_library("lib") { "tokio_base", ] } + +ohos_rust_unittest("rust_ylong_http_unit_test") { + module_out_path = "commonlibrary/rust/ylong_http" + sources = [ "src/lib.rs" ] + deps = [ "//third_party/rust/crates/tokio/tokio:lib" ] + clippy_lints = "none" + + rustflags = [ + "--cfg=feature=\"default\"", + "--cfg=feature=\"http1_1\"", + "--cfg=feature=\"http2\"", + "--cfg=feature=\"huffman\"", + ] +}