Skip to content

Commit 4d0bf7d

Browse files
authored
Some maintenance updates to help upcoming .NET 8 migration (#2826)
* Runtime identifiers updated, NETFrameworkAssembly attribute detection fix * Added platform to FAKE version info
1 parent 4fe8bcf commit 4d0bf7d

File tree

14 files changed

+43
-17
lines changed

14 files changed

+43
-17
lines changed

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ jobs:
4949
RELEASE_USER_GITHUB: ${{ secrets.RELEASE_USER_GITHUB }}
5050
REPOSITORY_NAME_GITHUB: ${{ secrets.REPOSITORY_NAME_GITHUB }}
5151
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52-
run: ${{github.workspace}}/release/dotnetcore/Fake.netcore/win7-x64/fake.exe build -t FastRelease
52+
run: ${{github.workspace}}/release/dotnetcore/Fake.netcore/win-x64/fake.exe build -t FastRelease

RELEASE_NOTES.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Release Notes
2+
## 6.1.2 - 2024-09-20
3+
* Runtime-identifier update to more recent runtimes.
4+
* Removed .NETFrameworkAssembly attribute fix on detecting .NET assemblies.
25

36
## 6.1.1 - 2024-08-30
47
* BUGFIX: Assembly resolver to pick a found SDK instead of first SDK, thanks @Thorium - https://github.com/fsprojects/FAKE/pull/2797/files

build.fsx

+9-4
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ docker run --rm -v $PWD:$PWD -w $PWD linuturk/mono-choco $@
425425
altToolPath
426426

427427
//TODO:: see if we need to update the runtimes to newer versions of OSs
428-
let runtimes = [ "win7-x86"; "win7-x64"; "osx.10.11-x64"; "linux-x64" ]
428+
let runtimes = [ "win-x86"; "win-x64"; "osx-x64"; "linux-x64" ]
429429

430430
/// <summary>
431431
/// Publishes the build artifacts for the given runtime
@@ -809,7 +809,10 @@ runtimes
809809
{ c with
810810
Runtime = Some runtime.Value
811811
Configuration = DotNet.Release
812-
OutputPath = Some outDir }
812+
OutputPath = Some outDir
813+
Framework = Some "net6.0"
814+
// DisableInternalBinLog: https://github.com/fsprojects/FAKE/issues/2722
815+
MSBuildParams = { MSBuild.CliArguments.Create() with DisableInternalBinLog = true }}
813816
|> dotnetSimple)
814817
proj
815818

@@ -876,7 +879,9 @@ Target.create "DotNetCreateNuGetPackage" (fun _ ->
876879
{ c.MSBuildParams with
877880
Properties =
878881
[ ("Version", nugetVersion)
879-
("PackageReleaseNotes", release.Notes |> String.toLines) ] } }
882+
("PackageReleaseNotes", release.Notes |> String.toLines) ]
883+
// DisableInternalBinLog: https://github.com/fsprojects/FAKE/issues/2722
884+
DisableInternalBinLog = true } }
880885
|> dotnetSimple)
881886
"Fake.sln"
882887

@@ -916,7 +921,7 @@ Target.create "DotNetCreateChocolateyPackage" (fun _ ->
916921
InstallerType = Choco.ChocolateyInstallerType.SelfContained
917922
Version = chocoVersion
918923
Files =
919-
[ System.IO.Path.GetFullPath(nugetDncDir </> @"Fake.netcore\win7-x86") + @"\**", Some "bin", None
924+
[ System.IO.Path.GetFullPath(nugetDncDir </> @"Fake.netcore\win-x86") + @"\**", Some "bin", None
920925
(System.IO.Path.GetFullPath @"src\VERIFICATION.txt"), Some "VERIFICATION.txt", None
921926
(System.IO.Path.GetFullPath @"License.txt"), Some "LICENSE.txt", None ]
922927
OutputDir = chocoReleaseDir }

docs/guide/buildserver.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Fake itself uses `GitHubActions` support for importing and displaying test resul
8484
Trace.publish (ImportData.Nunit NunitDataVersion.Nunit) "Fake_Core_CommandLine_UnitTests.TestResults.xml"
8585
8686
// upload artifacts
87-
Trace.publish ImportData.BuildArtifact ("release/dotnetcore/fake-dotnetcore-win7-x64.zip")
87+
Trace.publish ImportData.BuildArtifact ("release/dotnetcore/fake-dotnetcore-win-x64.zip")
8888
```
8989

9090
Also, prior to currently setup of FAKE which uses GitHub actions. The previous setup used VSTS (Azure DevOps)

docs/guide/dotnet-cli.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ DotNet.restore (fun args ->
4040
// Define more general properties in addition to the general ones, with arugments
4141
DotNet.restore (fun args ->
4242
{ args with
43-
Runtime = Some "win7-x86"
43+
Runtime = Some "win-x86"
4444
} |> withWorkDir "./test" ) "mysolution.sln"
4545
```
4646

docs/guide/getting-started.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ There are various ways to install FAKE:
215215
216216
5. Download the runtime specific zip.
217217
Just use the `-<runtime>` version matching your specific platform
218-
of [<ins>the downloads</ins>](https://github.com/fsharp/FAKE/releases) (for example `fake-dotnetcore-win7-x64.zip`),
218+
of [<ins>the downloads</ins>](https://github.com/fsharp/FAKE/releases) (for example `fake-dotnetcore-win-x64.zip`),
219219
extract it and execute the `fake` binary. Add the extracted binary to your `PATH` to just execute `fake` from any
220220
directory.
221221

src/VERIFICATION.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ in verifying that this package's contents are trustworthy.
44

55
This package is published by the FAKE Project itself. Any binaries will be
66
identical to other package types published by the project, in particular
7-
the fake-dotnetcore-win7-x86.zip binary release.
7+
the fake-dotnetcore-win-x86.zip binary release.

src/app/Fake.Core.String/String.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -275,4 +275,4 @@ module String =
275275
/// <summary>
276276
/// Determines if a text matches a given regex pattern.
277277
/// </summary>
278-
let (>**) pattern text = (getRegEx pattern).IsMatch text
278+
let (>**) pattern (text: string) = (getRegEx pattern).IsMatch text

src/app/Fake.IO.FileSystem/Path.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module Path =
3535
/// </summary>
3636
///
3737
/// <param name="path">The path to check</param>
38-
let isDirectory path =
38+
let isDirectory (path: string) =
3939
let attr = File.GetAttributes path
4040
attr &&& FileAttributes.Directory = FileAttributes.Directory
4141

src/app/Fake.Net.FTP/FTP.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ module FTP =
9999
List.forall (fun validator -> directoryName |> validator) validators
100100

101101
/// Checks to see if the `ftp content` string contains the string `Given_Folder_Name`
102-
let inline regexCheck folderName ftpContents =
102+
let inline regexCheck folderName (ftpContents: string) =
103103
Regex.IsMatch(ftpContents, $@"\s+%s{folderName}\s+")
104104

105105
/// <summary>

src/app/Fake.Runtime/CoreCache.fs

+3-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,9 @@ let findAndLoadInRuntimeDeps
332332

333333
let isFramework =
334334
assembly.GetCustomAttributes<AssemblyMetadataAttribute>()
335-
|> Seq.exists (fun m -> m.Key = ".NETFrameworkAssembly")
335+
|> Seq.exists (fun m ->
336+
m.Key = ".NETFrameworkAssembly" // net8.0 framework assemblies have NETFrameworkAssembly attribute removed. So identify them via RepositoryUrl:
337+
|| (m.Key = "RepositoryUrl" && m.Value.StartsWith "https://github.com/dotnet/"))
336338

337339
if not isFramework then
338340
None

src/app/Fake.Runtime/Environment.fs

+17-1
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,21 @@ let inline internal fakeContextAssembly () =
7373
/// Gets the FAKE version no.
7474
let fakeVersion = fakeContextAssembly().GetName().Version.ToString()
7575

76+
let getPlatform () =
77+
match System.Reflection.Assembly.GetExecutingAssembly() with
78+
| null -> ""
79+
| x ->
80+
match x.GetCustomAttributes(typeof<System.Runtime.Versioning.TargetFrameworkAttribute>, false) with
81+
| null -> ""
82+
| itms when itms.Length > 0 ->
83+
(itms |> Seq.head :?> System.Runtime.Versioning.TargetFrameworkAttribute)
84+
.FrameworkName
85+
| _ -> ""
86+
7687
/// Gets the FAKE Version string
77-
let fakeVersionStr = sprintf "FAKE 6 - F# Make (%s)" fakeVersion
88+
let fakeVersionStr =
89+
sprintf
90+
"FAKE %i - F# Make (%s) (running on %s)"
91+
(fakeContextAssembly().GetName().Version.Major)
92+
fakeVersion
93+
(getPlatform ())

src/app/Fake.netcore/Fake.netcore.fsproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<AssemblyName>fake</AssemblyName>
99
<OutputType>Exe</OutputType>
1010
<NoWarn>FS3186</NoWarn>
11-
<RuntimeIdentifiers>win7-x86;win7-x64;osx.10.11-x64;linux-x64</RuntimeIdentifiers>
11+
<RuntimeIdentifiers>win-x86;win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
1212
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
1313
</PropertyGroup>
1414
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">

src/legacy/[ignored].gitlab-ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ do_build:
6464
# mkdir fake-bin
6565
# unzip -n artifacts/fake-dotnetcore-ubuntu.14.04-x64.zip -d fake-bin || echo unzip returned $?
6666
# chmod +x fake-bin/fake
67-
# mkdir -p nuget/dotnetcore/Fake.netcore/win7-x86
68-
# unzip -n artifacts/fake-dotnetcore-win7-x86.zip -d nuget/dotnetcore/Fake.netcore/win7-x86 || echo unzip returned $?
67+
# mkdir -p nuget/dotnetcore/Fake.netcore/win-x86
68+
# unzip -n artifacts/fake-dotnetcore-win-x86.zip -d nuget/dotnetcore/Fake.netcore/win-x86 || echo unzip returned $?
6969
# unzip -n artifacts/chocolatey-requirements.zip || echo unzip returned $?
7070
# export artifactsdirectory=$PWD/artifacts
7171
# fake-bin/fake build target DotNetCoreCreateChocolateyPackage

0 commit comments

Comments
 (0)