-
Notifications
You must be signed in to change notification settings - Fork 564
Include Bindings code in Design Time builds #8357
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
Conversation
36518e8 to
174ac96
Compare
src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.Core.targets
Show resolved
Hide resolved
|
WIP commit message: Fixes: https://github.com/xamarin/xamarin-android/issues/7692
When `.java` files are part of a project through
`@(AndroidJavaSource)`, it would be nice if the *bindings* for those
Java types would be available through IDE IntelliSense/code completion.
Update the `AddBindingsToCompile` target so that it includes all
`$(IntermediateOutputPath)generated\**\*.cs` files into the design-
time build.
Additionally, fix an issue where if you remove the libraries the
generated files are not removed. |
src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.Core.targets
Outdated
Show resolved
Hide resolved
jonathanpeppers
left a comment
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.
Is it possible to test after only a design-time build, and then use Mono.Cecil to assert a type exists in the design-time build output? I don't remember if an assembly exists on disk after a design-time build completes.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BindingBuildTest.cs
Show resolved
Hide resolved
b73097b to
aefd4e6
Compare
The assembly does not get written to disk for DTB. |
ef2226b to
f824e0f
Compare
src/Xamarin.Android.Build.Tasks/Tasks/GenerateLayoutBindings.CSharpBindingGenerator.cs
Outdated
Show resolved
Hide resolved
297d8c9 to
7864abb
Compare
7864abb to
4caef47
Compare
|
@dellis1972: I forget when we wanted to move the codebehind files into However, shouldn't IntelliSense also know about/show the CodeBehind API? https://github.com/xamarin/xamarin-android/blob/main/Documentation/guides/LayoutCodeBehind.md Shouldn't IntelliSense show the |
|
|
@jonpryor the codebehind code is included via the |
) Fixes: #7692 When `.java` files are part of a project through `@(AndroidJavaSource)`, it would be nice if the *bindings* for those Java types would be available through IDE IntelliSense/code completion. Update the `AddBindingsToCompile` target so that it includes all `$(IntermediateOutputPath)generated\**\*.cs` files into the design- time build. Additionally, fix an issue where if you remove the libraries the generated files are not removed. Finally, move the Layout CodeBehind generated files to their own `$(IntermediateOutputPath)codebehind` directory. This is to keep the code behind and generated code separate, as it makes it easier to update and clean up if one or the other changes. When all the files are in the same location we might end up deleting files we otherwise need during an update process, slowing down the build.
* main: [Xamarin.Android.Build.Tasks] Include Bindings Design Time builds (dotnet#8357)
) Fixes: #7692 When `.java` files are part of a project through `@(AndroidJavaSource)`, it would be nice if the *bindings* for those Java types would be available through IDE IntelliSense/code completion. Update the `AddBindingsToCompile` target so that it includes all `$(IntermediateOutputPath)generated\**\*.cs` files into the design- time build. Additionally, fix an issue where if you remove the libraries the generated files are not removed. Finally, move the Layout CodeBehind generated files to their own `$(IntermediateOutputPath)codebehind` directory. This is to keep the code behind and generated code separate, as it makes it easier to update and clean up if one or the other changes. When all the files are in the same location we might end up deleting files we otherwise need during an update process, slowing down the build.
Fixes: #7692
When
.javafiles are part of a project through@(AndroidJavaSource), it would be nice if the bindings for thoseJava types would be available through IDE IntelliSense/code completion.
Update the
AddBindingsToCompiletarget so that it includes all$(IntermediateOutputPath)generated\**\*.csfiles into the design-time build.
Additionally, fix an issue where if you remove the libraries the
generated files are not removed.
Finally move the Layout CodeBehind generated files to their own
directory. This new directory is in
$(IntermediateOutputPath)codebehind.The reason behind this is to keep the code behind and generated code sepereate.
It makes it easier to update and clean up if one or the other changes. If all the files
are in the same location we might end up deleting things we need during an
update process.