organicmaps icon indicating copy to clipboard operation
organicmaps copied to clipboard

[data] Refactor resources folder

Open AndrewShkrob opened this issue 9 months ago • 5 comments

New folder structure From

  • resources-mdpi-clear
  • resources-mdpi-dark
  • resources-xhdpi-clear
  • resources-xhdpi-dark

To

symbols
├── 6plus
│   ├── clear
│   │   ├── symbols.png
│   │   └── symbols.sdf
│   ├── dark
│   │   ├── symbols.png
│   │   └── symbols.sdf
│   └── design
│       ├── symbols.png
│       └── symbols.sdf
├── hdpi
│   ├── clear
│   │   ├── symbols.png
│   │   └── symbols.sdf
│   ├── dark
│   │   ├── symbols.png
│   │   └── symbols.sdf
│   └── design
│       ├── symbols.png
│       ├── symbols.sdf

Moved area-hatching.png and traffic-arrow.png from {dpi}/{clear|dark} to symbols/default folder as all these files are the same and not regenerated.

Unfortunately, Xcode doesn't allow a resources folder in the root directory. I had to rename the folder from resources to symbols. More info: https://stackoverflow.com/questions/33993741/codesign-failed-with-exit-code-1-failing-to-build-copy-resources/40167588#40167588

I cannot place resources-svg in symbols/svg due to another Xcode problem. It doesn't allow to have a reference folder and exclude one of the subfolders from the project.

AndrewShkrob avatar May 08 '24 18:05 AndrewShkrob

@AndrewShkrob did you see this one? WDYT? https://github.com/organicmaps/organicmaps/pull/7264

biodranik avatar May 08 '24 21:05 biodranik

@AndrewShkrob did you see this one? WDYT? #7264

light/dark is much better than clear/dark We can postpone this PR until the #7264 is merged. I'll rebase it later.

AndrewShkrob avatar May 09 '24 10:05 AndrewShkrob

Moved area-hatching.png and traffic-arrow.png from {dpi}/{clear|dark} to symbols/default folder as all these files are the same and not regenerated.

So traffic arrows are different (compare mdpi to xxxhdpi).

area-hatching.png is the same for all dpis indeed. But its very likely we'll expand handling of it to support other more complex textures like forest, shrub, hospital, etc. and they're likely to be dpi-dependent.. @vng WDYT?

pastk avatar May 09 '24 11:05 pastk

Thanks for this PR, its a great companion to #7264!

Please check https://github.com/organicmaps/organicmaps/pull/7264#issuecomment-1987756789 i.e. there are dpi-specific folders in data/styles/clear/style-clear/ which would be great to move too!

pastk avatar May 09 '24 12:05 pastk

Please check #7264 (comment) i.e. there are dpi-specific folders in data/styles/clear/style-clear/ which would be great to move too!

Though I'm not sure it'll be a good idea to put them into symbols/hdpi/... you've created. Probably makes sense to keep "resource files" (included directly into apps) and "source files" separately, esp. given the Xcode restriction you've mentioned. Sometimes "sources" are identical to "resources" (there is no processing before app inclusion). In that case they should reside in "resources" directly or could be symlinked there (better for logical organisation of files and more future proof).

pastk avatar May 09 '24 12:05 pastk

The https://github.com/organicmaps/organicmaps/pull/7264 is merged, so this PR could be updated.

pastk avatar Jun 04 '24 14:06 pastk

The #7264 is merged, so this PR could be updated.

@AndrewShkrob could you please update the PR one you have time?

rtsisyk avatar Aug 24 '24 12:08 rtsisyk

Rebased I verified it again on all platforms. Please, pay attention to generate_symbols.sh script during the review. And I'd like to ask somebody (@pastk probably) to check locally that nothing is broken and works as it should.

AndrewShkrob avatar Oct 07 '24 17:10 AndrewShkrob