Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.
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
3 changes: 3 additions & 0 deletions Microsoft.DotNet.Cli.sln
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.Cli.Sln.In
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.Cli.Sln.Internal.Tests", "test\Microsoft.DotNet.Cli.Sln.Internal.Tests\Microsoft.DotNet.Cli.Sln.Internal.Tests.csproj", "{56F1E090-B80F-4BDF-8991-4B0F9B5B8C9A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "tool_fsc", "src\tool_fsharp\tool_fsc.csproj", "{602976C5-2477-4B4C-AD9A-1EAFB250529A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1621,5 +1623,6 @@ Global
{F2D1A7DA-B3EB-4CA7-BAA9-A18CEC398853} = {88278B81-7649-45DC-8A6A-D3A645C5AFC3}
{C98C7C2E-2C29-4A40-958C-60561ED77791} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
{56F1E090-B80F-4BDF-8991-4B0F9B5B8C9A} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
{602976C5-2477-4B4C-AD9A-1EAFB250529A} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
EndGlobalSection
EndGlobal
10 changes: 9 additions & 1 deletion build/Microsoft.DotNet.Cli.Compile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@
VersionSuffix="$(VersionSuffix)"
ProjectPath="$(SrcDirectory)/tool_roslyn/tool_roslyn.csproj" />

<DotNetPublish ToolPath="%(Stage.DotnetDir)"
Output="$(SdkOutputDirectory)/FSharp"
Configuration="$(Configuration)"
VersionSuffix="$(VersionSuffix)"
ProjectPath="$(SrcDirectory)/tool_fsharp/tool_fsc.csproj" />

<RemoveAssetFromDepsPackages DepsFile="$(SdkOutputDirectory)/redist.deps.json"
SectionName="runtimeTargets"
AssetPath="$(BinaryToCorehostifyRelDir)/%(RuntimeTargetsAssetsToRemoveFromDeps.Identity).exe" />
Expand Down Expand Up @@ -169,6 +175,7 @@

<!-- Removing Full CLR built TestHost assemblies from getting Crossgen as it is throwing error -->
<SdkFilesExclude Include="$(SdkOutputDirectory)/TestHost*/**/*" />

<SdkFiles Include="$(SdkOutputDirectory)/**/*" Exclude="@(SdkFilesExclude)" />
<SdkFilesWithPEMarker Remove="*" />
</ItemGroup>
Expand All @@ -194,7 +201,8 @@
JITPath="$(LibCLRJitPath)"
CrossgenPath="$(CrossgenPath)"
ReadyToRun="True"
PlatformAssemblyPaths="@(PlatformAssemblies);
PlatformAssemblyPaths="%(CrossgenTargets.RootDir)%(CrossgenTargets.Directory);

This comment was marked as spam.

@(PlatformAssemblies);
@(CompileStageSdkDirectories);
$(SharedFrameworkNameVersionPath)" />

Expand Down
1 change: 1 addition & 0 deletions build/Microsoft.DotNet.Cli.DependencyVersions.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<CLI_SharedFrameworkVersion>1.1.2</CLI_SharedFrameworkVersion>
<CLI_MSBuild_Version>15.3.0-preview-000400-01</CLI_MSBuild_Version>
<CLI_Roslyn_Version>2.3.0-beta3-61816-04</CLI_Roslyn_Version>
<CLI_FSharp_Version>4.2.0-rc-170621-0</CLI_FSharp_Version>
<CLI_NETSDK_Version>1.1.0-alpha-20170615-3</CLI_NETSDK_Version>
<CLI_NuGet_Version>4.3.0-preview3-4168</CLI_NuGet_Version>
<CLI_WEBSDK_Version>1.0.0-alpha-20170516-2-509</CLI_WEBSDK_Version>
Expand Down
6 changes: 6 additions & 0 deletions src/tool_fsharp/RunFsc.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@echo off

REM Copyright (c) .NET Foundation and contributors. All rights reserved.
REM Licensed under the MIT license. See LICENSE file in the project root for full license information.

"%~dp0..\..\..\dotnet" "%~dp0fsc.exe" %*
17 changes: 17 additions & 0 deletions src/tool_fsharp/RunFsc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#

set -e

SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

"$DIR/../../../dotnet" "$DIR/fsc.exe" "$@"
60 changes: 60 additions & 0 deletions src/tool_fsharp/tool_fsc.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.tasks" />

<PropertyGroup>
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>
<TargetFramework>netcoreapp1.1</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NetCore.App" Version="$(CLI_SharedFrameworkVersion)" />
<PackageReference Include="Microsoft.FSharp.Compiler" Version="$(CLI_FSharp_Version)" />
</ItemGroup>

<ItemGroup>
<Content Include="RunFsc.sh;RunFsc.cmd">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>

<Target Name="AddHackFilesToPublish"
AfterTargets="ComputeFilesToPublish">
<ItemGroup>
<!-- Workaround for https://github.com/dotnet/sdk/issues/115 -->
<HackFilesToCopy Include="$(NuGetPackagesDir)\Microsoft.FSharp.Compiler\$(CLI_FSharp_Version)\contentFiles\any\any\**;" />
</ItemGroup>

<Copy SourceFiles="@(HackFilesToCopy)"
DestinationFiles="@(HackFilesToCopy->'$(PublishDir)/%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>

<Target Name="MakeFscRunnableAndMoveToPublishDir"
AfterTargets="Publish"
BeforeTargets="RemoveFilesAfterPublish">

<ItemGroup>
<AssetsToRemoveFromDeps Include="tool_fsc.dll"
SectionName="runtime"/>
</ItemGroup>

<RemoveAssetFromDepsPackages DepsFile="$(PublishDir)/$(TargetName).deps.json"
SectionName="%(AssetsToRemoveFromDeps.SectionName)"
AssetPath="%(AssetsToRemoveFromDeps.Identity)" />

<Copy SourceFiles="$(PublishDir)/$(TargetName).runtimeconfig.json;
$(PublishDir)/$(TargetName).deps.json;"
DestinationFiles="$(PublishDir)/fsc.runtimeconfig.json;
$(PublishDir)/fsc.deps.json;"/>
</Target>

<Target Name="RemoveFilesAfterPublish"
AfterTargets="Publish">
<Delete Files="$(PublishDir)/$(TargetName).dll" />
<Delete Files="$(PublishDir)/$(TargetName).pdb" />
<Delete Files="$(PublishDir)/$(TargetName).runtimeconfig.json" />
<Delete Files="$(PublishDir)/$(TargetName).deps.json" />
</Target>
</Project>