Skip to content

Create configurations and src folders only for plugins that have native files #1217

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
Nov 19, 2015
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
14 changes: 8 additions & 6 deletions lib/services/android-project-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,18 +296,20 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
this.$fs.ensureDirectoryExists(configurationsDirectoryPath).wait();

let pluginConfigurationDirectoryPath = path.join(configurationsDirectoryPath, pluginName);
this.$fs.ensureDirectoryExists(pluginConfigurationDirectoryPath).wait();
if (this.$fs.exists(pluginPlatformsFolderPath).wait()) {
this.$fs.ensureDirectoryExists(pluginConfigurationDirectoryPath).wait();

// Copy all resources from plugin
let resourcesDestinationDirectoryPath = path.join(this.platformData.projectRoot, "src", pluginName);
this.$fs.ensureDirectoryExists(resourcesDestinationDirectoryPath).wait();
shell.cp("-Rf", path.join(pluginPlatformsFolderPath, "*"), resourcesDestinationDirectoryPath);
}

// Copy include.gradle file
let includeGradleFilePath = path.join(pluginPlatformsFolderPath, "include.gradle");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we copy this file in case the plugin does not have native code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we copy it only when the plugin has platforms/android/include.gradle file

if(this.$fs.exists(includeGradleFilePath).wait()) {
shell.cp("-f", includeGradleFilePath, pluginConfigurationDirectoryPath);
}

// Copy all resources from plugin
let resourcesDestinationDirectoryPath = path.join(this.platformData.projectRoot, "src", pluginName);
this.$fs.ensureDirectoryExists(resourcesDestinationDirectoryPath).wait();
shell.cp("-Rf", path.join(pluginPlatformsFolderPath, "*"), resourcesDestinationDirectoryPath);
}).future<void>()();
}

Expand Down