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

iOS - images fields in Content.json generated in random order #67

Closed
bencergazda opened this issue Dec 19, 2018 · 3 comments · Fixed by #68
Closed

iOS - images fields in Content.json generated in random order #67

bencergazda opened this issue Dec 19, 2018 · 3 comments · Fixed by #68
Assignees

Comments

@bencergazda
Copy link
Contributor

bencergazda commented Dec 19, 2018

This makes unwanted changes in the AppIcon.appiconset/Content.json file every time after running the script, even if we're running it against the same source icon.

run # 1:

{
  "images": [
    {
      "size": "40x40",
      "idiom": "iphone",
      "scale": "2x",
      "filename": "iphone-40x40-2x.png"
    },
    {
      "size": "29x29",
      "idiom": "iphone",
      "scale": "3x",
      "filename": "iphone-29x29-3x.png"
    },
    {
      "size": "29x29",
      "idiom": "iphone",
      "scale": "2x",
      "filename": "iphone-29x29-2x.png"
    },
    {
      "size": "29x29",
      "idiom": "iphone",
      "scale": "1x",
      "filename": "iphone-29x29-1x.png"
    },
    {
      "size": "20x20",
      "idiom": "ipad",
      "scale": "2x",
      "filename": "ipad-20x20-2x.png"
    },
    {
      "size": "20x20",
      "idiom": "iphone",
      "scale": "3x",
      "filename": "iphone-20x20-3x.png"
    },
    {
      "size": "20x20",
      "idiom": "iphone",
      "scale": "2x",
      "filename": "iphone-20x20-2x.png"
    },
    {
      "size": "20x20",
      "idiom": "ipad",
      "scale": "1x",
      "filename": "ipad-20x20-1x.png"
    },
    {
      "size": "40x40",
      "idiom": "iphone",
      "scale": "3x",
      "filename": "iphone-40x40-3x.png"
    },
    {
      "size": "57x57",
      "idiom": "iphone",
      "scale": "2x",
      "filename": "iphone-57x57-2x.png"
    },
    {
      "size": "60x60",
      "idiom": "iphone",
      "scale": "2x",
      "filename": "iphone-60x60-2x.png"
    },
    {
      "size": "57x57",
      "idiom": "iphone",
      "scale": "1x",
      "filename": "iphone-57x57-1x.png"
    },
    {
      "size": "60x60",
      "idiom": "iphone",
      "scale": "3x",
      "filename": "iphone-60x60-3x.png"
    },
    {
      "size": "72x72",
      "idiom": "ipad",
      "scale": "2x",
      "filename": "ipad-72x72-2x.png"
    },
    {
      "size": "83.5x83.5",
      "idiom": "ipad",
      "scale": "2x",
      "filename": "ipad-83.5x83.5-2x.png"
    },
    {
      "size": "29x29",
      "idiom": "ipad",
      "scale": "2x",
      "filename": "ipad-29x29-2x.png"
    },
    {
      "size": "50x50",
      "idiom": "ipad",
      "scale": "2x",
      "filename": "ipad-50x50-2x.png"
    },
    {
      "size": "76x76",
      "idiom": "ipad",
      "scale": "1x",
      "filename": "ipad-76x76-1x.png"
    },
    {
      "size": "29x29",
      "idiom": "ipad",
      "scale": "1x",
      "filename": "ipad-29x29-1x.png"
    },
    {
      "size": "72x72",
      "idiom": "ipad",
      "scale": "1x",
      "filename": "ipad-72x72-1x.png"
    },
    {
      "size": "40x40",
      "idiom": "ipad",
      "scale": "1x",
      "filename": "ipad-40x40-1x.png"
    },
    {
      "size": "76x76",
      "idiom": "ipad",
      "scale": "2x",
      "filename": "ipad-76x76-2x.png"
    },
    {
      "size": "50x50",
      "idiom": "ipad",
      "scale": "1x",
      "filename": "ipad-50x50-1x.png"
    },
    {
      "size": "40x40",
      "idiom": "ipad",
      "scale": "2x",
      "filename": "ipad-40x40-2x.png"
    },
    {
      "size": "1024x1024",
      "idiom": "ios-marketing",
      "scale": "1x",
      "filename": "ios-marketing-1024x1024-1x.png"
    }
  ],
  "info": {
    "version": 1,
    "author": "xcode"
  }
}

run # 2

{
  "images": [
    {
      "size": "40x40",
      "idiom": "ipad",
      "scale": "1x",
      "filename": "ipad-40x40-1x.png"
    },
    {
      "size": "29x29",
      "idiom": "ipad",
      "scale": "2x",
      "filename": "ipad-29x29-2x.png"
    },
    {
      "size": "29x29",
      "idiom": "ipad",
      "scale": "1x",
      "filename": "ipad-29x29-1x.png"
    },
    {
      "size": "60x60",
      "idiom": "iphone",
      "scale": "3x",
      "filename": "iphone-60x60-3x.png"
    },
    {
      "size": "60x60",
      "idiom": "iphone",
      "scale": "2x",
      "filename": "iphone-60x60-2x.png"
    },
    {
      "size": "57x57",
      "idiom": "iphone",
      "scale": "2x",
      "filename": "iphone-57x57-2x.png"
    },
    {
      "size": "57x57",
      "idiom": "iphone",
      "scale": "1x",
      "filename": "iphone-57x57-1x.png"
    },
    {
      "size": "40x40",
      "idiom": "iphone",
      "scale": "3x",
      "filename": "iphone-40x40-3x.png"
    },
    {
      "size": "40x40",
      "idiom": "iphone",
      "scale": "2x",
      "filename": "iphone-40x40-2x.png"
    },
    {
      "size": "29x29",
      "idiom": "iphone",
      "scale": "3x",
      "filename": "iphone-29x29-3x.png"
    },
    {
      "size": "29x29",
      "idiom": "iphone",
      "scale": "2x",
      "filename": "iphone-29x29-2x.png"
    },
    {
      "size": "29x29",
      "idiom": "iphone",
      "scale": "1x",
      "filename": "iphone-29x29-1x.png"
    },
    {
      "size": "20x20",
      "idiom": "ipad",
      "scale": "2x",
      "filename": "ipad-20x20-2x.png"
    },
    {
      "size": "20x20",
      "idiom": "iphone",
      "scale": "3x",
      "filename": "iphone-20x20-3x.png"
    },
    {
      "size": "20x20",
      "idiom": "iphone",
      "scale": "2x",
      "filename": "iphone-20x20-2x.png"
    },
    {
      "size": "20x20",
      "idiom": "ipad",
      "scale": "1x",
      "filename": "ipad-20x20-1x.png"
    },
    {
      "size": "40x40",
      "idiom": "ipad",
      "scale": "2x",
      "filename": "ipad-40x40-2x.png"
    },
    {
      "size": "76x76",
      "idiom": "ipad",
      "scale": "2x",
      "filename": "ipad-76x76-2x.png"
    },
    {
      "size": "50x50",
      "idiom": "ipad",
      "scale": "2x",
      "filename": "ipad-50x50-2x.png"
    },
    {
      "size": "72x72",
      "idiom": "ipad",
      "scale": "2x",
      "filename": "ipad-72x72-2x.png"
    },
    {
      "size": "50x50",
      "idiom": "ipad",
      "scale": "1x",
      "filename": "ipad-50x50-1x.png"
    },
    {
      "size": "83.5x83.5",
      "idiom": "ipad",
      "scale": "2x",
      "filename": "ipad-83.5x83.5-2x.png"
    },
    {
      "size": "76x76",
      "idiom": "ipad",
      "scale": "1x",
      "filename": "ipad-76x76-1x.png"
    },
    {
      "size": "72x72",
      "idiom": "ipad",
      "scale": "1x",
      "filename": "ipad-72x72-1x.png"
    },
    {
      "size": "1024x1024",
      "idiom": "ios-marketing",
      "scale": "1x",
      "filename": "ios-marketing-1024x1024-1x.png"
    }
  ],
  "info": {
    "version": 1,
    "author": "xcode"
  }
}

All the contents are the same, except of that in an other order.

@dwmkerr dwmkerr self-assigned this Dec 23, 2018
dwmkerr added a commit that referenced this issue Jan 18, 2019
This fix ensures that the icons in the manifest and Contents.json are
written in a deterministic order. This resolves issues where re-running
the tool on an unchanged set of icons could produce an unwanted change
to the local files, simply because the icon list was not in the same
order.

Fixes #67.
@dwmkerr
Copy link
Owner

dwmkerr commented Jan 18, 2019

@bencergazda if you get a minute can you try using the branch feat/order-icon-output? I've tested and this seems to resolve the issue, but would be great if you can check too. If it works, I'll merge and cut a new release!

@bencergazda
Copy link
Contributor Author

bencergazda commented Jan 21, 2019

@dwmkerr Thanks for the feedback. This indeed fixes the issue!

@dwmkerr
Copy link
Owner

dwmkerr commented Jan 21, 2019

Done! Published as v0.6.4 :)

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

Successfully merging a pull request may close this issue.

2 participants