GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(android): per-plugin build options, with aarSuffix to break name clashes by farfromrefug · Pull Request #6132 · NativeScript/nativescript-cli

Conversation

@farfromrefug

@farfromrefug farfromrefug commented Aug 18, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

The problem

getShortPluginName drops the npm scope:

sanitizePluginName(pluginName).replace(/[\-]/g, "_")  // "@foo/plugin-x" -> "plugin_x"

That name becomes the temp build directory, the produced .aar and the android namespace fallback. Two plugins from different scopes with the same package name — @foo/plugin-x and @bar/plugin-x — both build a plugin_x.aar, and which one gradle ends up linking depends on build order.

What

A project can give one of them a suffix:

// nativescript.config.ts
export default {
  android: {
    plugins: {
      "@bar/plugin-x": { aarSuffix: "-bar" },
    },
  },
} satisfies NativeScriptConfig;

@bar/plugin-x now builds plugin_x_bar.aar and stops colliding.

android.plugins is a map keyed by npm package name whose entries are spread into the options buildAar receives, so it is also where future per-plugin build settings can go. aarSuffix is the only key it carries today.

Details

The suffix is appended to the plugin name before it is shortened, so it goes through the same sanitizing as the rest of the name.

setupGradle used to recompute getShortPluginName(pluginName) for the namespace fallback (org.nativescript.<short name>), which would have kept colliding. It now takes the already-computed name as a parameter, so the temp directory, the .aar and the namespace all agree.

Nothing changes for a project that does not set plugins — the suffix defaults to empty and the name is exactly what it was.

Not covered

ns plugin build does not read the config: it runs inside a plugin's own directory, where there is no consuming app to declare a suffix. The option is on IPluginBuildOptions, so a hook can still set it there.

Tests

npm test — 1858 passing. The childProcess stub in test/services/android-plugin-build-service.ts now derives the built .aar name from the plugin directory gradle was pointed at instead of assuming it, which let me add two cases: the default name, and the name with aarSuffix applied.

Notes

From https://github.com/Akylas/nativescript-cli. Independent of #6129, #6130 and #6131, though #6129 also touches IAndroidBuildOptions.gradleArgs and the options object in android-project-service — expect a small textual conflict depending on merge order.

Summary by CodeRabbit

  • New Features

    • Added optional Android plugin configuration for customizing generated .aar filenames with a suffix.
    • Supports per-plugin suffixes to prevent naming conflicts between similarly named plugins.
  • Bug Fixes

    • Improved Android plugin build output naming to consistently honor configured suffixes and plugin paths.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@farfromrefug @claude
feat(android): per-plugin build options, with aarSuffix to break name…
bc7375b
… clashes

The name of the `.aar` built for a plugin comes from `getShortPluginName`,
which drops the npm scope. `@foo/plugin-x` and `@bar/plugin-x` therefore
both build a `plugin_x.aar` into their own platforms folder, and the one
that gradle picks up depends on which was built last.

A project can now give one of them a suffix:

```js
export default {
  android: {
    plugins: {
      "@bar/plugin-x": { aarSuffix: "-bar" },
    },
  },
} satisfies NativeScriptConfig;
```

`android.plugins` is a map keyed by npm package name, spread into the
options `buildAar` receives, so it is the place to put future per-plugin
build settings too. The suffix is appended to the plugin name before it is
shortened, and the resulting name is used consistently - for the temp
build directory, the produced `.aar` and the namespace fallback, which
`setupGradle` used to recompute without it.

Co-Authored-By: Claude Opus 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Aug 18, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d67eb031-3ab4-461f-9094-3c1d4f87aa40

📥 Commits

Reviewing files that changed from the base of the PR and between 2f9f2e0 and bc7375b.

📒 Files selected for processing (5)
  • lib/definitions/android-plugin-migrator.d.ts
  • lib/definitions/project.d.ts
  • lib/services/android-plugin-build-service.ts
  • lib/services/android-project-service.ts
  • test/services/android-plugin-build-service.ts

Included review availability: Your plan provides up to 4 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Android plugin configuration now supports optional AAR suffixes. The project service passes per-plugin settings into the build service. AAR naming and Gradle setup use the suffix-aware shortened name. Tests cover default and suffixed output names.

Changes

Android AAR naming

Layer / File(s) Summary
Android plugin configuration contracts
lib/definitions/android-plugin-migrator.d.ts, lib/definitions/project.d.ts
The public types define optional aarSuffix values for Android build options and per-plugin project configuration.
AAR naming and Gradle wiring
lib/services/android-project-service.ts, lib/services/android-plugin-build-service.ts
Per-plugin Android configuration is merged into build options. AAR naming includes the suffix before shortening, and the computed name is passed to Gradle setup.
AAR naming test coverage
test/services/android-plugin-build-service.ts
Tests track the Gradle project directory and verify default and suffix-based AAR filenames.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to bc737

The PR adds optional per-plugin AAR suffixing while preserving default behavior; no actionable merge-blocking risk remains after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant AndroidProjectService
  participant AndroidPluginBuildService
  participant Gradle
  AndroidProjectService->>AndroidPluginBuildService: pass per-plugin aarSuffix
  AndroidPluginBuildService->>AndroidPluginBuildService: derive shortened plugin name
  AndroidPluginBuildService->>Gradle: configure project with shortened name
  Gradle-->>AndroidPluginBuildService: create release AAR
Loading

Suggested reviewers: nathanwalker

Poem

A rabbit hops through Gradle’s lane,
With suffixes neat in AAR names.
Short names now stay clear and bright,
Tests guard each build from left to right.
Squeak—no plugin wears the same!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: per-plugin Android build options and the aarSuffix option to prevent AAR name collisions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@farfromrefug farfromrefug mentioned this pull request Aug 18, 2026
feat(android): --gradleFlavor to build a product flavor #6133
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Aug 19, 2026
feat(android): build only the ABIs of the devices being deployed to #6130
Open
This was referenced Aug 19, 2026
feat(android): optionally pass the device ABIs to plugin builds #6134
Open
feat(android): per-plugin build options reaching the plugin gradle build #6135
Open
@NathanWalker NathanWalker added this to the 9.2 milestone Aug 24, 2026
@edusperoni edusperoni mentioned this pull request Oct 22, 2026
feat(android): org.nativescript:gradle-api, Gradle facts file and opt-in read-only node_modules #6175
Draft
4 of 5 tasks

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

9.2

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@farfromrefug @NathanWalker
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.