fermoya / cocoapods-catalyst-support

Ruby extensions to help you configure your pods project so that pods not compiled for Catalyst can still be used for iOS devices
MIT License
111 stars 18 forks source link

Script won't remove any libraries #10

Closed jhmacdon closed 3 years ago

jhmacdon commented 3 years ago

Maybe I am using it wrong, but unless I comment out this line: pod_names_to_remove = podfile.dependencies.filter do |d| pod_names_to_remove.include? d.name end.flat_map do |d| [d.name, d.to_root_dependency.name] end.map do |s| s.sub('/', '') end

the script doesn't seem to remove any of the libraries.

Setting my unsupported pods to:

["FirebaseAnalytics", "FIRAnalyticsConnector", "GoogleAppMeasurement", "Mapbox", "FirebasePerformance"]`

Has the debug output of: 
`#### Unsupported Libraries ####
["FIRAnalyticsConnector", "Mapbox"]

#### Unsupported dependencies ####
[]

#### Frameworks not to be included in the Archive ####
[]

#### Resources not to be included in the Archive ####
[]

If I add the first line back in, they're all empty.

Sorry if I am not understanding something. Build seems to work just fine for ios devices still, but the catalyst builds have the same problem as always

fermoya commented 3 years ago

Hi @jhmacdon can you please share your Podfile?

Also, can you make sure you use the last version of the script please?

fermoya commented 3 years ago

@jhmacdon I'm not sure if the documentation isn't clear enough and if so please let me know and I'll try to rephrase it.

To exclude FirebaseAnalytics you need to add it to catalyst_unsupported_pods the same way you install it. That is, if you do pod 'Firebase/Analytics' the same name must go to catalyst_unsupported_pods. The line you're commenting is checking that the excluded pod is a dependency in the Podfile. If you use pod 'FirebaseAnalytics' then your dependency is FirebaseAnalytics. If you use pod 'Firebase/Analytics', then the dependency is 'Firebase/Analytics'.

I haven't tried MapBox but according to their documentation, you need to install it by executing pod 'Mapbox-iOS-SDK'. This means that your Podfile should look like:

load 'remove_ios_only_frameworks.rb'

target MyApp do
  use_frameworks!

  pod "Firebase/Analytics"
  pod "Mapbox-iOS-SDK"
end

def catalyst_unsupported_pods
  [
    "Firebase/Analytics",
    "Mapbox-iOS-SDK"
  ]
end

post_install do |installer|
  installer.configure_support_catalyst
end
fermoya commented 3 years ago

I'm closing this issue, feel free to open a new one if you find any issue