Skip to content

Commit ce83658

Browse files
authored
Change the way we generate nupkg files (dotnet#1721)
* Simplify Nugets * Re-remove ValidateConfiguration * Re-remove ValidateConfiguration * fsianycpu.config was inadvertently deleted * FSC.proj merge issue * fsharp.core.proj * Remove prerequisited from vsixmanifest
1 parent 5a65c08 commit ce83658

18 files changed

Lines changed: 55 additions & 240 deletions

build-everything.proj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@
1616

1717
<ItemGroup Condition="'$(BUILD_CORECLR)'=='1'">
1818
<ProjectsWithCoreClr Include="src/fsharp/FSharp.Core/FSharp.Core.fsproj" />
19-
<ProjectsWithCoreClr Include="src/fsharp/FSharp.Core.netcore.nuget/FSharp.Core.netcore.nuget.proj" />
2019
<ProjectsWithCoreClr Include="src/fsharp/FSharp.Build/FSharp.Build.fsproj" />
2120
<ProjectsWithCoreClr Include="src/fsharp/FSharp.Compiler/FSharp.Compiler.fsproj" />
2221
<ProjectsWithCoreClr Include="src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj" />
2322
<ProjectsWithCoreClr Include="src/fsharp/Fsc/Fsc.fsproj" />
2423
<ProjectsWithCoreClr Include="src/fsharp/fsi/Fsi.fsproj" />
25-
<ProjectsWithCoreClr Include="src/fsharp/FSharp.Compiler.netcore.nuget/FSharp.Compiler.nuget.proj" />
2624
<ProjectsWithCoreClr Include="src/fsharp/FSharp.Compiler.Host.netcore.nuget/FSharp.Compiler.Host.proj" />
2725
</ItemGroup>
2826

build.cmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,8 @@ if '%BUILD_PROTO%' == '1' (
476476

477477
pushd .\lkg\fsc & %_dotnetexe% restore & popd & if ERRORLEVEL 1 echo Error:%errorlevel% dotnet restore failed & goto :failure
478478
pushd .\lkg\fsi & %_dotnetexe% restore & popd & if ERRORLEVEL 1 echo Error:%errorlevel% dotnet restore failed & goto :failure
479-
pushd .\lkg\fsc & %_dotnetexe% publish project.json --no-build -o %~dp0\Tools\lkg -r win7-x64 & popd & if ERRORLEVEL 1 echo Error: dotnet publish failed & goto :failure
480-
pushd .\lkg\fsi & %_dotnetexe% publish project.json --no-build -o %~dp0\Tools\lkg -r win7-x64 & popd & if ERRORLEVEL 1 echo Error: dotnet publish failed & goto :failure
479+
pushd .\lkg\fsc & %_dotnetexe% publish project.json --no-build -o %~dp0Tools\lkg -r win7-x64 & popd & if ERRORLEVEL 1 echo Error: dotnet publish failed & goto :failure
480+
pushd .\lkg\fsi & %_dotnetexe% publish project.json --no-build -o %~dp0Tools\lkg -r win7-x64 & popd & if ERRORLEVEL 1 echo Error: dotnet publish failed & goto :failure
481481

482482
echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj
483483
%_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj

src/FSharpSource.Settings.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<ConfigurationGroup Condition="'$(ConfigurationGroup)'==''">Debug</ConfigurationGroup>
1919
</PropertyGroup>
2020

21+
<!-- Nuget Package properties -->
2122
<PropertyGroup>
2223
<!-- Settings used all the time -->
2324
<Tailcalls>true</Tailcalls>

src/FSharpSource.targets

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -453,15 +453,25 @@
453453
<RootNamespace></RootNamespace>
454454
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
455455
</PropertyGroup>
456-
456+
457+
<PropertyGroup>
458+
<PackageLicenceUrl Condition="'$(PackageLicenceUrl)' == ''">https://github.com/Microsoft/visualfsharp/blob/master/License.txt</PackageLicenceUrl>
459+
<PackageProjectUrl Condition="'$(PackageProjectUrl)' == ''">https://github.com/Microsoft/visualfsharp</PackageProjectUrl>
460+
<PackageVersion Condition="'$(PackageVersion)' == ''" >$(NuGetPerBuildPreReleaseVersion)</PackageVersion>
461+
<PackageAuthors Condition="'$(PackageAuthors)' == ''" >Microsoft</PackageAuthors>
462+
<PackageTags Condition="'$(PackageTags)' == ''" >Visual F# Compiler FSharp coreclr functional programming</PackageTags>
463+
</PropertyGroup>
464+
465+
<!-- This build step copies files to the output folder while replacing build variables in the text of those file. -->
457466
<PropertyGroup>
458467
<CompileDependsOn>$(CompileDependsOn);CopyAndSubstituteTextFiles</CompileDependsOn>
459468
</PropertyGroup>
469+
460470
<Target
461471
Name="CopyAndSubstituteTextFiles"
462472
Inputs="@(CopyAndSubstituteText)"
463473
Outputs="@(CopyAndSubstituteText->'$(OutDir)%(TargetFilename)')" >
464-
<Exec Command="$(FsiToolPath)\$(FsiToolExe) --exec $(MSBuildThisFileDirectory)scripts/subst.fsx --in:&quot;%(CopyAndSubstituteText.FullPath)&quot; --out:&quot;$(OutDir)%(CopyAndSubstituteText.TargetFilename)&quot; --pattern1:&quot;%(CopyAndSubstituteText.Pattern1)&quot; --replacement1:&quot;%(CopyAndSubstituteText.Replacement1)&quot; --pattern2:&quot;%(CopyAndSubstituteText.Pattern2)&quot; --replacement2:&quot;%(CopyAndSubstituteText.Replacement2)&quot; " />
474+
<Exec Command="$(FsiToolPath)\$(FsiToolExe) --exec $(MSBuildThisFileDirectory)scripts/subst.fsx --in:&quot;%(CopyAndSubstituteText.FullPath)&quot; --out:&quot;$(OutDir)%(CopyAndSubstituteText.TargetFilename)&quot; --pattern1:&quot;%(CopyAndSubstituteText.Pattern1)&quot; --replacement1:&quot;%(CopyAndSubstituteText.Replacement1)&quot; --pattern2:&quot;%(CopyAndSubstituteText.Pattern2)&quot; --replacement2:&quot;%(CopyAndSubstituteText.Replacement2)&quot; " />
465475
<!-- Make sure it will get cleaned -->
466476
<CreateItem Include="$(OutDir)%(CopyAndSubstituteText.TargetFilename)">
467477
<Output TaskParameter="Include" ItemName="FileWrites"/>
@@ -480,8 +490,16 @@
480490
</ItemGroup>
481491
</Target>
482492

483-
<Target Name="nugetrestore" BeforeTargets="Build" Condition=" '$(TargetFramework)' == 'coreclr' and '$(DOTNET_PUBLISH)' != 'true' ">
484-
<Exec Command="$(MSBuildThisFileDirectory)..\.nuget\nuget.exe restore -PackagesDirectory $(MSBuildThisFileDirectory)..\packages -Config $(MSBuildThisFileDirectory)..\.nuget\NuGet.Config project.json"/>
493+
<Target Name="dotnetrestore" BeforeTargets="Build" Condition=" '$(TargetFramework)' == 'coreclr' ">
494+
<Exec Command="$(MSBuildThisFileDirectory)..\.nuget\nuget.exe restore -PackagesDirectory $(MSBuildThisFileDirectory)..\packages -Config $(MSBuildThisFileDirectory)..\.nuget\NuGet.Config project.json" />
495+
</Target>
496+
497+
<Target Name="nugetpack" AfterTargets="Build" Condition="'$(TargetFramework)' == 'coreclr' "
498+
Inputs="@(PackageNuspec)" Outputs='$(OutputPath.TrimEnd("\"))\nuget\"%(PackageNuspec.Filename)).nupkg'>
499+
<PropertyGroup>
500+
<PackageProperties>-prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)"</PackageProperties>
501+
</PropertyGroup>
502+
<Exec Command='$(MSBuildThisFileDirectory)..\.nuget\nuget.exe pack %(PackageNuspec.Filename)%(PackageNuspec.Extension) -BasePath "$(OutputPath.TrimEnd("\"))" -ExcludeEmptyDirectories $(PackageProperties) -OutputDirectory "$(OutputPath.TrimEnd("\"))"' />
485503
</Target>
486504

487505
<Target Name="dotnetrestore" BeforeTargets="Build" Condition=" '$(TargetFramework)' == 'coreclr' and '$(DOTNET_PUBLISH)' == 'true' ">

src/fsharp/FSharp.Compiler.Host.netcore.nuget/FSharp.Compiler.Host.proj

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,28 @@
77
<Import Project="$(FSharpSourcesRoot)\FSharpSource.Settings.targets" />
88

99
<PropertyGroup>
10-
<pkgversion Condition=" '$(PKGVersion)' == '' ">$(NuGetPerBuildPreReleaseVersion)</pkgversion>
11-
<OutDir>$(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFramework)\bin</OutDir>
10+
<PackageLicenceUrl Condition="'$(PackageLicenceUrl)' == ''">https://github.com/Microsoft/visualfsharp/blob/master/License.txt</PackageLicenceUrl>
11+
<PackageProjectUrl Condition="'$(PackageProjectUrl)' == ''">https://github.com/Microsoft/visualfsharp</PackageProjectUrl>
12+
<PackageVersion Condition="'$(PackageVersion)' == ''" >$(NuGetPerBuildPreReleaseVersion)</PackageVersion>
13+
<PackageAuthors Condition="'$(PackageAuthors)' == ''" >Microsoft</PackageAuthors>
14+
<PackageTags Condition="'$(PackageTags)' == ''" >Visual F# Compiler FSharp coreclr functional programming</PackageTags>
15+
<OutputPath>$(FSharpSourcesRoot)\..\$(Configuration)\coreclr\bin</OutputPath>
1216
</PropertyGroup>
1317

14-
<!-- TODO: Switch to using lkg coreclr fsi and remove dependency on running FSharp.Compiler.Tools fsi -->
15-
16-
<Target Name="Build" Outputs="$(TargetPath)" DependsOnTargets="$(BuildDependsOn)">
17-
<Exec Command="$(FsiToolPath)\$(FsiToolExe) --exec layoutfschostnuget.fsx --nuspec:.\Microsoft.FSharp.Compiler.Host.netcore.nuspec --bindir:$(OutDir)"/>
18-
<Exec Command="$(FsiToolPath)\$(FsiToolExe) --exec ..\..\scripts\buildnugets.fsx --version:$(pkgversion) --nuspec:.\Microsoft.FSharp.Compiler.Host.netcore.nuspec --bindir:$(OutDir)"/>
19-
</Target>
18+
<ItemGroup Condition="'$(TargetFramework)' == 'coreclr'">
19+
<PackageNuspec Include="Microsoft.FSharp.Compiler.netcore.nuspec" />
20+
<PackageNuspec Include="Microsoft.FSharp.Compiler.Host.netcore.nuspec" />
21+
</ItemGroup>
22+
23+
<Target Name="Build" Outputs="$(TargetPath)" DependsOnTargets="$(nugetpack)" />
24+
<Target Name="Rebuild" DependsOnTargets="$(nugetpack)" />
2025

21-
<Target Name="Rebuild" DependsOnTargets="Build" />
26+
<Target Name="nugetpack" AfterTargets="Build" Condition="'$(TargetFramework)' == 'coreclr' "
27+
Inputs="@(PackageNuspec)" Outputs='$(OutputPath.TrimEnd("\"))\nuget\"%(PackageNuspec.Filename)).nupkg'>
28+
<PropertyGroup>
29+
<PackageProperties>-prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)"</PackageProperties>
30+
</PropertyGroup>
31+
<Exec Command='$(MSBuildThisFileDirectory)..\..\..\.nuget\nuget.exe pack %(PackageNuspec.Filename)%(PackageNuspec.Extension) -BasePath "$(OutputPath.TrimEnd("\"))" -ExcludeEmptyDirectories $(PackageProperties) -OutputDirectory "$(OutputPath.TrimEnd("\"))"' />
32+
</Target>
2233

2334
</Project>

src/fsharp/FSharp.Compiler.netcore.nuget/Microsoft.FSharp.Compiler.netcore.nuspec renamed to src/fsharp/FSharp.Compiler.Host.netcore.nuget/Microsoft.FSharp.Compiler.netcore.nuspec

File renamed without changes.

src/fsharp/FSharp.Compiler.Host.netcore.nuget/layoutfschostnuget.fsx

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

src/fsharp/FSharp.Compiler.netcore.nuget/FSharp.Compiler.nuget.proj

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

src/fsharp/FSharp.Compiler.netcore.nuget/layoutfscnuget.fsx

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

src/fsharp/FSharp.Core.netcore.nuget/FSharp.Core.netcore.nuget.proj

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

0 commit comments

Comments
 (0)