Uh oh!
There was an error while loading. Please reload this page.
[XABT] Allow deployment artifacts to specify multiple JavaDependencyVerification JavaArtifact libraries. - #9112
Conversation
c19adb8 to
6b87b0cCompare
jonathanpeppers
left a comment
There was a problem hiding this comment.
Regarding all of the different delimiters options, should we use ; as the standard MSBuild delimiter? Could ; be used as the top-level delimiter?
I'm wondering if we can use MSBuild to parse/split the top-level data, and not have to do that ourselves.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…erification JavaArtifact libraries.
ce00e69 to
7b8a54cComparejpobst
commented
Aug 12, 2024
I don't really have a preference here, but this conflicts with @jonpryor's request to support newlines. |
jonathanpeppers
commented
Aug 12, 2024
I tried to ask if there is a standard way for us to split like MSBuild does: I will ask the same question in Teams, maybe we could get a better answer there. |
7b8a54c to
bbfbf35Comparejonathanpeppers
commented
Aug 14, 2024
I asked in Teams, but there isn't a standard thing for splitting MSBuild item metadata. So, we can delimit on whichever character(s) we like. |
jonpryor
commented
Aug 14, 2024
My concern is legibility: I find "very long lines" difficult to read. Earlier this year I was looking into some stripe-binding related question, and had a reason to play with <ProjectReferenceInclude="..\stripe_terminal\stripe_terminal.csproj"JavaArtifacts="com.google.code.gson:gson:2.10.1;com.google.dagger:dagger:2.51;com.jaredrummler:android-device-names:1.1.9;com.neovisionaries:nv-i18n:1.29;com.scottyab:rootbeer-lib:0.1.0;…"(My I don't find the above to be readable, and it's not even complete yet! Staying within MSBuild, we could introduce another item group: <ItemGroup>
<_StripJavaArtifactInclude="com.google.code.gson:gson:2.10.1" />
<_StripJavaArtifactInclude="com.google.dagger:dagger:2.51" />
<_StripJavaArtifactInclude="com.jaredrummler:android-device-names:1.1.9" />
<_StripJavaArtifactInclude="com.neovisionaries:nv-i18n:1.29" />
<_StripJavaArtifactInclude="com.scottyab:rootbeer-lib:0.1.0" />
<!-- … -->
<ProjectReferenceInclude="..\stripe_terminal\stripe_terminal.csproj"JavaArtifacts="@(_StripJavaArtifact)"
/>
</ItemGroup>Which works, but as soon as you have multiple items which require This is why I was advocating for newlines and trimming/ignoring whitespace, which would allow "inlining" things: <ProjectReferenceInclude="..\stripe_terminal.csproj"JavaArtifacts=" com.google.code.gson:gson:2.10.1 com.google.dagger:dagger:2.51 com.jaredrummler:android-device-names:1.1.9 com.neovisionaries:nv-i18n:1.29 com.scottyab:rootbeer-lib:0.1.0 …"
/>Additionally, MSBuild default behavior of turning I thus believe we should split on |
| // Convert "../../src/blah/Blah.csproj" to "Blah.csproj" | ||
| if (type == "ProjectReference") | ||
| item_name = Path.GetFileName (item_name); |
There was a problem hiding this comment.
Do we actually want to do this? What if the same project name is used multiples but for different paths: Lib1/Helper.csproj, Lib2/Helper.csproj, …?
| artifacts.Add (art.ArtifactString, art); | ||
| if (MavenExtensions.TryParseArtifacts (id, log, out var parsed)) { | ||
| foreach (var art in parsed) { | ||
| log.LogMessage ("Ignoring Java dependency '{0}:{1}' version '{2}'", art.GroupId, art.Id, art.Version); |
There was a problem hiding this comment.
Given that we're now standardizing on "group:id:version" within %(JavaArtifacts), should we use that here as well?
* main: (47 commits) Bump to dotnet/sdk@5642787dac 9.0.100-rc.2.24426.2 (#9247) LEGO: Merge pull request 9246 Bump to 34.0.137 of the .NET 8 Android workload (#9243) Bump external/Java.Interop from `d30d554` to `51b784a` (#9241) Bump dotnet/android-tools@6575743 (#9235) Bump to mono/debugger-libs@d5664344 (#9238) [ci] Improve push_signed_nugets job condition (#9240) Bump to dotnet/android-tools@657574378a6 and xamarin/monodroid@8bd4bae7 (#9216) Bump to dotnet/java-interop@d30d554 (#9234) Localized file check-in by OneLocBuild Task (#9236) Bump to dotnet/sdk@e2b7b9d2b4 9.0.100-rc.2.24420.1 (#9228) $(AndroidPackVersionSuffix)=rc.2; net9 is 35.0.0-rc.2 (#9233) [Xamarin.Android.Build.Tasks] Scan for JCWs for each ABI in parallel (#9215) [Xamarin.Android.Build.Tasks] %(JavaArtifact) is a list (#9112) [native/monodroid] Fix error demangling satellite assembly names (#9166) [build] Update package metadata (#9230) [Xamarin.Android.Build.Tasks] Remove ILRepack (#9226) [Xamarin.Android.Build.Tasks] Fix an issue with incremental builds (#9183) [Xamarin.Android.Build.Tasks] remove `$XAMARIN_BUILD_ID` (#9223) [Mono.Android] Use .NET version of mdoc (#9225) ...
Fixes: #9013
Today, our Java Dependency Verification feature is built around our recommended practice of 1 binding library per project. This is reflected in the fact that
JavaArtifactandJavaVersiononly support a single library:However a user may choose to place multiple Java libraries in a single package (or project), and we have no way to express that. Instead of using
JavaArtifact/JavaVersionto specify a Java dependency, we will only useJavaArtifactand we will update the specification to include the artifact version:org.jetbrains.kotlin:kotlin-stdlib:1.7.10. Additionally, this attribute now allows multiple Java artifacts to be specified by separating them with a comma, semicolon, or newline.This change affects
@(PackageReference),@(ProjectReference),@(AndroidLibrary), and@(AndroidIgnoredJavaDependency).Examples:
Existing support for looking at NuGet package tags to automatically find Java libraries contained within has also been updated to support multiple
artifacttags. Note that separate tags are expected, not a single tag with multiple artifacts specified: