Skip to content

Commit

Permalink
Add InternalImportsByDefault support
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Ye committed Nov 4, 2024
1 parent 6999d13 commit 08d9f03
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 17 deletions.
10 changes: 7 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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,
]
)
20 changes: 11 additions & 9 deletions Patches/0001-Update-permission-control-for-source.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
From 97c19450444211b2376beb4803c66c300f95593a Mon Sep 17 00:00:00 2001
From 1192dab74ee93eae03c8948927c50e232f15334d Mon Sep 17 00:00:00 2001
From: Kyle <[email protected]>
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 @@
Expand All @@ -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 {
Expand Down Expand Up @@ -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 @@
Expand All @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions Scripts/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -38,5 +40,3 @@ cp -r $SOURCE_DIR/* $SOURCE_DES/

mkdir -p $TEST_DEST
cp -r $TEST_DIR/* $TEST_DEST/

rm -rf $REPO_DIR
2 changes: 1 addition & 1 deletion Sources/ProtobufKit/ProtobufDecoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion Sources/ProtobufKit/ProtobufEncoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 08d9f03

Please sign in to comment.