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

Incorrect deletion of unused identifiers #38

Open
vadimtrifonov opened this issue Sep 20, 2016 · 14 comments
Open

Incorrect deletion of unused identifiers #38

vadimtrifonov opened this issue Sep 20, 2016 · 14 comments

Comments

@vadimtrifonov
Copy link

When the script deletes unused identifiers it breaks the JSON structure by deleting only a single line and not a whole JSON object.

Following lines were deleted because of invalid format or no longer being used:
F6DD48671553FA9700A11AA0 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F6DD485D1553FA9700A11AA0 /* Localizable.strings */; };
F6DD48671553FA9700A11AA0 /* Localizable.strings in Resources */,
F6DD485D1553FA9700A11AA0 /* Localizable.strings */ = {

While leaving:
isa = PBXVariantGroup;
children = (
);
name = Localizable.strings;
path = "/Users/xp/Documents/iphone-app/Resources/Localization/EE";
sourceTree = "<absolute>";
};

@truebit
Copy link
Owner

truebit commented Sep 20, 2016

yes, it's a known issue.

Sent from my mobile device.

在 2016年9月20日,21:36,Vadim [email protected] 写道:

When the script deletes unused identifiers it breaks the JSON structure by deleting only a single line and not a whole JSON object.

Following lines were deleted because of invalid format or no longer being used:
F6DD48671553FA9700A11AA0 /* Localizable.strings in Resources / = {isa = PBXBuildFile; fileRef = F6DD485D1553FA9700A11AA0 / Localizable.strings /; };
F6DD48671553FA9700A11AA0 /
Localizable.strings in Resources /,
F6DD485D1553FA9700A11AA0 /
Localizable.strings */ = {

While leaving:
isa = PBXVariantGroup;
children = (
);
name = Localizable.strings;
path = "/Users/xp/Documents/iphone-app/Resources/Localization/EE";
sourceTree = "";
};


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@frranck
Copy link

frranck commented Nov 5, 2016

Hi @truebit
Is it a known issue that has been fixed ?

@truebit
Copy link
Owner

truebit commented Nov 5, 2016

there is an open PR saying fixed this. You could give it a try.

It's a major change, I have no time doing tests.

Sent from my mobile device.

在 2016年11月5日,23:06,frranck [email protected] 写道:

Hi @truebit
Is it a known issue that has been fixed ?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@frranck
Copy link

frranck commented Nov 8, 2016

I tried both the master version and the PR version and both broke my project.pbxproj :(
Do you know if your project supports files with similar names but located in different directories for different targets ?

@truebit
Copy link
Owner

truebit commented Nov 9, 2016

yes,it should support. could you send me your project file?

Sent from my mobile device.

在 2016年11月8日,20:53,frranck [email protected] 写道:

I tried both the master version and the PR version and both broke my project.pbxproj :(
Do you know if your project supports files with similar names but located in directories for different targets ?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@simonayzman
Copy link

This is still an issue. Any movement on this?

@truebit
Copy link
Owner

truebit commented Jul 18, 2017

@simonayzman Nope. This fix would change the core method to do the replacement, it's a major change. But in master branch, I added more logs to indicate that maybe texts needs to be deleted manually

@simonayzman
Copy link

@truebit Do you have a roadmap or suggestions for how you would fix it? In case someone decides to take a crack at it.

@miriyas
Copy link

miriyas commented Nov 21, 2017

Is there anyone knows replacement of this project?

@truebit
Copy link
Owner

truebit commented Nov 21, 2017

@simonayzman You could try to make a mark if you delete a line ends with character like ( or {, then delete all below lines after that before reach the corresponding ) and }

I will try to fix it in one or two days. I would need some problematic project file to test.

@simonayzman
Copy link

Not 100% sure about the xcode project file format, but I'm imagine that you'd have to ensure that the parentheses or braces would be balanced.

Try creating a react native project and uniquifying the iOS project?

@truebit
Copy link
Owner

truebit commented Nov 22, 2017

@simonayzman the leading white spaces are the same. I am working on it. would push to a test branch, you could try it later.

@truebit
Copy link
Owner

truebit commented Nov 22, 2017

I have push a new branch https://github.com/truebit/xUnique/tree/block_remove to address this issue.
If anyone got this problem, try this test branch by running the xUnique.py file directly to check if it works.
I do not know if I missed other project file scenarios.

truebit pushed a commit that referenced this issue Nov 22, 2017
…ld be removed. and delete all lines when meeting corresponding '};\n'. Matches done by the same count of leading whitespaces.

assuming this to be removed line would start with a UUID with leading whitespaces
@simonayzman
Copy link

Looks good to me! Works perfectly on my "bad" file.

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