Skip to content

Commit 8d5684d

Browse files
committed
Always clean plugin "platforms" subdir.
No longer cleaning that up on plugin prepare only. Cleaning it up every time we update tns_modules/<plugin> now.
1 parent 74d027b commit 8d5684d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

lib/services/plugins-service.ts

-5
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ export class PluginsService implements IPluginsService {
132132
}
133133

134134
if (!this.isPluginDataValidForPlatform(pluginData, platform).wait()) {
135-
// Still clean up platform in case other platforms were supported.
136-
shelljs.rm("-rf", path.join(pluginScriptsDestinationPath , pluginData.name, "platforms"));
137135
return;
138136
}
139137

@@ -143,12 +141,9 @@ export class PluginsService implements IPluginsService {
143141

144142
private preparePluginNativeCode(pluginData: IPluginData, platform: string): void {
145143
let platformData = this.$platformsData.getPlatformData(platform);
146-
let pluginScriptsDestinationPath = path.join(platformData.appDestinationDirectoryPath, constants.APP_FOLDER_NAME, "tns_modules");
147144

148145
pluginData.pluginPlatformsFolderPath = (_platform: string) => path.join(pluginData.fullPath, "platforms", _platform);
149146
platformData.platformProjectService.preparePluginNativeCode(pluginData).wait();
150-
shelljs.rm("-rf", path.join(pluginScriptsDestinationPath , pluginData.name, "platforms"));
151-
152147
}
153148

154149
public ensureAllDependenciesAreInstalled(): IFuture<void> {

lib/tools/node-modules/node-modules-dest-copy.ts

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ export class TnsModulesCopy {
5050

5151
shelljs.mkdir("-p", targetDir);
5252
shelljs.cp("-Rf", dependency.directory, targetDir);
53+
54+
//remove platform-specific files (processed separately by plugin services)
55+
const targetPackageDir = path.join(targetDir, dependency.name);
56+
shelljs.rm("-rf", path.join(targetPackageDir, "platforms"));
5357
}
5458
}
5559
}

0 commit comments

Comments
 (0)