-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[TIMOB-25032] iOS: Resolve asset-catalog hashes back to real names, fail build when detecting duplicates #10239
Conversation
Tests:
Generated by 🚫 dangerJS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few changes. Also requesting Chris' review for the CLI part of this.
iphone/Classes/FilesystemModule.m
Outdated
RELEASE_TO_NIL(sha) | ||
} | ||
} | ||
NSString *fileName = [imageArg lastPathComponent]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can reuse the existing imageArg
property:
imageArg = [imageArg lastPathComponent];
and align it to line 198 to be right after the other string manipulations. Same for other occurences of this code in the core.
iphone/cli/commands/_build.js
Outdated
const checked = new Set(); | ||
const duplicates = new Set(); | ||
|
||
Object.keys(imageAssets).forEach(function (assetName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe some ES6 here?
Object.keys(imageAssets).forEach(assetName => {
iphone/cli/commands/_build.js
Outdated
}); | ||
|
||
if (duplicates.size > 0) { | ||
duplicates.forEach(function (asset) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=>
iphone/cli/commands/_build.js
Outdated
|
||
if (duplicates.size > 0) { | ||
duplicates.forEach(function (asset) { | ||
this.logger.error(__('Image asset name "%s" used multiple time, duplicate names are not permitted', asset)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.logger.error(__('Image asset name "%s" used multiple time, asset names should be unique in Titanium SDK 8.0.0+', asset));
…ail build when detecting duplicates
Rebased with master to resolve existing merge conflicts BREAKING CHANGE: Will throw an error on build if there are duplicated image names in the project
Changed the warning message from notifying of 8.0.0 to 9.0.0
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this ticket is a bad idea and that we should NOT merge it. Please see my comment on the ticket: https://jira.appcelerator.org/browse/TIMOB-25032.
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
/* eslint-env mocha */ | ||
/* global Ti */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 🚫 tests/Resources/ti.ui.imageview.addontest.js line 8 – 'Ti' is already defined as a built-in global variable. (no-redeclare)
Closing in favor of PR #11437 |
JIRA: https://jira.appcelerator.org/browse/TIMOB-25032
Removed hashing from file names, first in the build step, so assets are stored under their real names, with checks in place to make sure duplicates are not used. And also in the module code to ensure de-hashing isn't attempted