Skip to content

Commit 62d6187

Browse files
triniwizNathanWalker
authored andcommitted
feat: gradle 8, kotlin 2.0 & update bundletool
1 parent a64f25b commit 62d6187

File tree

5 files changed

+215
-109
lines changed

5 files changed

+215
-109
lines changed

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,31 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService {
423423
);
424424
this.replaceFileContent(buildGradlePath, "{{pluginName}}", pluginName);
425425
this.replaceFileContent(settingsGradlePath, "{{pluginName}}", pluginName);
426+
427+
// gets the package from the AndroidManifest to use as the namespace or fallback to the `org.nativescript.${shortPluginName}`
428+
const shortPluginName = getShortPluginName(pluginName);
429+
430+
const manifestPath = path.join(
431+
pluginTempDir,
432+
"src",
433+
"main",
434+
"AndroidManifest.xml"
435+
);
436+
const manifestContent = this.$fs.readText(manifestPath);
437+
438+
let packageName = `org.nativescript.${shortPluginName}`;
439+
const xml = await this.getXml(manifestContent);
440+
if (xml["manifest"]) {
441+
if (xml["manifest"]["$"]["package"]) {
442+
packageName = xml["manifest"]["$"]["package"];
443+
}
444+
}
445+
446+
this.replaceFileContent(
447+
buildGradlePath,
448+
"{{pluginNamespace}}",
449+
packageName
450+
);
426451
}
427452

428453
private async getRuntimeGradleVersions(

0 commit comments

Comments
 (0)