Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions FSharp.Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,13 +1,38 @@
<Project>

<PropertyGroup>
<XlfLanguages>en;$(XlfLanguages)</XlfLanguages>
<TargetDotnetProfile Condition="$(TargetFramework.StartsWith('netstandard')) or $(TargetFramework.StartsWith('netcoreapp'))">coreclr</TargetDotnetProfile>
<TargetDotnetProfile Condition="$(TargetFramework.StartsWith('net4'))">net40</TargetDotnetProfile>
<OutputPath>$(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\bin</OutputPath>
<IntermediateOutputPath>$(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\obj\$(MSBuildProjectName)\</IntermediateOutputPath>
<XlfLanguages>en;$(XlfLanguages)</XlfLanguages>
<ActualOutputPath Condition="'$(Language)' != 'VB'">$(MSBuildProjectDirectory)\$(OutputPath)</ActualOutputPath>
<ActualOutputPath Condition="'$(Language)' == 'VB'">$(OutputPath)</ActualOutputPath>
<FinalOutputPath>$(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\bin</FinalOutputPath>
<FinalIntermediateOutputPath>$(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\obj</FinalIntermediateOutputPath>
</PropertyGroup>

<Target Name="HACK_CopyOutputsToTheProperLocation"
AfterTargets="AfterBuild"
Condition="'$(DisableOutputPathCopying)' != 'true'">
<!--
Ideally we'd set <OutputPath> to `$(Configuration)\[net40|coreclr]\bin`, but the calculation of `[net40|coreclr]`
depends on the `$(TargetFramework)` variable which is set by the individual project files, but by the time we have
that value (e.g., in this file) it's too late; some targets, particularly from the VsSDK have already used the
values of $(OutputPath)/$(OutDir).

The fix is to not set `$(Outputpath)` and simply copy stuff there after the fact.
-->

<ItemGroup>
<OutputFilesToCopy Include="$(ActualOutputPath)**" />
<IntermediateFilesToCopy Include="$(IntermediateOutputPath)\**" />
</ItemGroup>

<Message Text="Copying build artifacts to $(FinalOutputPath)" />
<MakeDir Directories="$(FinalOutputPath);$(FinalIntermediateOutputPath)" />
<Copy SourceFiles="@(OutputFilesToCopy)" DestinationFolder="$(FinalOutputPath)" />
<Copy SourceFiles="@(IntermediateFilesToCopy)" DestinationFolder="$(FinalIntermediateOutputPath)" />
</Target>

<Import Project="build\targets\AssemblyVersions.props" />
<Import Project="build\targets\GenerateAssemblyAttributes.targets" />
<Import Project="build\targets\GenerateInternalsVisibleTo.targets" />
Expand Down
2 changes: 1 addition & 1 deletion setup/fsharp-setup-build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</PropertyGroup>
<MSBuild Projects="%(VsixProjects.ProjectPath)"
Targets="Build"
Properties="Configuration=$(Configuration);IsLangPack=%(VsixProjects.IsLangPack);FSharpPackageVersion=$(FSharpPackageVersion);OutputPath=$(VsixBuildLocation);$(CustomProps)" />
Properties="Configuration=$(Configuration);IsLangPack=%(VsixProjects.IsLangPack);FSharpPackageVersion=$(FSharpPackageVersion);OutputPath=$(VsixBuildLocation);DisableOutputPathCopying=true;$(CustomProps)" />
<MSBuild Projects="%(SwixSetupProjects.ProjectPath)"
Targets="Build"
Properties="LocaleCode=%(SwixSetupProjects.LocaleCode);LocaleId=%(SwixSetupProjects.LocaleId);LocaleParentId=%(SwixSetupProjects.LocaleParentId);LocaleParentCulture=%(SwixSetupProjects.LocaleParentCulture);LocaleSpecificCulture=%(SwixSetupProjects.LocaleSpecificCulture);IsLangPack=%(SwixSetupProjects.IsLangPack);FSharpPackageVersion=$(FSharpPackageVersion);$(CustomProps)"/>
Expand Down
5 changes: 0 additions & 5 deletions vsintegration/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
<PackageTargetFallback>net462</PackageTargetFallback>
</PropertyGroup>

<PropertyGroup Condition="'$(CreateVsixContainer)' == 'true'">
<!-- Ensure VSIX packages end up in the proper location. -->
<OutDir>$(OutputPath)\</OutDir>
</PropertyGroup>

<ImportGroup Condition="'$(ImportVsSDK)' == 'true'">
<Import Project="$(NuGetPackageRoot)Microsoft.VSSDK.BuildTools\$(MicrosoftVSSDKBuildToolsPackageVersion)\build\Microsoft.VsSDK.BuildTools.props" />
<Import Project="$(NugetPackageRoot)Microsoft.VSSDK.BuildTools\$(MicrosoftVSSDKBuildToolsPackageVersion)\build\Microsoft.VsSDK.BuildTools.targets" />
Expand Down
8 changes: 0 additions & 8 deletions vsintegration/Templates.Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

<Import Project="Directory.Build.targets" />

<PropertyGroup>
<OutputPath>$(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName)</OutputPath>
</PropertyGroup>

<ItemGroup>
<!-- everything under the `Template` directory is not to be considered part of the project -->
<Compile Remove="**\Template\**" />
Expand All @@ -15,8 +11,4 @@

<Target Name="CoreCompile" />

<Target Name="CopyFilesToOutputDirectory" AfterTargets="CoreCompile">
<Copy SourceFiles="@(TemplateFiles)" DestinationFiles="@(TemplateFiles->'$(OutputPath)\%(Filename)%(Extension)')" />
</Target>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project>
<!-- empty to prevent directory crawling -->
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project>
<!-- empty to prevent directory crawling -->
</Project>