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

Generated obj-c class name is not changing after project name is changed in podfile #168

Open
zcsipler opened this issue Jun 20, 2017 · 10 comments

Comments

@zcsipler
Copy link

When I started to use cocoapods-keys, for the first try I used the sample code to test, so I added Eidolon as project name.

plugin 'cocoapods-keys', {
    :project => "Eidolon",
    :keys => [
    "SomeTestKey"
    ]}

Then a class was generated, correctly named "EidolonKeys" . Later I wanted to use the real name of my project so I changed it in the podfile:

plugin 'cocoapods-keys', {
    :project => "MyProject",
    :keys => [
    "SomeTestKey"
    ]}

After running either "pod install" or "pod update" still "EidolonKeys" class is generated instead of "MyProjectKeys". I would expect that the name of the generated class is always generated depending on the name which is defined in the podfile, in order to keep consistency with the ci and with other colleges who might be working on the same project. Am I doing something wrong, is it somehow possible to fix this issue?

@zcsipler zcsipler changed the title Geneared obj-c class name is not changing after project name is changed in podfile Generated obj-c class name is not changing after project name is changed in podfile Jun 20, 2017
@orta
Copy link
Owner

orta commented Jun 20, 2017

Try run pod deintegrate then pod install again, it shouldn't be keeping it around

@zcsipler
Copy link
Author

Just tried ,it doesn't work, still EidolonKeys class is generated :(

@orta
Copy link
Owner

orta commented Jun 20, 2017

Is it possible it's doing both?

@zcsipler
Copy link
Author

No, the only one class generated is "EidolonKeys", nothing else. And even if I update the podfile with a new key e.g.

plugin 'cocoapods-keys', {
:project => "MyProject",
:keys => [
"SomeTestKey",
"SomeOtherTestKey"
]}

the new property "someOtherTestKey" is inserted in EidolonKeys class. So it definitely updates, only the class name remains the old one

@orta
Copy link
Owner

orta commented Jun 20, 2017

Try use Target as well then, it lets you specify the name

If you need to specify a different project name from the target name, use the key :target to specify it.

e.g.

plugin 'cocoapods-keys', {
  :project => "MyProject",
  :target => "MyProject"
  :keys => [
    "SomeTestKey",
    "SomeOtherTestKey"
  ]}

@zcsipler
Copy link
Author

I already tried it but didn't help either.

@dfeddad
Copy link

dfeddad commented Sep 20, 2017

I had the same issue today, and found out that changing the project name in the Podfile is not enough for cocoapods-key to pickup the new name, you have to change the name in the YAML file generated by cocoapods-key.

Follow these steps to fix this problem:

  • Locate the generated YAML file for your project (you can find it in this folder ~/.cocoapods/keys)

The content of the file should look like this:

---
keys:
- Key1
- Key2
-....
path: [PATH_TO_YOUR_PROJECT_FOLDER]
name: [PROJECT_NAME]
  • Update the [PROJECT_NAME]

@jarrodparkes
Copy link

@dfeddad solution worked for me. so did removing the YAML file from ~/.cocoapods/keys

@jarrodparkes
Copy link

would it be possible to allow for the customizing of the name of the obfuscated class?

@deda9
Copy link

deda9 commented Nov 19, 2019

Perfect, that was awesome, it worked like charm!

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

5 participants