[jnimarshalmethod-gen] Delete the temporary files #301
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.
We don't want to leave the
*-JniMarshalMethods.dllfiles behind, sowe need to delete them, once the methods are moved back to the
originating assemblies.
Because the dynamic assembly builder needs to save the temporary
assembly, we need it to use
AssemblyBuilderAccess.Save, which meansthe assembly cannot be unloaded from the domain.
Thus we do the work in separate
AppDomainand unload the wholedomain at the end, so that the temporary files are not locked
anymore. A bit of refactoring was needed for that.
There is also new
--keeptempoption to enable the old behavior andkeep the temporary files.
And finally the help message is printed when no arguments
supplied. Plus new error message in case no assemblies were specified.