diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..0cbb9fe --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,22 @@ +name: Pull request + +on: + pull_request: + types: [opened, reopened, synchronize] + +jobs: + tests: + name: Test + uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main + with: + linux_build_command: "swift build" + linux_exclude_swift_versions: '[{"swift_version": "5.8"}, {"swift_version": "5.9"}, {"swift_version": "5.10"}]' + windows_build_command: "swift build" + windows_exclude_swift_versions: '[{"swift_version": "5.9"}, {"swift_version": "5.10"}]' + soundness: + name: Soundness + uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main + with: + license_header_check_project_name: "Swift.org" + license_header_check_enabled: false + unacceptable_language_check_enabled: false diff --git a/Package.swift b/Package.swift index f174d20..06d305f 100644 --- a/Package.swift +++ b/Package.swift @@ -4,85 +4,86 @@ import PackageDescription var buildSettings: [CXXSetting] = [ - .define("DEBUG", to: "1", .when(configuration: .debug)), - .define("U_ATTRIBUTE_DEPRECATED", to: ""), - .define("U_SHOW_CPLUSPLUS_API", to: "1"), - .define("U_SHOW_INTERNAL_API", to: "1"), - .define("U_STATIC_IMPLEMENTATION"), - .define("U_TIMEZONE", to: "_timezone", .when(platforms: [.windows])), - .define("U_TIMEZONE", to: "timezone", - .when(platforms: [ - .iOS, - .macOS, - .tvOS, - .watchOS, - .macCatalyst, - .driverKit, - .android, - .linux, - ])), - .define("U_TIMEZONE_PACKAGE", to: "\"icutz44l\""), - .define("U_HAVE_TZSET", to: "0", .when(platforms: [.wasi])), - .define("U_HAVE_TZNAME", to: "0", .when(platforms: [.wasi])), - .define("U_HAVE_TIMEZONE", to: "0", .when(platforms: [.wasi])), - .define("FORTIFY_SOURCE", to: "2"), - .define("STD_INSPIRED"), - .define("MAC_OS_X_VERSION_MIN_REQUIRED", to: "101500"), - .define("_WASI_EMULATED_SIGNAL", .when(platforms: [.wasi])), - .define("_WASI_EMULATED_MMAN", .when(platforms: [.wasi])), - .define("U_HAVE_STRTOD_L", to: "1"), - .define("U_HAVE_XLOCALE_H", to: "1"), - .define("U_HAVE_STRING_VIEW", to: "1"), - .define("U_DISABLE_RENAMING", to: "1"), - .define("U_COMBINED_IMPLEMENTATION"), - .define("U_COMMON_IMPLEMENTATION"), - .define("U_I18N_IMPLEMENTATION"), - .define("U_IO_IMPLEMENTATION"), - .define("HAVE_DLFCN_H", to: "0", .when(platforms: [.wasi])), - .define("HAVE_DLOPEN", to: "0", .when(platforms: [.wasi])), - .define("U_ENABLE_DYLOAD", to: "0", .when(platforms: [.wasi])), + .define("DEBUG", to: "1", .when(configuration: .debug)), + .define("U_ATTRIBUTE_DEPRECATED", to: ""), + .define("U_SHOW_CPLUSPLUS_API", to: "1"), + .define("U_SHOW_INTERNAL_API", to: "1"), + .define("U_STATIC_IMPLEMENTATION"), + .define("U_TIMEZONE", to: "_timezone", .when(platforms: [.windows])), + .define( + "U_TIMEZONE", to: "timezone", + .when(platforms: [ + .iOS, + .macOS, + .tvOS, + .watchOS, + .macCatalyst, + .driverKit, + .android, + .linux, + ])), + .define("U_TIMEZONE_PACKAGE", to: "\"icutz44l\""), + .define("U_HAVE_TZSET", to: "0", .when(platforms: [.wasi])), + .define("U_HAVE_TZNAME", to: "0", .when(platforms: [.wasi])), + .define("U_HAVE_TIMEZONE", to: "0", .when(platforms: [.wasi])), + .define("FORTIFY_SOURCE", to: "2"), + .define("STD_INSPIRED"), + .define("MAC_OS_X_VERSION_MIN_REQUIRED", to: "101500"), + .define("_WASI_EMULATED_SIGNAL", .when(platforms: [.wasi])), + .define("_WASI_EMULATED_MMAN", .when(platforms: [.wasi])), + .define("U_HAVE_STRTOD_L", to: "1"), + .define("U_HAVE_XLOCALE_H", to: "1"), + .define("U_HAVE_STRING_VIEW", to: "1"), + .define("U_DISABLE_RENAMING", to: "1"), + .define("U_COMBINED_IMPLEMENTATION"), + .define("U_COMMON_IMPLEMENTATION"), + .define("U_I18N_IMPLEMENTATION"), + .define("U_IO_IMPLEMENTATION"), + .define("HAVE_DLFCN_H", to: "0", .when(platforms: [.wasi])), + .define("HAVE_DLOPEN", to: "0", .when(platforms: [.wasi])), + .define("U_ENABLE_DYLOAD", to: "0", .when(platforms: [.wasi])), - // Where data are stored - .define("ICU_DATA_DIR", to: "\"/usr/share/icu/\""), - .define("USE_PACKAGE_DATA", to: "1"), - .define("APPLE_ICU_CHANGES", to: "1"), - - .headerSearchPath("common"), - .headerSearchPath("io"), - .headerSearchPath("i18n"), - .define("SWIFT_PACKAGE", to: "1", .when(platforms: [.linux])), + // Where data are stored + .define("ICU_DATA_DIR", to: "\"/usr/share/icu/\""), + .define("USE_PACKAGE_DATA", to: "1"), + .define("APPLE_ICU_CHANGES", to: "1"), + + .headerSearchPath("common"), + .headerSearchPath("io"), + .headerSearchPath("i18n"), + .define("SWIFT_PACKAGE", to: "1", .when(platforms: [.linux])), ] #if os(Windows) -buildSettings.append(contentsOf: [ + buildSettings.append(contentsOf: [ .define("_CRT_SECURE_NO_DEPRECATE"), .define("U_PLATFORM_USES_ONLY_WIN32_API"), -]) + ]) #endif let linkerSettings: [LinkerSetting] = [ - .linkedLibrary("wasi-emulated-signal", .when(platforms: [.wasi])), - .linkedLibrary("wasi-emulated-mman", .when(platforms: [.wasi])), + .linkedLibrary("wasi-emulated-signal", .when(platforms: [.wasi])), + .linkedLibrary("wasi-emulated-mman", .when(platforms: [.wasi])), ] let package = Package( - name: "FoundationICU", - products: [ - .library( - name: "_FoundationICU", - targets: [ - "_FoundationICU" - ] - ) - ], - targets: [ - .target( - name: "_FoundationICU", - path: "icuSources", - exclude: ["stubdata"], - cxxSettings: buildSettings, - linkerSettings: linkerSettings - ) - ], - cxxLanguageStandard: .cxx14 + name: "FoundationICU", + products: [ + .library( + name: "_FoundationICU", + targets: [ + "_FoundationICU" + ] + ) + ], + targets: [ + .target( + name: "_FoundationICU", + path: "icuSources", + exclude: ["stubdata"], + cxxSettings: buildSettings, + linkerSettings: linkerSettings + ) + ], + cxxLanguageStandard: .cxx14 )