-
Notifications
You must be signed in to change notification settings - Fork 578
[Xamarin.Android.Build.Tasks] Generate marshal methods for user assem… #1751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1102,6 +1102,7 @@ because xbuild doesn't support framework reference assemblies. | |
| <_AndroidComponentResgenFlagFile>$(IntermediateOutputPath)Component.R.cs.flag</_AndroidComponentResgenFlagFile> | ||
| <_AndroidStripFlag>$(IntermediateOutputPath)strip.flag</_AndroidStripFlag> | ||
| <_AndroidLinkFlag>$(IntermediateOutputPath)link.flag</_AndroidLinkFlag> | ||
| <_AndroidJniMarshalMethodsFlag>$(IntermediateOutputPath)jnimarshalmethods.flag</_AndroidJniMarshalMethodsFlag> | ||
| <_AndroidApkPerAbiFlagFile>$(IntermediateOutputPath)android\bin\apk_per_abi.flag</_AndroidApkPerAbiFlagFile> | ||
| <_AndroidDebugKeyStoreFlag>$(IntermediateOutputPath)android_debug_keystore.flag</_AndroidDebugKeyStoreFlag> | ||
| <_RemoveRegisterFlag>$(MonoAndroidIntermediateAssetsDir)shrunk\shrunk.flag</_RemoveRegisterFlag> | ||
|
|
@@ -2012,7 +2013,7 @@ because xbuild doesn't support framework reference assemblies. | |
| </Target> | ||
|
|
||
| <Target Name="_LinkAssemblies" | ||
| DependsOnTargets="_ResolveAssemblies;_CreatePackageWorkspace;_LinkAssembliesNoShrink;_LinkAssembliesShrink" /> | ||
| DependsOnTargets="_ResolveAssemblies;_CreatePackageWorkspace;_GenerateJniMarshalMethods;_LinkAssembliesNoShrink;_LinkAssembliesShrink" /> | ||
|
|
||
| <Target Name="_LinkAssembliesNoShrink" | ||
| Condition="'$(AndroidLinkMode)' == 'None'" | ||
|
|
@@ -2035,6 +2036,19 @@ because xbuild doesn't support framework reference assemblies. | |
| <Touch Files="$(_AndroidLinkFlag)" AlwaysCreate="true" /> | ||
| </Target> | ||
|
|
||
| <Target Name="_GenerateJniMarshalMethods" | ||
| Condition="'$(JniMarshalMethods)' == 'True' And '$(Configuration)' == 'Release' And '$(AndroidLinkMode)' != 'None'" | ||
| DependsOnTargets="_GetReferenceAssemblyPaths" | ||
| Inputs="@(ResolvedUserAssemblies->'$(MonoAndroidLinkerInputDir)%(Filename)%(Extension)')" | ||
| Outputs="$(_AndroidJniMarshalMethodsFlag)"> | ||
|
|
||
| <Exec | ||
| Command="MONO_PATH=$(_XATargetFrameworkDirectories) $(MonoAndroidBinDirectory)\mono $(MonoAndroidBinDirectory)\..\jnimarshalmethod-gen.exe @(ResolvedUserAssemblies->'$(MonoAndroidLinkerInputDir)%(Filename)%(Extension)')" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we also need to update the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Command="MONO_PATH="$(_XATargetFrameworkDirectories)" ...Additionally, I believe that For example (from a random full xamarin-android build log I have lying around): If e.g. Alternatively, perhaps |
||
| /> | ||
| <Touch Files="$(_AndroidJniMarshalMethodsFlag)" AlwaysCreate="True" /> | ||
|
|
||
| </Target> | ||
|
|
||
| <Target Name="_LinkAssembliesShrink" | ||
| Condition="'$(AndroidLinkMode)' != 'None'" | ||
| Inputs="@(ResolvedUserAssemblies->'$(MonoAndroidLinkerInputDir)%(Filename)%(Extension)');$(_AndroidBuildPropertiesCache)" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed,
$(JniMarshalMethods)does appear to control generation as well, wrt #1745 (comment).Thus,
$(AndroidGenerateJniMarshalMethods)seems appropriate.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Convention (also not followed consistently, but let's not make it worse):
For XML, attributes are indented one "tab stop" more than child elements. Additionally, prefer spaces over tabs, and use two-space "tab stops". Thus:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not use
'$(Configuration)' == 'Release'.$(Configuration)values are convention, and developers are able to add arbitrary names. (For example, Java.Interop had aXAIntegrationReleaseconfiguration for quite some time.)Any check against
$(Configuration)is a "code smell." (I think we still have one anyway -- though I can't currently find it -- but, again, we shouldn't make things worse.)