Skip to content

Commit

Permalink
Change order of Maven dependencies. Since Maven prefers the first, en…
Browse files Browse the repository at this point in the history
…sure local deps are first, project deps are second, and package deps are third.
  • Loading branch information
wasabii committed Jan 26, 2024
1 parent ff9276d commit 21bae61
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/IKVM.Maven.Sdk/buildTransitive/IKVM.Maven.Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@
</PropertyGroup>

<!-- Transforms the MavenReference item group into MavenReferenceItem items. -->
<Target Name="GetMavenReferenceItemsFromPackageReferences" DependsOnTargets="ResolvePackageAssets">
<MavenReferenceItemImport AssetsFilePath="$(ProjectAssetsFile)" TargetFramework="$(TargetFramework)" RuntimeIdentifier="$(RuntimeIdentifier)" Condition="Exists('$(ProjectAssetsFile)')">
<Output TaskParameter="Items" ItemName="_MavenReferenceItemFromPackageReferences" />
</MavenReferenceItemImport>
<Target Name="GetMavenReferenceItemsFromMavenReferences" Condition=" '@(MavenReference)' != '' ">
<ItemGroup>
<MavenReferenceItem Include="@(_MavenReferenceItemFromPackageReferences)">
<ReferenceSource>PackageReference</ReferenceSource>
<MavenReferenceItem Include="@(MavenReference)">
<ReferenceSource>MavenReference</ReferenceSource>
</MavenReferenceItem>
</ItemGroup>
</Target>

<!-- Obtains MavenReferenceItem items from child projects. -->
<Target Name="GetMavenReferenceItemsFromProjectReferences" DependsOnTargets="PrepareProjectReferences">
<Target Name="GetMavenReferenceItemsFromProjectReferences" DependsOnTargets="GetMavenReferenceItemsFromMavenReferences;PrepareProjectReferences">
<MSBuild
Projects="@(_MSBuildProjectReferenceExistent)"
Targets="GetMavenReferenceItems"
Expand All @@ -37,16 +34,19 @@
</Target>

<!-- Transforms the MavenReference item group into MavenReferenceItem items. -->
<Target Name="GetMavenReferenceItemsFromMavenReferences" Condition=" '@(MavenReference)' != '' ">
<Target Name="GetMavenReferenceItemsFromPackageReferences" DependsOnTargets="GetMavenReferenceItemsFromMavenReferences;GetMavenReferenceItemsFromProjectReferences;ResolvePackageAssets">
<MavenReferenceItemImport AssetsFilePath="$(ProjectAssetsFile)" TargetFramework="$(TargetFramework)" RuntimeIdentifier="$(RuntimeIdentifier)" Condition="Exists('$(ProjectAssetsFile)')">
<Output TaskParameter="Items" ItemName="_MavenReferenceItemFromPackageReferences" />
</MavenReferenceItemImport>
<ItemGroup>
<MavenReferenceItem Include="@(MavenReference)">
<ReferenceSource>MavenReference</ReferenceSource>
<MavenReferenceItem Include="@(_MavenReferenceItemFromPackageReferences)">
<ReferenceSource>PackageReference</ReferenceSource>
</MavenReferenceItem>
</ItemGroup>
</Target>

<!-- Populates the MavenReferenceItem set with required metadata. -->
<Target Name="GetMavenReferenceItemsMetadata" DependsOnTargets="GetMavenReferenceItemsFromPackageReferences;GetMavenReferenceItemsFromProjectReferences;GetMavenReferenceItemsFromMavenReferences;" Condition=" '@(MavenReferenceItem)' != '' ">
<Target Name="GetMavenReferenceItemsMetadata" DependsOnTargets="GetMavenReferenceItemsFromMavenReferences;GetMavenReferenceItemsFromProjectReferences;GetMavenReferenceItemsFromPackageReferences" Condition=" '@(MavenReferenceItem)' != '' ">
<!-- Probes for default metadata from the reference item. -->
<MavenReferenceItemPrepare Items="@(MavenReferenceItem)">
<Output TaskParameter="Items" ItemName="_MavenReferenceItemWithMetadata" />
Expand All @@ -63,10 +63,10 @@
<PropertyGroup>
<GetMavenReferenceItemsDependsOn>
$(GetMavenReferenceItemsDependsOn);
GetMavenReferenceItemsFromPackageReferences;
GetMavenReferenceItemsFromMavenReferences;
PrepareProjectReferences;
GetMavenReferenceItemsFromProjectReferences;
GetMavenReferenceItemsFromMavenReferences;
GetMavenReferenceItemsFromPackageReferences;
GetMavenReferenceItemsMetadata;
</GetMavenReferenceItemsDependsOn>
</PropertyGroup>
Expand Down

0 comments on commit 21bae61

Please sign in to comment.