-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add more cli options: `--msbuild` => path to msbuild `--dotnetcli` => path to dotnet, used for "dotnet msbuild" `--msbuild-host` => what msbuild host to run, to force specific or auto (oldsdk/dotnetsdk). By default for oldsdk is `msbuild` and dotnetsdk is `dotnet` ### Old fsproj parser Use `msbuild` from command line to ask msbuild info about the project (not using msbuild as library) How works: - override the `CoreCompile` target, to gather info about the project properties (OutputType, etc) - convert the msbuild properties to fsc args, using the Fsc task code To override the `CoreCompile` target, the `CustomAfterMicrosoftCommonTargets` property is used as hook to import the generate .target file after F# targets are imported (msbuild override targets with same name, based on import sequence) To convert msbuild properties to fsc compiler args, use the same Fsc msbuild task class code. - `Fsc` msbuild task from microsoft/visualfsharp repo - msbuild classes from mono/mono repo The strategy for `msbuild properties -> fsc args` can be customized Additional: - move repo to .net core 2.0 - `dotnet-proj-info` support `netcoreapp2.0` framework - `Dotnet.ProjInfo` support `netstandard2.0` framework - the `Fsc` task is not bundled with `Dotnet.ProjInfo`, so clients can pin another version if needed
- Loading branch information
1 parent
d47494a
commit 144a23b
Showing
39 changed files
with
876 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -238,3 +238,5 @@ _Pvt_Extensions | |
# Repo-specific files | ||
|
||
.dotnetsdk | ||
/.paket/ | ||
/paket-files/ |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
language: csharp | ||
|
||
mono: 5.2.0 | ||
dotnet: 2.0.0 | ||
|
||
install: | ||
# workaround for missing .net 4.5 targing pack | ||
- export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/ | ||
|
||
script: | ||
- dotnet pack -v n | ||
- dotnet test -v n | ||
|
||
matrix: | ||
include: | ||
- os: linux | ||
dist: trusty | ||
sudo: required | ||
- os: osx | ||
osx_image: xcode9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
image: | ||
- Visual Studio 2017 | ||
|
||
before_build: | ||
- ps: >- | ||
$buildId = $env:APPVEYOR_BUILD_NUMBER.PadLeft(5, '0'); | ||
$versionSuffixPR = "-PR$($env:APPVEYOR_PULL_REQUEST_NUMBER)-$buildId"; | ||
$branchName = "$env:APPVEYOR_REPO_BRANCH".Replace("_",""); | ||
$versionSuffixBRANCH = "-$branchName-$buildId"; | ||
$env:VersionSuffix = if ("$env:APPVEYOR_REPO_TAG" -eq "true") { "" } else { if ("$env:APPVEYOR_PULL_REQUEST_NUMBER") { $versionSuffixPR } else { $versionSuffixBRANCH } }; | ||
build_script: | ||
- cmd: echo vs %VersionSuffix%" | ||
- cmd: dotnet pack -v n | ||
- cmd: dotnet test -v n | ||
|
||
artifacts: | ||
- path: bin\nupkg\*.nupkg | ||
name: nupkgs | ||
type: NuGetPackage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<Project ToolsVersion="15.0"> | ||
|
||
<Import Project="src\Directory.Build.props" /> | ||
|
||
<Target Name="Build"> | ||
<Exec Command='dotnet build src/dotnet-proj-info' /> | ||
</Target> | ||
|
||
<Target Name="Restore"> | ||
<Exec Command="$(MonoOrEmpty)paket.bootstrapper.exe" WorkingDirectory=".paket" ConsoleToMSBuild="true" /> | ||
<Exec Command="$(MonoOrEmpty)paket.exe restore" WorkingDirectory=".paket" ConsoleToMSBuild="true" /> | ||
</Target> | ||
|
||
<Target Name="Pack"> | ||
<RemoveDir Directories="$(NupkgsDir)" /> | ||
<Exec Command='dotnet pack src/dotnet-proj-info -c Release -o "$(NupkgsDir)" /p:Version=$(Version)' /> | ||
<Exec Command='dotnet pack src/Dotnet.ProjInfo -c Release -o "$(NupkgsDir)" /p:Version=$(Version)' /> | ||
</Target> | ||
|
||
<Target Name="Test"> | ||
<Exec Command='dotnet test -v n' WorkingDirectory="test" IgnoreStandardErrorWarningFormat="true" /> | ||
</Target> | ||
|
||
<Target Name="VSTest" DependsOnTargets="Test" /> | ||
|
||
</Project> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
// the Fsc build task | ||
github Microsoft/visualfsharp:Visual-Studio-2017-Version-15.4 src/fsharp/FSharp.Build/Fsc.fs | ||
github Microsoft/visualfsharp:Visual-Studio-2017-Version-15.4 src/fsharp/FSharp.Build/Microsoft.FSharp.Targets | ||
|
||
// msbuild classes from Mono | ||
github mono/mono:mono-5.2.0.224 mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/CommandLineBuilder.cs | ||
github mono/mono:mono-5.2.0.224 mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/ITaskItem.cs | ||
github mono/mono:mono-5.2.0.224 mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/ITaskItem2.cs | ||
github mono/mono:mono-5.2.0.224 mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/MSBuildUtils.cs | ||
github mono/mono:mono-5.2.0.224 mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/ReservedNameUtils.cs | ||
github mono/mono:mono-5.2.0.224 mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TaskItem.cs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
GITHUB | ||
remote: Microsoft/visualfsharp | ||
src/fsharp/FSharp.Build/Fsc.fs (cc1b137bc17f401a0cc669ff8fc598714d0fe652) | ||
src/fsharp/FSharp.Build/Microsoft.FSharp.Targets (cc1b137bc17f401a0cc669ff8fc598714d0fe652) | ||
remote: mono/mono | ||
mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/ITaskItem.cs (14f2c814ccc4b98f11dae3074ba6a081956e9079) | ||
mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/ITaskItem2.cs (14f2c814ccc4b98f11dae3074ba6a081956e9079) | ||
mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/CommandLineBuilder.cs (14f2c814ccc4b98f11dae3074ba6a081956e9079) | ||
mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TaskItem.cs (14f2c814ccc4b98f11dae3074ba6a081956e9079) | ||
mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/MSBuildUtils.cs (14f2c814ccc4b98f11dae3074ba6a081956e9079) | ||
mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/ReservedNameUtils.cs (14f2c814ccc4b98f11dae3074ba6a081956e9079) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="no"?> | ||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects> | ||
<Authors>Enrico Sada</Authors> | ||
<PackageProjectUrl>https://github.com/enricosada/dotnet-proj-info/</PackageProjectUrl> | ||
<PackageTags>mbuild;dotnet;sdk;csproj;fsproj</PackageTags> | ||
<RepositoryUrl>https://github.com/enricosada/dotnet-proj-info.git</RepositoryUrl> | ||
|
||
<RepoRootDir>$([System.IO.Path]::GetFullPath("$(MSBuildThisFileDirectory)\.."))</RepoRootDir> | ||
<NupkgsDir>$(RepoRootDir)/bin/nupkg</NupkgsDir> | ||
<Version Condition=" '$(Version)' == '' ">0.8.0$(VersionSuffix)</Version> | ||
<MonoOrEmpty Condition=" '$(OS)' != 'Windows_NT' ">mono </MonoOrEmpty> | ||
</PropertyGroup> | ||
</Project> |
16 changes: 16 additions & 0 deletions
16
src/Dotnet.ProjInfo.Helpers/Dotnet.ProjInfo.Helpers.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="..\..\paket-files\mono\mono\mcs\class\Microsoft.Build.Utilities\Microsoft.Build.Utilities\CommandLineBuilder.cs" /> | ||
<Compile Include="..\..\paket-files\mono\mono\mcs\class\Microsoft.Build.Framework\Microsoft.Build.Framework\ITaskItem.cs" /> | ||
<Compile Include="..\..\paket-files\mono\mono\mcs\class\Microsoft.Build.Framework\Microsoft.Build.Framework\ITaskItem2.cs" /> | ||
<Compile Include="..\..\paket-files\mono\mono\mcs\class\Microsoft.Build.Utilities\Microsoft.Build.Utilities\TaskItem.cs" /> | ||
<Compile Include="..\..\paket-files\mono\mono\mcs\class\Microsoft.Build.Utilities\Mono.XBuild.Utilities\MSBuildUtils.cs" /> | ||
<Compile Include="..\..\paket-files\mono\mono\mcs\class\Microsoft.Build.Utilities\Mono.XBuild.Utilities\ReservedNameUtils.cs" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,42 @@ | ||
<Project Sdk="FSharp.NET.Sdk;Microsoft.NET.Sdk"> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>netstandard1.6;net45</TargetFrameworks> | ||
<TargetFrameworks>netstandard2.0;netstandard1.6;net45</TargetFrameworks> | ||
<Description>Get msbuild info</Description> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' != 'netstandard1.6' "> | ||
<!-- old fsproj is not supported on netstandard1.6 --> | ||
<Compile Include="ExternalFSharp\MissingApi.fs" /> | ||
<Compile Include="ExternalFSharp\FscConfig.fs" /> | ||
|
||
<ProjectReference Include="..\Dotnet.ProjInfo.Helpers\Dotnet.ProjInfo.Helpers.csproj" PrivateAssets="All" /> | ||
|
||
<EmbeddedResource Include="..\..\paket-files\Microsoft\visualfsharp\src\fsharp\FSharp.Build\Microsoft.FSharp.Targets" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="..\dotnet-proj-info\Inspect.fs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="FSharp.Core" Condition=" '$(TargetFramework)' == 'netstandard1.6' " Version="4.1.*" /> | ||
<PackageReference Include="FSharp.Core" Condition=" '$(TargetFramework)' == 'net45' " Version="4.0.0.1" /> | ||
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.*" PrivateAssets="All" /> | ||
</ItemGroup> | ||
|
||
<Import Project="..\PackagesInfo.props" /> | ||
<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' "> | ||
<!-- no need to reference System.ValueTuple nupkg on net45 because use FSharp.Core v4.0 --> | ||
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference> | ||
</PropertyGroup> | ||
|
||
<!-- HACK: p2p of type project, not package (ref https://github.com/NuGet/Home/issues/3891 ) --> | ||
<PropertyGroup> | ||
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);IncludeP2POutput</TargetsForTfmSpecificBuildOutput> | ||
</PropertyGroup> | ||
<Target Name="IncludeP2POutput" Condition=" '$(TargetFramework)' != 'netstandard1.6' "> | ||
<ItemGroup> | ||
<BuildOutputInPackage Include="$(MSBuildProjectDirectory)/$(OutputPath)Dotnet.ProjInfo.Helpers.dll" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
</Project> |
Oops, something went wrong.