Skip to content

Commit 08d9f03

Browse files
committed
Add InternalImportsByDefault support
1 parent 6999d13 commit 08d9f03

File tree

5 files changed

+23
-17
lines changed

5 files changed

+23
-17
lines changed

Package.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// swift-tools-version: 6.0
2-
// The swift-tools-version declares the minimum version of Swift required to build this package.
32

43
import PackageDescription
54

@@ -43,7 +42,12 @@ let package = Package(
4342
.library(name: "ProtobufKit", type: libraryType, targets: ["ProtobufKit"]),
4443
],
4544
targets: [
46-
.target(name: "ProtobufKit"),
47-
testTarget,
45+
.target(
46+
name: "ProtobufKit",
47+
swiftSettings: [
48+
.enableUpcomingFeature("InternalImportsByDefault"),
49+
]
50+
),
51+
testTarget,
4852
]
4953
)

Patches/0001-Update-permission-control-for-source.patch

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
From 97c19450444211b2376beb4803c66c300f95593a Mon Sep 17 00:00:00 2001
1+
From 1192dab74ee93eae03c8948927c50e232f15334d Mon Sep 17 00:00:00 2001
22
From: Kyle <[email protected]>
3-
Date: Wed, 30 Oct 2024 13:51:49 +0800
3+
Date: Mon, 4 Nov 2024 18:13:17 +0800
44
Subject: [PATCH] Update permission control for source
55

66
---
7-
.../Data/Protobuf/ProtobufDecoder.swift | 60 ++++----
8-
.../Data/Protobuf/ProtobufEncoder.swift | 128 +++++++++---------
7+
.../Data/Protobuf/ProtobufDecoder.swift | 62 ++++-----
8+
.../Data/Protobuf/ProtobufEncoder.swift | 130 +++++++++---------
99
.../Data/Protobuf/ProtobufMessage.swift | 63 ++++-----
10-
3 files changed, 120 insertions(+), 131 deletions(-)
10+
3 files changed, 122 insertions(+), 133 deletions(-)
1111

1212
diff --git a/Sources/OpenSwiftUICore/Data/Protobuf/ProtobufDecoder.swift b/Sources/OpenSwiftUICore/Data/Protobuf/ProtobufDecoder.swift
13-
index ef3572a..13ab6c3 100644
13+
index 9b13d7e..f4dab78 100644
1414
--- a/Sources/OpenSwiftUICore/Data/Protobuf/ProtobufDecoder.swift
1515
+++ b/Sources/OpenSwiftUICore/Data/Protobuf/ProtobufDecoder.swift
1616
@@ -1,25 +1,21 @@
@@ -23,7 +23,8 @@ index ef3572a..13ab6c3 100644
2323
-// ID: FFA06CAF6B06DC3E21EC75547A0CD421
2424
+// ProtobufKit
2525

26-
import Foundation
26+
-package import Foundation
27+
+public import Foundation
2728

2829
/// An object that decodes instances of a data type from protobuf objects.
2930
-package struct ProtobufDecoder {
@@ -247,7 +248,7 @@ index ef3572a..13ab6c3 100644
247248
return try value(fromBinaryPlist: data)
248249
}
249250
diff --git a/Sources/OpenSwiftUICore/Data/Protobuf/ProtobufEncoder.swift b/Sources/OpenSwiftUICore/Data/Protobuf/ProtobufEncoder.swift
250-
index 20c38d1..6bf0291 100644
251+
index 7f53954..56d563a 100644
251252
--- a/Sources/OpenSwiftUICore/Data/Protobuf/ProtobufEncoder.swift
252253
+++ b/Sources/OpenSwiftUICore/Data/Protobuf/ProtobufEncoder.swift
253254
@@ -1,25 +1,21 @@
@@ -260,7 +261,8 @@ index 20c38d1..6bf0291 100644
260261
-// ID: C7B3AAD101AF9EA76FC322BD6EF713E6
261262
+// ProtobufKit
262263

263-
import Foundation
264+
-package import Foundation
265+
+public import Foundation
264266

265267
/// An object that encodes instances of a data type as protobuf objects.
266268
-package struct ProtobufEncoder {

Scripts/update.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ filepath() {
88
PACKAGE_ROOT="$(dirname $(dirname $(filepath $0)))"
99

1010
UPSTREAM_REPO_URL="https://github.com/OpenSwiftUIProject/OpenSwiftUI"
11-
UPSTREAM_COMMIT_HASH="ab3f0e91bddc98e04aac552cce1059cc4acac9e7"
11+
UPSTREAM_COMMIT_HASH="724907a185dde986eda20357560e2c11c7fb2623"
1212

1313
REPO_DIR="$PACKAGE_ROOT/.repos/OpenSwiftUI"
1414
PATCHES_DIR="$PACKAGE_ROOT/Patches"
@@ -19,6 +19,8 @@ SOURCE_DES="$PACKAGE_ROOT/Sources/ProtobufKit"
1919
TEST_DIR="$REPO_DIR/Tests/OpenSwiftUICoreTests/Data/Protobuf"
2020
TEST_DEST="$PACKAGE_ROOT/Tests/ProtobufKitTests"
2121

22+
rm -rf $REPO_DIR
23+
2224
git clone --depth 1 $UPSTREAM_REPO_URL $REPO_DIR
2325
cd $REPO_DIR
2426
git fetch --depth=1 origin $UPSTREAM_COMMIT_HASH
@@ -38,5 +40,3 @@ cp -r $SOURCE_DIR/* $SOURCE_DES/
3840

3941
mkdir -p $TEST_DEST
4042
cp -r $TEST_DIR/* $TEST_DEST/
41-
42-
rm -rf $REPO_DIR

Sources/ProtobufKit/ProtobufDecoder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// ProtobufDecoder.swift
33
// ProtobufKit
44

5-
import Foundation
5+
public import Foundation
66

77
/// An object that decodes instances of a data type from protobuf objects.
88
public struct ProtobufDecoder {

Sources/ProtobufKit/ProtobufEncoder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// ProtobufEncoder.swift
33
// ProtobufKit
44

5-
import Foundation
5+
public import Foundation
66

77
/// An object that encodes instances of a data type as protobuf objects.
88
public struct ProtobufEncoder {

0 commit comments

Comments
 (0)