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

Explicitly set the PRODUCT_NAME to TARGET_NAME #2398

Merged
merged 1 commit into from Sep 22, 2015

Conversation

tonyarnold
Copy link
Contributor

When used as a subproject, the $PRODUCT_NAME variable was not being inferred from the xcconfigs. Setting the project level product name works around the problem (the tests use $TARGET_NAME and the frameworks all use $PROJECT_NAME).

I'm sure there's a problem here deeper than what I've investigated, but this PR fixes the symptoms reasonably cleanly.

Fixes #2395.

@NachoSoto
Copy link
Member

Awesome!
Just making sure: this is changed in the project, not the targets, right? That way we avoid duplication 👍

@tonyarnold
Copy link
Contributor Author

Absolutely — I've even removed the customised entries at the target levels on the tests.

@NachoSoto
Copy link
Member

Awesome!

@NachoSoto
Copy link
Member

Actually, one second. Using $TARGET_NAME means that other platforms, like watchOS would have a different product name, which is wrong!

Am I missing something?

@tonyarnold
Copy link
Contributor Author

It looks like it's an Xcode bug? Check the derived names of the framework targets — they're correctly getting their values from the xcconfigs, but only if the project has a PRODUCT_NAME set.

This bears some deeper investigation.

@neilpa
Copy link
Member

neilpa commented Sep 22, 2015

You should be able to use $(PROJECT_NAME) instead of target name

@neilpa
Copy link
Member

neilpa commented Sep 22, 2015

And then $(PROJECT_NAME)Tests for all the tests.

@tonyarnold
Copy link
Contributor Author

@neilpa this is more work/maintenance (modifying the setting in each test target, versus just the project), and I don't think it really changes the outcome. Happy to go with whatever, but I'd favour less maintenance.

Maybe we need our own local xcconfig on top of those included in the submodule?

@neilpa
Copy link
Member

neilpa commented Sep 22, 2015

I don't really care about the tests, can do whatever works and is easy there. However, I don't see how $TARGET_NAME works since that should resolve to ReactiveCocoa-Mac, ReactiveCocoa-iOS, etc.

@tonyarnold
Copy link
Contributor Author

$TARGET_NAME is being ignored on the non-tests. Like I said, it seems like a bug in Xcode and the fix seems ridiculous, but unless $PRODUCT_NAME is set a the project level, the value in the xcconfigs is not flowing through. Completely nuts 🔩

@neilpa
Copy link
Member

neilpa commented Sep 22, 2015

Ahh. I understand now. Lulz Xcode.

neilpa added a commit that referenced this pull request Sep 22, 2015
Explicitly set the PRODUCT_NAME to TARGET_NAME
@neilpa neilpa merged commit 50af8fe into ReactiveCocoa:swift2 Sep 22, 2015
@tonyarnold tonyarnold deleted the fix/product_name branch September 22, 2015 23:36
@tonyarnold
Copy link
Contributor Author

I've made a terrible mistake! This "feature" is fixed in Xcode 7.1, so now we end up with ReactiveCocoa-Mac.framework and a whole swag of problems. I'll submit a new PR to hardcore the name when I'm home later 😦

@NachoSoto
Copy link
Member

Oh yeah that explains what I was seeing today!

@tonyarnold
Copy link
Contributor Author

🤘 hardcore the name

tonyarnold added a commit to tonyarnold/ReactiveCocoa that referenced this pull request Oct 24, 2015
NachoSoto added a commit that referenced this pull request Oct 24, 2015
Hardcode the framework name to fix issues arising from #2398
neilpa added a commit that referenced this pull request Oct 24, 2015
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

Successfully merging this pull request may close these issues.

None yet

3 participants