Skip to content

Commit 144a23b

Browse files
authored
support old fsproj (#9)
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
1 parent d47494a commit 144a23b

39 files changed

+876
-149
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,5 @@ _Pvt_Extensions
238238
# Repo-specific files
239239

240240
.dotnetsdk
241+
/.paket/
242+
/paket-files/

.paket/paket.bootstrapper.exe

39 KB
Binary file not shown.

.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
language: csharp
2+
3+
mono: 5.2.0
4+
dotnet: 2.0.0
5+
6+
install:
7+
# workaround for missing .net 4.5 targing pack
8+
- export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/
9+
10+
script:
11+
- dotnet pack -v n
12+
- dotnet test -v n
13+
14+
matrix:
15+
include:
16+
- os: linux
17+
dist: trusty
18+
sudo: required
19+
- os: osx
20+
osx_image: xcode9

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,25 @@ see `examples` directory
66

77
## Build
88

9-
to create packages:
9+
Run:
1010

11+
```bash
12+
dotnet build
1113
```
12-
set VERSION=1.2.3
13-
build.cmd
14+
15+
To run tests:
16+
17+
```bash
18+
dotnet test -v n
1419
```
1520

16-
will create packages with version `1.2.3` in `artifacts\nupkgs`
21+
To create packages:
22+
23+
```bash
24+
dotnet pack
25+
```
26+
27+
will create packages in `artifacts\nupkgs`
28+
29+
pass `/p:Version=1.2.3` to create a package with version `1.2.3`
30+

appveyor.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
image:
2+
- Visual Studio 2017
3+
4+
before_build:
5+
- ps: >-
6+
$buildId = $env:APPVEYOR_BUILD_NUMBER.PadLeft(5, '0');
7+
$versionSuffixPR = "-PR$($env:APPVEYOR_PULL_REQUEST_NUMBER)-$buildId";
8+
$branchName = "$env:APPVEYOR_REPO_BRANCH".Replace("_","");
9+
$versionSuffixBRANCH = "-$branchName-$buildId";
10+
$env:VersionSuffix = if ("$env:APPVEYOR_REPO_TAG" -eq "true") { "" } else { if ("$env:APPVEYOR_PULL_REQUEST_NUMBER") { $versionSuffixPR } else { $versionSuffixBRANCH } };
11+
12+
build_script:
13+
- cmd: echo vs %VersionSuffix%"
14+
- cmd: dotnet pack -v n
15+
- cmd: dotnet test -v n
16+
17+
artifacts:
18+
- path: bin\nupkg\*.nupkg
19+
name: nupkgs
20+
type: NuGetPackage

build.cmd

Lines changed: 0 additions & 13 deletions
This file was deleted.

build.proj

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<Project ToolsVersion="15.0">
2+
3+
<Import Project="src\Directory.Build.props" />
4+
5+
<Target Name="Build">
6+
<Exec Command='dotnet build src/dotnet-proj-info' />
7+
</Target>
8+
9+
<Target Name="Restore">
10+
<Exec Command="$(MonoOrEmpty)paket.bootstrapper.exe" WorkingDirectory=".paket" ConsoleToMSBuild="true" />
11+
<Exec Command="$(MonoOrEmpty)paket.exe restore" WorkingDirectory=".paket" ConsoleToMSBuild="true" />
12+
</Target>
13+
14+
<Target Name="Pack">
15+
<RemoveDir Directories="$(NupkgsDir)" />
16+
<Exec Command='dotnet pack src/dotnet-proj-info -c Release -o "$(NupkgsDir)" /p:Version=$(Version)' />
17+
<Exec Command='dotnet pack src/Dotnet.ProjInfo -c Release -o "$(NupkgsDir)" /p:Version=$(Version)' />
18+
</Target>
19+
20+
<Target Name="Test">
21+
<Exec Command='dotnet test -v n' WorkingDirectory="test" IgnoreStandardErrorWarningFormat="true" />
22+
</Target>
23+
24+
<Target Name="VSTest" DependsOnTargets="Test" />
25+
26+
</Project>

examples/.vscode/launch.json

Lines changed: 0 additions & 52 deletions
This file was deleted.

examples/.vscode/tasks.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

examples/NuGet.Config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<packageSources>
44
<clear />
55
<add key="nuget-org" value="https://api.nuget.org/v3/index.json" />
6-
<add key="netcorecli dev feed" value="https://www.myget.org/F/netcorecli-fsc/api/v3/index.json" />
76
<add key="dotnet-proj-info dev feed" value="https://www.myget.org/F/dotnet-proj-info/api/v3/index.json" />
87
</packageSources>
98
</configuration>

0 commit comments

Comments
 (0)