truebit / xUnique

merge Xcode project file is so easy
https://fclef.wordpress.com
Other
1.5k stars 117 forks source link

Incorrect deletion of unused identifiers #38

Open vadimtrifonov opened 7 years ago

vadimtrifonov commented 7 years ago

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 commented 7 years ago

yes, it's a known issue.

Sent from my mobile device.

在 2016年9月20日,21:36,Vadim notifications@github.com 写道:

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 commented 7 years ago

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

truebit commented 7 years ago

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 notifications@github.com 写道:

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 commented 7 years ago

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 commented 7 years ago

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

Sent from my mobile device.

在 2016年11月8日,20:53,frranck notifications@github.com 写道:

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 commented 7 years ago

This is still an issue. Any movement on this?

truebit commented 7 years ago

@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 commented 7 years ago

@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 commented 6 years ago

Is there anyone knows replacement of this project?

truebit commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

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.

simonayzman commented 6 years ago

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