Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: gradle 8, kotlin 2.0 & update bundletool
  • Loading branch information
triniwiz authored and NathanWalker committed May 31, 2024
commit 62d6187457d60b11d6b67348e8d3d70e02b6ffd4
25 changes: 25 additions & 0 deletions lib/services/android-plugin-build-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,31 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService {
);
this.replaceFileContent(buildGradlePath, "{{pluginName}}", pluginName);
this.replaceFileContent(settingsGradlePath, "{{pluginName}}", pluginName);

// gets the package from the AndroidManifest to use as the namespace or fallback to the `org.nativescript.${shortPluginName}`
const shortPluginName = getShortPluginName(pluginName);

const manifestPath = path.join(
pluginTempDir,
"src",
"main",
"AndroidManifest.xml"
);
const manifestContent = this.$fs.readText(manifestPath);

let packageName = `org.nativescript.${shortPluginName}`;
const xml = await this.getXml(manifestContent);
if (xml["manifest"]) {
if (xml["manifest"]["$"]["package"]) {
packageName = xml["manifest"]["$"]["package"];
}
}

this.replaceFileContent(
buildGradlePath,
"{{pluginNamespace}}",
packageName
);
}

private async getRuntimeGradleVersions(
Expand Down
Loading