Skip to content

Merge Java.Interop .github/ into dotnet/android after repo unification - #11942

Merged
jonathanpeppers merged 2 commits into
mainfrom
jonathanpeppers-merge-java-interop-instructions
Jul 1, 2026
Merged

jonathanpeppers merged 2 commits into
mainfrom
jonathanpeppers-merge-java-interop-instructions

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Now that dotnet/java-interop is merged into dotnet/android at external/Java.Interop/, we had two parallel .github/ trees drifting apart: two copilot-instructions.md files, two reviewer skills, and duplicate agentic-workflows plumbing. This PR consolidates them into a single canonical set under the top-level .github/.

Approach

Scoped instructions file. Converted external/Java.Interop/.github/copilot-instructions.md into a new .github/instructions/java-interop.instructions.md with an applyTo: "external/Java.Interop/**" frontmatter (matches the existing gradle.instructions.md pattern). The top-level copilot-instructions.md already covers formatting, NRT, and CI rules, so the scoped file only keeps Java.Interop-specific content: project overview, JNI concepts, repo layout, and JNI patterns.

Merged the java-interop-reviewer skill into android-reviewer. The android reviewer was a superset for most files, but the java-interop reviewer had real content on JNI, generator codegen, trimmer/AOT, C++ style, and naming that we did not want to lose:

  • SKILL.md: added JNI interop / JNI references / Generator codegen / Trimmer-AOT / Naming categories; added JNI reference leaks and Trimmer/NativeAOT compatibility to the priority list; extended the interop-rules load trigger to include external/Java.Interop/**.
  • references/interop-rules.md: prepended a JNI Interop Checks table (JniObjectReference lifecycle, JniPeerMembers caching, virtual/non-virtual dispatch, [Register] accuracy, JniTransition, exception checking, thread-local JNI environments).
  • references/repo-conventions.md: added Naming, JNI Interop Patterns, and Downstream Impact subsections.
  • references/native-rules.md, security-rules.md, testing-rules.md, ai-pitfalls.md: added 1-3 rows each (C++ standard headers, don't auto-elevate, generator/JVM tests, ignoring trimmer/AOT).
  • msbuild-rules.md and csharp-rules.md: no changes; the java-interop versions were strict subsets.

Deleted the redundant external/Java.Interop/.github/ content. The whole reviewer skill (merged), the build-and-test skill (referenced Java.Interop.sln which no longer applies), a byte-identical duplicate agentic-workflows skill, the java-interop-reviewer workflow (superseded by android-reviewer.md), an orphan agents/agentic-workflows.md, and a duplicate aw/actions-lock.json.

Notes for reviewers

  • The scoped instructions file relies on the same applyTo frontmatter mechanism as .github/instructions/gradle.instructions.md, so it kicks in automatically when Copilot touches files under external/Java.Interop/.

  • Nothing in the top-level copilot-instructions.md needed to change: external/Java.Interop/ is already listed in the Architecture section.

  • No product code is touched. This is .github/ and instruction files only.

  • Useful description of why the change is necessary.

  • Links to issues fixed - N/A

  • Unit tests - N/A (documentation and Copilot instructions only)

Now that dotnet/java-interop is merged into dotnet/android at
external/Java.Interop/, consolidate the parallel .github/ trees:

Instructions:
* Convert external/Java.Interop/.github/copilot-instructions.md into
  .github/instructions/java-interop.instructions.md with an
  `applyTo: �xternal/Java.Interop/** ` frontmatter (same pattern as
  gradle.instructions.md). The top-level copilot-instructions.md already
  covers formatting, NRT, and CI rules; the scoped file only keeps
  Java.Interop-specific project overview, JNI concepts, layout, and
  patterns.

Skills (merged into .github/skills/android-reviewer/):
* SKILL.md — add JNI interop / JNI references / Generator codegen /
  Trimmer/AOT / Naming categories; add `JNI reference leaks` and
  `Trimmer/NativeAOT compatibility` to priority list; extend the
  interop-rules load-trigger to include external/Java.Interop/**.
* references/interop-rules.md — prepend a JNI Interop Checks table
  covering JniObjectReference lifecycle, JniPeerMembers caching,
  virtual/non-virtual dispatch, [Register] accuracy, JniTransition,
  exception checking, thread-local JNI environments.
* references/native-rules.md — add `Use C++ standard headers`.
* references/repo-conventions.md — add Naming, JNI Interop Patterns,
  and Downstream Impact subsections.
* references/security-rules.md — add `Don't auto-elevate`.
* references/testing-rules.md — add Generator/Invoker, JVM-dependent,
  and expected-codegen-output rules.
* references/ai-pitfalls.md — add `Ignoring trimmer/AOT`.

Deleted:
* external/Java.Interop/.github/copilot-instructions.md
* external/Java.Interop/.github/skills/java-interop-reviewer/ (merged)
* external/Java.Interop/.github/skills/build-and-test/ (refers to
  Java.Interop.sln, no longer relevant; the top-level `tests` skill
  and `build.cmd`/`build.sh` cover this).
* external/Java.Interop/.github/skills/agentic-workflows/
  (byte-identical to the top-level skill)
* external/Java.Interop/.github/workflows/java-interop-reviewer.md
  (superseded by .github/workflows/android-reviewer.md)
* external/Java.Interop/.github/agents/agentic-workflows.md
* external/Java.Interop/.github/aw/actions-lock.json (top-level
  .github/aw/ is authoritative)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 1, 2026 18:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Consolidates the previously duplicated Java.Interop .github/ assets into the repository’s top-level .github/ after the repo unification, by moving Java.Interop-specific Copilot guidance into a scoped instructions file and merging Java.Interop reviewer rules into the existing android-reviewer skill.

Changes:

  • Added a scoped .github/instructions/java-interop.instructions.md that applies only to external/Java.Interop/**.
  • Merged Java.Interop-specific review guidance (JNI interop, generator/codegen, trimmer/AOT considerations, etc.) into .github/skills/android-reviewer/.
  • Removed the now-redundant external/Java.Interop/.github/ reviewer workflows/skills/instructions and related agentic-workflows plumbing.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
external/Java.Interop/.github/workflows/java-interop-reviewer.md Removed redundant Java.Interop-specific reviewer workflow (superseded by top-level reviewer workflow).
external/Java.Interop/.github/skills/java-interop-reviewer/SKILL.md Removed redundant Java.Interop reviewer skill after merging content into android-reviewer.
external/Java.Interop/.github/skills/java-interop-reviewer/references/testing-rules.md Removed redundant reference rules (now covered in android-reviewer references).
external/Java.Interop/.github/skills/java-interop-reviewer/references/security-rules.md Removed redundant reference rules (now covered in android-reviewer references).
external/Java.Interop/.github/skills/java-interop-reviewer/references/repo-conventions.md Removed redundant conventions (merged into android-reviewer repo conventions).
external/Java.Interop/.github/skills/java-interop-reviewer/references/native-rules.md Removed redundant native rules (merged into android-reviewer native rules).
external/Java.Interop/.github/skills/java-interop-reviewer/references/msbuild-rules.md Removed redundant MSBuild rules (already covered by android-reviewer).
external/Java.Interop/.github/skills/java-interop-reviewer/references/interop-rules.md Removed redundant interop rules (merged into android-reviewer interop rules).
external/Java.Interop/.github/skills/java-interop-reviewer/references/csharp-rules.md Removed redundant C# rules (already covered by android-reviewer references).
external/Java.Interop/.github/skills/java-interop-reviewer/references/ai-pitfalls.md Removed redundant AI pitfalls (merged additions into android-reviewer AI pitfalls).
external/Java.Interop/.github/skills/build-and-test/SKILL.md Removed Java.Interop-specific build-and-test skill content that no longer matches unified repo build workflow.
external/Java.Interop/.github/skills/agentic-workflows/SKILL.md Removed duplicate agentic-workflows router skill under Java.Interop tree.
external/Java.Interop/.github/copilot-instructions.md Removed duplicate Java.Interop Copilot instructions (replaced by scoped instructions under top-level .github/instructions/).
external/Java.Interop/.github/aw/actions-lock.json Removed duplicate agentic-workflows actions lock file under Java.Interop tree.
external/Java.Interop/.github/agents/agentic-workflows.md Removed redundant agent descriptor under Java.Interop tree.
.github/skills/android-reviewer/SKILL.md Expanded reviewer skill scope to include JNI interop, generator/codegen, and trimmer/AOT compatibility.
.github/skills/android-reviewer/references/testing-rules.md Added generator/JVM-specific test guidance for Java.Interop-related tests.
.github/skills/android-reviewer/references/security-rules.md Added guidance discouraging auto-elevation helpers.
.github/skills/android-reviewer/references/repo-conventions.md Added JNI-aware naming guidance and JNI interop/downstream-impact review patterns.
.github/skills/android-reviewer/references/native-rules.md Added C++ standard header guidance.
.github/skills/android-reviewer/references/interop-rules.md Added a dedicated JNI interop checks table and broadened interop markers to include Java.Interop types.
.github/skills/android-reviewer/references/ai-pitfalls.md Added trimmer/AOT pitfall row relevant to Java.Interop changes.
.github/instructions/java-interop.instructions.md New scoped instructions file for external/Java.Interop/** with project-specific context and conventions.

Comment thread .github/skills/android-reviewer/references/interop-rules.md Outdated
Comment thread .github/instructions/java-interop.instructions.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Jul 1, 2026
@jonathanpeppers
jonathanpeppers merged commit 7cfd2e9 into main Jul 1, 2026
42 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-merge-java-interop-instructions branch July 1, 2026 20:20
jonathanpeppers added a commit that referenced this pull request Jul 1, 2026
#11943)

Follow-up to #11942 (which handled `external/Java.Interop/.github/`).
Delete files under `external/Java.Interop/` that are byte-duplicates of
top-level files or orphans from the pre-merge standalone repo layout.

Deleted:

  * `product.snk`              -- byte-identical to top-level `product.snk`
  * `CODE-OF-CONDUCT.md`       -- identical boilerplate to top-level
  * `SECURITY.md`              -- near-duplicate of top-level, with a
                                  stale link to the Xamarin support policy
  * `.gitmodules`              -- redundant; top-level `.gitmodules`
                                  already has the same submodule entry
  * `Java.Interop.code-workspace` -- 6-line VS Code workspace file from
                                     the standalone repo, no references
  * `Makefile`                 -- standalone-repo GNU makefile; not
                                  referenced by top-level CI, `build.sh`,
                                  `build.cmd`, `eng/`, `build-tools/`,
                                  `Documentation/`, or the JI Azure
                                  DevOps templates in
                                  `external/Java.Interop/build-tools/automation/`.

The 9 csprojs that previously signed against
`external/Java.Interop/product.snk` via `..\..\product.snk` now use a
new `$(ProductSnkPath)` property defined in
`external/Java.Interop/Directory.Build.props`:

    $(MSBuildThisFileDirectory)..\..\product.snk

which resolves to the top-level `product.snk`.

Verified locally:

  * `dotnet msbuild ... -getProperty:AssemblyOriginatorKeyFile,ProductSnkPath`
    reports the resolved path pointing at the top-level `product.snk`.
  * `dotnet build external/Java.Interop/Java.Interop.sln -t:Prepare`
    succeeds.
  * `dotnet build external/Java.Interop/src/Java.Interop/Java.Interop.csproj`
    succeeds and the resulting `Java.Interop.dll` reports the expected
    `84e04ff9cfb79065` public key token.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
jonathanpeppers added a commit that referenced this pull request Jul 1, 2026
The nested `external/Java.Interop/external/xamarin-android-tools`
submodule and the top-level `external/xamarin-android-tools`
submodule both point at the same repo (dotnet/android-tools /
xamarin/xamarin-android-tools). Since the Java.Interop history was
merged into dotnet/android in #11942, keeping both is pure
duplication.

Remove the nested submodule and retarget every Java.Interop consumer
at the top-level `external/xamarin-android-tools` checkout:

- `external/Java.Interop/Directory.Build.props`:
  `$(XamarinAndroidToolsDirectory)` now points at `..\xamarin-android-tools`.
- `external/Java.Interop/Java.Interop.sln` and
  `build-tools/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks.sln`:
  updated project paths.
- `external/Java.Interop/Makefile` and
  `external/Java.Interop/tools/generator/generator.slnf`: updated paths.
- Top-level `.gitmodules`: removed the nested submodule entry.
- `external/Java.Interop/.gitmodules`: deleted (only entry was the
  now-removed submodule).
- `.github/skills/tests/references/test-catalog.md`: updated paths.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
jonathanpeppers added a commit that referenced this pull request Jul 2, 2026
…11944)

The nested `external/Java.Interop/external/xamarin-android-tools`
submodule and the top-level `external/xamarin-android-tools`
submodule both point at the same repo (dotnet/android-tools /
xamarin/xamarin-android-tools). Since the Java.Interop history was
merged into dotnet/android in #11942, keeping both is pure
duplication.

Remove the nested submodule and retarget every Java.Interop consumer
at the top-level `external/xamarin-android-tools` checkout:

- `external/Java.Interop/Directory.Build.props`:
  `$(XamarinAndroidToolsDirectory)` now points at `..\xamarin-android-tools`.
- `external/Java.Interop/Java.Interop.sln` and
  `build-tools/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks.sln`:
  updated project paths.
- `external/Java.Interop/Makefile` and
  `external/Java.Interop/tools/generator/generator.slnf`: updated paths.
- Top-level `.gitmodules`: removed the nested submodule entry.
- `external/Java.Interop/.gitmodules`: deleted (only entry was the
  now-removed submodule).
- `.github/skills/tests/references/test-catalog.md`: updated paths.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants