Skip to content

Remove plugin platforms folder #714

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 2 commits into from
Jul 30, 2015
Merged
Show file tree
Hide file tree
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
15 changes: 13 additions & 2 deletions lib/services/ios-project-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
shell.cp("-R", libraryPath, fullTargetPath);

let project = this.createPbxProj();
let frameworkPath = path.relative("platforms/ios", path.join(targetPath, frameworkName + ".framework"));
let frameworkPath = this.getFrameworkRelativePath(libraryPath);
project.addFramework(frameworkPath, { customFramework: true, embed: true });
project.updateBuildProperty("IPHONEOS_DEPLOYMENT_TARGET", "8.0");
this.savePbxProj(project).wait();
Expand Down Expand Up @@ -271,6 +271,13 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
return name.replace(/\\\"/g, "\"");
}

private getFrameworkRelativePath(libraryPath: string): string {
let frameworkName = path.basename(libraryPath, path.extname(libraryPath));
let targetPath = path.join("lib", this.platformData.normalizedPlatformName, frameworkName);
let frameworkPath = path.relative("platforms/ios", path.join(targetPath, frameworkName + ".framework"));
return frameworkPath;
}

private get pbxProjPath(): string {
return path.join(this.platformData.projectRoot, this.$projectData.projectName + ".xcodeproj", "project.pbxproj");
}
Expand Down Expand Up @@ -298,7 +305,11 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
let pluginPlatformsFolderPath = pluginData.pluginPlatformsFolderPath(IOSProjectService.IOS_PLATFORM_NAME);
let project = this.createPbxProj();

_.each(this.getAllDynamicFrameworksForPlugin(pluginData).wait(), fileName => project.removeFramework(path.join(pluginPlatformsFolderPath, fileName + ".framework"), { customFramework: true, embed: true }));
_.each(this.getAllDynamicFrameworksForPlugin(pluginData).wait(), fileName => {
let fullFrameworkPath = path.join(pluginPlatformsFolderPath, fileName);
let relativeFrameworkPath = this.getFrameworkRelativePath(fullFrameworkPath);
project.removeFramework(relativeFrameworkPath, { customFramework: true, embed: true })
});

this.savePbxProj(project).wait();
}).future<void>()();
Expand Down
2 changes: 2 additions & 0 deletions lib/services/plugins-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ export class PluginsService implements IPluginsService {
pluginData.pluginPlatformsFolderPath = (platform: string) => path.join(pluginData.fullPath, "platforms", platform);
platformData.platformProjectService.preparePluginNativeCode(pluginData).wait();

shelljs.rm("-rf", path.join(pluginDestinationPath, pluginData.name, "platforms"));

// Show message
this.$logger.out(`Successfully prepared plugin ${pluginData.name} for ${platform}.`);

Expand Down
1 change: 0 additions & 1 deletion lib/tools/broccoli/node-modules-dest-copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export class DestCopy implements IBroccoliPlugin {
let isPlugin = !!dependency.nativescript;
if(isPlugin) {
this.$pluginsService.prepare(dependency).wait();
shelljs.rm("-rf", path.join(this.outputRoot, dependency.name, "platforms"));
}
});
}
Expand Down