Browse Source

Retire SwiftProtobufFoundationCompat.

Since Foundation is still needed within SwiftProtobufCore, move the few files
back and rename them to call out that have the `Data` bridging.
Thomas Van Lenten 2 years ago
parent
commit
876e7eb67c

+ 2 - 3
DevTools/LibraryVersions.py

@@ -19,7 +19,6 @@ _VERSION_RE = re.compile(r'^(?P<major>\d+)\.(?P<minor>\d+)(.(?P<revision>\d+))?$
 
 _PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 _CORE_PODSPEC_PATH = os.path.join(_PROJECT_ROOT, 'SwiftProtobufCore.podspec')
-_FOUNDATION_PODSPEC_PATH = os.path.join(_PROJECT_ROOT, 'SwiftProtobufFoundationCompat.podspec')
 _PODSPEC_PATH = os.path.join(_PROJECT_ROOT, 'SwiftProtobuf.podspec')
 _VERSION_SWIFT_PATH = os.path.join(_PROJECT_ROOT, 'Sources/SwiftProtobufCore/Version.swift')
 
@@ -43,7 +42,7 @@ def ValidateFiles():
 
   # Test the other two podspecs.
   expected_version = 'version = \'%s.%s.%s\'' % (major, minor, revision)
-  for p in (_FOUNDATION_PODSPEC_PATH, _CORE_PODSPEC_PATH):
+  for p in (_CORE_PODSPEC_PATH,):
     pod_content = open(p).read()
     if expected_version not in open(p).read():
       Fail('Version in %s did not match SwiftProtobuf.podspec' % os.path.basename(p))
@@ -64,7 +63,7 @@ def UpdateFiles(version_string):
   (major, minor, revision) = ExtractVersion(version_string)
 
   # Update *.podspec
-  for p in (_FOUNDATION_PODSPEC_PATH, _CORE_PODSPEC_PATH, _PODSPEC_PATH):
+  for p in (_CORE_PODSPEC_PATH, _PODSPEC_PATH):
     pod_content = open(p).read()
     pod_content = re.sub(r'version = \'(\d+\.\d+\.\d+)\'',
                          'version = \'%s.%s.%s\'' % (major, minor, revision),

+ 2 - 13
Documentation/RELEASING.md

@@ -52,8 +52,7 @@ When doing a release:
 
    CocoaPods only does one Swift Module per podspec, so the current three modules can be modeled
    via three podspec files that have dependencies: SwiftProtobufCore.podspec ->
-   SwiftProtobufFoundationCompat.podspec -> SwiftProtobuf.podspec. So they end up having to
-   be published in that order:
+   SwiftProtobuf.podspec. So they end up having to be published in that order:
 
    1. Publish the `SwiftProtobufCore.podspec`:
 
@@ -64,15 +63,6 @@ When doing a release:
       _Note:_ This uses that local copy of the podspec, but checks against the sources on
       github.
 
-   1. Publish the `SwiftProtobufFoundationCompat.podspec`:
-
-      ```
-      $ pod trunk push SwiftProtobufFoundationCompat.podspec
-      ```
-
-      _Note:_ This uses that local copy of `SwiftProtobufFoundationCompat.podspec`, but checks
-      against the sources on github and the already published `SwiftProtobufCore.podspec`
-
    1. Publish the `SwiftProtobuf.podspec`:
 
       ```
@@ -80,8 +70,7 @@ When doing a release:
       ```
 
       _Note:_ This uses that local copy of `SwiftProtobuf.podspec`, but checks
-      against the sources on github and the already published `SwiftProtobufCore.podspec` and
-      `SwiftProtobufFoundationCompat.podspec`.
+      against the sources on github and the already published `SwiftProtobufCore.podspec`.
 
 1. Bump the version on _main_
 

+ 1 - 2
Makefile

@@ -526,6 +526,5 @@ test-conformance: build check-for-protobuf-checkout Sources/Conformance/failure_
 pod-lib-lint:
 	@if [ `uname -s` = "Darwin" ] ; then \
 	  pod lib lint SwiftProtobufCore.podspec ; \
-	  pod lib lint --include-podspecs=SwiftProtobufCore.podspec SwiftProtobufFoundationCompat.podspec ; \
-	  pod lib lint '--include-podspecs={SwiftProtobufCore.podspec,SwiftProtobufFoundationCompat.podspec}' SwiftProtobuf.podspec ; \
+	  pod lib lint '--include-podspecs=SwiftProtobufCore.podspec' SwiftProtobuf.podspec ; \
 	fi

+ 1 - 5
Package.swift

@@ -39,13 +39,9 @@ let package = Package(
         name: "SwiftProtobufCore",
         exclude: ["CMakeLists.txt"]
     ),
-    .target(
-        name: "SwiftProtobufFoundationCompat",
-        dependencies: ["SwiftProtobufCore"]
-    ),
     .target(
         name: "SwiftProtobuf",
-        dependencies: ["SwiftProtobufCore", "SwiftProtobufFoundationCompat"]
+        dependencies: ["SwiftProtobufCore"]
     ),
     .target(
         name: "SwiftProtobufPluginLibrary",

+ 1 - 3
Package@swift-5.4.swift

@@ -20,10 +20,8 @@ let package = Package(
   ],
   targets: [
     .target(name: "SwiftProtobufCore"),
-    .target(name: "SwiftProtobufFoundationCompat",
-            dependencies: ["SwiftProtobufCore"]),
     .target(name: "SwiftProtobuf",
-            dependencies: ["SwiftProtobufCore", "SwiftProtobufFoundationCompat"]),
+            dependencies: ["SwiftProtobufCore"]),
     .target(name: "SwiftProtobufPluginLibrary",
             dependencies: ["SwiftProtobuf"]),
     .target(name: "SwiftProtobufTestHelpers",

+ 1 - 3
Package@swift-5.5.swift

@@ -20,10 +20,8 @@ let package = Package(
   ],
   targets: [
     .target(name: "SwiftProtobufCore"),
-    .target(name: "SwiftProtobufFoundationCompat",
-            dependencies: ["SwiftProtobufCore"]),
     .target(name: "SwiftProtobuf",
-            dependencies: ["SwiftProtobufCore", "SwiftProtobufFoundationCompat"]),
+            dependencies: ["SwiftProtobufCore"]),
     .target(name: "SwiftProtobufPluginLibrary",
             dependencies: ["SwiftProtobuf"]),
     .target(name: "SwiftProtobufTestHelpers",

+ 1 - 3
Sources/SwiftProtobuf/Exports.swift

@@ -8,10 +8,8 @@
 //
 // -----------------------------------------------------------------------------
 ///
-/// File for declaring other module re-exports. This allows users to use both `SwiftProtobufCore`
-/// and `SwiftProtobufFoundationCompat` just by importing `SwiftProtobuf`.
+/// File for declaring other module re-exports.
 ///
 // -----------------------------------------------------------------------------
 
 @_exported import SwiftProtobufCore
-@_exported import SwiftProtobufFoundationCompat

+ 1 - 2
Sources/SwiftProtobufFoundationCompat/Message+BinaryAdditions.swift → Sources/SwiftProtobufCore/Message+BinaryAdditions_Data.swift

@@ -1,4 +1,4 @@
-// Sources/SwiftProtobufFoundationCompat/Message+BinaryAdditions.swift - Per-type binary coding
+// Sources/SwiftProtobufCore/Message+BinaryAdditions_Data.swift - Per-type binary coding
 //
 // Copyright (c) 2022 Apple Inc. and the project authors
 // Licensed under Apache License v2.0 with Runtime Library Exception
@@ -13,7 +13,6 @@
 // -----------------------------------------------------------------------------
 
 import Foundation
-import SwiftProtobufCore
 
 /// Binary encoding and decoding methods for messages.
 extension Message {

+ 1 - 2
Sources/SwiftProtobufFoundationCompat/Message+JSONAdditions.swift → Sources/SwiftProtobufCore/Message+JSONAdditions_Data.swift

@@ -1,4 +1,4 @@
-// Sources/SwiftProtobuf/Message+JSONAdditions.swift - JSON format primitive types
+// Sources/SwiftProtobufCore/Message+JSONAdditions_Data.swift - JSON format primitive types
 //
 // Copyright (c) 2022 Apple Inc. and the project authors
 // Licensed under Apache License v2.0 with Runtime Library Exception
@@ -13,7 +13,6 @@
 // -----------------------------------------------------------------------------
 
 import Foundation
-import SwiftProtobufCore
 
 /// JSON encoding and decoding methods for messages.
 extension Message {

+ 1 - 2
Sources/SwiftProtobufFoundationCompat/Message+JSONArrayAdditions.swift → Sources/SwiftProtobufCore/Message+JSONArrayAdditions_Data.swift

@@ -1,4 +1,4 @@
-// Sources/SwiftProtobuf/Array+JSONAdditions.swift - JSON format primitive types
+// Sources/SwiftProtobufCore/Message+JSONArrayAdditions_Data.swift - JSON format primitive types
 //
 // Copyright (c) 2014 - 2017 Apple Inc. and the project authors
 // Licensed under Apache License v2.0 with Runtime Library Exception
@@ -13,7 +13,6 @@
 // -----------------------------------------------------------------------------
 
 import Foundation
-import SwiftProtobufCore
 
 /// JSON encoding and decoding methods for arrays of messages.
 extension Message {

+ 0 - 1
SwiftProtobuf.podspec

@@ -20,7 +20,6 @@ Pod::Spec.new do |s|
   # Require and exact match on the dependency, since it isn't yet clear
   # if we'll be able to support interop between minor/bugfixes.
   s.dependency 'SwiftProtobufCore', "= #{s.version}"
-  s.dependency 'SwiftProtobufFoundationCompat', "= #{s.version}"
 
   s.swift_versions = ['5.0']
 end

+ 0 - 25
SwiftProtobufFoundationCompat.podspec

@@ -1,25 +0,0 @@
-Pod::Spec.new do |s|
-  s.name = 'SwiftProtobufFoundationCompat'
-  s.version = '2.0.0'
-  s.license = { :type => 'Apache 2.0', :file => 'LICENSE.txt' }
-  s.summary = 'Swift Protobuf Foundation Compatibility Library'
-  s.homepage = 'https://github.com/apple/swift-protobuf'
-  s.author = 'Apple Inc.'
-  s.source = { :git => 'https://github.com/apple/swift-protobuf.git', :tag => s.version }
-
-  s.requires_arc = true
-  s.ios.deployment_target = '9.0'
-  s.osx.deployment_target = '10.9'
-  s.tvos.deployment_target = '9.0'
-  s.watchos.deployment_target = '2.0'
-
-  s.cocoapods_version = '>= 1.7.0'
-
-  s.source_files = 'Sources/SwiftProtobufFoundationCompat/**/*.swift'
-
-  # Require and exact match on the dependency, since it isn't yet clear
-  # if we'll be able to support interop between minor/bugfixes.
-  s.dependency 'SwiftProtobufCore', "= #{s.version}"
-
-  s.swift_versions = ['5.0']
-end