Skip to content

Commit 54d8f44

Browse files
FatmeFatme
Fatme
authored and
Fatme
committed
Merge pull request #1217 from NativeScript/fatme/fix-long-path-on-windows
Create configurations and src folders only for plugins that have native files
2 parents 1d40bb1 + a8caa28 commit 54d8f44

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/services/android-project-service.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,18 +296,20 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
296296
this.$fs.ensureDirectoryExists(configurationsDirectoryPath).wait();
297297

298298
let pluginConfigurationDirectoryPath = path.join(configurationsDirectoryPath, pluginName);
299-
this.$fs.ensureDirectoryExists(pluginConfigurationDirectoryPath).wait();
299+
if (this.$fs.exists(pluginPlatformsFolderPath).wait()) {
300+
this.$fs.ensureDirectoryExists(pluginConfigurationDirectoryPath).wait();
301+
302+
// Copy all resources from plugin
303+
let resourcesDestinationDirectoryPath = path.join(this.platformData.projectRoot, "src", pluginName);
304+
this.$fs.ensureDirectoryExists(resourcesDestinationDirectoryPath).wait();
305+
shell.cp("-Rf", path.join(pluginPlatformsFolderPath, "*"), resourcesDestinationDirectoryPath);
306+
}
300307

301308
// Copy include.gradle file
302309
let includeGradleFilePath = path.join(pluginPlatformsFolderPath, "include.gradle");
303310
if(this.$fs.exists(includeGradleFilePath).wait()) {
304311
shell.cp("-f", includeGradleFilePath, pluginConfigurationDirectoryPath);
305312
}
306-
307-
// Copy all resources from plugin
308-
let resourcesDestinationDirectoryPath = path.join(this.platformData.projectRoot, "src", pluginName);
309-
this.$fs.ensureDirectoryExists(resourcesDestinationDirectoryPath).wait();
310-
shell.cp("-Rf", path.join(pluginPlatformsFolderPath, "*"), resourcesDestinationDirectoryPath);
311313
}).future<void>()();
312314
}
313315

0 commit comments

Comments
 (0)