Skip to content

Remove iOS static library verification #3169

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

Merged
merged 1 commit into from
Oct 23, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions lib/services/ios-project-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,6 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
}

private async addStaticLibrary(staticLibPath: string, projectData: IProjectData): Promise<void> {
await this.validateStaticLibrary(staticLibPath);
// Copy files to lib folder.
const libraryName = path.basename(staticLibPath, ".a");
const headersSubpath = path.join(path.dirname(staticLibPath), "include", libraryName);
Expand Down Expand Up @@ -1031,21 +1030,6 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
}
}

private async validateStaticLibrary(libraryPath: string): Promise<void> {
if (path.extname(libraryPath) !== ".a") {
this.$errors.failWithoutHelp(`The bundle at ${libraryPath} does not contain a valid static library in the '.a' file format.`);
}

const expectedArchs = ["armv7", "arm64", "i386"];
const archsInTheFatFile = await this.$childProcess.exec("lipo -i " + libraryPath);

expectedArchs.forEach(expectedArch => {
if (archsInTheFatFile.indexOf(expectedArch) < 0) {
this.$errors.failWithoutHelp(`The static library at ${libraryPath} is not built for one or more of the following required architectures: ${expectedArchs.join(", ")}. The static library must be built for all required architectures.`);
}
});
}

private replaceFileContent(file: string, projectData: IProjectData): void {
const fileContent = this.$fs.readText(file);
const replacedContent = helpers.stringReplaceAll(fileContent, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER, projectData.projectName);
Expand Down