Skip to content
This repository was archived by the owner on Jul 6, 2026. It is now read-only.

[invocation-overhead] git ignore generated source files. - #1173

Closed
jpobst wants to merge 1 commit into
mainfrom
remove-generated
Closed

[invocation-overhead] git ignore generated source files.#1173
jpobst wants to merge 1 commit into
mainfrom
remove-generated

Conversation

@jpobst

@jpobstjpobst commented Dec 7, 2023

Copy link
Copy Markdown
Contributor

Building the Java.Interop.sln solution always produces some generated files that git wants to try to commit:

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: tests/invocation-overhead/jni.cs
Untracked files:
(use "git add <file>..." to include in what will be committed)
tests/invocation-overhead/jni-api.h
tests/invocation-overhead/jni.c

Ignore these files with .gitignore.

Note that the first time we generate jni.cs we need to manually add it to @(Compile) because the wildcard expansion has already executed at that point. Additional times the file gets regenerated we use KeepDuplicates='false' to prevent a duplicate @(Compile) file warning.

@jpobst
jpobst marked this pull request as ready for review December 7, 2023 19:09
@jpobst
jpobst requested a review from jonpryorDecember 7, 2023 19:09
@jonpryor

jonpryor commented Dec 11, 2023

Copy link
Copy Markdown
Contributor

We should probably instead addtests/invocation-overhead/jni-api.h and tests/invocation-overhead/jni.c, and update tests/invocation-overhead/jni.cs, as these are useful ways to see what build-tools/jnienv-gen output is, without needing to build the repo itself and look at e.g. src/Java.Interop/obj/Debug/net7.0/JniEnvironment.g.cs or src/java-interop/obj/Debug-net7.0/jni.c.

For example, consider 0f1efeb, which updated jnienv-gen, and also included updates to tests/invocation-overhead/jni.cs. This made code review easier -- at least I'd like to think so -- because the changes introduced to jnienv-gen were visible in the same PR as changes to jni.cs.

@jpobst

Copy link
Copy Markdown
ContributorAuthor

Sounds good to me. This solution also fulfills my desire of appeasing git. 😁

I'll update this PR to do this instead.

@jpobst

Copy link
Copy Markdown
ContributorAuthor

Superseded by #1175.

@jpobstjpobst closed this Dec 11, 2023
@jpobst
jpobst deleted the remove-generated branch December 11, 2023 19:55
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Apr 12, 2024
Sign up for freeto 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.

2 participants

@jpobst@jonpryor