diff --git a/bundle.json b/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..7eb45424912e54a5bba7381a29bf8d784fade2d9 --- /dev/null +++ b/bundle.json @@ -0,0 +1,31 @@ +{ + "component": { + "name": "ylong_http", + "description": "ylong HTTP implementation", + "subsystem": "commonlibrary", + "features": [], + "rom": "100KB", + "ram": "~200KB", + "deps": { + "third_party": [ + "//third_party/rust/crates/tokio/tokio:lib", + "//third_party/rust/crates/libc:lib", + "//third_party/openssl:libcrypto_shared", + "//third_party/openssl:libssl_shared" + ] + }, + "build": { + "sub_component": [], + "inner_kits": [ + { + "header": { + "header_base": [], + "header_files": [] + }, + "name": "//commonlibrary/rust/ylong_http/ylong_http_client:ylong_http_client" + } + ], + "test": [] + } + } +} diff --git a/ylong_http/BUILD.gn b/ylong_http/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..8b9d6bb81176fc338de97560e9878a6bd41bb293 --- /dev/null +++ b/ylong_http/BUILD.gn @@ -0,0 +1,31 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") + +ohos_rust_static_library("lib") { + crate_name = "ylong_http" + crate_type = "rlib" + crate_root = "src/lib.rs" + + subsystem_name = "commonlibrary" + part_name = "ylong_http" + + sources = [ "src/lib.rs" ] + deps = [ "//third_party/rust/crates/tokio/tokio:lib" ] + clippy_lints = "none" + features = [ + "default", + "http1_1", + ] +} diff --git a/ylong_http_client/BUILD.gn b/ylong_http_client/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..02e7c6b7a02dce87e813d837300d6a2780cacf69 --- /dev/null +++ b/ylong_http_client/BUILD.gn @@ -0,0 +1,67 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/test.gni") + +ohos_rust_shared_library("ylong_http_client") { + crate_name = "ylong_http_client" + crate_type = "dylib" + crate_root = "src/lib.rs" + + subsystem_name = "commonlibrary" + part_name = "ylong_http" + + sources = [ "src/lib.rs" ] + deps = [ + "//commonlibrary/rust/ylong_http/ylong_http:lib", + "//third_party/openssl:libcrypto_shared", + "//third_party/openssl:libssl_shared", + "//third_party/rust/crates/libc:lib", + "//third_party/rust/crates/tokio/tokio:lib", + ] + clippy_lints = "none" + features = [ + "default", + "async", + "http1_1", + "c_openssl_3_0", + "__tls", + "__c_openssl", + "tokio_base", + ] +} + +ohos_rust_unittest("rust_ylong_http_client_unit_test") { + module_out_path = "commonlibrary/rust/ylong_http" + sources = [ "src/lib.rs" ] + deps = [ + ":ylong_http_client", + "//commonlibrary/rust/ylong_http/ylong_http:lib", + "//third_party/openssl:libcrypto_shared", + "//third_party/openssl:libssl_shared", + "//third_party/rust/crates/libc:lib", + "//third_party/rust/crates/tokio/tokio:lib", + ] + clippy_lints = "none" + + rustflags = [ + "--cfg=feature=\"default\"", + "--cfg=feature=\"async\"", + "--cfg=feature=\"http1_1\"", + "--cfg=feature=\"c_openssl_3_0\"", + "--cfg=feature=\"__tls\"", + "--cfg=feature=\"__c_openssl\"", + "--cfg=feature=\"tokio_base\"", + ] +}