Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Commit 13e84f7

Browse files
author
Livar
authored
Merge pull request #7033 from KevinRansom/rel/1.1.0
Add F# to dotnet cli 1.1.0
2 parents 7d25028 + 7af5450 commit 13e84f7

6 files changed

+96
-1
lines changed

Microsoft.DotNet.Cli.sln

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.Cli.Sln.In
197197
EndProject
198198
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}"
199199
EndProject
200+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "tool_fsc", "src\tool_fsharp\tool_fsc.csproj", "{602976C5-2477-4B4C-AD9A-1EAFB250529A}"
201+
EndProject
200202
Global
201203
GlobalSection(SolutionConfigurationPlatforms) = preSolution
202204
Debug|Any CPU = Debug|Any CPU
@@ -1621,5 +1623,6 @@ Global
16211623
{F2D1A7DA-B3EB-4CA7-BAA9-A18CEC398853} = {88278B81-7649-45DC-8A6A-D3A645C5AFC3}
16221624
{C98C7C2E-2C29-4A40-958C-60561ED77791} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
16231625
{56F1E090-B80F-4BDF-8991-4B0F9B5B8C9A} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
1626+
{602976C5-2477-4B4C-AD9A-1EAFB250529A} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
16241627
EndGlobalSection
16251628
EndGlobal

build/Microsoft.DotNet.Cli.Compile.targets

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@
126126
VersionSuffix="$(VersionSuffix)"
127127
ProjectPath="$(SrcDirectory)/tool_roslyn/tool_roslyn.csproj" />
128128

129+
<DotNetPublish ToolPath="%(Stage.DotnetDir)"
130+
Output="$(SdkOutputDirectory)/FSharp"
131+
Configuration="$(Configuration)"
132+
VersionSuffix="$(VersionSuffix)"
133+
ProjectPath="$(SrcDirectory)/tool_fsharp/tool_fsc.csproj" />
134+
129135
<RemoveAssetFromDepsPackages DepsFile="$(SdkOutputDirectory)/redist.deps.json"
130136
SectionName="runtimeTargets"
131137
AssetPath="$(BinaryToCorehostifyRelDir)/%(RuntimeTargetsAssetsToRemoveFromDeps.Identity).exe" />
@@ -169,6 +175,7 @@
169175

170176
<!-- Removing Full CLR built TestHost assemblies from getting Crossgen as it is throwing error -->
171177
<SdkFilesExclude Include="$(SdkOutputDirectory)/TestHost*/**/*" />
178+
172179
<SdkFiles Include="$(SdkOutputDirectory)/**/*" Exclude="@(SdkFilesExclude)" />
173180
<SdkFilesWithPEMarker Remove="*" />
174181
</ItemGroup>
@@ -194,7 +201,8 @@
194201
JITPath="$(LibCLRJitPath)"
195202
CrossgenPath="$(CrossgenPath)"
196203
ReadyToRun="True"
197-
PlatformAssemblyPaths="@(PlatformAssemblies);
204+
PlatformAssemblyPaths="%(CrossgenTargets.RootDir)%(CrossgenTargets.Directory);
205+
@(PlatformAssemblies);
198206
@(CompileStageSdkDirectories);
199207
$(SharedFrameworkNameVersionPath)" />
200208

build/Microsoft.DotNet.Cli.DependencyVersions.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<CLI_SharedFrameworkVersion>1.1.2</CLI_SharedFrameworkVersion>
55
<CLI_MSBuild_Version>15.3.0-preview-000402-01</CLI_MSBuild_Version>
66
<CLI_Roslyn_Version>2.3.0-beta3-61816-04</CLI_Roslyn_Version>
7+
<CLI_FSharp_Version>4.2.0-rc-170621-0</CLI_FSharp_Version>
78
<CLI_NETSDK_Version>1.1.0-alpha-20170615-3</CLI_NETSDK_Version>
89
<CLI_NuGet_Version>4.3.0-preview3-4168</CLI_NuGet_Version>
910
<CLI_WEBSDK_Version>1.0.0-alpha-20170516-2-509</CLI_WEBSDK_Version>

src/tool_fsharp/RunFsc.cmd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@echo off
2+
3+
REM Copyright (c) .NET Foundation and contributors. All rights reserved.
4+
REM Licensed under the MIT license. See LICENSE file in the project root for full license information.
5+
6+
"%~dp0..\..\..\dotnet" "%~dp0fsc.exe" %*

src/tool_fsharp/RunFsc.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) .NET Foundation and contributors. All rights reserved.
4+
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
5+
#
6+
7+
set -e
8+
9+
SOURCE="${BASH_SOURCE[0]}"
10+
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
11+
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
12+
SOURCE="$(readlink "$SOURCE")"
13+
[[ "$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
14+
done
15+
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
16+
17+
"$DIR/../../../dotnet" "$DIR/fsc.exe" "$@"

src/tool_fsharp/tool_fsc.csproj

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.tasks" />
4+
5+
<PropertyGroup>
6+
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>
7+
<TargetFramework>netcoreapp1.1</TargetFramework>
8+
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Microsoft.NetCore.App" Version="$(CLI_SharedFrameworkVersion)" />
13+
<PackageReference Include="Microsoft.FSharp.Compiler" Version="$(CLI_FSharp_Version)" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<Content Include="RunFsc.sh;RunFsc.cmd">
18+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
19+
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
20+
</Content>
21+
</ItemGroup>
22+
23+
<Target Name="AddHackFilesToPublish"
24+
AfterTargets="ComputeFilesToPublish">
25+
<ItemGroup>
26+
<!-- Workaround for https://github.com/dotnet/sdk/issues/115 -->
27+
<HackFilesToCopy Include="$(NuGetPackagesDir)\Microsoft.FSharp.Compiler\$(CLI_FSharp_Version)\contentFiles\any\any\**;" />
28+
</ItemGroup>
29+
30+
<Copy SourceFiles="@(HackFilesToCopy)"
31+
DestinationFiles="@(HackFilesToCopy->'$(PublishDir)/%(RecursiveDir)%(Filename)%(Extension)')" />
32+
</Target>
33+
34+
<Target Name="MakeFscRunnableAndMoveToPublishDir"
35+
AfterTargets="Publish"
36+
BeforeTargets="RemoveFilesAfterPublish">
37+
38+
<ItemGroup>
39+
<AssetsToRemoveFromDeps Include="tool_fsc.dll"
40+
SectionName="runtime"/>
41+
</ItemGroup>
42+
43+
<RemoveAssetFromDepsPackages DepsFile="$(PublishDir)/$(TargetName).deps.json"
44+
SectionName="%(AssetsToRemoveFromDeps.SectionName)"
45+
AssetPath="%(AssetsToRemoveFromDeps.Identity)" />
46+
47+
<Copy SourceFiles="$(PublishDir)/$(TargetName).runtimeconfig.json;
48+
$(PublishDir)/$(TargetName).deps.json;"
49+
DestinationFiles="$(PublishDir)/fsc.runtimeconfig.json;
50+
$(PublishDir)/fsc.deps.json;"/>
51+
</Target>
52+
53+
<Target Name="RemoveFilesAfterPublish"
54+
AfterTargets="Publish">
55+
<Delete Files="$(PublishDir)/$(TargetName).dll" />
56+
<Delete Files="$(PublishDir)/$(TargetName).pdb" />
57+
<Delete Files="$(PublishDir)/$(TargetName).runtimeconfig.json" />
58+
<Delete Files="$(PublishDir)/$(TargetName).deps.json" />
59+
</Target>
60+
</Project>

0 commit comments

Comments
 (0)