From 08d9f03589ed114e2059b43011604cbaa4e7e6c1 Mon Sep 17 00:00:00 2001 From: Kyle Date: Mon, 4 Nov 2024 19:08:44 +0800 Subject: [PATCH] Add InternalImportsByDefault support --- Package.swift | 10 +++++++--- ...Update-permission-control-for-source.patch | 20 ++++++++++--------- Scripts/update.sh | 6 +++--- Sources/ProtobufKit/ProtobufDecoder.swift | 2 +- Sources/ProtobufKit/ProtobufEncoder.swift | 2 +- 5 files changed, 23 insertions(+), 17 deletions(-) diff --git a/Package.swift b/Package.swift index c4e7601..618e0d6 100644 --- a/Package.swift +++ b/Package.swift @@ -1,5 +1,4 @@ // swift-tools-version: 6.0 -// The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription @@ -43,7 +42,12 @@ let package = Package( .library(name: "ProtobufKit", type: libraryType, targets: ["ProtobufKit"]), ], targets: [ - .target(name: "ProtobufKit"), - testTarget, + .target( + name: "ProtobufKit", + swiftSettings: [ + .enableUpcomingFeature("InternalImportsByDefault"), + ] + ), + testTarget, ] ) diff --git a/Patches/0001-Update-permission-control-for-source.patch b/Patches/0001-Update-permission-control-for-source.patch index 07c9491..228c62e 100644 --- a/Patches/0001-Update-permission-control-for-source.patch +++ b/Patches/0001-Update-permission-control-for-source.patch @@ -1,16 +1,16 @@ -From 97c19450444211b2376beb4803c66c300f95593a Mon Sep 17 00:00:00 2001 +From 1192dab74ee93eae03c8948927c50e232f15334d Mon Sep 17 00:00:00 2001 From: Kyle -Date: Wed, 30 Oct 2024 13:51:49 +0800 +Date: Mon, 4 Nov 2024 18:13:17 +0800 Subject: [PATCH] Update permission control for source --- - .../Data/Protobuf/ProtobufDecoder.swift | 60 ++++---- - .../Data/Protobuf/ProtobufEncoder.swift | 128 +++++++++--------- + .../Data/Protobuf/ProtobufDecoder.swift | 62 ++++----- + .../Data/Protobuf/ProtobufEncoder.swift | 130 +++++++++--------- .../Data/Protobuf/ProtobufMessage.swift | 63 ++++----- - 3 files changed, 120 insertions(+), 131 deletions(-) + 3 files changed, 122 insertions(+), 133 deletions(-) diff --git a/Sources/OpenSwiftUICore/Data/Protobuf/ProtobufDecoder.swift b/Sources/OpenSwiftUICore/Data/Protobuf/ProtobufDecoder.swift -index ef3572a..13ab6c3 100644 +index 9b13d7e..f4dab78 100644 --- a/Sources/OpenSwiftUICore/Data/Protobuf/ProtobufDecoder.swift +++ b/Sources/OpenSwiftUICore/Data/Protobuf/ProtobufDecoder.swift @@ -1,25 +1,21 @@ @@ -23,7 +23,8 @@ index ef3572a..13ab6c3 100644 -// ID: FFA06CAF6B06DC3E21EC75547A0CD421 +// ProtobufKit - import Foundation +-package import Foundation ++public import Foundation /// An object that decodes instances of a data type from protobuf objects. -package struct ProtobufDecoder { @@ -247,7 +248,7 @@ index ef3572a..13ab6c3 100644 return try value(fromBinaryPlist: data) } diff --git a/Sources/OpenSwiftUICore/Data/Protobuf/ProtobufEncoder.swift b/Sources/OpenSwiftUICore/Data/Protobuf/ProtobufEncoder.swift -index 20c38d1..6bf0291 100644 +index 7f53954..56d563a 100644 --- a/Sources/OpenSwiftUICore/Data/Protobuf/ProtobufEncoder.swift +++ b/Sources/OpenSwiftUICore/Data/Protobuf/ProtobufEncoder.swift @@ -1,25 +1,21 @@ @@ -260,7 +261,8 @@ index 20c38d1..6bf0291 100644 -// ID: C7B3AAD101AF9EA76FC322BD6EF713E6 +// ProtobufKit - import Foundation +-package import Foundation ++public import Foundation /// An object that encodes instances of a data type as protobuf objects. -package struct ProtobufEncoder { diff --git a/Scripts/update.sh b/Scripts/update.sh index 3ff973c..70471d9 100755 --- a/Scripts/update.sh +++ b/Scripts/update.sh @@ -8,7 +8,7 @@ filepath() { PACKAGE_ROOT="$(dirname $(dirname $(filepath $0)))" UPSTREAM_REPO_URL="https://github.com/OpenSwiftUIProject/OpenSwiftUI" -UPSTREAM_COMMIT_HASH="ab3f0e91bddc98e04aac552cce1059cc4acac9e7" +UPSTREAM_COMMIT_HASH="724907a185dde986eda20357560e2c11c7fb2623" REPO_DIR="$PACKAGE_ROOT/.repos/OpenSwiftUI" PATCHES_DIR="$PACKAGE_ROOT/Patches" @@ -19,6 +19,8 @@ SOURCE_DES="$PACKAGE_ROOT/Sources/ProtobufKit" TEST_DIR="$REPO_DIR/Tests/OpenSwiftUICoreTests/Data/Protobuf" TEST_DEST="$PACKAGE_ROOT/Tests/ProtobufKitTests" +rm -rf $REPO_DIR + git clone --depth 1 $UPSTREAM_REPO_URL $REPO_DIR cd $REPO_DIR git fetch --depth=1 origin $UPSTREAM_COMMIT_HASH @@ -38,5 +40,3 @@ cp -r $SOURCE_DIR/* $SOURCE_DES/ mkdir -p $TEST_DEST cp -r $TEST_DIR/* $TEST_DEST/ - -rm -rf $REPO_DIR \ No newline at end of file diff --git a/Sources/ProtobufKit/ProtobufDecoder.swift b/Sources/ProtobufKit/ProtobufDecoder.swift index 13ab6c3..f4dab78 100644 --- a/Sources/ProtobufKit/ProtobufDecoder.swift +++ b/Sources/ProtobufKit/ProtobufDecoder.swift @@ -2,7 +2,7 @@ // ProtobufDecoder.swift // ProtobufKit -import Foundation +public import Foundation /// An object that decodes instances of a data type from protobuf objects. public struct ProtobufDecoder { diff --git a/Sources/ProtobufKit/ProtobufEncoder.swift b/Sources/ProtobufKit/ProtobufEncoder.swift index 6bf0291..56d563a 100644 --- a/Sources/ProtobufKit/ProtobufEncoder.swift +++ b/Sources/ProtobufKit/ProtobufEncoder.swift @@ -2,7 +2,7 @@ // ProtobufEncoder.swift // ProtobufKit -import Foundation +public import Foundation /// An object that encodes instances of a data type as protobuf objects. public struct ProtobufEncoder {