Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add .net sdk preview3 fsprojs to core3 #2004

Merged
merged 6 commits into from
Nov 4, 2016
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
160 changes: 160 additions & 0 deletions src/Paket.Core/Paket.Core.preview3.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />

<PropertyGroup>
<TargetFramework>netstandard1.6</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<Version>1.0.0-preview3</Version>
<Authors>Enrico Sada</Authors>
</PropertyGroup>

<ItemGroup>
<Compile Include="../../paket-files/fsprojects/FSharp.TypeProviders.StarterPack/src/AssemblyReader.fs" />
<Compile Include="../../paket-files/fsharp/FAKE/src/app/FakeLib/Globbing/Globbing.fs" />
<Compile Include="Async.fs" />
<Compile Include="AssemblyInfo.fs" />
<Compile Include="CustomAssemblyInfo.fs" />
<Compile Include="Domain.fs" />
<Compile Include="Logging.fsi" />
<Compile Include="Logging.fs" />
<Compile Include="Constants.fs" />
<Compile Include="Utils.fs" />
<Compile Include="SemVer.fs" />
<Compile Include="VersionRange.fs" />
<Compile Include="Xml.fs" />
<Compile Include="GitCommandHelper.fs" />
<Compile Include="GitHandling.fs" />
<Compile Include="ConfigFile.fs" />
<Compile Include="Cache.fs" />
<Compile Include="Cultures.fs" />
<Compile Include="PackageSources.fs" />
<Compile Include="FrameworkHandling.fs" />
<Compile Include="PlatformMatching.fs" />
<Compile Include="Requirements.fs" />
<Compile Include="ModuleResolver.fs" />
<Compile Include="RemoteDownload.fs" />
<Compile Include="RemoteUpload.fs" />
<Compile Include="PackageResolver.fs" />
<Compile Include="Nuspec.fs" />
<Compile Include="InstallModel.fs" />
<Compile Include="ReferencesFile.fs" />
<Compile Include="SolutionFile.fs" />
<Compile Include="Nuget.fs" />
<Compile Include="NuGetV3.fs" />
<Compile Include="NuGetV2.fs" />
<Compile Include="DependenciesTypes.fs" />
<Compile Include="DependenciesFileParser.fs" />
<Compile Include="LockFile.fs" />
<Compile Include="TemplateFile.fs" />
<Compile Include="PackagesConfigFile.fs" />
<Compile Include="ProjectFile.fs" />
<Compile Include="DependenciesFile.fs" />
<Compile Include="LocalFile.fs" />
<Compile Include="DependencyChangeDetection.fs" />
<Compile Include="GarbageCollection.fs" />
<Compile Include="RestoreProcess.fs" />
<Compile Include="BindingRedirects.fs" />
<Compile Include="NupkgWriter.fs" />
<Compile Include="ProcessOptions.fs" />
<Compile Include="DependencyModel.fs" />
<Compile Include="InstallProcess.fs" />
<Compile Include="UpdateProcess.fs" />
<Compile Include="RemoveProcess.fs" />
<Compile Include="AddProcess.fs" />
<Compile Include="PackageMetaData.fs" />
<Compile Include="PackageProcess.fs" />
<Compile Include="Environment.fs" />
<Compile Include="Releases.fs" />
<Compile Include="Simplifier.fs" />
<Compile Include="VSIntegration.fs" />
<Compile Include="NugetConvert.fs" />
<Compile Include="FindOutdated.fs" />
<Compile Include="FindReferences.fs" />
<Compile Include="Why.fs" />
<Compile Include="PublicAPI.fs" />
<Compile Include="ScriptGeneration.fs" />
</ItemGroup>

<ItemGroup>
<None Include="paket.template" />
<None Include="paket.references" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="NETStandard.Library">
<Version>1.6.0</Version>
</PackageReference>
<!-- was "FSharp.Core": "4.0.1.7-alpha", -->
<PackageReference Include="Microsoft.FSharp.Core.netcore">
<Version>1.0.0-alpha-161023</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="FSharp.NET.Sdk">
<Version>1.0.0-alpha-000001</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="NETStandard.Library">
<Version>1.6.0</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>9.0.1</Version>
</PackageReference>
<PackageReference Include="Mono.Cecil">
<Version>0.10.0-beta1-v2</Version>
</PackageReference>
<PackageReference Include="Chessie">
<Version>0.6.0</Version>
</PackageReference>
<PackageReference Include="System.Xml.XmlDocument">
<Version>4.0.1</Version>
</PackageReference>
<PackageReference Include="System.Net.Requests">
<Version>4.0.11</Version>
</PackageReference>
<PackageReference Include="System.Diagnostics.TraceSource">
<Version>4.0.0</Version>
</PackageReference>
<PackageReference Include="System.Xml.XPath.XmlDocument">
<Version>4.0.1</Version>
</PackageReference>
<PackageReference Include="System.Diagnostics.Process">
<Version>4.1.0</Version>
</PackageReference>
<PackageReference Include="System.Xml.XDocument">
<Version>4.0.11</Version>
</PackageReference>
<PackageReference Include="System.Xml.XPath.XDocument">
<Version>4.0.1</Version>
</PackageReference>
<PackageReference Include="System.Security.Cryptography.ProtectedData">
<Version>4.0.0</Version>
</PackageReference>
<PackageReference Include="System.Security.Cryptography.Algorithms">
<Version>4.2.0</Version>
</PackageReference>
<PackageReference Include="System.Diagnostics.FileVersionInfo">
<Version>4.0.0</Version>
</PackageReference>
</ItemGroup>

<PropertyGroup>
<DefineConstants>$(DefineConstants);DOTNETCORE;NETSTANDARD1_5;NETSTANDARD1_6;USE_HTTP_CLIENT</DefineConstants>
</PropertyGroup>

<ItemGroup>
<DotNetCliToolReference Include="dotnet-compile-fsc">
<Version>1.0.0-preview2-020000</Version>
</DotNetCliToolReference>
</ItemGroup>

<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />

</Project>
3 changes: 2 additions & 1 deletion src/Paket.Core/Paket.Core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"../DependenciesFileParser.fs",
"../LockFile.fs",
"../TemplateFile.fs",
"../PackagesConfigFile.fs",
"../ProjectFile.fs",
"../DependenciesFile.fs",
"../LocalFile.fs",
Expand All @@ -56,7 +57,6 @@
"../BindingRedirects.fs",
"../NupkgWriter.fs",
"../ProcessOptions.fs",
"../PackagesConfigFile.fs",
"../DependencyModel.fs",
"../InstallProcess.fs",
"../UpdateProcess.fs",
Expand All @@ -71,6 +71,7 @@
"../NugetConvert.fs",
"../FindOutdated.fs",
"../FindReferences.fs",
"../Why.fs",
"../PublicAPI.fs",
"../ScriptGeneration.fs"
]
Expand Down
65 changes: 65 additions & 0 deletions src/Paket/Paket.preview3.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<Version>1.0.0-preview3</Version>
<Authors>Enrico Sada</Authors>
</PropertyGroup>

<!--<Win32Resource>paket.res</Win32Resource>-->

<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="Commands.fs" />
<Compile Include="Program.fs" />
<!--<Content Include="App.config" />-->
<None Include="paket.references" />
<!--<EmbeddedResource Include="embedded\PaketRestoreTask.deps.json" />
<EmbeddedResource Include="embedded\PaketRestoreTask.dll" />
<EmbeddedResource Include="embedded\Paket.Restore.targets" />-->
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App">
<Version>1.0.1</Version>
</PackageReference>
<!-- was "FSharp.Core": "4.0.1.7-alpha", -->
<PackageReference Include="Microsoft.FSharp.Core.netcore">
<Version>1.0.0-alpha-161023</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="FSharp.NET.Sdk">
<Version>1.0.0-alpha-000001</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Paket.Core\Paket.Core.preview3.fsproj">
<Name>Paket.Core.preview3</Name>
</ProjectReference>
<PackageReference Include="Chessie">
<Version>0.6.0</Version>
</PackageReference>
<PackageReference Include="Argu">
<Version>3.3.0</Version>
</PackageReference>
</ItemGroup>

<ItemGroup>
<DotNetCliToolReference Include="dotnet-compile-fsc">
<Version>1.0.0-preview2-020000</Version>
</DotNetCliToolReference>
</ItemGroup>

<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />

</Project>
18 changes: 18 additions & 0 deletions src/Paket/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ let processWithValidation silent validateF commandF (result : ParseResults<'T>)
traceError "Command was:"
traceError (" " + String.Join(" ",Environment.GetCommandLineArgs()))
result.Parser.PrintUsage() |> traceError
#if NETCOREAPP1_0
// Environment.ExitCode not supported in netcoreapp1.0
#else
Environment.ExitCode <- 1
#endif
else
commandF result
let elapsedTime = Utils.TimeSpanToReadableString stopWatch.Elapsed
Expand Down Expand Up @@ -207,7 +211,11 @@ let pack (results : ParseResults<_>) =
?releaseNotes = results.TryGetResult <@ PackArgs.ReleaseNotes @>,
?templateFile = results.TryGetResult <@ PackArgs.TemplateFile @>,
excludedTemplates = results.GetResults <@ PackArgs.ExcludedTemplate @>,
#if NETCOREAPP1_0
workingDir = System.IO.Directory.GetCurrentDirectory(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use this in both cases and remove the #if?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jupp will do

#else
workingDir = Environment.CurrentDirectory,
#endif
lockDependencies = results.Contains <@ PackArgs.LockDependencies @>,
minimumFromLockFile = results.Contains <@ PackArgs.LockDependenciesToMinimum @>,
pinProjectReferences = results.Contains <@ PackArgs.PinProjectReferences @>,
Expand Down Expand Up @@ -317,11 +325,17 @@ let generateIncludeScripts (results : ParseResults<GenerateIncludeScriptsArgs>)
let environmentFramework = lazy (
// HACK: resolve .net version based on environment
// list of match is incomplete / inaccurate
#if NETCOREAPP1_0
// Environment.Version is not supported
//dunno what is used for, using a default
DotNetFramework (FrameworkVersion.V4_5)
#else
let version = Environment.Version
match version.Major, version.Minor, version.Build, version.Revision with
| 4, 0, 30319, 42000 -> DotNetFramework (FrameworkVersion.V4_6)
| 4, 0, 30319, _ -> DotNetFramework (FrameworkVersion.V4_5)
| _ -> DotNetFramework (FrameworkVersion.V4_5) // paket.exe is compiled for framework 4.5
#endif
)
let tupleMap f v = (v, f v)
let failOnMismatch toParse parsed f message =
Expand Down Expand Up @@ -436,7 +450,11 @@ let main() =

with
| exn when not (exn :? System.NullReferenceException) ->
#if NETCOREAPP1_0
// Environment.ExitCode not supported
#else
Environment.ExitCode <- 1
#endif
traceErrorfn "Paket failed with:%s\t%s" Environment.NewLine exn.Message

if verbose then
Expand Down