Skip to content

Commit

Permalink
fix(ios): xcode project change detection causing unnecessary rebuilds
Browse files Browse the repository at this point in the history
  • Loading branch information
janvennemann authored and ewanharris committed Aug 5, 2021
1 parent 8034f58 commit 89773aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -4118,7 +4118,7 @@ iOSBuilder.prototype._embedCapabilitiesAndWriteEntitlementsPlist = function _emb
// write the entitlements.plist
const contents = plist.toString('xml');

if (!fs.existsSync(dest) || contents !== fs.readFileSync(dest).toString()) {
if (!fs.existsSync(dest) || contents !== fs.readFileSync(dest, 'utf-8').trim()) {
if (!this.forceRebuild) {
this.logger.info(__('Forcing rebuild: %s has changed since last build', dest.replace(this.projectDir + '/', '')));
this.forceRebuild = true;
Expand Down
14 changes: 7 additions & 7 deletions iphone/cli/hooks/frameworks.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ class FrameworkManager {

const xcodeProject = hookData.args[0];
const frameworkIntegrator = new FrameworkIntegrator(xcodeProject, this._builder, this._logger);
for (const frameworkInfo of this._frameworks.values()) {
const frameworks = Array.from(this._frameworks.values())
.sort((a, b) => a.name.localeCompare(b.name));
for (const frameworkInfo of frameworks) {
this._logger.trace(`Integrating ${frameworkInfo.type} framework ${frameworkInfo.name.green} into Xcode project.`);
frameworkIntegrator.integrateFramework(frameworkInfo);
}
Expand Down Expand Up @@ -397,12 +399,10 @@ class InspectFrameworksTask extends IncrementalFileTask {
const metadata = await fs.readJSON(this._metadataPathAndFilename);
for (const frameworkPath of Object.keys(metadata)) {
const frameworkMetadata = metadata[frameworkPath];
this._frameworks.set(frameworkMetadata.name, new FrameworkInfo(
frameworkMetadata.name,
frameworkMetadata.path,
frameworkMetadata.type,
new Set(frameworkMetadata.architectures)
));
this._frameworks.set(frameworkMetadata.name, new FrameworkInfo({
...frameworkMetadata,
architectures: new Set(frameworkMetadata.architectures)
}));
}
return true;
} catch (e) {
Expand Down

0 comments on commit 89773aa

Please sign in to comment.