Add fsc to distribution (#6508)

* Add fsc to distribution

* update package

* Update compiler version

* I'm not sure these do anything usefull

* Reenable f# new project tests

* Revert "Reenable f# new project tests"

This reverts commit 34d294ec8c42145cf8cf0af166f9dfc8ee51b6f8.

* merge

* Update fsharp version

* Update compiler version

* Review feedback

* review feedback

* Update DependencyVersions.props
This commit is contained in:
Kevin Ransom (msft) 2017-05-19 23:20:19 -07:00 committed by Livar
parent 947c8daabc
commit cf9967bcd2
15 changed files with 134 additions and 192 deletions

View file

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>a666217d-2aca-4866-b109-ea476e51c7aa</ProjectGuid>
<RootNamespace>FSharpTestApp</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

View file

@ -1,16 +0,0 @@
// 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.
namespace TestApp
open System
open System.Diagnostics
module Program =
open TestLibrary
[<EntryPoint>]
let Main (args: string array) =
printfn "%s" (TestLibrary.Helper.GetMessage())
0

View file

@ -1,48 +0,0 @@
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true,
"compilerName": "fsc",
"compile": {
"includeFiles": [
"Program.fs"
]
}
},
"dependencies": {
"TestLibrary": {
"version": "1.0.0-*",
"target": "project"
},
"Microsoft.NETCore.App": "1.1.0",
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-160509"
},
"tools": {
"dotnet-compile-fsc": {
"version": "1.0.0-preview2-*",
"imports": [
"dnxcore50",
"portable-net45+win81",
"netstandard1.3"
]
}
},
"frameworks": {
"netcoreapp1.1": {
"imports": "dnxcore50"
}
},
"runtimes": {
"win7-x64": {},
"win7-x86": {},
"osx.10.10-x64": {},
"osx.10.11-x64": {},
"ubuntu.14.04-x64": {},
"ubuntu.16.04-x64": {},
"centos.7-x64": {},
"rhel.7.2-x64": {},
"debian.8-x64": {},
"fedora.23-x64": {},
"opensuse.13.2-x64": {}
}
}

View file

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>ec801982-096b-4af3-a42b-7881b1a7380e</ProjectGuid>
<RootNamespace>FSharpTestLibrary</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

View file

@ -1,12 +0,0 @@
// 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.
namespace TestLibrary
open Lib
type Helper() =
static member GetMessage () = Lib.message ()
static member SayHi () = Lib.sayHi ()

View file

@ -1,12 +0,0 @@
// 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.
module Lib
open System
let message () =
"This string came from the test library!"
let sayHi () =
Console.WriteLine("Hello there!")

View file

@ -1,31 +0,0 @@
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-160509",
"NETStandard.Library": "1.6.0"
},
"tools": {
"dotnet-compile-fsc": {
"version": "1.0.0-preview2-*",
"imports": [
"dnxcore50",
"portable-net45+win81",
"netstandard1.3"
]
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": "dnxcore50"
}
},
"buildOptions": {
"compilerName": "fsc",
"compile": {
"includeFiles": [
"Helper2.fs",
"Helper.fs"
]
}
}
}

View file

@ -4,6 +4,7 @@
<CLI_SharedFrameworkVersion>2.0.0-preview2-25319-02</CLI_SharedFrameworkVersion> <CLI_SharedFrameworkVersion>2.0.0-preview2-25319-02</CLI_SharedFrameworkVersion>
<CLI_MSBuild_Version>15.3.0-preview-000234-01</CLI_MSBuild_Version> <CLI_MSBuild_Version>15.3.0-preview-000234-01</CLI_MSBuild_Version>
<CLI_Roslyn_Version>2.0.0-rc4-61325-08</CLI_Roslyn_Version> <CLI_Roslyn_Version>2.0.0-rc4-61325-08</CLI_Roslyn_Version>
<CLI_FSharp_Version>1.0.0-rc-170511-0</CLI_FSharp_Version>
<CLI_NETSDK_Version>2.0.0-preview2-20170506-1</CLI_NETSDK_Version> <CLI_NETSDK_Version>2.0.0-preview2-20170506-1</CLI_NETSDK_Version>
<CLI_NuGet_Version>4.3.0-preview1-2500</CLI_NuGet_Version> <CLI_NuGet_Version>4.3.0-preview1-2500</CLI_NuGet_Version>
<CLI_WEBSDK_Version>1.0.0-rel-20170501-473</CLI_WEBSDK_Version> <CLI_WEBSDK_Version>1.0.0-rel-20170501-473</CLI_WEBSDK_Version>

View file

@ -6,6 +6,7 @@
<SdkOutputDirectory>$(OutputDirectory)/sdk/$(SdkVersion)</SdkOutputDirectory> <SdkOutputDirectory>$(OutputDirectory)/sdk/$(SdkVersion)</SdkOutputDirectory>
<SymbolsDirectory>$(BaseOutputDirectory)/stage2symbols</SymbolsDirectory> <SymbolsDirectory>$(BaseOutputDirectory)/stage2symbols</SymbolsDirectory>
<RoslynDirectory>$(SdkOutputDirectory)/Roslyn</RoslynDirectory> <RoslynDirectory>$(SdkOutputDirectory)/Roslyn</RoslynDirectory>
<FSharpDirectory>$(SdkOutputDirectory)/FSharp</FSharpDirectory>
<CompilationDirectory>$(BaseOutputDirectory)/stage2compilation</CompilationDirectory> <CompilationDirectory>$(BaseOutputDirectory)/stage2compilation</CompilationDirectory>
<IntermediateDirectory>$(BaseOutputDirectory)/intermediate</IntermediateDirectory> <IntermediateDirectory>$(BaseOutputDirectory)/intermediate</IntermediateDirectory>
<PackagesDirectory>$(BaseOutputDirectory)/packages</PackagesDirectory> <PackagesDirectory>$(BaseOutputDirectory)/packages</PackagesDirectory>

View file

@ -70,6 +70,14 @@
ProjectPath="$(SrcDirectory)/tool_roslyn/tool_roslyn.csproj" /> ProjectPath="$(SrcDirectory)/tool_roslyn/tool_roslyn.csproj" />
</Target> </Target>
<Target Name="PublishFSharp"
BeforeTargets="Publish">
<DotNetPublish ToolPath="$(Stage0Directory)"
Configuration="$(Configuration)"
ProjectPath="$(SrcDirectory)/tool_fsharp/tool_fsc.csproj" />
</Target>
<Target Name="GenerateCliRuntimeConfigurationFiles" <Target Name="GenerateCliRuntimeConfigurationFiles"
AfterTargets="Publish"> AfterTargets="Publish">
<RemoveAssetFromDepsPackages DepsFile="$(PublishDir)/$(TargetName).deps.json" <RemoveAssetFromDepsPackages DepsFile="$(PublishDir)/$(TargetName).deps.json"

View file

@ -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
src/tool_fsharp/RunFsc.sh Normal file
View file

@ -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" "$@"

View file

@ -0,0 +1,67 @@
<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>netcoreapp2.0</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<PublishDir>$(FSharpDirectory)</PublishDir>
<VersionSuffix>$(CommitCount)</VersionSuffix>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NetCore.App" Version="$(CLI_SharedFrameworkVersion)" />
<PackageReference Include="Microsoft.FSharp.Core.netcore" Version="$(CLI_FSharp_Version)" />
<PackageReference Include="Microsoft.FSharp.Compiler.netcore" Version="$(CLI_FSharp_Version)" />
</ItemGroup>
<ItemGroup>
<Content Include="RunFsc.sh;RunFsc.cmd">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
<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)/runtimes/any/native/default.win32manifest;
$(PublishDir)/runtimes/any/native/Microsoft.FSharp.Targets;
$(PublishDir)/runtimes/any/native/Microsoft.Portable.FSharp.Targets;
$(PublishDir)/runtimes/any/native/Microsoft.FSharp.NetSdk.props;
$(PublishDir)/runtimes/any/native/Microsoft.FSharp.NetSdk.targets;
$(PublishDir)/runtimes/any/native/FSharp.Core.optdata;
$(PublishDir)/runtimes/any/native/FSharp.Core.sigdata;
$(PublishDir)/runtimes/any/native/FSharp.Core.xml;
$(PublishDir)/$(TargetName).runtimeconfig.json;
$(PublishDir)/$(TargetName).deps.json;"
DestinationFiles="$(PublishDir)/default.win32manifest;
$(PublishDir)/Microsoft.FSharp.Targets;
$(PublishDir)/Microsoft.Portable.FSharp.Targets;
$(PublishDir)/Microsoft.FSharp.NetSdk.props;
$(PublishDir)/Microsoft.FSharp.NetSdk.targets;
$(PublishDir)/FSharp.Core.optdata;
$(PublishDir)/FSharp.Core.sigdata;
$(PublishDir)/FSharp.Core.xml;
$(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>