xUnique icon indicating copy to clipboard operation
xUnique copied to clipboard

Incorrect deletion of unused identifiers

Open vadimtrifonov opened this issue 7 years ago • 14 comments

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>"; };

vadimtrifonov avatar Sep 20 '16 13:09 vadimtrifonov

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.

truebit avatar Sep 20 '16 16:09 truebit

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

frranck avatar Nov 05 '16 15:11 frranck

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.

truebit avatar Nov 05 '16 15:11 truebit

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 ?

frranck avatar Nov 08 '16 12:11 frranck

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.

truebit avatar Nov 09 '16 01:11 truebit

This is still an issue. Any movement on this?

simonayzman avatar Jul 14 '17 20:07 simonayzman

@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

truebit avatar Jul 18 '17 09:07 truebit

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

simonayzman avatar Jul 18 '17 14:07 simonayzman

Is there anyone knows replacement of this project?

miriyas avatar Nov 21 '17 06:11 miriyas

@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.

truebit avatar Nov 21 '17 07:11 truebit

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?

simonayzman avatar Nov 21 '17 16:11 simonayzman

@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 avatar Nov 22 '17 09:11 truebit

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 avatar Nov 22 '17 11:11 truebit

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

simonayzman avatar Nov 22 '17 15:11 simonayzman