Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.
Closed
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
275 changes: 154 additions & 121 deletions Microsoft.DotNet.Cli.sln

Large diffs are not rendered by default.

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"

This comment was marked as spam.

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>