From 61db15dee732c075a7175d26000d3ec2577425bc Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 7 May 2024 12:02:51 +0800 Subject: [PATCH 1/2] Add SwiftPM support --- .gitignore | 5 ++- Logan/Clogan/include/aes_util.h | 1 + Logan/Clogan/include/base_util.h | 1 + Logan/Clogan/include/cJSON.h | 1 + Logan/Clogan/include/clogan_core.h | 1 + Logan/Clogan/include/clogan_status.h | 1 + Logan/Clogan/include/console_util.h | 1 + Logan/Clogan/include/construct_data.h | 1 + Logan/Clogan/include/directory_util.h | 1 + Logan/Clogan/include/json_util.h | 1 + Logan/Clogan/include/logan_config.h | 1 + Logan/Clogan/include/mmap_util.h | 1 + Logan/Clogan/include/zlib_util.h | 1 + Logan/iOS/include/Logan.h | 1 + Package.swift | 49 +++++++++++++++++++++++++++ 15 files changed, 66 insertions(+), 1 deletion(-) create mode 120000 Logan/Clogan/include/aes_util.h create mode 120000 Logan/Clogan/include/base_util.h create mode 120000 Logan/Clogan/include/cJSON.h create mode 120000 Logan/Clogan/include/clogan_core.h create mode 120000 Logan/Clogan/include/clogan_status.h create mode 120000 Logan/Clogan/include/console_util.h create mode 120000 Logan/Clogan/include/construct_data.h create mode 120000 Logan/Clogan/include/directory_util.h create mode 120000 Logan/Clogan/include/json_util.h create mode 120000 Logan/Clogan/include/logan_config.h create mode 120000 Logan/Clogan/include/mmap_util.h create mode 120000 Logan/Clogan/include/zlib_util.h create mode 120000 Logan/iOS/include/Logan.h create mode 100644 Package.swift diff --git a/.gitignore b/.gitignore index afa87cd4..e81b4bcc 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,7 @@ Carthage # `pod install` in .travis.yml # # Pods/ -.data/ \ No newline at end of file +.data/ + +# SwiftPM +.swiftpm \ No newline at end of file diff --git a/Logan/Clogan/include/aes_util.h b/Logan/Clogan/include/aes_util.h new file mode 120000 index 00000000..62908a5d --- /dev/null +++ b/Logan/Clogan/include/aes_util.h @@ -0,0 +1 @@ +../aes_util.h \ No newline at end of file diff --git a/Logan/Clogan/include/base_util.h b/Logan/Clogan/include/base_util.h new file mode 120000 index 00000000..e964375b --- /dev/null +++ b/Logan/Clogan/include/base_util.h @@ -0,0 +1 @@ +../base_util.h \ No newline at end of file diff --git a/Logan/Clogan/include/cJSON.h b/Logan/Clogan/include/cJSON.h new file mode 120000 index 00000000..3f5887e7 --- /dev/null +++ b/Logan/Clogan/include/cJSON.h @@ -0,0 +1 @@ +../cJSON.h \ No newline at end of file diff --git a/Logan/Clogan/include/clogan_core.h b/Logan/Clogan/include/clogan_core.h new file mode 120000 index 00000000..ac49f76b --- /dev/null +++ b/Logan/Clogan/include/clogan_core.h @@ -0,0 +1 @@ +../clogan_core.h \ No newline at end of file diff --git a/Logan/Clogan/include/clogan_status.h b/Logan/Clogan/include/clogan_status.h new file mode 120000 index 00000000..0e01b676 --- /dev/null +++ b/Logan/Clogan/include/clogan_status.h @@ -0,0 +1 @@ +../clogan_status.h \ No newline at end of file diff --git a/Logan/Clogan/include/console_util.h b/Logan/Clogan/include/console_util.h new file mode 120000 index 00000000..0c30d7ea --- /dev/null +++ b/Logan/Clogan/include/console_util.h @@ -0,0 +1 @@ +../console_util.h \ No newline at end of file diff --git a/Logan/Clogan/include/construct_data.h b/Logan/Clogan/include/construct_data.h new file mode 120000 index 00000000..918b3924 --- /dev/null +++ b/Logan/Clogan/include/construct_data.h @@ -0,0 +1 @@ +../construct_data.h \ No newline at end of file diff --git a/Logan/Clogan/include/directory_util.h b/Logan/Clogan/include/directory_util.h new file mode 120000 index 00000000..41cbe4f4 --- /dev/null +++ b/Logan/Clogan/include/directory_util.h @@ -0,0 +1 @@ +../directory_util.h \ No newline at end of file diff --git a/Logan/Clogan/include/json_util.h b/Logan/Clogan/include/json_util.h new file mode 120000 index 00000000..c0d66c14 --- /dev/null +++ b/Logan/Clogan/include/json_util.h @@ -0,0 +1 @@ +../json_util.h \ No newline at end of file diff --git a/Logan/Clogan/include/logan_config.h b/Logan/Clogan/include/logan_config.h new file mode 120000 index 00000000..886a6fd2 --- /dev/null +++ b/Logan/Clogan/include/logan_config.h @@ -0,0 +1 @@ +../logan_config.h \ No newline at end of file diff --git a/Logan/Clogan/include/mmap_util.h b/Logan/Clogan/include/mmap_util.h new file mode 120000 index 00000000..ac55d345 --- /dev/null +++ b/Logan/Clogan/include/mmap_util.h @@ -0,0 +1 @@ +../mmap_util.h \ No newline at end of file diff --git a/Logan/Clogan/include/zlib_util.h b/Logan/Clogan/include/zlib_util.h new file mode 120000 index 00000000..fd208e5b --- /dev/null +++ b/Logan/Clogan/include/zlib_util.h @@ -0,0 +1 @@ +../zlib_util.h \ No newline at end of file diff --git a/Logan/iOS/include/Logan.h b/Logan/iOS/include/Logan.h new file mode 120000 index 00000000..a7a859f8 --- /dev/null +++ b/Logan/iOS/include/Logan.h @@ -0,0 +1 @@ +../Logan.h \ No newline at end of file diff --git a/Package.swift b/Package.swift new file mode 100644 index 00000000..7c7f8fdf --- /dev/null +++ b/Package.swift @@ -0,0 +1,49 @@ +// swift-tools-version: 5.9 + +/* + * Copyright (c) 2018-present, 美团点评 + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +import PackageDescription + +let package = Package( + name: "Logan", + products: [ + .library(name: "Logan", targets: ["Logan"]), + ], + targets: [ + .target( + name: "mbedtls", + path: "Logan/mbedtls" + ), + .target( + name: "CLogan", + dependencies: ["mbedtls"], + path: "Logan/Clogan", + exclude: ["main.c"] + ), + .target( + name: "Logan", + dependencies: ["CLogan"], + path: "Logan/iOS" + ), + ] +) From 60acfb7a4c045e1cfe86a6626f20d7ba4a23233d Mon Sep 17 00:00:00 2001 From: Kyle Date: Thu, 9 May 2024 11:10:27 +0800 Subject: [PATCH 2/2] Remove include layout Co-authored-by: wsxyeah --- .gitignore | 3 ++- Logan/Clogan/include/aes_util.h | 1 - Logan/Clogan/include/base_util.h | 1 - Logan/Clogan/include/cJSON.h | 1 - Logan/Clogan/include/clogan_core.h | 1 - Logan/Clogan/include/clogan_status.h | 1 - Logan/Clogan/include/console_util.h | 1 - Logan/Clogan/include/construct_data.h | 1 - Logan/Clogan/include/directory_util.h | 1 - Logan/Clogan/include/json_util.h | 1 - Logan/Clogan/include/logan_config.h | 1 - Logan/Clogan/include/mmap_util.h | 1 - Logan/Clogan/include/zlib_util.h | 1 - Logan/iOS/include/Logan.h | 1 - Package.swift | 6 ++++-- 15 files changed, 6 insertions(+), 16 deletions(-) delete mode 120000 Logan/Clogan/include/aes_util.h delete mode 120000 Logan/Clogan/include/base_util.h delete mode 120000 Logan/Clogan/include/cJSON.h delete mode 120000 Logan/Clogan/include/clogan_core.h delete mode 120000 Logan/Clogan/include/clogan_status.h delete mode 120000 Logan/Clogan/include/console_util.h delete mode 120000 Logan/Clogan/include/construct_data.h delete mode 120000 Logan/Clogan/include/directory_util.h delete mode 120000 Logan/Clogan/include/json_util.h delete mode 120000 Logan/Clogan/include/logan_config.h delete mode 120000 Logan/Clogan/include/mmap_util.h delete mode 120000 Logan/Clogan/include/zlib_util.h delete mode 120000 Logan/iOS/include/Logan.h diff --git a/.gitignore b/.gitignore index e81b4bcc..466f228a 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,5 @@ Carthage .data/ # SwiftPM -.swiftpm \ No newline at end of file +.swiftpm +.build diff --git a/Logan/Clogan/include/aes_util.h b/Logan/Clogan/include/aes_util.h deleted file mode 120000 index 62908a5d..00000000 --- a/Logan/Clogan/include/aes_util.h +++ /dev/null @@ -1 +0,0 @@ -../aes_util.h \ No newline at end of file diff --git a/Logan/Clogan/include/base_util.h b/Logan/Clogan/include/base_util.h deleted file mode 120000 index e964375b..00000000 --- a/Logan/Clogan/include/base_util.h +++ /dev/null @@ -1 +0,0 @@ -../base_util.h \ No newline at end of file diff --git a/Logan/Clogan/include/cJSON.h b/Logan/Clogan/include/cJSON.h deleted file mode 120000 index 3f5887e7..00000000 --- a/Logan/Clogan/include/cJSON.h +++ /dev/null @@ -1 +0,0 @@ -../cJSON.h \ No newline at end of file diff --git a/Logan/Clogan/include/clogan_core.h b/Logan/Clogan/include/clogan_core.h deleted file mode 120000 index ac49f76b..00000000 --- a/Logan/Clogan/include/clogan_core.h +++ /dev/null @@ -1 +0,0 @@ -../clogan_core.h \ No newline at end of file diff --git a/Logan/Clogan/include/clogan_status.h b/Logan/Clogan/include/clogan_status.h deleted file mode 120000 index 0e01b676..00000000 --- a/Logan/Clogan/include/clogan_status.h +++ /dev/null @@ -1 +0,0 @@ -../clogan_status.h \ No newline at end of file diff --git a/Logan/Clogan/include/console_util.h b/Logan/Clogan/include/console_util.h deleted file mode 120000 index 0c30d7ea..00000000 --- a/Logan/Clogan/include/console_util.h +++ /dev/null @@ -1 +0,0 @@ -../console_util.h \ No newline at end of file diff --git a/Logan/Clogan/include/construct_data.h b/Logan/Clogan/include/construct_data.h deleted file mode 120000 index 918b3924..00000000 --- a/Logan/Clogan/include/construct_data.h +++ /dev/null @@ -1 +0,0 @@ -../construct_data.h \ No newline at end of file diff --git a/Logan/Clogan/include/directory_util.h b/Logan/Clogan/include/directory_util.h deleted file mode 120000 index 41cbe4f4..00000000 --- a/Logan/Clogan/include/directory_util.h +++ /dev/null @@ -1 +0,0 @@ -../directory_util.h \ No newline at end of file diff --git a/Logan/Clogan/include/json_util.h b/Logan/Clogan/include/json_util.h deleted file mode 120000 index c0d66c14..00000000 --- a/Logan/Clogan/include/json_util.h +++ /dev/null @@ -1 +0,0 @@ -../json_util.h \ No newline at end of file diff --git a/Logan/Clogan/include/logan_config.h b/Logan/Clogan/include/logan_config.h deleted file mode 120000 index 886a6fd2..00000000 --- a/Logan/Clogan/include/logan_config.h +++ /dev/null @@ -1 +0,0 @@ -../logan_config.h \ No newline at end of file diff --git a/Logan/Clogan/include/mmap_util.h b/Logan/Clogan/include/mmap_util.h deleted file mode 120000 index ac55d345..00000000 --- a/Logan/Clogan/include/mmap_util.h +++ /dev/null @@ -1 +0,0 @@ -../mmap_util.h \ No newline at end of file diff --git a/Logan/Clogan/include/zlib_util.h b/Logan/Clogan/include/zlib_util.h deleted file mode 120000 index fd208e5b..00000000 --- a/Logan/Clogan/include/zlib_util.h +++ /dev/null @@ -1 +0,0 @@ -../zlib_util.h \ No newline at end of file diff --git a/Logan/iOS/include/Logan.h b/Logan/iOS/include/Logan.h deleted file mode 120000 index a7a859f8..00000000 --- a/Logan/iOS/include/Logan.h +++ /dev/null @@ -1 +0,0 @@ -../Logan.h \ No newline at end of file diff --git a/Package.swift b/Package.swift index 7c7f8fdf..5f03fdda 100644 --- a/Package.swift +++ b/Package.swift @@ -38,12 +38,14 @@ let package = Package( name: "CLogan", dependencies: ["mbedtls"], path: "Logan/Clogan", - exclude: ["main.c"] + exclude: ["main.c"], + publicHeadersPath: "./" ), .target( name: "Logan", dependencies: ["CLogan"], - path: "Logan/iOS" + path: "Logan/iOS", + publicHeadersPath: "./" ), ] )