Skip to content

Commit

Permalink
Merge pull request #30 from tboby/fix-rework
Browse files Browse the repository at this point in the history
WIP: Remove parser, port C# Task, and other modernisation
  • Loading branch information
baronfel authored Oct 22, 2024
2 parents 3872775 + 0614db1 commit 8fd6473
Show file tree
Hide file tree
Showing 36 changed files with 1,281 additions and 1,071 deletions.
6 changes: 3 additions & 3 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"version": 1,
"isRoot": true,
"tools": {
"fantomas-tool": {
"version": "4.6.0-beta-001",
"fantomas": {
"version": "6.3.12",
"commands": [
"fantomas"
]
}
}
}
}
23 changes: 23 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.{fs,fsx,fsi}]
max_line_length = 100
fsharp_alternative_long_member_definitions = true
fsharp_multi_line_lambda_closing_newline = true
fsharp_multiline_bracket_style = aligned
fsharp_keep_max_number_of_blank_lines = 1
fsharp_align_function_signature_to_indentation = true
fsharp_max_if_then_else_short_width = 0

fsharp_experimental_elmish = true
fsharp_record_multiline_formatter = number_of_items
fsharp_array_or_list_multiline_formatter = number_of_items
fsharp_max_record_number_of_items = 0
fsharp_max_array_or_list_number_of_items = 0
30 changes: 21 additions & 9 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
<Project>
<!-- Make F# support Central Package Management -->
<PropertyGroup>
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
</PropertyGroup>
<!-- Use lock files -->
<PropertyGroup>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<RestoreLockedMode Condition="'$(ContinuousIntegrationBuild)' == 'true'">true</RestoreLockedMode>
</PropertyGroup>
<ItemGroup>
<!-- Automatically set RepositoryUrl, DebugType embedded, ContinuousIntegrationBuild -->
<PackageReference Include="DotNet.ReproducibleBuilds" PrivateAssets="All"/>
</ItemGroup>
<PropertyGroup>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Authors>Chet Husk</Authors>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageTags>version;changelog;keepachangelog</PackageTags>
<GeneratePathProperty>true</GeneratePathProperty>
<!-- Currently not automatic https://github.com/dotnet/sourcelink/issues/712 -->
<PackageProjectUrl>https://github.com/ionide/KeepAChangelog</PackageProjectUrl>
<PackageIcon>ionide.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Dotnet.ReproducibleBuilds" Version="1.1.1" PrivateAssets="All" />
<PackageReference Update="FSharp.Core" Version=""/>
</ItemGroup>
<ItemGroup Condition="'$(IsPackable)' == 'true'">
<None Include="$(MSBuildThisFileDirectory)README.md" Pack="true" PackagePath="\" />
<None Include="$(MSBuildThisFileDirectory)ionide.png" Pack="true" PackagePath="\" />
<None Include="$(MSBuildThisFileDirectory)/README.md" Pack="true" PackagePath="\" />
<None Include="$(MSBuildThisFileDirectory)/ionide.png" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>
</Project>
22 changes: 22 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<CentralPackagePackageVersionOverride>false</CentralPackagePackageVersionOverride>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="EasyBuild.FileSystemProvider" Version="0.3.0" />
<PackageVersion Include="Fixie.TestAdapter" Version="3.4.0" />
<PackageVersion Include="FSharp.Core" Version="7.0.300" />
<PackageVersion Include="FsToolkit.ErrorHandling" Version="4.17.0" />
<PackageVersion Include="KeepAChangelogParser" Version="1.2.4" />
<!-- 17.8.* aligns with .NET 8 SDK -->
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.8.3" />
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="Semver" Version="2.3.0" />
<PackageVersion Include="Shouldly" Version="4.2.1" />
<PackageVersion Include="SimpleExec" Version="12.0.0" />
<PackageVersion Include="DotNet.ReproducibleBuilds" Version="1.2.25" />
<PackageVersion Include="DotNet.ReproducibleBuilds.Isolated" Version="1.2.25" />
</ItemGroup>
</Project>
22 changes: 6 additions & 16 deletions Ionide.KeepAChangelog.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ VisualStudioVersion = 16.0.30114.105
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{31D4F8AF-532B-4DDF-BBA3-FD9B4C8FDA73}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Ionide.KeepAChangelog.Tasks", "src\Ionide.KeepAChangelog.Tasks\Ionide.KeepAChangelog.Tasks.fsproj", "{6CCAEBD2-9EE9-4540-AECF-02F0221B9C87}"
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Ionide.KeepAChangelog.Tasks", "src\Ionide.KeepAChangelog.Tasks.fsproj", "{6CCAEBD2-9EE9-4540-AECF-02F0221B9C87}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Ionide.KeepAChangelog", "src\Ionide.KeepAChangelog\Ionide.KeepAChangelog.fsproj", "{7C0C4ECD-27AF-47DD-904D-7952AC01A7A8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{B66528FD-2329-4D67-9C9A-3EF46C301815}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Ionide.KeepAChangelog.Test", "test\Ionide.KeepAChangelog.Test\Ionide.KeepAChangelog.Test.fsproj", "{349B0A8F-FBE0-4363-A950-ED4D6564560F}"
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Ionide.KeepAChangelog.Tasks.Test", "tests\Ionide.KeepAChangelog.Tasks.Test.fsproj", "{6456526B-A0F6-4998-A57A-772A055DF8AD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -26,18 +22,12 @@ Global
{6CCAEBD2-9EE9-4540-AECF-02F0221B9C87}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6CCAEBD2-9EE9-4540-AECF-02F0221B9C87}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6CCAEBD2-9EE9-4540-AECF-02F0221B9C87}.Release|Any CPU.Build.0 = Release|Any CPU
{7C0C4ECD-27AF-47DD-904D-7952AC01A7A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7C0C4ECD-27AF-47DD-904D-7952AC01A7A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7C0C4ECD-27AF-47DD-904D-7952AC01A7A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7C0C4ECD-27AF-47DD-904D-7952AC01A7A8}.Release|Any CPU.Build.0 = Release|Any CPU
{349B0A8F-FBE0-4363-A950-ED4D6564560F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{349B0A8F-FBE0-4363-A950-ED4D6564560F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{349B0A8F-FBE0-4363-A950-ED4D6564560F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{349B0A8F-FBE0-4363-A950-ED4D6564560F}.Release|Any CPU.Build.0 = Release|Any CPU
{6456526B-A0F6-4998-A57A-772A055DF8AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6456526B-A0F6-4998-A57A-772A055DF8AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6456526B-A0F6-4998-A57A-772A055DF8AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6456526B-A0F6-4998-A57A-772A055DF8AD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{6CCAEBD2-9EE9-4540-AECF-02F0221B9C87} = {31D4F8AF-532B-4DDF-BBA3-FD9B4C8FDA73}
{7C0C4ECD-27AF-47DD-904D-7952AC01A7A8} = {31D4F8AF-532B-4DDF-BBA3-FD9B4C8FDA73}
{349B0A8F-FBE0-4363-A950-ED4D6564560F} = {B66528FD-2329-4D67-9C9A-3EF46C301815}
EndGlobalSection
EndGlobal
File renamed without changes.
5 changes: 3 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"sdk": {
"version": "6.0.400"
"version": "8.0.100",
"rollForward": "latestMinor"
}
}
}
63 changes: 63 additions & 0 deletions src/Ionide.KeepAChangelog.Tasks.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net8.0</TargetFrameworks>
<IsPackable>true</IsPackable>
<Description>MSBuild Tasks and Targets that set your Assembly Version, Package Version, and Package Release Notes from your KeepAChangelog-compatible Changelogs.</Description>

<!-- we need the assemblies bundled, so set this so we don't expose any dependencies to the outside world -->
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput>
<NoWarn>NU5128;NU5100</NoWarn><!-- NU5100 is because we pack to tasks/, not lib/ -->
<BuildOutputTargetFolder>tasks</BuildOutputTargetFolder>

<!-- deps.json generation -->
<GenerateDependencyFile>true</GenerateDependencyFile>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<!-- remove FSharp.Core localisations -->
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<!-- Setting this sets the `developmentDependency` flag on our generated package,
which means that consumers don't need to set PrivateAssets="all" and IncludeAssets="build, buildMultitargeting"
to make use of this project without impacting their own dependency trees. -->
<DevelopmentDependency>true</DevelopmentDependency>
</PropertyGroup>

<ItemGroup>
<Compile Include="Log.fs" />
<Compile Include="Library.fs" />
<!-- these lines pack the single-TFM build props/targets files to the `build` folder in the generated package.
By convention, the .NET SDK will look for `build\<Package Id>.props` and `build\<Package Id>.targets`
for automatic inclusion in a single-TFM build. -->
<Content Include="build\*" PackagePath="build\" />
<!-- these lines pack the multi-target TFM build props/targets files to the `buildMultiTargeting` folder in the generated package.
By convention, the .NET SDK will look for `buildMultiTargeting\<Package Id>.props` and `buildMultiTargeting\<Package Id>.targets`
for automatic inclusion in a multi-TFM build. -->
<Content Include="buildMultiTargeting\*" PackagePath="buildMultiTargeting\" />
</ItemGroup>
<ItemGroup>
<!-- All dependencies need PrivateAssets="all" not flow as a nuget-dependency to consumers -->
<!-- MS.B.U.C specifically-->
<PackageReference Include="FsToolkit.ErrorHandling" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Utilities.Core" ExcludeAssets="Runtime" PrivateAssets="all" />
<PackageReference Include="KeepAChangelogParser" PrivateAssets="all" />
<PackageReference Include="Semver" PrivateAssets="all" />
<PackageReference Include="FSharp.Core" PrivateAssets="all" />
</ItemGroup>

<!-- This target adds the deps.json file to the TFM-specific subfolder of runtime dependencies of the app. -->
<Target Name="AddBuildDependencyFileToBuiltProjectOutputGroupOutput" BeforeTargets="BuiltProjectOutputGroup" Condition=" '$(GenerateDependencyFile)' == 'true'">

<ItemGroup>
<BuiltProjectOutputGroupOutput Include="$(ProjectDepsFilePath)" TargetPath="$(ProjectDepsFileName)" FinalOutputPath="$(ProjectDepsFilePath)" />
</ItemGroup>
</Target>

<!-- This target copies the runtime dependencies of this project (all PackageReferences without ExcludeAssets="runtime") to the package
without having to manually specify the correct sub-paths. -->
<Target Name="CopyProjectReferencesToPackage" DependsOnTargets="ResolveReferences">
<ItemGroup>
<!-- the dependencies of your MSBuild task must be packaged inside the package, they cannot be expressed as normal PackageReferences -->
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths)" TargetPath="%(ReferenceCopyLocalPaths.DestinationSubPath)" />
</ItemGroup>
</Target>

</Project>
78 changes: 0 additions & 78 deletions src/Ionide.KeepAChangelog.Tasks/Ionide.KeepAChangelog.Tasks.fsproj

This file was deleted.

97 changes: 0 additions & 97 deletions src/Ionide.KeepAChangelog.Tasks/Library.fs

This file was deleted.

Loading

0 comments on commit 8fd6473

Please sign in to comment.