Subito-it / PodBuilder

A tool to precompile CocoaPods pods
Other
284 stars 28 forks source link

Can't override SWIFT_VERSION #18

Closed gutaker closed 4 years ago

gutaker commented 4 years ago

Hi,

as the title says I can't get it to work, no matter what method I always get an error like:

Unable to determine Swift version for the following pods:

- `Alamofire` does not specify a Swift version and none of the targets (`DummyTarget`) integrating it have the `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/xcode/target_validator.rb:125:in `verify_swift_pods_swift_version'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/xcode/target_validator.rb:39:in `validate!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:590:in `validate_targets'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:158:in `install!'
    /Library/Ruby/Gems/2.6.0/gems/pod-builder-1.9.4/lib/pod_builder/install.rb:146:in `install'
    /Library/Ruby/Gems/2.6.0/gems/pod-builder-1.9.4/lib/pod_builder/install.rb:117:in `podfile'
    /Library/Ruby/Gems/2.6.0/gems/pod-builder-1.9.4/lib/pod_builder/command/build.rb:79:in `block in call'
    /Library/Ruby/Gems/2.6.0/gems/pod-builder-1.9.4/lib/pod_builder/command/build.rb:75:in `each'
    /Library/Ruby/Gems/2.6.0/gems/pod-builder-1.9.4/lib/pod_builder/command/build.rb:75:in `call'
    /Library/Ruby/Gems/2.6.0/gems/pod-builder-1.9.4/lib/pod_builder/command/build_all.rb:11:in `call'
    /Library/Ruby/Gems/2.6.0/gems/pod-builder-1.9.4/exe/pod_builder:362:in `block in parse_commandline'
    /Library/Ruby/Gems/2.6.0/gems/pod-builder-1.9.4/exe/pod_builder:361:in `each'
    /Library/Ruby/Gems/2.6.0/gems/pod-builder-1.9.4/exe/pod_builder:361:in `parse_commandline'
    /Library/Ruby/Gems/2.6.0/gems/pod-builder-1.9.4/exe/pod_builder:379:in `<top (required)>'
    /usr/local/bin/pod_builder:23:in `load'
    /usr/local/bin/pod_builder:23:in `<main>'

Command failed!

macOS Catalina 10.15.7 Xcode 11.7 Cocoapods 1.9.3 pod-builder 1.9.4

The Podfile:

platform :ios, '10.0'

target 'ScrollViewTest' do
  use_frameworks!

  pod 'Alamofire', '4.8.1'
end

ENV['COCOAPODS_DISABLE_STATS'] = "true"

Tried spec_overrides inside Podbuilder.json:

"spec_overrides": {
    "Alamofire": {
      "swift_version": "5.0"
    }
  }

Tried post_install like this:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = "5.0"
    end
  end
end

Tried pre_install like this:

pre_install do |installer|
  installer.analysis_result.specifications.each do |s|
    s.root.swift_versions << '5' if s.root.swift_versions.empty?
  end
end
tcamin commented 4 years ago

Please try again using the beta version. ‘gem install pod-builder —pre’

On Wed, 30 Sep 2020 at 21:55 Patryk Gutaker notifications@github.com wrote:

Hi,

as the title says I can't get it to work, no matter what method I always get an error like:

Unable to determine Swift version for the following pods:

  • Alamofire does not specify a Swift version and none of the targets (DummyTarget) integrating it have the SWIFT_VERSION attribute set. Please contact the author or set the SWIFT_VERSION attribute in at least one of the targets that integrate this pod.

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/xcode/target_validator.rb:125:in `verify_swift_pods_swift_version'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/xcode/target_validator.rb:39:in `validate!'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:590:in `validate_targets'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:158:in `install!'

/Library/Ruby/Gems/2.6.0/gems/pod-builder-1.9.4/lib/pod_builder/install.rb:146:in `install'

/Library/Ruby/Gems/2.6.0/gems/pod-builder-1.9.4/lib/pod_builder/install.rb:117:in `podfile'

/Library/Ruby/Gems/2.6.0/gems/pod-builder-1.9.4/lib/pod_builder/command/build.rb:79:in `block in call'

/Library/Ruby/Gems/2.6.0/gems/pod-builder-1.9.4/lib/pod_builder/command/build.rb:75:in `each'

/Library/Ruby/Gems/2.6.0/gems/pod-builder-1.9.4/lib/pod_builder/command/build.rb:75:in `call'

/Library/Ruby/Gems/2.6.0/gems/pod-builder-1.9.4/lib/pod_builder/command/build_all.rb:11:in `call'

/Library/Ruby/Gems/2.6.0/gems/pod-builder-1.9.4/exe/pod_builder:362:in `block in parse_commandline'

/Library/Ruby/Gems/2.6.0/gems/pod-builder-1.9.4/exe/pod_builder:361:in `each'

/Library/Ruby/Gems/2.6.0/gems/pod-builder-1.9.4/exe/pod_builder:361:in `parse_commandline'

/Library/Ruby/Gems/2.6.0/gems/pod-builder-1.9.4/exe/pod_builder:379:in `<top (required)>'

/usr/local/bin/pod_builder:23:in `load'

/usr/local/bin/pod_builder:23:in `

'

Command failed!

macOS Catalina 10.15.7

Xcode 11.7

Cocoapods 1.9.3

pod-builder 1.9.4

The Podfile:

platform :ios, '10.0'

target 'ScrollViewTest' do

use_frameworks!

pod 'Alamofire', '4.8.1'

end

ENV['COCOAPODS_DISABLE_STATS'] = "true"

Tried spec_overrides inside Podbuilder.json:

"spec_overrides": {

"Alamofire": {

  "swift_version": "5.0"

}

}

Tried post_install like this:

post_install do |installer|

installer.pods_project.targets.each do |target|

  target.build_configurations.each do |config|

      config.build_settings['SWIFT_VERSION'] = "5.0"

  end

end

end

Tried pre_install like this:

pre_install do |installer|

installer.analysis_result.specifications.each do |s|

s.root.swift_versions << '5' if s.root.swift_versions.empty?

end

end

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Subito-it/PodBuilder/issues/18, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGVUEON6VAOIYQMT6DYR53SIOEJXANCNFSM4R7QRDMA .

gutaker commented 4 years ago

Please try again using the beta version. ‘gem install pod-builder —pre’

Thanks, worked like a charm!

Could you please provide ETA of 2.0 release? I'd like to use your magnificent piece of software in production pipeline, but for my team it has to be "stable".

Anyway, great job!

tcamin commented 4 years ago

It's a few weeks ahead max.