diff --git a/AGENTS.md b/AGENTS.md index 6786d5d..4e387cb 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -7,8 +7,8 @@ decision engine. See README.md for the package layout and measured numbers. ## Commands -mise installs the SDK pinned in `global.json` (plus the .NET 10 runtime every project targets). Run everything -through it: +mise installs the SDK pinned in `global.json`; the libraries target net10.0 and net11.0, the CLI, the tests and the +examples net11.0. Run everything through it: ```bash mise run build # build the solution diff --git a/Directory.Build.props b/Directory.Build.props index d4141e8..d7839bf 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - net10.0 + net11.0 latest enable enable @@ -27,6 +27,10 @@ true + + net10.0;net11.0 + true Nullean and contributors Nullean diff --git a/Directory.Packages.props b/Directory.Packages.props index b141278..b24e6d1 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -29,8 +29,8 @@ - + - + diff --git a/build/scripts/Paths.fs b/build/scripts/Paths.fs index 7b6edfd..89462ef 100644 --- a/build/scripts/Paths.fs +++ b/build/scripts/Paths.fs @@ -5,6 +5,8 @@ open System.IO let ToolName = "Layar" let Repository = "nullean/layar" +/// The framework the public API diff reads from the previous release and from this build: the oldest the libraries +/// target, which every release ships let MainTFM = "net10.0" let SignKey = "" @@ -39,6 +41,12 @@ let Root = let RootRelative path = Path.GetRelativePath(Root.FullName, path) +/// The build output the API diff reads: a library's MainTFM folder, or the one folder of a project that targets a single +/// framework (a dotnet tool, net11.0 alone) +let ApiDiffOutput (projectDirectory: string) = + let library = $".artifacts/bin/{projectDirectory}/release_{MainTFM}" + if Directory.Exists library then library else $".artifacts/bin/{projectDirectory}/release" + let Output = DirectoryInfo(Path.Combine(Root.FullName, "build", "output")) let ToolProject = DirectoryInfo(Path.Combine(Root.FullName, "src", ToolName)) diff --git a/build/scripts/Program.fs b/build/scripts/Program.fs index 868caed..b325424 100644 --- a/build/scripts/Program.fs +++ b/build/scripts/Program.fs @@ -53,8 +53,8 @@ let main argv = for project in projectsToClean () do sh $"dotnet clean {project} -c Release -v q" } | Build -> command { - composes [Clean] - executes (shell { sh $"dotnet build -c Release" }) } + composes [Clean] } + |> executes { sh $"dotnet build -c Release" } | Test -> target [Build] { sh $"dotnet run --project tests/Laya.Tests/Laya.Tests.csproj -c Release" } | Pack -> command { requires [Build]; composes [Generatepackages; Validatepackages; Generateapichanges] } | Ci -> command { requires [Test]; composes [Generatepackages; Validatepackages; Generateapichanges] } @@ -73,7 +73,7 @@ let main argv = let report = Path.Combine(output, $"breaking-changes-{id}.md") let projectDirectory, assembly = Paths.packageInfo id // quoted: an unquoted | would pipe - sh $"dotnet assembly-differ diff 'previous-nuget|{id}|{version}|{Paths.MainTFM}' 'directory|.artifacts/bin/{projectDirectory}/release' -a --target {assembly} -f github-comment --output {report}" } + sh $"dotnet assembly-differ diff 'previous-nuget|{id}|{version}|{Paths.MainTFM}' 'directory|{Paths.ApiDiffOutput projectDirectory}' -a --target {assembly} -f github-comment --output {report}" } | Docs -> target [] { Documentation.build () Documentation.serve port.Value } diff --git a/examples/layar-aot-smoketest/layar-aot-smoketest.csproj b/examples/layar-aot-smoketest/layar-aot-smoketest.csproj index 2619d02..4231c4b 100644 --- a/examples/layar-aot-smoketest/layar-aot-smoketest.csproj +++ b/examples/layar-aot-smoketest/layar-aot-smoketest.csproj @@ -2,7 +2,7 @@ Exe - net10.0 + net11.0 layar_aot_smoketest true false diff --git a/examples/layar-torchsharp-aot-smoketest/layar-torchsharp-aot-smoketest.csproj b/examples/layar-torchsharp-aot-smoketest/layar-torchsharp-aot-smoketest.csproj index 5816c69..6512b1c 100644 --- a/examples/layar-torchsharp-aot-smoketest/layar-torchsharp-aot-smoketest.csproj +++ b/examples/layar-torchsharp-aot-smoketest/layar-torchsharp-aot-smoketest.csproj @@ -2,7 +2,7 @@ Exe - net10.0 + net11.0 layar_torchsharp_aot_smoketest true false diff --git a/mise.toml b/mise.toml index 62d7f59..36c711a 100644 --- a/mise.toml +++ b/mise.toml @@ -8,8 +8,7 @@ DOTNET_CLI_TELEMETRY_OPTOUT = "1" DOTNET_SKIP_FIRST_TIME_EXPERIENCE = "1" [tools] -# "10": every project targets net10.0, so the tests and the build run on the .NET 10 runtime -dotnet = ["""{{ read_file(path='global.json') | split(pat='"version"') | nth(n=1) | split(pat='"') | nth(n=1) }}""", "10"] +dotnet = ["""{{ read_file(path='global.json') | split(pat='"version"') | nth(n=1) | split(pat='"') | nth(n=1) }}"""] gh = "latest" zizmor = "1" diff --git a/src/Laya.Cli/Laya.Cli.csproj b/src/Laya.Cli/Laya.Cli.csproj index 13928b6..07bfa6b 100644 --- a/src/Laya.Cli/Laya.Cli.csproj +++ b/src/Laya.Cli/Laya.Cli.csproj @@ -2,6 +2,10 @@ Exe + + + net11.0 Laya.Cli