From a7f8956311414dd445679629ed0e44335a414397 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 29 Nov 2022 12:02:39 +1300 Subject: [PATCH 1/4] Fix 'duplicated UUIDs' warning produced by 'pod install' --- CHANGELOG.md | 6 ++++++ WordPressShared.podspec | 22 ++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fc6bb3..bc5ff93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,12 @@ _None._ _None._ +## [2.0.0-beta.2](https://github.com/wordpress-mobile/WordPress-iOS-Shared/releases/tag/2.0.0-beta.2) + +### Bug Fixes + +- Fix an issue where 'pod install' produces a 'duplicate UUID' warning. + ## [2.0.0-beta.1](https://github.com/wordpress-mobile/WordPress-iOS-Shared/releases/tag/2.0.0-beta.1) ### Breaking Changes diff --git a/WordPressShared.podspec b/WordPressShared.podspec index 3246fdc..9f2f4c0 100644 --- a/WordPressShared.podspec +++ b/WordPressShared.podspec @@ -2,9 +2,24 @@ # rubocop:disable Metrics/BlockLength +# Helper to lookup ObjC source files +module Lookup + def self.objc_files + directory = Pathname.new('Sources/WordPressSharedObjC') + include_dir = directory.join('include') + public_header_files = include_dir.glob('*.h') + .map { |link| link.realpath.relative_path_from(Dir.pwd) } + source_files = directory.glob('**/*.{h,m}').reject { |file| (file <=> include_dir) == 1 } + { + source_files: source_files.map(&:to_s), + public_header_files: public_header_files.map(&:to_s) + } + end +end + Pod::Spec.new do |s| s.name = 'WordPressShared' - s.version = '2.0.0-beta.1' + s.version = '2.0.0-beta.2' s.summary = 'Shared components used in building the WordPress iOS apps and other library components.' s.description = <<-DESC @@ -21,9 +36,8 @@ Pod::Spec.new do |s| s.swift_version = '5.0' s.source = { git: 'https://github.com/wordpress-mobile/WordPress-iOS-Shared.git', tag: s.version.to_s } - s.source_files = 'Sources/WordPressShared/**/*.swift', 'Sources/WordPressSharedObjC/**/*.{h,m}' - s.public_header_files = 'Sources/WordPressSharedObjC/include', 'Sources/WordPressSharedObjC/WordPressShared.h' - s.private_header_files = 'Sources/WordPressSharedObjC/Private/*.h' + s.source_files = ['Sources/WordPressShared/**/*.swift'] + Lookup.objc_files[:source_files] + s.public_header_files = ['Sources/WordPressSharedObjC/WordPressShared.h'] + Lookup.objc_files[:public_header_files] s.resource_bundles = { WordPressShared: [ 'Sources/WordPressShared/Resources/*.{ttf,otf,json}', From a33647360f2f52a0743e19475021d3792f19be21 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 29 Nov 2022 12:35:46 +1300 Subject: [PATCH 2/4] Use rake's FileList instead of our own function --- WordPressShared.podspec | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/WordPressShared.podspec b/WordPressShared.podspec index 9f2f4c0..b03ca92 100644 --- a/WordPressShared.podspec +++ b/WordPressShared.podspec @@ -1,21 +1,8 @@ # frozen_string_literal: true -# rubocop:disable Metrics/BlockLength +require 'rake' -# Helper to lookup ObjC source files -module Lookup - def self.objc_files - directory = Pathname.new('Sources/WordPressSharedObjC') - include_dir = directory.join('include') - public_header_files = include_dir.glob('*.h') - .map { |link| link.realpath.relative_path_from(Dir.pwd) } - source_files = directory.glob('**/*.{h,m}').reject { |file| (file <=> include_dir) == 1 } - { - source_files: source_files.map(&:to_s), - public_header_files: public_header_files.map(&:to_s) - } - end -end +# rubocop:disable Metrics/BlockLength Pod::Spec.new do |s| s.name = 'WordPressShared' @@ -36,8 +23,9 @@ Pod::Spec.new do |s| s.swift_version = '5.0' s.source = { git: 'https://github.com/wordpress-mobile/WordPress-iOS-Shared.git', tag: s.version.to_s } - s.source_files = ['Sources/WordPressShared/**/*.swift'] + Lookup.objc_files[:source_files] - s.public_header_files = ['Sources/WordPressSharedObjC/WordPressShared.h'] + Lookup.objc_files[:public_header_files] + s.source_files = ['Sources/WordPressShared/**/*.swift'] \ + + FileList['Sources/WordPressSharedObjC/**/*.{h,m}'].exclude('Sources/WordPressSharedObjC/include') + s.public_header_files = 'Sources/WordPressSharedObjC/include', 'Sources/WordPressSharedObjC/WordPressShared.h' s.resource_bundles = { WordPressShared: [ 'Sources/WordPressShared/Resources/*.{ttf,otf,json}', From 00a19e0577c13567dedcd822630d532b3dce4f28 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 29 Nov 2022 12:37:07 +1300 Subject: [PATCH 3/4] Bring back the private_header_files --- WordPressShared.podspec | 1 + 1 file changed, 1 insertion(+) diff --git a/WordPressShared.podspec b/WordPressShared.podspec index b03ca92..a76324b 100644 --- a/WordPressShared.podspec +++ b/WordPressShared.podspec @@ -26,6 +26,7 @@ Pod::Spec.new do |s| s.source_files = ['Sources/WordPressShared/**/*.swift'] \ + FileList['Sources/WordPressSharedObjC/**/*.{h,m}'].exclude('Sources/WordPressSharedObjC/include') s.public_header_files = 'Sources/WordPressSharedObjC/include', 'Sources/WordPressSharedObjC/WordPressShared.h' + s.private_header_files = 'Sources/WordPressSharedObjC/Private/*.h' s.resource_bundles = { WordPressShared: [ 'Sources/WordPressShared/Resources/*.{ttf,otf,json}', From b25c94f772fbf32808c6e6bf66bfb2033ee59d5b Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 29 Nov 2022 12:38:47 +1300 Subject: [PATCH 4/4] Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc5ff93..2debc2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,7 +52,7 @@ _None._ ### Bug Fixes -- Fix an issue where 'pod install' produces a 'duplicate UUID' warning. +- Fix an issue where 'pod install' produces a 'duplicate UUID' warning. [#327] ## [2.0.0-beta.1](https://github.com/wordpress-mobile/WordPress-iOS-Shared/releases/tag/2.0.0-beta.1)