From d8ce8bebffeeff9a4d001b613d10bcca99680b6a Mon Sep 17 00:00:00 2001 From: hu-kai45 Date: Sun, 25 Jun 2023 19:14:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20BUILD.gn=20=E5=92=8C=20bun?= =?UTF-8?q?dle.json=20=E7=AD=89=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hu-kai45 --- bundle.json | 31 ++++++++++++++++++ ylong_http/BUILD.gn | 31 ++++++++++++++++++ ylong_http_client/BUILD.gn | 67 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 129 insertions(+) create mode 100644 bundle.json create mode 100644 ylong_http/BUILD.gn create mode 100644 ylong_http_client/BUILD.gn diff --git a/bundle.json b/bundle.json new file mode 100644 index 0000000..7eb4542 --- /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 0000000..8b9d6bb --- /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 0000000..02e7c6b --- /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\"", + ] +} -- Gitee