FlineDev / BartyCrouch

Localization/I18n: Incrementally update/translate your Strings files from .swift, .h, .m(m), .storyboard or .xib files.
MIT License
1.37k stars 121 forks source link

[Bug] PodSpec does not support iOS anymore #273

Closed jonasbeckers closed 1 year ago

jonasbeckers commented 1 year ago

Expected Behavior:

BartyCrouch is compatible with iOS & macOS.

Current Behavior:

Only macOS is supported from version 4.14.0

Jeehut commented 1 year ago

@jonasbeckers Why would BartyCrouch support iOS? I have to admit, I have no idea how the CocoaPods support works here, but BartyCrouch itself only supports to be built for macOS as it can only be run on macOS (there's no Xcode for iOS). But as I did not add the CocoaPods support myself (it was a community contribution), I also don't fully understand how it's being used. If the macOS-only thing is a problem, feel free to post a PR adding back support for other platforms. But I had to explicitly add the supported platforms because CocoaPods was complaining while I made the last release.

Having that said, the official and recommended way to install BartyCrouch is via Homebrew. I know how that works and can provide more proper support for that. For CocoaPods, the community needs to help out.

jonasbeckers commented 1 year ago

I use it as a dependency to call in my Run script phase. This way I can have different version for different projects.

Jeehut commented 1 year ago

Why would you want to have different versions for different projects? BartyCrouch doesn't exactly have breaking changes, especially not anymore now that I released RemafoX as its successor. So I think having the latest version installed via Homebrew is gonna be better. But your choice. As I said, I can't provide support for something that I didn't add or understand. It's up to the community.

jonasbeckers commented 1 year ago

Allowing iOS in the podspec shouldn't be an issue, as it previously worked with older versions. Previously the podspec did not specify any limits on what platform was supported.

Jeehut commented 1 year ago

@jonasbeckers Previously, CocoaPods did not complain when I made a release. But recently it did. I had to specify the platforms explicitly. Adding iOS might still work, if you think so, feel free to post a PR where you've added back iOS, but make sure to test out everything works with building the Pod locally so I don't get an issue when I run pod trunk push. Then I'll happily make a new release.

djbe commented 1 year ago

Had the same thing happen with Sourcery (see https://github.com/krzysztofzablocki/Sourcery/issues/1098). As @jonasbeckers mentioned, adding other platforms fixes this.

Although, the solution used in Sourcery (adding multiple platform definitions) seems to be undefined behaviour. According to the CocoaPods podspec docs, to support multiple platforms we should use deployment_target. So I've based my PR on how SwiftLint does it.

Jeehut commented 1 year ago

@djbe Thank you for providing a possible fix. Unfortunately, the pod trunk push failed with the following output:

pod trunk push                                                        

[!] Found podspec `BartyCrouch.podspec`
Updating spec repo `trunk`
Validating podspec
 -> BartyCrouch (4.14.1)
    - NOTE  | xcodebuild:  note: Using codesigning identity override: -
    - NOTE  | xcodebuild:  note: Building targets in dependency order
    - NOTE  | [iOS] xcodebuild:  /var/folders/n_/vfzcwr7j3gndx375gg3pf9600000gn/T/CocoaPods-Lint-20221231-23982-dnhtcm-BartyCrouch/App.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.1.99. (in target 'App' from project 'App')
    - NOTE  | xcodebuild:  note: Metadata extraction skipped. No AppIntents.framework dependency found. (in target 'App' from project 'App')
    - NOTE  | [iOS] xcodebuild:  Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.1.99. (in target 'BartyCrouch' from project 'Pods')
    - NOTE  | [iOS] xcodebuild:  Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.1.99. (in target 'Pods-App' from project 'Pods')
    - NOTE  | xcodebuild:  note: Using codesigning identity override: 
    - NOTE  | [tvOS] xcodebuild:  Pods.xcodeproj: warning: The tvOS Simulator deployment target 'TVOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.1.99. (in target 'Pods-App' from project 'Pods')
    - NOTE  | [tvOS] xcodebuild:  Pods.xcodeproj: warning: The tvOS Simulator deployment target 'TVOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.1.99. (in target 'BartyCrouch' from project 'Pods')
    - NOTE  | [tvOS] xcodebuild:  /var/folders/n_/vfzcwr7j3gndx375gg3pf9600000gn/T/CocoaPods-Lint-20221231-23982-dnhtcm-BartyCrouch/App.xcodeproj: warning: The tvOS Simulator deployment target 'TVOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.1.99. (in target 'App' from project 'App')
    - ERROR | [watchOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
    - NOTE  | [watchOS] xcodebuild:  xcodebuild: error: Unable to find a destination matching the provided destination specifier:

[!] The spec did not pass validation, due to 1 error.

I just updated the versions by adding 2 MAJOR versions to iOS, tvOS, and watchOS. That god rid of the warnings, but it still failed with the watchOS error. So I removed watchOS from the list entirely for now, this worked. See 9d03ec1c296380a5b7090fb6dfae3535f8c61447.

So, everyone please try updating to 4.14.1 and see if you still run into this issue. You might if you have the build script in a watchOS target. But at least iOS and tvOS targets should work now. Thanks to @djbe!