|
1 | 1 | import * as path from "path"; |
2 | 2 | import { MANIFEST_FILE_NAME, INCLUDE_GRADLE_NAME, ASSETS_DIR, RESOURCES_DIR } from "../constants"; |
| 3 | +import { getShortPluginName } from "../common/helpers"; |
3 | 4 | import { Builder, parseString } from "xml2js"; |
4 | 5 | import { ILogger } from "log4js"; |
5 | 6 |
|
@@ -37,15 +38,6 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService { |
37 | 38 | return this.$fs.exists(manifest) ? manifest : null; |
38 | 39 | } |
39 | 40 |
|
40 | | - private getShortPluginName(pluginName: string): string { |
41 | | - return this.sanitizePluginName(pluginName).replace(/[\-]/g, "_"); |
42 | | - } |
43 | | - |
44 | | - private sanitizePluginName(pluginName: string): string { |
45 | | - // avoid long plugin names, exclude the npm module scope (@scope/nativescript-plugin) from the android plugin name |
46 | | - return pluginName.split("/").pop(); |
47 | | - } |
48 | | - |
49 | 41 | private async updateManifestContent(oldManifestContent: string, defaultPackageName: string): Promise<string> { |
50 | 42 | let xml: any = await this.getXml(oldManifestContent); |
51 | 43 |
|
@@ -169,7 +161,7 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService { |
169 | 161 | // IDEA: apply app.gradle here in order to get any and all user-defined variables |
170 | 162 | // IDEA: apply the entire include.gradle here instead of copying over the repositories {} and dependencies {} scopes |
171 | 163 |
|
172 | | - const shortPluginName = this.getShortPluginName(options.pluginName); |
| 164 | + const shortPluginName = getShortPluginName(options.pluginName); |
173 | 165 | const newPluginDir = path.join(options.tempPluginDirPath, shortPluginName); |
174 | 166 | const newPluginMainSrcDir = path.join(newPluginDir, "src", "main"); |
175 | 167 | const defaultPackageName = "org.nativescript." + shortPluginName; |
|
0 commit comments