Skip to content

Commit

Permalink
minimize duplication for packaging in projects - centralize in Direct…
Browse files Browse the repository at this point in the history
…ory.Build.props
  • Loading branch information
baronfel committed Feb 14, 2022
1 parent b8ea214 commit e8378b5
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 129 deletions.
14 changes: 13 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<!-- Common packaging properties for all packages in this repo -->
<Authors>Florian Verdonck, Jindřich Ivánek</Authors>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Description>
This library aims at formatting F# source files based on a given configuration.
Fantomas will ensure correct indentation and consistent spacing between elements in the source files.
Expand All @@ -13,7 +14,18 @@ Some common use cases include:
(2) Converting legacy code from verbose syntax to light syntax
(3) Formatting auto-generated F# signatures.
</Description>
<Copyright>Copyright © $[System.DateTime]::UtcNow.Year)</Copyright>
<Copyright>Copyright © $([System.DateTime]::UtcNow.Year)</Copyright>
<PackageTags>F# fsharp formatting beautifier indentation indenter</PackageTags>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<DebugType>embedded</DebugType>
<PackageIcon>fantomas_logo.png</PackageIcon>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup Condition="'$(IsPackable)' == 'true'">
<None Include="$(MSBuildThisFileDirectory)fantomas_logo.png" Visible="false" Pack="true" PackagePath="" />
<None Include="$(MSBuildThisFileDirectory)README.md" Visible="false" Pack="true" PackagePath="" />
</ItemGroup>
</Project>
15 changes: 2 additions & 13 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,10 @@ open System
open System.IO
open Fake.DotNet

// Git configuration (used for publishing documentation in gh-pages branch)
// The profile where the project is posted
let gitHome = "https://github.com/fsprojects"
// The name of the project on GitHub
let gitName = "fantomas"


let projectUrl = sprintf "%s/%s" gitHome gitName

let configuration = DotNet.BuildConfiguration.Release

// (<solutionFile>.sln is built during the building process)
let solutionFile = "fantomas"
let solutionFile = "fantomas.sln"
//// Environment.CurrentDirectory <- __SOURCE_DIRECTORY__


Expand Down Expand Up @@ -143,9 +134,7 @@ Target.create "Clean" (fun _ ->

// --------------------------------------------------------------------------------------
// Build library & test project
Target.create "Build" (fun _ ->
let sln = sprintf "%s.sln" solutionFile
DotNet.build (fun p -> { p with Configuration = configuration }) sln)
Target.create "Build" (fun _ -> DotNet.build (fun p -> { p with Configuration = configuration }) solutionFile)

Target.create "UnitTests" (fun _ ->
DotNet.test
Expand Down
2 changes: 2 additions & 0 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ group tool
nuget StreamJsonRpc
nuget Thoth.Json.Net
nuget SerilogTraceListener
nuget Ionide.KeepAChangelog.Tasks copy_local: true
nuget Dotnet.ReproducibleBuilds copy_local: true

group client
storage: none
Expand Down
22 changes: 21 additions & 1 deletion paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ NUGET
System.Threading.Thread (>= 4.3)
System.Threading.ThreadPool (>= 4.3)
FSharp.Core (6.0.1) - content: none
Ionide.KeepAChangelog.Tasks (0.1.1) - copy_local: true
Ionide.KeepAChangelog.Tasks (0.1.2) - copy_local: true
Microsoft.Build.Framework (17.0)
System.Security.Permissions (>= 4.7)
Microsoft.Build.Tasks.Core (17.0)
Expand Down Expand Up @@ -2031,14 +2031,34 @@ NUGET
Argu (6.1.1)
FSharp.Core (>= 4.3.2)
System.Configuration.ConfigurationManager (>= 4.4)
DotNet.ReproducibleBuilds (1.1.1) - copy_local: true
Microsoft.SourceLink.AzureRepos.Git (>= 1.1.1)
Microsoft.SourceLink.Bitbucket.Git (>= 1.1.1)
Microsoft.SourceLink.GitHub (>= 1.1.1)
Microsoft.SourceLink.GitLab (>= 1.1.1)
Fable.Core (3.6.1)
FSharp.Core (6.0.1)
Ionide.KeepAChangelog.Tasks (0.1.2) - copy_local: true
MessagePack (2.3.85)
MessagePack.Annotations (>= 2.3.85)
MessagePack.Annotations (2.3.85)
Microsoft.Bcl.AsyncInterfaces (6.0)
Microsoft.Build.Tasks.Git (1.1.1) - copy_local: true
Microsoft.NETCore.Platforms (6.0.1)
Microsoft.NETCore.Targets (5.0)
Microsoft.SourceLink.AzureRepos.Git (1.1.1) - copy_local: true
Microsoft.Build.Tasks.Git (>= 1.1.1)
Microsoft.SourceLink.Common (>= 1.1.1)
Microsoft.SourceLink.Bitbucket.Git (1.1.1) - copy_local: true
Microsoft.Build.Tasks.Git (>= 1.1.1)
Microsoft.SourceLink.Common (>= 1.1.1)
Microsoft.SourceLink.Common (1.1.1) - copy_local: true
Microsoft.SourceLink.GitHub (1.1.1) - copy_local: true
Microsoft.Build.Tasks.Git (>= 1.1.1)
Microsoft.SourceLink.Common (>= 1.1.1)
Microsoft.SourceLink.GitLab (1.1.1) - copy_local: true
Microsoft.Build.Tasks.Git (>= 1.1.1)
Microsoft.SourceLink.Common (>= 1.1.1)
Microsoft.VisualStudio.Threading (17.0.64)
Microsoft.Bcl.AsyncInterfaces (>= 5.0)
Microsoft.VisualStudio.Threading.Analyzers (>= 17.0.64)
Expand Down
6 changes: 0 additions & 6 deletions src/Fantomas.Client/Fantomas.Client.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@
<ChangelogFile>$(MSBuildThisFileDirectory)CHANGELOG.md</ChangelogFile>
<TargetFramework>netstandard2.0</TargetFramework>
<Description>Companion library to format using fantomas tool.</Description>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<WarnOn>3390;$(WarnOn)</WarnOn>
<WarningsAsErrors>FS0025</WarningsAsErrors>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageIcon>fantomas_logo.png</PackageIcon>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IsPackable>true</IsPackable>
</PropertyGroup>
<ItemGroup>
<None Include="paket.references" />
<None Include="..\..\LICENSE.md" Visible="false" Pack="true" PackagePath="" />
<None Include="..\..\fantomas_logo.png" Visible="false" Pack="true" PackagePath="" />
<Compile Include="Contracts.fs" />
<Compile Include="LSPFantomasServiceTypes.fs" />
<Compile Include="FantomasToolLocator.fs" />
Expand Down
4 changes: 0 additions & 4 deletions src/Fantomas.CoreGlobalTool/Fantomas.CoreGlobalTool.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
<PackAsTool>True</PackAsTool>
<AssemblyName>fantomas-tool</AssemblyName>
<WarningsAsErrors>FS0025</WarningsAsErrors>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageIcon>fantomas_logo.png</PackageIcon>
<IsPackable>true</IsPackable>
</PropertyGroup>
<ItemGroup>
Expand All @@ -21,8 +19,6 @@
</ItemGroup>
<ItemGroup>
<None Include="paket.references" />
<None Include="..\..\LICENSE.md" Visible="false" Pack="true" PackagePath="" />
<None Include="..\..\fantomas_logo.png" Visible="false" Pack="true" PackagePath="" />
<Compile Include="Daemon.fs" />
<Compile Include="Program.fs" />
</ItemGroup>
Expand Down
87 changes: 0 additions & 87 deletions src/Fantomas.CoreGlobalTool/LICENSE.txt

This file was deleted.

5 changes: 2 additions & 3 deletions src/Fantomas.CoreGlobalTool/paket.references
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Ionide.KeepAChangelog.Tasks
Dotnet.ReproducibleBuilds

group tool
FSharp.Core
Argu
StreamJsonRpc
Thoth.Json.Net
SerilogTraceListener
Ionide.KeepAChangelog.Tasks
Dotnet.ReproducibleBuilds
5 changes: 0 additions & 5 deletions src/Fantomas.Extras/Fantomas.Extras.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@
<TargetFramework>netstandard2.0</TargetFramework>
<Description>Utility package for Fantomas</Description>
<WarningsAsErrors>FS0025</WarningsAsErrors>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageIcon>fantomas_logo.png</PackageIcon>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IsPackable>true</IsPackable>
</PropertyGroup>
<ItemGroup>
<None Include="paket.references" />
<None Include="..\..\LICENSE.md" Visible="false" Pack="true" PackagePath="" />
<None Include="..\..\fantomas_logo.png" Visible="false" Pack="true" PackagePath="" />
<Compile Include="EditorConfig.fs" />
<Compile Include="IgnoreFile.fs" />
<Compile Include="FakeHelpers.fs" />
Expand Down
9 changes: 0 additions & 9 deletions src/Fantomas/Fantomas.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Description>Source code formatter for F#</Description>
<WarningsAsErrors>FS0025</WarningsAsErrors>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageIcon>fantomas_logo.png</PackageIcon>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<DebugType>embedded</DebugType>
<RepositoryUrl>https://github.com/fsprojects/fantomas</RepositoryUrl>
<IsPackable>true</IsPackable>
</PropertyGroup>
<ItemGroup>
<None Include="paket.references" />
<None Include="..\..\LICENSE.md" Visible="false" Pack="true" PackagePath="" />
<None Include="..\..\fantomas_logo.png" Visible="false" Pack="true" PackagePath="" />
<Compile Include="AssemblyInfo.fs" />
<Compile Include="RangeHelpers.fs" />
<Compile Include="TriviaTypes.fs" />
Expand Down

0 comments on commit e8378b5

Please sign in to comment.