Skip to content

Commit 8292188

Browse files
authored
Merge pull request #3448 from NativeScript/pete/rebuild-aar-patch2
fix(plugin-build): strip npm scope names from android plugin names
2 parents 62eeb66 + 70574a5 commit 8292188

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

lib/common

Submodule common updated 1 file

lib/services/android-plugin-build-service.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as path from "path";
22
import { MANIFEST_FILE_NAME, INCLUDE_GRADLE_NAME, ASSETS_DIR, RESOURCES_DIR } from "../constants";
3+
import { getShortPluginName } from "../common/helpers";
34
import { Builder, parseString } from "xml2js";
45
import { ILogger } from "log4js";
56

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

40-
private getShortPluginName(pluginName: string): string {
41-
return pluginName.replace(/[\-]/g, "_");
42-
}
43-
4441
private async updateManifestContent(oldManifestContent: string, defaultPackageName: string): Promise<string> {
4542
let xml: any = await this.getXml(oldManifestContent);
4643

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

167-
const shortPluginName = this.getShortPluginName(options.pluginName);
164+
const shortPluginName = getShortPluginName(options.pluginName);
168165
const newPluginDir = path.join(options.tempPluginDirPath, shortPluginName);
169166
const newPluginMainSrcDir = path.join(newPluginDir, "src", "main");
170167
const defaultPackageName = "org.nativescript." + shortPluginName;

0 commit comments

Comments
 (0)