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

Nested image assets structure is broken in v6.6.2 #1072

Open
pavm035 opened this issue Aug 3, 2023 · 1 comment
Open

Nested image assets structure is broken in v6.6.2 #1072

pavm035 opened this issue Aug 3, 2023 · 1 comment

Comments

@pavm035
Copy link

pavm035 commented Aug 3, 2023

Hi,

Recently we did upgrade SDK from 5.3.0 to 6.6.2 and updated yml files accordingly, but looks like Generated code for assets is changed and the following code is not valid anymore. Would you please let us know what do we fix to keep the code same as before

Valid in v5.3.0
Asset.Icon.EmergencyAlert.alertGray.image,

Error in 6.6.2:
Asset.Icon.EmergencyAlert.alertGray.image

Error: Type 'Asset' has no member 'Icon'

yml config

strings:
  inputs: Common/Resources/Localizable.strings
  outputs:
    templateName: structured-swift5
    output: Common/Resources/Strings.swift
    params:
      enumName: LocalizedString

xcassets:
  inputs: Common/Resources/Assets.xcassets
  outputs:
    templateName: swift5
    output: Common/Resources/Images.swift
    params:
      enumName: Asset.swift

Code change

// Before
internal enum Asset {
  internal enum Button {
    internal static let disclaimerClose = ImageAsset(name: "DisclaimerClose")
  }
...
}

// After
internal enum Asset {
  internal static let disclaimerClose = ImageAsset(name: "DisclaimerClose")
}
@pavm035 pavm035 changed the title Asset.Icon.EmergencyAlert.alertGray.image is not valid anymore v6.6.2 Nested image assets structure is broken in v6.6.2 Aug 3, 2023
@Liquidsoul
Copy link
Member

Did you look at the breaking changes introduced in the intermediate version like the 6.0.0?

Could you try to pin down the version that introduce the issue? The 5.3.0 > 6.6.2 range is a bit large and the version 5.3.0 is really old (May 16, 2018).

This could also be related to how your xcassets is configured and without it I cannot help much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants