Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute after_prepare hook only on iOS/OSX platform #80

Open
foonjs opened this issue Nov 1, 2023 · 0 comments
Open

Execute after_prepare hook only on iOS/OSX platform #80

foonjs opened this issue Nov 1, 2023 · 0 comments

Comments

@foonjs
Copy link

foonjs commented Nov 1, 2023

In my current Cordova based project that runs on both Android and iOS, config.xml used for Android has a different project name than the one in iOS. Whenever after_prepare hook is triggered, it encountered error at finding for "project_name".xcodeproj.

Would suggest moving this hook into iOS and OSX specifically to prevent this hook from running when this command "cordova platform add android" is being executed.

<platform name="ios">
    <hook type="after_prepare" src="src/add-swift-support.js" />
    <hook type="after_platform_add" src="src/add-swift-support.js" />
    <hook type="after_plugin_add" src="src/add-swift-support.js" />
  </platform>
  <platform name="osx">
    <hook type="after_prepare" src="src/add-swift-support.js" />
    <hook type="after_platform_add" src="src/add-swift-support.js" />
    <hook type="after_plugin_add" src="src/add-swift-support.js" />
  </platform>
@foonjs foonjs changed the title Include after_prepare hook only when the platform is iOS or OSX Execute after_prepare hook only on iOS/OSX platform Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant