Skip to content

[external/Java.Interop] Remove standalone-repo scaffolding after merge - #11943

Merged
jonathanpeppers merged 1 commit into
mainfrom
jonathanpeppers-java-interop-stale-file-hunt
Jul 1, 2026
Merged

[external/Java.Interop] Remove standalone-repo scaffolding after merge#11943
jonathanpeppers merged 1 commit into
mainfrom
jonathanpeppers-java-interop-stale-file-hunt

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Follow-up to #11942, which handles external/Java.Interop/.github/. This PR is round 2: delete files under external/Java.Interop/ that are byte-duplicates of top-level files, or orphans left over from the pre-merge standalone-repo layout.

Files deleted

File Rationale
external/Java.Interop/product.snk Byte-identical to top-level product.snk (SHA256 708EA5D6…AAB160).
external/Java.Interop/CODE-OF-CONDUCT.md Identical 6-line boilerplate to top-level CODE-OF-CONDUCT.md.
external/Java.Interop/SECURITY.md Near-duplicate of top-level SECURITY.md, with a stale link to the Xamarin support policy.
external/Java.Interop/.gitmodules Redundant; the top-level .gitmodules already has the external/Java.Interop/external/xamarin-android-tools submodule entry.
external/Java.Interop/Java.Interop.code-workspace 6-line VS Code workspace file from the standalone repo, no references anywhere.
external/Java.Interop/Makefile Standalone-repo GNU makefile. See "Makefile orphaned check" below.

product.snk retargeting

Nine JI csprojs previously set <AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile> — resolving to external/Java.Interop/product.snk (the now-deleted duplicate). They now use a new shared property defined in external/Java.Interop/Directory.Build.props:

<ProductSnkPath Condition=" '$(ProductSnkPath)' == '' ">$(MSBuildThisFileDirectory)..\..\product.snk</ProductSnkPath>

which resolves to the top-level product.snk. Each of the 9 csprojs now says <AssemblyOriginatorKeyFile>$(ProductSnkPath)</AssemblyOriginatorKeyFile>.

Csprojs retargeted:

  • src/Java.Interop/Java.Interop.csproj
  • src/Java.Interop.Localization/Java.Interop.Localization.csproj
  • src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil.csproj
  • src/Java.Interop.Tools.Diagnostics/Java.Interop.Tools.Diagnostics.csproj
  • src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers.csproj
  • src/Java.Interop.Tools.Maven/Java.Interop.Tools.Maven.csproj
  • src/Xamarin.Android.Tools.Bytecode/Xamarin.Android.Tools.Bytecode.csproj
  • tests/Java.Interop-Tests/Java.Interop-Tests.csproj
  • tests/TestJVM/TestJVM.csproj

Makefile orphaned check

Before deleting, I grepped the whole tree for callers of external/Java.Interop/Makefile:

  • No matches for Java\.Interop.Makefile under top-level Makefile, build.sh, build.cmd, eng/, build-tools/, or Documentation/.
  • No matches for make -C external/Java.Interop or make.*Java.Interop anywhere in the repo.
  • Top-level CI drives JI via dotnet build external/Java.Interop/Java.Interop.sln (see external/Java.Interop/build-tools/automation/templates/core-build.yaml, referenced from build-tools/automation/yaml-templates/stage-java-interop-tests.yaml), never via make.

Verification

  • dotnet msbuild external/Java.Interop/src/Java.Interop/Java.Interop.csproj -getProperty:AssemblyOriginatorKeyFile,ProductSnkPath reports both properties resolving to …\external\Java.Interop\..\..\product.snk (i.e. the top-level key).
  • dotnet build external/Java.Interop/Java.Interop.sln -t:Prepare -c Debug — succeeds.
  • dotnet build external/Java.Interop/src/Java.Interop/Java.Interop.csproj -c Debug — succeeds; the produced Java.Interop.dll reports the expected public key token 84e04ff9cfb79065.

Not in scope (deferred)

Flagged during the audit but left for follow-up PRs:

  • Consolidating the nested external/Java.Interop/external/xamarin-android-tools submodule with the top-level external/xamarin-android-tools (still consumed by Java.Interop.sln, Java.Interop.BootstrapTasks.sln, and the CI templates).
  • external/Java.Interop/.gitignore (only unique entries are obsolete Gendarme cruft and a specific dev's JDK installer package).
  • README.md, LICENSE, ThirdPartyNotices.txt — need TPN / legal review before merging into top-level equivalents.
  • .editorconfig / .gitattributes — nearly identical to top-level; the JI .gitattributes uniquely covers gradlew / *.properties / *.kt / *.kts for build-tools/gradle/. Harmless as-is.

Pull Request
title and
description
should follow the
commit-messages.md workflow documentation, and in particular should include:

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`:

    <ProductSnkPath>$(MSBuildThisFileDirectory)..\..\product.snk</ProductSnkPath>

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>
Copilot AI review requested due to automatic review settings July 1, 2026 18:26

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

Removes leftover standalone-repo scaffolding under external/Java.Interop/ after the Java.Interop merge, and retargets Java.Interop project signing to use the repo-root product.snk rather than a duplicated copy.

Changes:

  • Introduces $(ProductSnkPath) in external/Java.Interop/Directory.Build.props pointing to the repo-root product.snk.
  • Updates 9 Java.Interop projects/tests to sign using $(ProductSnkPath) instead of a relative path to a now-deleted duplicate key.
  • Deletes redundant/orphaned standalone-repo files (SECURITY.md, CODE-OF-CONDUCT.md, nested .gitmodules, Makefile, VS Code workspace).

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
external/Java.Interop/Directory.Build.props Adds ProductSnkPath property resolving to repo-root product.snk.
external/Java.Interop/src/Java.Interop/Java.Interop.csproj Uses $(ProductSnkPath) for AssemblyOriginatorKeyFile.
external/Java.Interop/src/Java.Interop.Localization/Java.Interop.Localization.csproj Uses $(ProductSnkPath) for signing key.
external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil.csproj Uses $(ProductSnkPath) for signing key.
external/Java.Interop/src/Java.Interop.Tools.Diagnostics/Java.Interop.Tools.Diagnostics.csproj Uses $(ProductSnkPath) for signing key.
external/Java.Interop/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers.csproj Uses $(ProductSnkPath) for signing key.
external/Java.Interop/src/Java.Interop.Tools.Maven/Java.Interop.Tools.Maven.csproj Uses $(ProductSnkPath) for signing key.
external/Java.Interop/src/Xamarin.Android.Tools.Bytecode/Xamarin.Android.Tools.Bytecode.csproj Uses $(ProductSnkPath) for signing key.
external/Java.Interop/tests/Java.Interop-Tests/Java.Interop-Tests.csproj Uses $(ProductSnkPath) for signing key.
external/Java.Interop/tests/TestJVM/TestJVM.csproj Uses $(ProductSnkPath) for signing key.
external/Java.Interop/SECURITY.md Deleted redundant/stale security policy file.
external/Java.Interop/CODE-OF-CONDUCT.md Deleted duplicate Code of Conduct file.
external/Java.Interop/.gitmodules Deleted redundant nested .gitmodules.
external/Java.Interop/Java.Interop.code-workspace Deleted orphaned VS Code workspace file.
external/Java.Interop/Makefile Deleted orphaned standalone-repo Makefile.

@jonathanpeppers
jonathanpeppers merged commit d385c5f into main Jul 1, 2026
43 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-java-interop-stale-file-hunt branch July 1, 2026 21:12
@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants