Skip to content

fix(plugin-build): strip npm scope names from android plugin names #3448

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
Mar 13, 2018
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
2 changes: 1 addition & 1 deletion lib/common
Submodule common updated 1 files
+11 −2 helpers.ts
7 changes: 2 additions & 5 deletions lib/services/android-plugin-build-service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as path from "path";
import { MANIFEST_FILE_NAME, INCLUDE_GRADLE_NAME, ASSETS_DIR, RESOURCES_DIR } from "../constants";
import { getShortPluginName } from "../common/helpers";
import { Builder, parseString } from "xml2js";
import { ILogger } from "log4js";

Expand Down Expand Up @@ -37,10 +38,6 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService {
return this.$fs.exists(manifest) ? manifest : null;
}

private getShortPluginName(pluginName: string): string {
return pluginName.replace(/[\-]/g, "_");
}

private async updateManifestContent(oldManifestContent: string, defaultPackageName: string): Promise<string> {
let xml: any = await this.getXml(oldManifestContent);

Expand Down Expand Up @@ -164,7 +161,7 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService {
// IDEA: apply app.gradle here in order to get any and all user-defined variables
// IDEA: apply the entire include.gradle here instead of copying over the repositories {} and dependencies {} scopes

const shortPluginName = this.getShortPluginName(options.pluginName);
const shortPluginName = getShortPluginName(options.pluginName);
const newPluginDir = path.join(options.tempPluginDirPath, shortPluginName);
const newPluginMainSrcDir = path.join(newPluginDir, "src", "main");
const defaultPackageName = "org.nativescript." + shortPluginName;
Expand Down