From e19c61f4e20fcdbf2e06f996e39be71b99910c81 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Mon, 11 Mar 2024 12:32:13 +0800 Subject: [PATCH] Use SPM as the build manager; etc. --- ...inuous-integration-workflow-spm-Ubuntu.yml | 24 ++ ...tinuous-integration-workflow-spm-macOS.yml | 14 + ...uous-integration-workflow-xcode-latest.yml | 20 - CMakeLists.txt | 6 +- {TekkonCCTest_gtest => GTests}/TekkonTest.cc | 30 +- test.sh => GoogleTest.sh | 0 Package.swift | 28 ++ README.md | 17 +- Sources/Tekkon/Tekkon.cc | 13 + {Tekkon => Sources/Tekkon/include}/Tekkon.hh | 44 +- Tekkon/main.cc | 16 - TekkonCC.xcodeproj/project.pbxproj | 392 ------------------ .../TekkonCCTests}/TekkonCCTests_Advanced.mm | 28 +- .../TekkonCCTests}/TekkonCCTests_Basic.mm | 28 +- .../TekkonCCTests_Intermediate.mm | 28 +- 15 files changed, 136 insertions(+), 552 deletions(-) create mode 100644 .github/workflows/continuous-integration-workflow-spm-Ubuntu.yml create mode 100644 .github/workflows/continuous-integration-workflow-spm-macOS.yml delete mode 100644 .github/workflows/continuous-integration-workflow-xcode-latest.yml rename {TekkonCCTest_gtest => GTests}/TekkonTest.cc (99%) rename test.sh => GoogleTest.sh (100%) create mode 100644 Package.swift create mode 100644 Sources/Tekkon/Tekkon.cc rename {Tekkon => Sources/Tekkon/include}/Tekkon.hh (98%) delete mode 100644 Tekkon/main.cc delete mode 100644 TekkonCC.xcodeproj/project.pbxproj rename {TekkonCCTests => Tests/TekkonCCTests}/TekkonCCTests_Advanced.mm (99%) rename {TekkonCCTests => Tests/TekkonCCTests}/TekkonCCTests_Basic.mm (86%) rename {TekkonCCTests => Tests/TekkonCCTests}/TekkonCCTests_Intermediate.mm (90%) diff --git a/.github/workflows/continuous-integration-workflow-spm-Ubuntu.yml b/.github/workflows/continuous-integration-workflow-spm-Ubuntu.yml new file mode 100644 index 0000000..1360add --- /dev/null +++ b/.github/workflows/continuous-integration-workflow-spm-Ubuntu.yml @@ -0,0 +1,24 @@ +name: Build_UnitTest_SPM_Ubuntu +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + name: Swift ${{ matrix.swift }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + swift: ["5.9.2"] + steps: + - uses: swift-actions/setup-swift@v1 + with: + swift-version: ${{ matrix.swift }} + - uses: actions/checkout@v4 + - name: Build + run: swift build + - name: Run tests + run: swift test diff --git a/.github/workflows/continuous-integration-workflow-spm-macOS.yml b/.github/workflows/continuous-integration-workflow-spm-macOS.yml new file mode 100644 index 0000000..1863442 --- /dev/null +++ b/.github/workflows/continuous-integration-workflow-spm-macOS.yml @@ -0,0 +1,14 @@ +name: unit-test +on: [push] + +jobs: + build: + name: unit-test + runs-on: macOS-latest + env: + GIT_SSL_NO_VERIFY: true + DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer + steps: + - uses: actions/checkout@v1 + - name: test + run: swift test diff --git a/.github/workflows/continuous-integration-workflow-xcode-latest.yml b/.github/workflows/continuous-integration-workflow-xcode-latest.yml deleted file mode 100644 index d14f7a9..0000000 --- a/.github/workflows/continuous-integration-workflow-xcode-latest.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Build_UnitTest_Xcode -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - name: Build and Test with Latest Xcode - runs-on: macOS-latest - env: - DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer - steps: - - uses: actions/checkout@v1 - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: latest-stable - - name: TekkonCC Unit Test - run: xcodebuild -scheme TekkonCCTests -configuration Debug test diff --git a/CMakeLists.txt b/CMakeLists.txt index 51c1ee1..33d99a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ project(Tekkon) set(CMAKE_CXX_STANDARD 17) -add_library(TekkonLib Tekkon/Tekkon.hh Tekkon/main.cc) +add_library(TekkonLib ./Sources/Tekkon/include/Tekkon.hh ./Sources/Tekkon/Tekkon.cc) if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") cmake_policy(SET CMP0135 NEW) @@ -16,14 +16,14 @@ include(FetchContent) FetchContent_Declare( googletest # Specify the commit you depend on and update it regularly. - URL https://gitcode.net/mirrors/google/googletest/-/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5/googletest-609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip + URL https://github.com/google/googletest/archive/5376968f6948923e2411081fd9372e71a59d8e77.zip ) # For Windows: Prevent overriding the parent project's compiler/linker settings set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) FetchContent_MakeAvailable(googletest) # Test target declarations. -add_executable(TekkonTest TekkonCCTest_gtest/TekkonTest.cc) +add_executable(TekkonTest ./GTests/TekkonTest.cc) target_link_libraries(TekkonTest gtest_main TekkonLib) include(GoogleTest) gtest_discover_tests(TekkonTest) diff --git a/TekkonCCTest_gtest/TekkonTest.cc b/GTests/TekkonTest.cc similarity index 99% rename from TekkonCCTest_gtest/TekkonTest.cc rename to GTests/TekkonTest.cc index da9f9a3..e324ae2 100644 --- a/TekkonCCTest_gtest/TekkonTest.cc +++ b/GTests/TekkonTest.cc @@ -1,28 +1,12 @@ // (c) 2022 and onwards The vChewing Project (MIT-NTL License). -/* -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: +// ==================== +// This code is released under the MIT license (SPDX-License-Identifier: MIT) +// ... with NTL restriction stating that: +// No trademark license is granted to use the trade names, trademarks, service +// marks, or product names of Contributor, except as required to fulfill notice +// requirements defined in MIT License. -1. The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -2. No trademark license is granted to use the trade names, trademarks, service -marks, or product names of Contributor, except as required to fulfill notice -requirements above. - -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. -*/ - -#include "../Tekkon/Tekkon.hh" +#include "../Sources/Tekkon/include/Tekkon.hh" #include "gtest/gtest.h" namespace Tekkon { diff --git a/test.sh b/GoogleTest.sh similarity index 100% rename from test.sh rename to GoogleTest.sh diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..d899f7b --- /dev/null +++ b/Package.swift @@ -0,0 +1,28 @@ +// swift-tools-version: 5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "Tekkon", + products: [ + // Products define the executables and libraries a package produces, making them visible to other packages. + .library( + name: "Tekkon", + targets: ["Tekkon"]), + ], + targets: [ + // Targets are the basic building blocks of a package, defining a module or a test suite. + // Targets can depend on other targets in this package and products from dependencies. + .target( + name: "Tekkon", + cxxSettings: [.unsafeFlags(["-fcxx-modules", "-fmodules"])] + ), + .testTarget( + name: "TekkonCCTests", + dependencies: ["Tekkon"] + // swiftSettings: [.interoperabilityMode(.Cxx)] + ), + ], + cxxLanguageStandard: .cxx17 +) diff --git a/README.md b/README.md index de13bff..8fd28b0 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,20 @@ 鐵恨引擎的 Cpp 版本,依 Cpp 17 標準編寫完成。 -該專案雖使用 Xcode 開發維護+單元測試,但不妨礙在任何平台使用,因為實體只有「Tekkon.hh」這一個檔案(格式:UTF8 無 BOM)。 - -該專案推薦至少使用 Xcode 13.4.1。更舊版的 Xcode 的話,只要你能跑 Cpp 17 沒問題就行。或者,「`cmake -S . -B Build`」然後到 Build 目錄下執行「`make runTest`」。 +該專案雖使用 Swift Package Manager (SPM) 開發維護+單元測試,但不妨礙在任何平台使用,因為**實體只有「Tekkon.hh」這一個檔案(格式:UTF8 無 BOM)**。 +- 敝倉庫的 ObjC 檔案全都是給 SPM 專用的單元測試腳本。 + +該專案推薦使用的建置手段: +- [跨平台 OS] 任何有支援 Cpp17 的 compiler,比如符合這種要求的 Clang 或 GCC。 +- [跨平台 OS] Swift 5.9,以 SPM 的形式建置。 + - 因為沒有用到任何 Swift 原始碼,所以建置產物對 Swift 不會構成依賴。SPM 在這裡充當了 CMake 的替代角色。 +- [僅 Apple 平台] 使用 Xcode 的話,須至少 Xcode 15.1。 // Xcode 15.0 因為 Bug 太多的原因不推薦使用。 + +該專案推薦使用的單元測試手段: +- SPM 單元測試,直接使用上文提到的 SPM 或 Xcode 即可。 +- GoogleTests,詳見 GTests 目錄下的內容。 + - 但因為 GoogleTests 官方程式包 Archive 無法在某些國家和地區穩定獲取的緣故,敝倉庫不推薦在這些市場使用這個測試手段。 + - SPM 可以在 Linux 系統下完成單元測試與建置。 > 注意:該引擎會將「ㄅㄨㄥ ㄆㄨㄥ ㄇㄨㄥ ㄈㄨㄥ」這四種讀音自動轉換成「ㄅㄥ ㄆㄥ ㄇㄥ ㄈㄥ」、將「ㄅㄨㄛ ㄆㄨㄛ ㄇㄨㄛ ㄈㄨㄛ」這四種讀音自動轉換成「ㄅㄛ ㄆㄛ ㄇㄛ ㄈㄛ」。如果您正在開發的輸入法的詞庫內的「甮」字的讀音沒有從「ㄈㄨㄥˋ」改成「ㄈㄥˋ」、或者說需要保留「ㄈㄨㄥˋ」的讀音的話,請按需修改「receiveKeyfromPhonabet()」函式當中的相關步驟、來跳過該轉換。該情形為十分罕見之情形。類似情形則是台澎金馬審音的慣用讀音「ㄌㄩㄢˊ」,因為使用者眾、所以不會被該引擎自動轉換成「ㄌㄨㄢˊ」。威注音輸入法內部已經從辭典角度做了處理、允許在敲「ㄌㄨㄢˊ」的時候出現以「ㄌㄩㄢˊ」為讀音的漢字。我們鼓勵輸入法開發者們使用 [威注音語彙庫](https://gitee.com/vChewing/libvchewing-data) 來實現對兩岸讀音習慣的同時兼顧。 diff --git a/Sources/Tekkon/Tekkon.cc b/Sources/Tekkon/Tekkon.cc new file mode 100644 index 0000000..211fb55 --- /dev/null +++ b/Sources/Tekkon/Tekkon.cc @@ -0,0 +1,13 @@ +// (c) 2022 and onwards The vChewing Project (MIT-NTL License). +// ==================== +// This code is released under the MIT license (SPDX-License-Identifier: MIT) +// ... with NTL restriction stating that: +// No trademark license is granted to use the trade names, trademarks, service +// marks, or product names of Contributor, except as required to fulfill notice +// requirements defined in MIT License. + +#include "./include/Tekkon.hh" + +namespace Tekkon {}; + +int main(int argc, const char* argv[]) { return 0; } diff --git a/Tekkon/Tekkon.hh b/Sources/Tekkon/include/Tekkon.hh similarity index 98% rename from Tekkon/Tekkon.hh rename to Sources/Tekkon/include/Tekkon.hh index ef51ebc..e4d1d82 100644 --- a/Tekkon/Tekkon.hh +++ b/Sources/Tekkon/include/Tekkon.hh @@ -1,26 +1,10 @@ // (c) 2022 and onwards The vChewing Project (MIT-NTL License). -/* -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: - -1. The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -2. No trademark license is granted to use the trade names, trademarks, service -marks, or product names of Contributor, except as required to fulfill notice -requirements above. - -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. -*/ +// ==================== +// This code is released under the MIT license (SPDX-License-Identifier: MIT) +// ... with NTL restriction stating that: +// No trademark license is granted to use the trade names, trademarks, service +// marks, or product names of Contributor, except as required to fulfill notice +// requirements defined in MIT License. // ADVICE: Save as UTF8 without BOM signature!!! @@ -29,7 +13,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /// 那樣放在檔案末尾,就只能放在檔案開頭了。另外,Cpp 的 select case 語句是可以 /// 將 std::string 拿來 switch 的,但必須做雜湊化處理(hashify)使其整數化。 -// This module conforms to Cpp20 standard. Use Clang-14 or higher to compile. +// This module conforms to Cpp17 standard. +// Clang-14 or higher is recommended for compilation. +// If using Swift Package Manager to compile, use Swift 5.9 or newer. #ifndef TEKKON_HH_ #define TEKKON_HH_ @@ -93,11 +79,11 @@ std::vector& operator+=(std::vector& x, std::vector& y) { } // The following function is taken from boost internals. -// License https://www.boost.org/users/license.html -inline static unsigned utf8ByteCount(uint8_t theChar) { +// License: https://www.boost.org/users/license.html +inline static unsigned utf8ByteCount(char theChar) { // if the most significant bit with a zero in it is in position // 8-N then there are N bytes in this UTF-8 sequence: - uint8_t mask = 0x80u; + char mask = 0x80u; unsigned result = 0; while (theChar & mask) { ++result; @@ -107,12 +93,12 @@ inline static unsigned utf8ByteCount(uint8_t theChar) { } // The following function is taken from boost internals. -// License https://www.boost.org/users/license.html +// License: https://www.boost.org/users/license.html inline static std::vector splitByCodepoint(std::string input) { std::vector arrReturned; auto netaIterated = input.cbegin(); while (netaIterated != input.cend()) { - uint8_t count = utf8ByteCount(*netaIterated); + unsigned count = utf8ByteCount(*netaIterated); arrReturned.emplace_back(std::string{netaIterated, netaIterated + count}); netaIterated += count; } @@ -399,7 +385,7 @@ inline static std::vector> {"v1", "ǖ"}, {"v2", "ǘ"}, {"v3", "ǚ"}, {"v4", "ǜ"}}; -// MARK, - Maps for Keyboard-to-Pinyin parsers +// MARK: - Maps for Keyboard-to-Pinyin parsers /// 任何形式的拼音排列都會用到的陣列(韋氏拼音與趙元任國語羅馬字除外), /// 用 Strings 反而省事一些。 diff --git a/Tekkon/main.cc b/Tekkon/main.cc deleted file mode 100644 index 5f5d105..0000000 --- a/Tekkon/main.cc +++ /dev/null @@ -1,16 +0,0 @@ -// -// main.cpp -// TekkonCC -// -// Created by ShikiSuen on 2022/6/13. -// - -#include - -#include "Tekkon.hh" - -int main(int argc, const char* argv[]) { - // insert code here... - std::cout << "Hello, World!\n"; - return 0; -} diff --git a/TekkonCC.xcodeproj/project.pbxproj b/TekkonCC.xcodeproj/project.pbxproj deleted file mode 100644 index 8789901..0000000 --- a/TekkonCC.xcodeproj/project.pbxproj +++ /dev/null @@ -1,392 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 55; - objects = { - -/* Begin PBXBuildFile section */ - 5B07925E285797BE0009C7B4 /* TekkonCCTests_Intermediate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5B07925D285797BE0009C7B4 /* TekkonCCTests_Intermediate.mm */; }; - 5B2E9DE32892B67F00E78AE6 /* TekkonCCTest_gtest in Resources */ = {isa = PBXBuildFile; fileRef = 5B2E9DE22892B67F00E78AE6 /* TekkonCCTest_gtest */; }; - 5B304FD728585B2A00696C3A /* TekkonCCTests_Basic.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5B304FD628585B2A00696C3A /* TekkonCCTests_Basic.mm */; }; - 5B304FD928585B3100696C3A /* TekkonCCTests_Advanced.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5B304FD828585B3100696C3A /* TekkonCCTests_Advanced.mm */; }; - 5BF7D5E02857898200BD81A6 /* main.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5BF7D5DF2857898200BD81A6 /* main.cc */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 5BF7D5DA2857898200BD81A6 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 1; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 5B07925D285797BE0009C7B4 /* TekkonCCTests_Intermediate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = TekkonCCTests_Intermediate.mm; sourceTree = ""; }; - 5B2E9DE22892B67F00E78AE6 /* TekkonCCTest_gtest */ = {isa = PBXFileReference; lastKnownFileType = folder; path = TekkonCCTest_gtest; sourceTree = ""; }; - 5B304FD628585B2A00696C3A /* TekkonCCTests_Basic.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = TekkonCCTests_Basic.mm; sourceTree = ""; }; - 5B304FD828585B3100696C3A /* TekkonCCTests_Advanced.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = TekkonCCTests_Advanced.mm; sourceTree = ""; }; - 5B6C78CA28578A83001AA4D1 /* Tekkon.hh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = Tekkon.hh; sourceTree = ""; }; - 5B6C78DA285792C9001AA4D1 /* TekkonCCTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TekkonCCTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 5BF7D5DC2857898200BD81A6 /* TekkonCC */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TekkonCC; sourceTree = BUILT_PRODUCTS_DIR; }; - 5BF7D5DF2857898200BD81A6 /* main.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cc; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 5B6C78D7285792C9001AA4D1 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 5BF7D5D92857898200BD81A6 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 5B6C78DB285792C9001AA4D1 /* TekkonCCTests */ = { - isa = PBXGroup; - children = ( - 5B304FD628585B2A00696C3A /* TekkonCCTests_Basic.mm */, - 5B07925D285797BE0009C7B4 /* TekkonCCTests_Intermediate.mm */, - 5B304FD828585B3100696C3A /* TekkonCCTests_Advanced.mm */, - ); - path = TekkonCCTests; - sourceTree = ""; - }; - 5BF7D5D32857898200BD81A6 = { - isa = PBXGroup; - children = ( - 5B2E9DE22892B67F00E78AE6 /* TekkonCCTest_gtest */, - 5BF7D5DE2857898200BD81A6 /* Tekkon */, - 5B6C78DB285792C9001AA4D1 /* TekkonCCTests */, - 5BF7D5DD2857898200BD81A6 /* Products */, - ); - sourceTree = ""; - }; - 5BF7D5DD2857898200BD81A6 /* Products */ = { - isa = PBXGroup; - children = ( - 5BF7D5DC2857898200BD81A6 /* TekkonCC */, - 5B6C78DA285792C9001AA4D1 /* TekkonCCTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 5BF7D5DE2857898200BD81A6 /* Tekkon */ = { - isa = PBXGroup; - children = ( - 5BF7D5DF2857898200BD81A6 /* main.cc */, - 5B6C78CA28578A83001AA4D1 /* Tekkon.hh */, - ); - path = Tekkon; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5B6C78D9285792C9001AA4D1 /* TekkonCCTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5B6C78E0285792C9001AA4D1 /* Build configuration list for PBXNativeTarget "TekkonCCTests" */; - buildPhases = ( - 5B6C78D6285792C9001AA4D1 /* Sources */, - 5B6C78D7285792C9001AA4D1 /* Frameworks */, - 5B6C78D8285792C9001AA4D1 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = TekkonCCTests; - productName = TekkonCCTests; - productReference = 5B6C78DA285792C9001AA4D1 /* TekkonCCTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 5BF7D5DB2857898200BD81A6 /* TekkonCC */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5BF7D5E32857898200BD81A6 /* Build configuration list for PBXNativeTarget "TekkonCC" */; - buildPhases = ( - 5BF7D5D82857898200BD81A6 /* Sources */, - 5BF7D5D92857898200BD81A6 /* Frameworks */, - 5BF7D5DA2857898200BD81A6 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = TekkonCC; - productName = TekkonCC; - productReference = 5BF7D5DC2857898200BD81A6 /* TekkonCC */; - productType = "com.apple.product-type.tool"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 5BF7D5D42857898200BD81A6 /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = 1; - LastUpgradeCheck = 1340; - TargetAttributes = { - 5B6C78D9285792C9001AA4D1 = { - CreatedOnToolsVersion = 13.4.1; - }; - 5BF7D5DB2857898200BD81A6 = { - CreatedOnToolsVersion = 13.4.1; - }; - }; - }; - buildConfigurationList = 5BF7D5D72857898200BD81A6 /* Build configuration list for PBXProject "TekkonCC" */; - compatibilityVersion = "Xcode 13.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5BF7D5D32857898200BD81A6; - productRefGroup = 5BF7D5DD2857898200BD81A6 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5BF7D5DB2857898200BD81A6 /* TekkonCC */, - 5B6C78D9285792C9001AA4D1 /* TekkonCCTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 5B6C78D8285792C9001AA4D1 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 5B2E9DE32892B67F00E78AE6 /* TekkonCCTest_gtest in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 5B6C78D6285792C9001AA4D1 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 5B304FD728585B2A00696C3A /* TekkonCCTests_Basic.mm in Sources */, - 5B304FD928585B3100696C3A /* TekkonCCTests_Advanced.mm in Sources */, - 5B07925E285797BE0009C7B4 /* TekkonCCTests_Intermediate.mm in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 5BF7D5D82857898200BD81A6 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 5BF7D5E02857898200BD81A6 /* main.cc in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 5B6C78DE285792C9001AA4D1 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ""; - GCC_C_LANGUAGE_STANDARD = gnu11; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = org.atelierInmu.TekkonCCTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - }; - name = Debug; - }; - 5B6C78DF285792C9001AA4D1 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ""; - GCC_C_LANGUAGE_STANDARD = gnu11; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = org.atelierInmu.TekkonCCTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - }; - name = Release; - }; - 5BF7D5E12857898200BD81A6 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "c++17"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11.5; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - }; - name = Debug; - }; - 5BF7D5E22857898200BD81A6 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "c++17"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11.5; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - SDKROOT = macosx; - }; - name = Release; - }; - 5BF7D5E42857898200BD81A6 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = ""; - ENABLE_HARDENED_RUNTIME = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 5BF7D5E52857898200BD81A6 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = ""; - ENABLE_HARDENED_RUNTIME = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 5B6C78E0285792C9001AA4D1 /* Build configuration list for PBXNativeTarget "TekkonCCTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5B6C78DE285792C9001AA4D1 /* Debug */, - 5B6C78DF285792C9001AA4D1 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5BF7D5D72857898200BD81A6 /* Build configuration list for PBXProject "TekkonCC" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5BF7D5E12857898200BD81A6 /* Debug */, - 5BF7D5E22857898200BD81A6 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5BF7D5E32857898200BD81A6 /* Build configuration list for PBXNativeTarget "TekkonCC" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5BF7D5E42857898200BD81A6 /* Debug */, - 5BF7D5E52857898200BD81A6 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5BF7D5D42857898200BD81A6 /* Project object */; -} diff --git a/TekkonCCTests/TekkonCCTests_Advanced.mm b/Tests/TekkonCCTests/TekkonCCTests_Advanced.mm similarity index 99% rename from TekkonCCTests/TekkonCCTests_Advanced.mm rename to Tests/TekkonCCTests/TekkonCCTests_Advanced.mm index ff2b0cd..6bd9b19 100644 --- a/TekkonCCTests/TekkonCCTests_Advanced.mm +++ b/Tests/TekkonCCTests/TekkonCCTests_Advanced.mm @@ -1,26 +1,10 @@ // (c) 2022 and onwards The vChewing Project (MIT-NTL License). -/* -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: - -1. The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -2. No trademark license is granted to use the trade names, trademarks, service -marks, or product names of Contributor, except as required to fulfill notice -requirements above. - -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. -*/ +// ==================== +// This code is released under the MIT license (SPDX-License-Identifier: MIT) +// ... with NTL restriction stating that: +// No trademark license is granted to use the trade names, trademarks, service +// marks, or product names of Contributor, except as required to fulfill notice +// requirements defined in MIT License. // ADVICE: Save as UTF8 without BOM signature!!! diff --git a/TekkonCCTests/TekkonCCTests_Basic.mm b/Tests/TekkonCCTests/TekkonCCTests_Basic.mm similarity index 86% rename from TekkonCCTests/TekkonCCTests_Basic.mm rename to Tests/TekkonCCTests/TekkonCCTests_Basic.mm index c45b611..effd41b 100644 --- a/TekkonCCTests/TekkonCCTests_Basic.mm +++ b/Tests/TekkonCCTests/TekkonCCTests_Basic.mm @@ -1,26 +1,10 @@ // (c) 2022 and onwards The vChewing Project (MIT-NTL License). -/* -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: - -1. The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -2. No trademark license is granted to use the trade names, trademarks, service -marks, or product names of Contributor, except as required to fulfill notice -requirements above. - -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. -*/ +// ==================== +// This code is released under the MIT license (SPDX-License-Identifier: MIT) +// ... with NTL restriction stating that: +// No trademark license is granted to use the trade names, trademarks, service +// marks, or product names of Contributor, except as required to fulfill notice +// requirements defined in MIT License. // ADVICE: Save as UTF8 without BOM signature!!! diff --git a/TekkonCCTests/TekkonCCTests_Intermediate.mm b/Tests/TekkonCCTests/TekkonCCTests_Intermediate.mm similarity index 90% rename from TekkonCCTests/TekkonCCTests_Intermediate.mm rename to Tests/TekkonCCTests/TekkonCCTests_Intermediate.mm index 305177a..2a94020 100644 --- a/TekkonCCTests/TekkonCCTests_Intermediate.mm +++ b/Tests/TekkonCCTests/TekkonCCTests_Intermediate.mm @@ -1,26 +1,10 @@ // (c) 2022 and onwards The vChewing Project (MIT-NTL License). -/* -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: - -1. The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -2. No trademark license is granted to use the trade names, trademarks, service -marks, or product names of Contributor, except as required to fulfill notice -requirements above. - -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. -*/ +// ==================== +// This code is released under the MIT license (SPDX-License-Identifier: MIT) +// ... with NTL restriction stating that: +// No trademark license is granted to use the trade names, trademarks, service +// marks, or product names of Contributor, except as required to fulfill notice +// requirements defined in MIT License. // ADVICE: Save as UTF8 without BOM signature!!!