Skip to content

Commit

Permalink
Merge branch 'develop' into feature/jdktool
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabii committed Sep 20, 2022
2 parents 4fd9ce9 + a0789a4 commit 9928ac4
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 37 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/IKVM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ on:
push:
branches:
- main
- master
- develop
pull_request:
branches:
- main
- master
- develop

jobs:
Expand Down Expand Up @@ -170,7 +168,7 @@ jobs:
run: dotnet restore IKVM.sln
- name: Build Artifacts
run: |
msbuild /m:1 `
msbuild /m `
/p:Configuration="Release" `
/p:Platform="Any CPU" `
/p:Version=${env:GitVersion_FullSemVer} `
Expand Down
96 changes: 65 additions & 31 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
<Project>

<PropertyGroup>
<GlobalPropertiesToRemove>$(GlobalPropertiesToRemove);PublishDir;PackageOutputPath</GlobalPropertiesToRemove>
</PropertyGroup>

<ItemDefinitionGroup>
<ResolvedFileToPublish>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemDefinitionGroup>

<!-- Attempt to remove the PublishDir from the evaluation graph to prevent multiple evaluation. -->
<Target Name="AddPublishDirToGlobalPropertiesToRemove" BeforeTargets="AssignProjectConfiguration">
<ItemGroup>
<ProjectReference Update="@(ProjectReference)">
<GlobalPropertiesToRemove>%(ProjectReference.GlobalPropertiesToRemove);$(GlobalPropertiesToRemove)</GlobalPropertiesToRemove>
</ProjectReference>
</ItemGroup>
</Target>

<!-- Publish target that returns publish directory. -->
<Target Name="IkvmPublish" DependsOnTargets="Publish" Returns="$(PublishDirFullPath)">
<PropertyGroup>
<PublishDirFullPath>$([System.IO.Path]::GetFullPath('$(PublishDir)'))</PublishDirFullPath>
</PropertyGroup>
</Target>

<!-- LibProjectReferences are references to vcxproj that that have their target outputs collected and included into the content directory. This allows multi-platform targeting. -->
<Target Name="GetLibProjectReferences" Condition=" '@(LibProjectReference)' != '' ">
<MSBuild Projects="@(LibProjectReference->'%(ProjectFile)')" Targets="GetTargetPath" BuildInParallel="$(BuildInParallel)" Properties="Platform=%(LibProjectReference.Platform);Configuration=%(LibProjectReference.Configuration)">
<ItemGroup>
<LibProjectReference Update="@(LibProjectReference)">
<GlobalPropertiesToRemove>%(LibProjectReference.GlobalPropertiesToRemove);$(GlobalPropertiesToRemove)</GlobalPropertiesToRemove>
</LibProjectReference>
</ItemGroup>
<MSBuild Projects="@(LibProjectReference->'%(ProjectFile)')" Targets="GetTargetPath" BuildInParallel="$(BuildInParallel)" Properties="Platform=%(LibProjectReference.Platform);Configuration=%(LibProjectReference.Configuration)" RemoveProperties="%(LibProjectReference.GlobalPropertiesToRemove)">
<Output TaskParameter="TargetOutputs" ItemName="_LibProjectReferenceWithOutputPath" />
</MSBuild>
<ItemGroup>
Expand All @@ -37,30 +56,31 @@
</Target>

<Target Name="BuildLibProjectReferences" BeforeTargets="Compile" DependsOnTargets="GetLibProjectReferences" Condition=" '$(DesignTimeBuild)' != 'true' And '@(LibProjectReference)' != '' ">
<MSBuild Projects="%(LibProjectReferenceWithOutputPath.ProjectFile)" Targets="Build" BuildInParallel="$(BuildInParallel)" Properties="Platform=%(LibProjectReferenceWithOutputPath.Platform);Configuration=%(LibProjectReferenceWithOutputPath.Configuration)">
<MSBuild Projects="%(LibProjectReferenceWithOutputPath.ProjectFile)" Targets="Build" BuildInParallel="$(BuildInParallel)" Properties="Platform=%(LibProjectReferenceWithOutputPath.Platform);Configuration=%(LibProjectReferenceWithOutputPath.Configuration)" RemoveProperties="%(LibProjectReferenceWithOutputPath.GlobalPropertiesToRemove)">
<Output TaskParameter="TargetOutputs" ItemName="LibProjectReferencesCompileOutput" />
</MSBuild>
</Target>

<!--
PublishProjectReference
These references have their Publish target invoked, with the output being consumed by the containing project.
-->

<Target Name="AssignPublishProjectConfiguration" Condition=" '$(DesignTimeBuild)' != 'true' And '@(PublishProjectReference)' != '' ">
<ItemGroup>
<PublishProjectReference Update="@(PublishProjectReference)">
<GlobalPropertiesToRemove>%(PublishProjectReference.GlobalPropertiesToRemove);$(GlobalPropertiesToRemove)</GlobalPropertiesToRemove>
</PublishProjectReference>
</ItemGroup>
<PropertyGroup>
<OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration Condition="'$(OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration)' == ''">true</OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration>
<ShouldUnsetParentConfigurationAndPlatform Condition="'$(ShouldUnsetParentConfigurationAndPlatform)' == '' and ('$(BuildingInsideVisualStudio)' == 'true' or '$(BuildingSolutionFile)' == 'true')">true</ShouldUnsetParentConfigurationAndPlatform>
<ShouldUnsetParentConfigurationAndPlatform Condition="'$(ShouldUnsetParentConfigurationAndPlatform)' == ''">false</ShouldUnsetParentConfigurationAndPlatform>
</PropertyGroup>
<AssignProjectConfiguration
ProjectReferences="@(PublishProjectReference)"
CurrentProject="$(MSBuildProjectFullPath)"
CurrentProjectConfiguration="$(Configuration)"
CurrentProjectPlatform="$(Platform)"
DefaultToVcxPlatformMapping="$(DefaultToVcxPlatformMapping)"
VcxToDefaultPlatformMapping="$(VcxToDefaultPlatformMapping)"
OutputType="$(OutputType)"
ResolveConfigurationPlatformUsingMappings="false"
SolutionConfigurationContents="$(CurrentSolutionConfigurationContents)"
AddSyntheticProjectReferencesForSolutionDependencies="false"
OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration = "$(OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration)"
ShouldUnsetParentConfigurationAndPlatform = "$(ShouldUnsetParentConfigurationAndPlatform)" >
<AssignProjectConfiguration ProjectReferences="@(PublishProjectReference)" CurrentProject="$(MSBuildProjectFullPath)" CurrentProjectConfiguration="$(Configuration)" CurrentProjectPlatform="$(Platform)" DefaultToVcxPlatformMapping="$(DefaultToVcxPlatformMapping)" VcxToDefaultPlatformMapping="$(VcxToDefaultPlatformMapping)" OutputType="$(OutputType)" ResolveConfigurationPlatformUsingMappings="false" SolutionConfigurationContents="$(CurrentSolutionConfigurationContents)" AddSyntheticProjectReferencesForSolutionDependencies="false" OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration="$(OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration)" ShouldUnsetParentConfigurationAndPlatform="$(ShouldUnsetParentConfigurationAndPlatform)">
<Output TaskParameter="AssignedProjects" ItemName="_PublishProjectReferenceWithConfiguration"/>
<Output TaskParameter="UnassignedProjects" ItemName="_PublishProjectReferenceWithConfiguration"/>
</AssignProjectConfiguration>
Expand All @@ -77,12 +97,12 @@
</Target>

<Target Name="GetPublishProjectReferenceItems" DependsOnTargets="GetPublishProjectReferences" Condition=" '$(DesignTimeBuild)' != 'true' And '@(_PublishProjectReference)' != '' ">
<MSBuild Projects="@(_PublishProjectReference)" Targets="Publish;PublishItemsOutputGroup" BuildInParallel="$(BuildInParallel)" Properties="%(_PublishProjectReference.SetConfiguration);%(_PublishProjectReference.SetPlatform);%(_PublishProjectReference.SetTargetFramework);%(_PublishProjectReference.PublishProperties)" RemoveProperties="%(_PublishProjectReference.GlobalPropertiesToRemove);%(_PublishProjectReference.PublishPropertiesToRemove);PublishDir;PublishUrl;Location" RebaseOutputs="true">
<MSBuild Projects="@(_PublishProjectReference)" Targets="Publish;PublishItemsOutputGroup" BuildInParallel="$(BuildInParallel)" Properties="%(_PublishProjectReference.SetConfiguration);%(_PublishProjectReference.SetPlatform);%(_PublishProjectReference.SetTargetFramework);%(_PublishProjectReference.PublishProperties)" RemoveProperties="%(_PublishProjectReference.GlobalPropertiesToRemove);%(_PublishProjectReference.PublishPropertiesToRemove)" RebaseOutputs="true">
<Output TaskParameter="TargetOutputs" ItemName="_PublishProjectReferenceItems" />
</MSBuild>
</Target>

<Target Name="GetPublishProjectReferenceCopyToOutputDirectoryItems" DependsOnTargets="GetPublishProjectReferenceItems" Condition=" '$(DesignTimeBuild)' != 'true' ">
<Target Name="GetPublishProjectReferenceCopyToOutputDirectoryItems" DependsOnTargets="GetPublishProjectReferenceItems" Condition=" '$(DesignTimeBuild)' != 'true' and '@(_PublishProjectReferenceItems)' != '' ">
<ItemGroup>
<ContentWithTargetPath Include="@(_PublishProjectReferenceItems->'%(Identity)')" Condition=" '%(_PublishProjectReferenceItems.PublishTargetPath)' != '' ">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down Expand Up @@ -134,26 +154,27 @@
<Target Name="GetPublishProjectReferencePackageItemsBeforeGetPackageFiles" DependsOnTargets="$(GetPublishProjectReferenceItemsBeforePackageFilesDependsOn)" BeforeTargets="_GetPackageFiles" Condition=" '$(DesignTimeBuild)' != 'true' ">

</Target>

<!--
IncludeProjectReference
These references have their build output included into the content output of the consuming project.
-->

<Target Name="AssignIncludeProjectConfiguration" Condition=" '$(DesignTimeBuild)' != 'true' And '@(IncludeProjectReference)' != '' ">
<ItemGroup>
<IncludeProjectReference Update="@(IncludeProjectReference)">
<GlobalPropertiesToRemove>%(IncludeProjectReference.GlobalPropertiesToRemove);$(GlobalPropertiesToRemove)</GlobalPropertiesToRemove>
</IncludeProjectReference>
</ItemGroup>
<PropertyGroup>
<OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration Condition="'$(OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration)' == ''">true</OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration>
<ShouldUnsetParentConfigurationAndPlatform Condition="'$(ShouldUnsetParentConfigurationAndPlatform)' == '' and ('$(BuildingInsideVisualStudio)' == 'true' or '$(BuildingSolutionFile)' == 'true')">true</ShouldUnsetParentConfigurationAndPlatform>
<ShouldUnsetParentConfigurationAndPlatform Condition="'$(ShouldUnsetParentConfigurationAndPlatform)' == ''">false</ShouldUnsetParentConfigurationAndPlatform>
</PropertyGroup>
<AssignProjectConfiguration
ProjectReferences="@(IncludeProjectReference)"
CurrentProject="$(MSBuildProjectFullPath)"
CurrentProjectConfiguration="$(Configuration)"
CurrentProjectPlatform="$(Platform)"
DefaultToVcxPlatformMapping="$(DefaultToVcxPlatformMapping)"
VcxToDefaultPlatformMapping="$(VcxToDefaultPlatformMapping)"
OutputType="$(OutputType)"
ResolveConfigurationPlatformUsingMappings="false"
SolutionConfigurationContents="$(CurrentSolutionConfigurationContents)"
AddSyntheticProjectReferencesForSolutionDependencies="false"
OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration = "$(OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration)"
ShouldUnsetParentConfigurationAndPlatform = "$(ShouldUnsetParentConfigurationAndPlatform)" >
<AssignProjectConfiguration ProjectReferences="@(IncludeProjectReference)" CurrentProject="$(MSBuildProjectFullPath)" CurrentProjectConfiguration="$(Configuration)" CurrentProjectPlatform="$(Platform)" DefaultToVcxPlatformMapping="$(DefaultToVcxPlatformMapping)" VcxToDefaultPlatformMapping="$(VcxToDefaultPlatformMapping)" OutputType="$(OutputType)" ResolveConfigurationPlatformUsingMappings="false" SolutionConfigurationContents="$(CurrentSolutionConfigurationContents)" AddSyntheticProjectReferencesForSolutionDependencies="false" OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration="$(OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration)" ShouldUnsetParentConfigurationAndPlatform="$(ShouldUnsetParentConfigurationAndPlatform)">
<Output TaskParameter="AssignedProjects" ItemName="_IncludeProjectReferenceWithConfiguration"/>
<Output TaskParameter="UnassignedProjects" ItemName="_IncludeProjectReferenceWithConfiguration"/>
</AssignProjectConfiguration>
Expand Down Expand Up @@ -228,11 +249,24 @@

</Target>

<!--
PackageProjectReference
These references have ther produced NuGet file (Pack target) copied into the consuming project as a content file.
-->

<Target Name="GetPackageOutputPath" DependsOnTargets="_GetAbsoluteOutputPathsForPack" Returns="$(PackageOutputAbsolutePath)">

</Target>

<Target Name="AssignPackageProjectConfiguration" Condition=" '$(DesignTimeBuild)' != 'true' And '@(PackageProjectReference)' != '' " >
<ItemGroup>
<PackageProjectReference Update="@(PackageProjectReference)">
<GlobalPropertiesToRemove>%(PackageProjectReference.GlobalPropertiesToRemove);$(GlobalPropertiesToRemove)</GlobalPropertiesToRemove>
</PackageProjectReference>
</ItemGroup>
<PropertyGroup>
<OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration Condition="'$(OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration)' == ''">true</OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration>
<ShouldUnsetParentConfigurationAndPlatform Condition="'$(ShouldUnsetParentConfigurationAndPlatform)' == '' and ('$(BuildingInsideVisualStudio)' == 'true' or '$(BuildingSolutionFile)' == 'true')">true</ShouldUnsetParentConfigurationAndPlatform>
Expand Down Expand Up @@ -265,4 +299,4 @@
</GetCopyToOutputDirectoryItemsDependsOn>
</PropertyGroup>

</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<Output TaskParameter="TargetOutputs" PropertyName="_JavaCompilerPublishDir" />
</MSBuild>
<PropertyGroup>
<JavaCompilerPath Condition=" '$(JavaCompilerPath)' == '' And Exists('$(_JavaCompilerPublishDir)javac.exe') ">$(_JavaCompilerPublishDir)\javac.exe</JavaCompilerPath>
<JavaCompilerPath Condition=" '$(JavaCompilerPath)' == '' And Exists('$(_JavaCompilerPublishDir)javac.exe') ">$([System.IO.Path]::GetFullPath('$(_JavaCompilerPublishDir)\javac.exe'))</JavaCompilerPath>
<JavaCompilerExec Condition=" '$(JavaCompilerExec)' == '' ">$(JavaCompilerPath)</JavaCompilerExec>
</PropertyGroup>
<Error Text="Could not locate javac executable." Condition=" '$(JavaCompilerPath)' == '' " />
Expand All @@ -82,7 +82,7 @@
<Output TaskParameter="TargetOutputs" PropertyName="_IkvmCompilerPublishDir" />
</MSBuild>
<PropertyGroup>
<IkvmCompilerPath Condition=" '$(IkvmCompilerPath)' == '' And Exists('$(_IkvmCompilerPublishDir)\ikvmc.exe') ">$(_IkvmCompilerPublishDir)\ikvmc.exe</IkvmCompilerPath>
<IkvmCompilerPath Condition=" '$(IkvmCompilerPath)' == '' And Exists('$(_IkvmCompilerPublishDir)\ikvmc.exe') ">$([System.IO.Path]::GetFullPath('$(_IkvmCompilerPublishDir)\ikvmc.exe'))</IkvmCompilerPath>
<IkvmCompilerExec Condition=" '$(IkvmCompilerExec)' == '' ">$(IkvmCompilerPath)</IkvmCompilerExec>
</PropertyGroup>
<Error Text="Could not locate ikvmc executable." Condition=" '$(IkvmCompilerPath)' == '' " />
Expand All @@ -104,7 +104,7 @@
<Output TaskParameter="TargetOutputs" PropertyName="_IkvmExporterPublishDir" />
</MSBuild>
<PropertyGroup>
<IkvmExporterPath Condition=" '$(IkvmExporterPath)' == '' And Exists('$(_IkvmExporterPublishDir)ikvmstub.exe')">$(_IkvmExporterPublishDir)ikvmstub.exe</IkvmExporterPath>
<IkvmExporterPath Condition=" '$(IkvmExporterPath)' == '' And Exists('$(_IkvmExporterPublishDir)ikvmstub.exe')">$([System.IO.Path]::GetFullPath('$(_IkvmExporterPublishDir)ikvmstub.exe'))</IkvmExporterPath>
<IkvmExporterExec Condition=" '$(IkvmExporterExec)' == '' ">$(IkvmExporterPath)</IkvmExporterExec>
</PropertyGroup>
<Error Text="Could not locate ikvmstub executable." Condition=" '$(IkvmExporterPath)' == '' " />
Expand Down

0 comments on commit 9928ac4

Please sign in to comment.