From 3f13849c0fc9632518ddbb8c86833748a1c624da Mon Sep 17 00:00:00 2001 From: Michael Ludwig Date: Tue, 29 Jul 2025 09:21:03 +0200 Subject: [PATCH 1/6] RMTP-124 use nuke build --- .nuke/build.schema.json | 265 ++++++++++++++++++ .nuke/parameters.ci.json | 17 ++ .nuke/parameters.full.json | 17 ++ .nuke/parameters.json | 10 + .nuke/parameters.local.json | 17 ++ .nuke/parameters.nightly.json | 17 ++ Build/Build.cs | 201 +++++++++++++ Build/Build.csproj | 148 ++-------- Build/Build.licenseheader | 1 - Build/Customizations/Configuration.props | 12 - Build/Customizations/Databases.cs | 41 +++ .../Customizations/Local/Configuration.props | 10 - .../Local/Configuration.targets | 31 -- Build/Customizations/Overrides.targets | 45 --- Build/Customizations/Projects.props | 42 --- .../ReleaseProcessScript.config | 44 --- .../Server/Configuration.targets | 27 -- Build/How-to-Release.md | 14 - Build/Remotion.Local.build | 140 --------- Build/Remotion.Server.build | 129 --------- Build/Remotion.build | 180 ------------ Build/app.config | 11 - Build/packages.config | 24 -- Build/teamcity.properties | 1 - Core/Core.csproj | 4 + Directory.Packages.props | 3 + 26 files changed, 612 insertions(+), 839 deletions(-) create mode 100644 .nuke/build.schema.json create mode 100644 .nuke/parameters.ci.json create mode 100644 .nuke/parameters.full.json create mode 100644 .nuke/parameters.json create mode 100644 .nuke/parameters.local.json create mode 100644 .nuke/parameters.nightly.json create mode 100644 Build/Build.cs delete mode 100644 Build/Build.licenseheader delete mode 100644 Build/Customizations/Configuration.props create mode 100644 Build/Customizations/Databases.cs delete mode 100644 Build/Customizations/Local/Configuration.props delete mode 100644 Build/Customizations/Local/Configuration.targets delete mode 100644 Build/Customizations/Overrides.targets delete mode 100644 Build/Customizations/Projects.props delete mode 100644 Build/Customizations/ReleaseProcessScript.config delete mode 100644 Build/Customizations/Server/Configuration.targets delete mode 100644 Build/How-to-Release.md delete mode 100644 Build/Remotion.Local.build delete mode 100644 Build/Remotion.Server.build delete mode 100644 Build/Remotion.build delete mode 100644 Build/app.config delete mode 100644 Build/packages.config delete mode 100644 Build/teamcity.properties diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json new file mode 100644 index 000000000..f78fc8a52 --- /dev/null +++ b/.nuke/build.schema.json @@ -0,0 +1,265 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/build", + "title": "Build Schema", + "definitions": { + "build": { + "type": "object", + "properties": { + "AdditionalBuildMetadata": { + "type": "string", + "description": "Additional build metadata that is attached to the assembly informational version" + }, + "AssemblySigningKeyFile": { + "type": "string", + "description": "Path to the key file containing the signing key" + }, + "Configurations": { + "type": "array", + "description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)", + "items": { + "type": "string" + } + }, + "Continue": { + "type": "boolean", + "description": "Indicates to continue a previously failed build attempt" + }, + "DependDBNugetConfig": { + "type": "string" + }, + "DependDBNuGetSources": { + "type": "string" + }, + "DependDBProjectBranch": { + "type": "string" + }, + "DependDBProjectImportNotificationMailAddress": { + "type": "string" + }, + "DependDBProjectImportNotificationMailAddressCc": { + "type": "string" + }, + "DependDBProjectName": { + "type": "string" + }, + "DependDBProjectVersion": { + "type": "string" + }, + "DependDBRetentionTime": { + "type": "string" + }, + "DependDBTargetFramework": { + "type": "string" + }, + "DependDBTrackedReferences": { + "type": "string" + }, + "Help": { + "type": "boolean", + "description": "Shows the help text for this build assembly" + }, + "Host": { + "type": "string", + "description": "Host for execution. Default is 'automatic'", + "enum": [ + "AppVeyor", + "AzurePipelines", + "Bamboo", + "Bitbucket", + "Bitrise", + "GitHubActions", + "GitLab", + "Jenkins", + "Rider", + "SpaceAutomation", + "TeamCity", + "Terminal", + "TestHost", + "TravisCI", + "VisualStudio", + "VSCode" + ] + }, + "LogFolder": { + "type": "string", + "description": "Path to the log folder where log files are put" + }, + "NoLogo": { + "type": "boolean", + "description": "Disables displaying the NUKE logo" + }, + "OutputFolder": { + "type": "string", + "description": "Path to the output folder where build artifacts are put" + }, + "Partition": { + "type": "string", + "description": "Partition to use on CI" + }, + "Plan": { + "type": "boolean", + "description": "Shows the execution plan (HTML)" + }, + "Profile": { + "type": "array", + "description": "Defines the profiles to load", + "items": { + "type": "string" + } + }, + "Root": { + "type": "string", + "description": "Root directory during build execution" + }, + "Skip": { + "type": "array", + "description": "List of targets to be skipped. Empty list skips all dependencies", + "items": { + "type": "string", + "enum": [ + "AddRemotionPackagingArtefacts", + "Build", + "CIBuild", + "Clean", + "CreateTestMatrix", + "CreateTestPlan", + "DetermineBuildMetadata", + "DetermineProjectMetadata", + "DetermineTestResources", + "FullBuild", + "GenerateDependDBOutput", + "GenerateSbom", + "NightlyBuild", + "Pack", + "Restore", + "Test", + "VerifyTestParameters" + ] + } + }, + "Solution": { + "type": "string", + "description": "Path to a solution file that is automatically loaded" + }, + "Target": { + "type": "array", + "description": "List of targets to be invoked. Default is '{default_target}'", + "items": { + "type": "string", + "enum": [ + "AddRemotionPackagingArtefacts", + "Build", + "CIBuild", + "Clean", + "CreateTestMatrix", + "CreateTestPlan", + "DetermineBuildMetadata", + "DetermineProjectMetadata", + "DetermineTestResources", + "FullBuild", + "GenerateDependDBOutput", + "GenerateSbom", + "NightlyBuild", + "Pack", + "Restore", + "Test", + "VerifyTestParameters" + ] + } + }, + "TempFolder": { + "type": "string", + "description": "Path to the temp folder where temporary build files are put" + }, + "TestBrowsers": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "Chrome", + "Edge", + "Firefox", + "NoBrowser" + ] + } + }, + "TestConfigurations": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "Debug", + "Release" + ] + } + }, + "TestExecutionRuntimes": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "Docker_Win_NET8_0", + "EnforcedLocalMachine(Docker_Win_NET8_0)", + "LocalMachine" + ] + } + }, + "TestFilter": { + "type": "string", + "description": "Executes only tests that match the specified test filter" + }, + "TestPlatforms": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "x64", + "x86" + ] + } + }, + "TestSqlServers": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "NoDB", + "SqlServer2016", + "SqlServer2017", + "SqlServer2019", + "SqlServer2022", + "SqlServerDefault" + ] + } + }, + "TestTargetRuntimes": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "NET8_0" + ] + } + }, + "UseReleaseVersioning": { + "type": "boolean", + "description": "Uses release instead of debug versioning when determining the build versions" + }, + "VcsUrlTemplate": { + "type": "string" + }, + "Verbosity": { + "type": "string", + "description": "Logging verbosity during build execution. Default is 'Normal'", + "enum": [ + "Minimal", + "Normal", + "Quiet", + "Verbose" + ] + } + } + } + } +} diff --git a/.nuke/parameters.ci.json b/.nuke/parameters.ci.json new file mode 100644 index 000000000..6de66fbe8 --- /dev/null +++ b/.nuke/parameters.ci.json @@ -0,0 +1,17 @@ +{ + "$schema": "./build.schema.json", + "Target": [ "CIBuild" ], + "TestConfigurations": [ "Debug" ], + "TestExecutionRuntimes": [ "Docker_Win_NET48", "EnforcedLocalMachine" ], + "TestPlatforms": [ "x86" ], + "TestTargetRuntimes": [ "NET48" ], + "TestBrowsers": [ "NoBrowser" ], + "TestSqlServers": [ "NoDB" ], + "SkipCleanProjects": "False", + "SkipTests": "False", + "SkipDocumentation": "True", + "SkipNuGetOrg": "True", + "SkipSourceLinks": "True", + "SkipNuGet": "True", + "SkipDependDB": "True" +} \ No newline at end of file diff --git a/.nuke/parameters.full.json b/.nuke/parameters.full.json new file mode 100644 index 000000000..9b951871b --- /dev/null +++ b/.nuke/parameters.full.json @@ -0,0 +1,17 @@ +{ + "$schema": "./build.schema.json", + "Target": [ "FullBuild" ], + "TestConfigurations": [ "Debug", "Release" ], + "TestExecutionRuntimes": [ "Docker_Win_NET48", "EnforcedLocalMachine" ], + "TestPlatforms": [ "x86", "x64" ], + "TestTargetRuntimes": [ "NET48" ], + "TestBrowsers": [ "NoBrowser" ], + "TestSqlServers": [ "NoDB" ], + "SkipCleanProjects": "False", + "SkipTests": "False", + "SkipDocumentation": "False", + "SkipNuGetOrg": "False", + "SkipSourceLinks": "False", + "SkipNuGet": "False", + "SkipDependDB": "False" +} \ No newline at end of file diff --git a/.nuke/parameters.json b/.nuke/parameters.json new file mode 100644 index 000000000..48b51b461 --- /dev/null +++ b/.nuke/parameters.json @@ -0,0 +1,10 @@ +{ + "$schema": "./build.schema.json", + "DependDBProjectName": "re-motion Framework: TypePipe (www.re-motion.org)", + "DependDBRetentionTime": "10", + "DependDBProjectBranch": "Main", + "DependDBProjectImportNotificationMailAddressCc": "nonexistent@nonexistent.nonexistent", + "DependDBTrackedReferences": "Remotion.*", + "DependDBNugetConfig": "~/nuget.config", + "DependDBTargetFramework": "net45" +} diff --git a/.nuke/parameters.local.json b/.nuke/parameters.local.json new file mode 100644 index 000000000..70356f38f --- /dev/null +++ b/.nuke/parameters.local.json @@ -0,0 +1,17 @@ +{ + "$schema": "./build.schema.json", + "Target": [ "LocalBuild" ], + "TestConfigurations": [ "Debug" ], + "TestExecutionRuntimes": [ "LocalMachine" ], + "TestPlatforms": [ "x86" ], + "TestTargetRuntimes": [ "NET48" ], + "TestBrowsers": [ "NoBrowser" ], + "TestSqlServers": [ "NoDB" ], + "SkipCleanProjects": "False", + "SkipTests": "False", + "SkipDocumentation": "True", + "SkipNuGetOrg": "True", + "SkipSourceLinks": "True", + "SkipNuGet": "True", + "SkipDependDB": "True" +} \ No newline at end of file diff --git a/.nuke/parameters.nightly.json b/.nuke/parameters.nightly.json new file mode 100644 index 000000000..e484531c1 --- /dev/null +++ b/.nuke/parameters.nightly.json @@ -0,0 +1,17 @@ +{ + "$schema": "./build.schema.json", + "Target": [ "NightlyBuild" ], + "TestConfigurations": [ "Debug", "Release" ], + "TestExecutionRuntimes": [ "Docker_Win_NET48", "EnforcedLocalMachine" ], + "TestPlatforms": [ "x86", "x64" ], + "TestTargetRuntimes": [ "NET48" ], + "TestBrowsers": [ "NoBrowser" ], + "TestSqlServers": [ "NoDB" ], + "SkipCleanProjects": "False", + "SkipTests": "False", + "SkipDocumentation": "False", + "SkipNuGetOrg": "False", + "SkipSourceLinks": "False", + "SkipNuGet": "False", + "SkipDependDB": "False" +} \ No newline at end of file diff --git a/Build/Build.cs b/Build/Build.cs new file mode 100644 index 000000000..2a050a4f7 --- /dev/null +++ b/Build/Build.cs @@ -0,0 +1,201 @@ +// This file is part of the re-motion Core Framework (www.re-motion.org) +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// The re-motion Core Framework is free software; you can redistribute it +// and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// re-motion is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with re-motion; if not, see http://www.gnu.org/licenses. +// +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Linq; +using Customizations; +using JetBrains.Annotations; +using NuGet.Versioning; +using Nuke.Common; +using Nuke.Common.IO; +using Nuke.Common.ProjectModel; +using Remotion.BuildScript; +using Remotion.BuildScript.Components; +using Remotion.BuildScript.GenerateSbom; +using Remotion.BuildScript.Test; +using Remotion.BuildScript.Test.Dimensions; +using Remotion.BuildScript.Test.Runtimes; +using static Customizations.Databases; +using static Remotion.BuildScript.Test.Dimensions.Configurations; +using static Remotion.BuildScript.Test.Dimensions.ExecutionRuntimes; +using static Remotion.BuildScript.Test.Dimensions.OperatingSystems; +using static Remotion.BuildScript.Test.Dimensions.Platforms; +using static Remotion.BuildScript.Test.Dimensions.TargetFrameworks; + +// ReSharper disable RedundantTypeArgumentsOfMethod + +class Build : RemotionBuild, IDependDB, ITest +{ + + [Parameter(ValueProviderMember = nameof(SupportedTestSqlServers), Separator = "+")] + public string[] TestSqlServers { get; set; } = []; + + [CanBeNull] private TestMatrix _databaseTestMatrix; + [CanBeNull] private TestMatrix _normalTestMatrix; + + + public static int Main () => Execute(); + + [UsedImplicitly] + public Target AddRemotionPackagingArtefacts => _ => _ + .TriggeredBy() + .Executes(() => + { + // Create NPM package + var packageJsonPath = ((IBaseBuild)this).Solution.Directory / "Remotion" / "Web" / "Dependencies.JavaScript" / "package.json"; + Assert.FileExists(packageJsonPath); + + var outputPackageJson = ((IBaseBuild)this).OutputFolder / "Npm" / "remotion.dependencies" / "package.json"; + AddVersionToPackageJson(packageJsonPath, outputPackageJson, ((IBuildMetadata)this).BuildMetadataPerConfiguration.First().Value.Version); + }); + + public override ISbomGeneratorBuilder ConfigureSbomGenerationInfoBuilder (Solution solution) + { + var version = ((IBuildMetadata)this).GetBaseVersion(); + + var semanticVersion = SemanticVersion.Parse(version); + var shortenedVersion = $"{semanticVersion.Major}.{semanticVersion.Minor}.{semanticVersion.Patch}"; + + var blacklistedProjects = new[] + { + "Web.Dependencies.Javascript", + "*.Analyzers*" + // We disregard test projects when generating the sbom already, so these are not required here. + }; + + var packageJsonPath = solution.Directory / "Remotion" / "Web" / "Dependencies.JavaScript" / "package.json"; + var packageJsonWithVersion = TemporaryDirectory / "sbom" / "package.json"; + + AddVersionToPackageJson(packageJsonPath, packageJsonWithVersion, shortenedVersion); + + var outputFolderPath = ((IBaseBuild)this).OutputFolder / "SBOM"; + outputFolderPath.CreateDirectory(); + + var outputSbomPath = outputFolderPath / "re-motion.sbom.json"; + + // We do not require github auth because we do not do enough requests for licenses and package infos + var builder = new SolutionSbomGeneratorBuilder(solution, semanticVersion.ToString(), TemporaryDirectory / "sbomGeneration", outputSbomPath, "", "") + .WithProjectsBlackListed(blacklistedProjects) + .WithPackageJsonFile(packageJsonWithVersion); + + return builder; + } + + public override void ConfigureProjects (ProjectsBuilder projects) + { + [CanBeNull] + static TestConfiguration CreateTestConfiguration ( + [CanBeNull] TestMatrix testMatrix, + ITestExecutionRuntimeFactory testExecutionRuntimeFactory, + ImmutableArray testExecutionWrappers) + { + return testMatrix != null + ? new TestConfiguration(testExecutionRuntimeFactory, testMatrix, testExecutionWrappers) + : null; + } + + var testExecutionRuntimeFactory = new DefaultTestExecutionRuntimeFactory(NullDockerRunSettingsCustomizer.Instance); + + // NOTE: Test matrices might be null if the CreateTestMatrix step was not called. + // This is intended behavior as we want to support partial builds. + // If there is no test matrix, the test configuration will be null as well. + + var normalTestConfiguration = CreateTestConfiguration( + _normalTestMatrix, + testExecutionRuntimeFactory, + ImmutableArray.Empty); + + projects.AddReleaseProject("Core"); + projects.AddReleaseProject("Development"); + projects.AddReleaseProject("Documentation"); + + projects.AddUnitTestProject("Core.UnitTests", normalTestConfiguration); + projects.AddUnitTestProject("IntegrationTests", normalTestConfiguration); + } + + public override void ConfigureSupportedTestDimensions (SupportedTestDimensionsBuilder supportedTestDimensions) + { + supportedTestDimensions.AddOperatingSystemsDimension(); + supportedTestDimensions.AddSupportedDimension(LocalMachine, Docker_Win_NET48); + supportedTestDimensions.AddSupportedDimension(NET48); + supportedTestDimensions.AddSupportedDimension(Debug, Release); + supportedTestDimensions.AddSupportedDimension(x64, x86); + supportedTestDimensions.AddSupportedDimension(NoDB); + } + + public override void ConfigureEnabledTestDimensions (EnabledTestDimensionsBuilder enabledTestDimensions) + { + base.ConfigureEnabledTestDimensions(enabledTestDimensions); + + enabledTestDimensions.AddEnabledOperatingSystems(); + + if (SupportedTestDimensions.IsSupported()) + { + var testSqlServers = SupportedTestDimensions.ParseTestDimensionValuesOrDefault(TestSqlServers) + ?? throw CreateConfigurationException(); + + enabledTestDimensions.AddEnabledDimension(testSqlServers); + } + + return; + + static InvalidOperationException CreateConfigurationException () + where T : TestDimension + { + return new InvalidOperationException($"The configuration for test dimension '{typeof(T).Name}' cannot be empty."); + } + } + + public override void ConfigureTestMatrix (TestMatricesBuilder builder) + { + + _normalTestMatrix = builder.AddTestMatrix ( + "NormalTestMatrix", + new TestDimension[,] + { + { Windows, Docker_Win_NET48, NET48, NoDB, Debug, x86 }, + { Windows, Docker_Win_NET48, NET48, NoDB, Release, x86 }, + { Windows, Docker_Win_NET48, NET48, NoDB, Debug, x64 }, + { Windows, Docker_Win_NET48, NET48, NoDB, Release, x64 }, + + // Local--> + { Windows, LocalMachine, NET48, NoDB, Debug, x86 }, + { Windows, LocalMachine, NET48, NoDB, Release, x86 }, + { Windows, LocalMachine, NET48, NoDB, Debug, x64 }, + { Windows, LocalMachine, NET48, NoDB, Release, x64 }, + + // Exercise compatibility between installed .NET version, target framework and SQL Server + { Windows, Docker_Win_NET48, NET472, NoDB, Release, x64 }, + { Windows, Docker_Win_NET48, NET462, NoDB, Release, x64 }, + { Windows, Docker_Win_NET472, NET472, NoDB, Release, x64 }, + { Windows, Docker_Win_NET472, NET462, NoDB, Release, x64 }, + { Windows, Docker_Win_NET462, NET462, NoDB, Release, x64 }, + }, + allowEmpty: true); + } + + + protected IEnumerable SupportedTestSqlServers => GetTestDimensionValueList(); + + private void AddVersionToPackageJson (AbsolutePath packageJsonPath, AbsolutePath duplicatedPackageJsonPath, string version) + { + var packageJsonContent = packageJsonPath.ReadAllText().Replace("$version$", version); + + duplicatedPackageJsonPath.WriteAllText(packageJsonContent); + } +} diff --git a/Build/Build.csproj b/Build/Build.csproj index bfe2f74ce..714790768 100644 --- a/Build/Build.csproj +++ b/Build/Build.csproj @@ -1,137 +1,29 @@ - - - + + - Debug - AnyCPU - {6A1A04E3-5411-4F8C-BCB8-0FE00884DC5A} - Library - Properties - Build - Build - v4.7.2 - 512 - cd8904e3 - + Exe + net8.0 + + CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006 + true + .. + .. + 1 + false - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - .BuildProject - - - - - - - - - - - - - - - - - - + - + + + - - ..\packages\JetBrains.Annotations.2019.1.3\lib\net20\JetBrains.Annotations.dll - - - ..\packages\Microsoft.Build.Framework.17.2.0\lib\net472\Microsoft.Build.Framework.dll - - - ..\packages\Microsoft.Build.Utilities.Core.17.2.0\lib\net472\Microsoft.Build.Utilities.Core.dll - - - ..\packages\Microsoft.IO.Redist.6.0.0\lib\net472\Microsoft.IO.Redist.dll - - - ..\packages\Microsoft.NET.StringTools.1.0.0\lib\net472\Microsoft.NET.StringTools.dll - - - ..\packages\Remotion.BuildScript.3.0.0-alpha.5\lib\net472\Remotion.BuildScript.dll - - - - ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll - - - ..\packages\System.Collections.Immutable.5.0.0\lib\net461\System.Collections.Immutable.dll - - - - ..\packages\System.Configuration.ConfigurationManager.4.7.0\lib\net461\System.Configuration.ConfigurationManager.dll - - - - - - ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll - - - - - ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - - ..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll - - - - ..\packages\System.Security.AccessControl.4.7.0\lib\net461\System.Security.AccessControl.dll - - - ..\packages\System.Security.Permissions.4.7.0\lib\net461\System.Security.Permissions.dll - - - ..\packages\System.Security.Principal.Windows.4.7.0\lib\net461\System.Security.Principal.Windows.dll - - - - - - + + + - + - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - + \ No newline at end of file diff --git a/Build/Build.licenseheader b/Build/Build.licenseheader deleted file mode 100644 index f5059b633..000000000 --- a/Build/Build.licenseheader +++ /dev/null @@ -1 +0,0 @@ -extensions: .build .targets .nuspec .ps1 diff --git a/Build/Customizations/Configuration.props b/Build/Customizations/Configuration.props deleted file mode 100644 index 34f8d86ed..000000000 --- a/Build/Customizations/Configuration.props +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/Build/Customizations/Databases.cs b/Build/Customizations/Databases.cs new file mode 100644 index 000000000..b3d5b8eaf --- /dev/null +++ b/Build/Customizations/Databases.cs @@ -0,0 +1,41 @@ +// This file is part of the re-motion Core Framework (www.re-motion.org) +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// The re-motion Core Framework is free software; you can redistribute it +// and/or modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// re-motion is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with re-motion; if not, see http://www.gnu.org/licenses. +// +using Remotion.BuildScript.Test; + +namespace Customizations; + +public class Databases : TestDimension +{ + public static readonly Databases NoDB = new(nameof(NoDB)); + + public bool HasSpecificVersion { get; } + + public int Version { get; } + + public Databases (string value) + : base(nameof(Databases), value) + { + HasSpecificVersion = false; + } + + public Databases (string value, int version) + : base(nameof(Databases), value) + { + HasSpecificVersion = true; + Version = version; + } +} diff --git a/Build/Customizations/Local/Configuration.props b/Build/Customizations/Local/Configuration.props deleted file mode 100644 index 46d8579fd..000000000 --- a/Build/Customizations/Local/Configuration.props +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Unavailable - Unavailable - Unavailable - - - \ No newline at end of file diff --git a/Build/Customizations/Local/Configuration.targets b/Build/Customizations/Local/Configuration.targets deleted file mode 100644 index 568ac0b2e..000000000 --- a/Build/Customizations/Local/Configuration.targets +++ /dev/null @@ -1,31 +0,0 @@ - - - - - LocalMachine - NET48 - - - - - - - - - LocalMachine - NET48 - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Build/Customizations/Overrides.targets b/Build/Customizations/Overrides.targets deleted file mode 100644 index 3aa6b28a9..000000000 --- a/Build/Customizations/Overrides.targets +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - <_nunitRunnerFolderPath>$(TempDirectory)SharedSourceBuildNunitCopy\ - - - - - - <_filesToBeCopied Include="$(NUnitToolPath)**\*.*" /> - <_filesToBeCopied Include="%(NUnitExtensionsPaths.Identity)**\*.*" /> - - - - - - \ No newline at end of file diff --git a/Build/Customizations/Projects.props b/Build/Customizations/Projects.props deleted file mode 100644 index 87165e358..000000000 --- a/Build/Customizations/Projects.props +++ /dev/null @@ -1,42 +0,0 @@ - - - - - Win_NET48 + NET48 + NoBrowser + NoDB + Debug + x86; - Win_NET48 + NET48 + NoBrowser + NoDB + Release + x86; - Win_NET48 + NET48 + NoBrowser + NoDB + Debug + x64; - Win_NET48 + NET48 + NoBrowser + NoDB + Release + x64; - - - LocalMachine + NET48 + NoBrowser + NoDB + Debug + x86; - LocalMachine + NET48 + NoBrowser + NoDB + Release + x86; - LocalMachine + NET48 + NoBrowser + NoDB + Debug + x64; - LocalMachine + NET48 + NoBrowser + NoDB + Release + x64; - - - Win_NET48 + NET472 + NoBrowser + NoDB + Release + x64; - Win_NET48 + NET462 + NoBrowser + NoDB + Release + x64; - Win_NET472 + NET472 + NoBrowser + NoDB + Release + x64; - Win_NET472 + NET462 + NoBrowser + NoDB + Release + x64; - Win_NET462 + NET462 + NoBrowser + NoDB + Release + x64; - - - - - True - - - True - True - - - True - - - $(NormalTestConfiguration) - - - $(NormalTestConfiguration) - - - \ No newline at end of file diff --git a/Build/Customizations/ReleaseProcessScript.config b/Build/Customizations/ReleaseProcessScript.config deleted file mode 100644 index 160b3f382..000000000 --- a/Build/Customizations/ReleaseProcessScript.config +++ /dev/null @@ -1,44 +0,0 @@ - - - - https://jira.rubicon.eu/ - RMTP - yes - - - origin - BitBucket - - - Build/Customizations/Version.props - - - - - C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\msbuild.exe - - - - - Build\Remotion.Local.build - /t:UpdateAssemblyInfosForRelease - /property:Version={version} - - Update metadata to version '{version}'. - - - - - - Build\Remotion.Local.build - /t:UpdateAssemblyInfosForDevelopment - /property:Version={version} - - Update metadata to version '{version}'. - - - - - - - \ No newline at end of file diff --git a/Build/Customizations/Server/Configuration.targets b/Build/Customizations/Server/Configuration.targets deleted file mode 100644 index b810aeca7..000000000 --- a/Build/Customizations/Server/Configuration.targets +++ /dev/null @@ -1,27 +0,0 @@ - - - - - Win_NET48 - NET48 - - - - - - - - - Win_NET48+Win_NET472+Win_NET462 - NET48+NET472+NET462 - - True - - True - - - - - - - \ No newline at end of file diff --git a/Build/How-to-Release.md b/Build/How-to-Release.md deleted file mode 100644 index 308e60780..000000000 --- a/Build/How-to-Release.md +++ /dev/null @@ -1,14 +0,0 @@ -# Install Release Process Automation Tool - -`dotnet tool install Remotion.ReleaseProcessAutomation -g --add-source https://nuget.re-motion.org/nuget/re-motion-infrastructure/ --prerelease` - -# Perform a Release - -On the commandline, use `releasetool` to start the process. - -# Reference Section - -`.BuildProject`: located in the solution root. Indicates the location of the configuration file. - -`Build/Customizations/releaseProcessScript.config`: The release tool configuration file. -Contains the MSBuild version and other solution specific details relevant for releasing a new version. \ No newline at end of file diff --git a/Build/Remotion.Local.build b/Build/Remotion.Local.build deleted file mode 100644 index ad4d2cccb..000000000 --- a/Build/Remotion.Local.build +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - noreply@localhost.net - http://localhost/{0} - - - - Unavailable - - - - - Debug - x86 - NoDB - NoBrowser - LocalMachine - NET48 - - False - False - True - True - True - True - True - - - - - - Debug+Release - x64 - NoDB - NoBrowser - LocalMachine - NET48 - - False - False - True - True - True - False - False - - - - - - Debug - False - - - - - - Debug+Release - False - - - - - - Debug - False - False - - - - - - False - True - True - True - True - True - True - - - - - - - - <_formattedDateTime>$([System.DateTime]::Now.ToString("yyMMdd-HHmmss")) - <_version>$(Version.Split('-')[0]) - $(_version)-x.9.$(_formattedDateTime) - True - - - - - - - - <_version>$(Version.Split('-')[0]) - - $(_version)-x.9 - - False - - - - - - - - - - - - - - diff --git a/Build/Remotion.Server.build b/Build/Remotion.Server.build deleted file mode 100644 index 5bc9c57f3..000000000 --- a/Build/Remotion.Server.build +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - $(teamcity_build_checkoutdir)\ - $(build_vcs_number) - $(build_number) - - $(BuildRootDirectory)log\ - $(BuildRootDirectory)working\ - $(BuildRootDirectory)output\ - $(BuildRootDirectory)temp\ - - $(SecureNetworkShare)\remotion.snk - - - - - - - - Commit-$(CommitID) - - - - - - Debug - x86 - NoDB - NoBrowser - Win_NET48+EnforcedLocalMachine - NET48 - - False - False - True - True - True - True - True - - - - - - - Debug+Release - x86+x64 - NoDB - NoBrowser - Win_NET48+EnforcedLocalMachine - NET48 - - False - False - False - False - False - False - False - - - - - - - - - - - - - - - - - - - - - - <_version>$(Version.Split('-')[0]) - $(_version)-x.1.$(BuildNumber) - True - - - - - - - - - - - - - - - - - - diff --git a/Build/Remotion.build b/Build/Remotion.build deleted file mode 100644 index c31c80475..000000000 --- a/Build/Remotion.build +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - - - $(MSBuildProjectDirectory)\..\packages\ - $(PackagesDirectory)DependDB.BuildProcessor.2.0.0\tools\ - $(PackagesDirectory)DependDB.BuildProcessor.NuGetPreProcessor.2.0.0\tools\ - $(PackagesDirectory)NUnit.ConsoleRunner.3.15.5\tools\ - $(PackagesDirectory)NuGet.CommandLine.3.5.0\tools\ - $(PackagesDirectory)NuGet.for.MSBuild.1.4.3\build\ - $(PackagesDirectory)Remotion.BuildScript.3.0.0-alpha.5\BuildTargets\ - $(RemotionBuildScriptTasksPath)..\lib\net472\ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(MSBuildProjectDirectory)\Customizations\ - - - - - - - - - - - - $(MSBuildProjectDirectory)\..\ - $(MSBuildProjectDirectory)\BuildOutput\ - $(OutputDirectory)log\ - $(OutputDirectory)temp\ - - $(SolutionDirectory)remotion.snk - - - False - - - - - - SolutionKeyFile=$(SolutionKeyFile); - SolutionDirectory=$(SolutionDirectory); - OutputDirectory=$(OutputDirectory); - TempDirectory=$(TempDirectory); - LogDirectory=$(LogDirectory); - Version=$(Version); - AdditionalBuildMetadata=$(AdditionalBuildMetadata); - VcsUrlTemplate=$(VcsUrlTemplate); - VcsUrlRequiresWindowsCredentials=$(VcsUrlRequiresWindowsCredentials); - Platforms=$(Platforms); - DatabaseSystems=$(DatabaseSystems); - Browsers=$(Browsers); - ExecutionRuntimes=$(ExecutionRuntimes); - TargetRuntimes=$(TargetRuntimes); - TestCategoriesToExclude=$(TestCategoriesToExclude); - - - - - - - - - - CleanProjects - - RunTests - - GenerateDocumentation - - CreateNuGetPackagesWithSymbolServerSupport - - InsertSourceLinks - - CreateNuGetPackagesWithDebugSymbols - - ProcessForDependDB - - - - - LogConfiguration; - $(CleanProjectsTarget); - BuildReleaseProjects; - BuildTestProjects; - $(RunTestsTarget); - $(GenerateDocumentationTarget); - $(PackageNuGetOrgTarget); - $(SourceLinkTarget); - $(PackageNuGetTarget); - $(DependDBTarget); - RestoreBackupFiles; - - - - - - - - - - - <_configurations>$([MSBuild]::Unescape($(Configurations.Replace('+',';')))) - - - - <_configurationIDs Remove="@(_configurationIDs)" /> - <_configurationIDs Include="$(_configurations)" /> - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Build/app.config b/Build/app.config deleted file mode 100644 index 1696df668..000000000 --- a/Build/app.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/Build/packages.config b/Build/packages.config deleted file mode 100644 index 7e178c5c8..000000000 --- a/Build/packages.config +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Build/teamcity.properties b/Build/teamcity.properties deleted file mode 100644 index eddad5ef1..000000000 --- a/Build/teamcity.properties +++ /dev/null @@ -1 +0,0 @@ -MSBuildVersion=17.0 \ No newline at end of file diff --git a/Core/Core.csproj b/Core/Core.csproj index 2e1fad7b8..2bb49a369 100644 --- a/Core/Core.csproj +++ b/Core/Core.csproj @@ -49,4 +49,8 @@ Key features: + + + + diff --git a/Directory.Packages.props b/Directory.Packages.props index 05e57c9f5..18efe2b29 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -10,6 +10,9 @@ + + + \ No newline at end of file From 39694f403f5d85d04c4248bedd67d2abd68b6551 Mon Sep 17 00:00:00 2001 From: Michael Ludwig Date: Tue, 29 Jul 2025 09:48:08 +0200 Subject: [PATCH 2/6] replace build.cmd --- Build.cmd | 118 +++--------------------------------------------------- build.ps1 | 74 ++++++++++++++++++++++++++++++++++ build.sh | 67 +++++++++++++++++++++++++++++++ 3 files changed, 147 insertions(+), 112 deletions(-) create mode 100644 build.ps1 create mode 100644 build.sh diff --git a/Build.cmd b/Build.cmd index 75682805e..b08cc590f 100644 --- a/Build.cmd +++ b/Build.cmd @@ -1,113 +1,7 @@ -@echo off -pushd %~dp0 +:; set -eo pipefail +:; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) +:; ${SCRIPT_DIR}/build.sh "$@" +:; exit $? -set program-path=%ProgramFiles% -set program-pathX86=%ProgramFiles(x86)% -if not exist "%program-pathX86%" set program-pathX86=%program-path% -set msbuild="%program-pathX86%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe" -if not exist %msbuild% set msbuild="%program-path%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe" -if not exist %msbuild% set msbuild="%program-path%\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\MSBuild.exe" -if not exist %msbuild% set msbuild="%program-path%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" - -set log-dir=build\BuildOutput\log -set nuget-bin=build\BuildOutput\temp\nuget-bin -set nuget=%nuget-bin%\nuget.exe -set nuget-download=powershell.exe -NoProfile -Command "& {(New-Object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe','%nuget%')}" -set solution=Remotion-TypePipe.sln - -if not exist remotion.snk goto nosnk - -if not [%1]==[] goto %1 - -echo Welcome to the re-motion build tool! -echo. -echo Using %msbuild% -echo. -echo Choose your desired build: -echo [1] ... Test build ^(x86-debug^) -echo [2] ... Full build ^(x86-debug/release, x64-debug/release, create packages^) -echo [3] ... Docs build ^(x86-debug if not present, docs^) -echo Requires Sandcastle Help File Builder to be installed! -echo [4] ... Package ^(create NuGet packages in .\Build\BuildOutput^) -echo [5] ... Run DependDB -echo [6] ... Oops, nothing please - exit. -echo. - -choice /c:123456 /n /m "Your choice: " - -if %ERRORLEVEL%==1 goto run_test_build -if %ERRORLEVEL%==2 goto run_full_build -if %ERRORLEVEL%==3 goto run_docs_build -if %ERRORLEVEL%==4 goto run_pkg_build -if %ERRORLEVEL%==5 goto run_dependdb -if %ERRORLEVEL%==6 goto run_exit -goto build_succeeded - -:run_test_build -mkdir %log-dir% -mkdir %nuget-bin% -%nuget-download% -%nuget% restore %solution% -NonInteractive -%msbuild% build\Remotion.Local.build /t:TestBuild /maxcpucount /verbosity:normal /flp:verbosity=normal;logfile=build\BuildOutput\log\build.log -if not %ERRORLEVEL%==0 goto build_failed -goto build_succeeded - -:run_full_build -mkdir %log-dir% -mkdir %nuget-bin% -%nuget-download% -%nuget% restore %solution% -NonInteractive -%msbuild% build\Remotion.Local.build /t:FullBuildWithoutDocumentation /maxcpucount /verbosity:normal /flp:verbosity=normal;logfile=build\BuildOutput\log\build.log -if not %ERRORLEVEL%==0 goto build_failed -goto build_succeeded - -:run_docs_build -mkdir %log-dir% -mkdir %nuget-bin% -%nuget-download% -%nuget% restore %solution% -NonInteractive -%msbuild% build\Remotion.Local.build /t:DocumentationBuild /maxcpucount /verbosity:minimal /flp:verbosity=normal;logfile=build\BuildOutput\log\build.log -if not %ERRORLEVEL%==0 goto build_failed -goto build_succeeded - -:run_pkg_build -mkdir %log-dir% -mkdir %nuget-bin% -%nuget-download% -%nuget% restore %solution% -NonInteractive -%msbuild% build\Remotion.Local.build /t:PackageBuild /maxcpucount /verbosity:minimal /flp:verbosity=normal;logfile=build\BuildOutput\log\build.log -if not %ERRORLEVEL%==0 goto build_failed -goto build_succeeded - -:run_dependdb -mkdir %log-dir% -mkdir %nuget-bin% -%nuget-download% -%nuget% restore %solution% -NonInteractive -%msbuild% build\Remotion.Local.build /t:DependDBBuild /maxcpucount /verbosity:normal /flp:verbosity=detailed;logfile=build\BuildOutput\log\build.log -if not %ERRORLEVEL%==0 goto build_failed -goto build_succeeded - -:run_exit -exit /b 0 - - -:build_failed -echo. -echo Building %solution% has failed. -start build\BuildOutput\log\build.log -pause -popd -exit /b 1 - -:build_succeeded -echo. -pause -popd -exit /b 0 - -:nosnk -echo remotion.snk does not exist. Please run Generate-Snk.cmd from a Visual Studio Command Prompt. -pause -popd -exit /b 2 +@ECHO OFF +powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %* diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 000000000..e6339c020 --- /dev/null +++ b/build.ps1 @@ -0,0 +1,74 @@ +[CmdletBinding()] +Param( + [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] + [string[]]$BuildArguments +) + +Write-Output "PowerShell $($PSVersionTable.PSEdition) version $($PSVersionTable.PSVersion)" + +Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { Write-Error $_ -ErrorAction Continue; exit 1 } +$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent + +########################################################################### +# CONFIGURATION +########################################################################### + +$BuildProjectFile = "$PSScriptRoot\build\Build.csproj" +$TempDirectory = "$PSScriptRoot\\.nuke\temp" + +$DotNetGlobalFile = "$PSScriptRoot\\global.json" +$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1" +$DotNetChannel = "STS" + +$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1 +$env:DOTNET_NOLOGO = 1 + +########################################################################### +# EXECUTION +########################################################################### + +function ExecSafe([scriptblock] $cmd) { + & $cmd + if ($LASTEXITCODE) { exit $LASTEXITCODE } +} + +# If dotnet CLI is installed globally and it matches requested version, use for execution +if ($null -ne (Get-Command "dotnet" -ErrorAction SilentlyContinue) -and ` + $(dotnet --version) -and $LASTEXITCODE -eq 0) { + $env:DOTNET_EXE = (Get-Command "dotnet").Path +} +else { + # Download install script + $DotNetInstallFile = "$TempDirectory\dotnet-install.ps1" + New-Item -ItemType Directory -Path $TempDirectory -Force | Out-Null + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + (New-Object System.Net.WebClient).DownloadFile($DotNetInstallUrl, $DotNetInstallFile) + + # If global.json exists, load expected version + if (Test-Path $DotNetGlobalFile) { + $DotNetGlobal = $(Get-Content $DotNetGlobalFile | Out-String | ConvertFrom-Json) + if ($DotNetGlobal.PSObject.Properties["sdk"] -and $DotNetGlobal.sdk.PSObject.Properties["version"]) { + $DotNetVersion = $DotNetGlobal.sdk.version + } + } + + # Install by channel or version + $DotNetDirectory = "$TempDirectory\dotnet-win" + if (!(Test-Path variable:DotNetVersion)) { + ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath } + } else { + ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath } + } + $env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe" + $env:PATH = "$DotNetDirectory;$env:PATH" +} + +Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)" + +if (Test-Path env:NUKE_ENTERPRISE_TOKEN) { + & $env:DOTNET_EXE nuget remove source "nuke-enterprise" > $null + & $env:DOTNET_EXE nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password $env:NUKE_ENTERPRISE_TOKEN > $null +} + +ExecSafe { & $env:DOTNET_EXE build --no-cache --force $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet } +ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments } diff --git a/build.sh b/build.sh new file mode 100644 index 000000000..259142b1f --- /dev/null +++ b/build.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash + +bash --version 2>&1 | head -n 1 + +set -eo pipefail +SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) + +########################################################################### +# CONFIGURATION +########################################################################### + +BUILD_PROJECT_FILE="$SCRIPT_DIR/Build/Build.csproj" +TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp" + +DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json" +DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh" +DOTNET_CHANNEL="STS" + +export DOTNET_CLI_TELEMETRY_OPTOUT=1 +export DOTNET_NOLOGO=1 + +########################################################################### +# EXECUTION +########################################################################### + +function FirstJsonValue { + perl -nle 'print $1 if m{"'"$1"'": "([^"]+)",?}' <<< "${@:2}" +} + +# If dotnet CLI is installed globally and it matches requested version, use for execution +if [ -x "$(command -v dotnet)" ] && dotnet --version &>/dev/null; then + export DOTNET_EXE="$(command -v dotnet)" +else + # Download install script + DOTNET_INSTALL_FILE="$TEMP_DIRECTORY/dotnet-install.sh" + mkdir -p "$TEMP_DIRECTORY" + curl -Lsfo "$DOTNET_INSTALL_FILE" "$DOTNET_INSTALL_URL" + chmod +x "$DOTNET_INSTALL_FILE" + + # If global.json exists, load expected version + if [[ -f "$DOTNET_GLOBAL_FILE" ]]; then + DOTNET_VERSION=$(FirstJsonValue "version" "$(cat "$DOTNET_GLOBAL_FILE")") + if [[ "$DOTNET_VERSION" == "" ]]; then + unset DOTNET_VERSION + fi + fi + + # Install by channel or version + DOTNET_DIRECTORY="$TEMP_DIRECTORY/dotnet-unix" + if [[ -z ${DOTNET_VERSION+x} ]]; then + "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --channel "$DOTNET_CHANNEL" --no-path + else + "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path + fi + export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet" + export PATH="$DOTNET_DIRECTORY:$PATH" +fi + +echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)" + +if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "$NUKE_ENTERPRISE_TOKEN" != "" ]]; then + "$DOTNET_EXE" nuget remove source "nuke-enterprise" &>/dev/null || true + "$DOTNET_EXE" nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password "$NUKE_ENTERPRISE_TOKEN" --store-password-in-clear-text &>/dev/null || true +fi + +"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet +"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@" From 50ef319144759d1696e151071cd97a410507c3a3 Mon Sep 17 00:00:00 2001 From: Michael Ludwig Date: Tue, 29 Jul 2025 13:55:46 +0200 Subject: [PATCH 3/6] fixes --- .nuke/build.schema.json | 28 +++++++--------------------- .nuke/parameters.json | 1 + Build/Build.cs | 14 +++----------- Remotion-TypePipe.sln | 2 -- 4 files changed, 11 insertions(+), 34 deletions(-) diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index f78fc8a52..e627430da 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -172,18 +172,6 @@ "type": "string", "description": "Path to the temp folder where temporary build files are put" }, - "TestBrowsers": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "Chrome", - "Edge", - "Firefox", - "NoBrowser" - ] - } - }, "TestConfigurations": { "type": "array", "items": { @@ -199,8 +187,9 @@ "items": { "type": "string", "enum": [ - "Docker_Win_NET8_0", - "EnforcedLocalMachine(Docker_Win_NET8_0)", + "Docker_Win_NET462", + "Docker_Win_NET472", + "Docker_Win_NET48", "LocalMachine" ] } @@ -224,12 +213,7 @@ "items": { "type": "string", "enum": [ - "NoDB", - "SqlServer2016", - "SqlServer2017", - "SqlServer2019", - "SqlServer2022", - "SqlServerDefault" + "NoDB" ] } }, @@ -238,7 +222,9 @@ "items": { "type": "string", "enum": [ - "NET8_0" + "NET462", + "NET472", + "NET48" ] } }, diff --git a/.nuke/parameters.json b/.nuke/parameters.json index 48b51b461..5f567ca49 100644 --- a/.nuke/parameters.json +++ b/.nuke/parameters.json @@ -1,5 +1,6 @@ { "$schema": "./build.schema.json", + "Solution": "Remotion-TypePipe.sln", "DependDBProjectName": "re-motion Framework: TypePipe (www.re-motion.org)", "DependDBRetentionTime": "10", "DependDBProjectBranch": "Main", diff --git a/Build/Build.cs b/Build/Build.cs index 2a050a4f7..26ddb6050 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -54,15 +54,7 @@ class Build : RemotionBuild, IDependDB, ITest [UsedImplicitly] public Target AddRemotionPackagingArtefacts => _ => _ .TriggeredBy() - .Executes(() => - { - // Create NPM package - var packageJsonPath = ((IBaseBuild)this).Solution.Directory / "Remotion" / "Web" / "Dependencies.JavaScript" / "package.json"; - Assert.FileExists(packageJsonPath); - - var outputPackageJson = ((IBaseBuild)this).OutputFolder / "Npm" / "remotion.dependencies" / "package.json"; - AddVersionToPackageJson(packageJsonPath, outputPackageJson, ((IBuildMetadata)this).BuildMetadataPerConfiguration.First().Value.Version); - }); + .Executes (() => { }); public override ISbomGeneratorBuilder ConfigureSbomGenerationInfoBuilder (Solution solution) { @@ -131,8 +123,8 @@ static TestConfiguration CreateTestConfiguration ( public override void ConfigureSupportedTestDimensions (SupportedTestDimensionsBuilder supportedTestDimensions) { supportedTestDimensions.AddOperatingSystemsDimension(); - supportedTestDimensions.AddSupportedDimension(LocalMachine, Docker_Win_NET48); - supportedTestDimensions.AddSupportedDimension(NET48); + supportedTestDimensions.AddSupportedDimension(LocalMachine, Docker_Win_NET48, Docker_Win_NET472, Docker_Win_NET462); + supportedTestDimensions.AddSupportedDimension(NET48, NET472, NET462); supportedTestDimensions.AddSupportedDimension(Debug, Release); supportedTestDimensions.AddSupportedDimension(x64, x86); supportedTestDimensions.AddSupportedDimension(NoDB); diff --git a/Remotion-TypePipe.sln b/Remotion-TypePipe.sln index 33795508a..481d17f27 100644 --- a/Remotion-TypePipe.sln +++ b/Remotion-TypePipe.sln @@ -47,9 +47,7 @@ Global {F6FAF727-9405-4BCC-9153-803F73853E67}.Release|Any CPU.ActiveCfg = Release|Any CPU {F6FAF727-9405-4BCC-9153-803F73853E67}.Release|Any CPU.Build.0 = Release|Any CPU {6A1A04E3-5411-4F8C-BCB8-0FE00884DC5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6A1A04E3-5411-4F8C-BCB8-0FE00884DC5A}.Debug|Any CPU.Build.0 = Debug|Any CPU {6A1A04E3-5411-4F8C-BCB8-0FE00884DC5A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6A1A04E3-5411-4F8C-BCB8-0FE00884DC5A}.Release|Any CPU.Build.0 = Release|Any CPU {CCF6D89F-A4A4-4A35-8324-B014F72C11BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CCF6D89F-A4A4-4A35-8324-B014F72C11BD}.Debug|Any CPU.Build.0 = Debug|Any CPU {CCF6D89F-A4A4-4A35-8324-B014F72C11BD}.Release|Any CPU.ActiveCfg = Release|Any CPU From 207e9edf453f2e4a97f38c510a8e041540ee4a28 Mon Sep 17 00:00:00 2001 From: Michael Ludwig Date: Tue, 29 Jul 2025 14:09:19 +0200 Subject: [PATCH 4/6] add enforcedLocalMachine to suported executionruntimes --- .nuke/build.schema.json | 1 + .nuke/parameters.local.json | 2 +- Build/Build.cs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index e627430da..2c0737f73 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -190,6 +190,7 @@ "Docker_Win_NET462", "Docker_Win_NET472", "Docker_Win_NET48", + "EnforcedLocalMachine", "LocalMachine" ] } diff --git a/.nuke/parameters.local.json b/.nuke/parameters.local.json index 70356f38f..d8d8788d7 100644 --- a/.nuke/parameters.local.json +++ b/.nuke/parameters.local.json @@ -1,6 +1,6 @@ { "$schema": "./build.schema.json", - "Target": [ "LocalBuild" ], + "Target": [ "CIBuild" ], "TestConfigurations": [ "Debug" ], "TestExecutionRuntimes": [ "LocalMachine" ], "TestPlatforms": [ "x86" ], diff --git a/Build/Build.cs b/Build/Build.cs index 26ddb6050..bff3fd40b 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -123,7 +123,7 @@ static TestConfiguration CreateTestConfiguration ( public override void ConfigureSupportedTestDimensions (SupportedTestDimensionsBuilder supportedTestDimensions) { supportedTestDimensions.AddOperatingSystemsDimension(); - supportedTestDimensions.AddSupportedDimension(LocalMachine, Docker_Win_NET48, Docker_Win_NET472, Docker_Win_NET462); + supportedTestDimensions.AddSupportedDimension(LocalMachine, EnforcedLocalMachine, Docker_Win_NET48, Docker_Win_NET472, Docker_Win_NET462); supportedTestDimensions.AddSupportedDimension(NET48, NET472, NET462); supportedTestDimensions.AddSupportedDimension(Debug, Release); supportedTestDimensions.AddSupportedDimension(x64, x86); From a55df361f84f710597662abf5d6b849b739751a7 Mon Sep 17 00:00:00 2001 From: Michael Ludwig Date: Tue, 29 Jul 2025 15:53:29 +0200 Subject: [PATCH 5/6] more fixes --- .nuke/parameters.json | 6 ++++-- Build/Build.cs | 32 -------------------------------- 2 files changed, 4 insertions(+), 34 deletions(-) diff --git a/.nuke/parameters.json b/.nuke/parameters.json index 5f567ca49..bdebee735 100644 --- a/.nuke/parameters.json +++ b/.nuke/parameters.json @@ -1,11 +1,13 @@ { "$schema": "./build.schema.json", "Solution": "Remotion-TypePipe.sln", - "DependDBProjectName": "re-motion Framework: TypePipe (www.re-motion.org)", + "DependDBProjectName": "re-motion Framework TypePipe", "DependDBRetentionTime": "10", "DependDBProjectBranch": "Main", + "DependDBProjectImportNotificationMailAddress": "nonexistent@nonexistent.nonexistent", "DependDBProjectImportNotificationMailAddressCc": "nonexistent@nonexistent.nonexistent", "DependDBTrackedReferences": "Remotion.*", "DependDBNugetConfig": "~/nuget.config", - "DependDBTargetFramework": "net45" + "DependDBTargetFramework": "net462", + "VcsUrlTemplate": "example.com" } diff --git a/Build/Build.cs b/Build/Build.cs index bff3fd40b..c276cca9c 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -56,38 +56,6 @@ class Build : RemotionBuild, IDependDB, ITest .TriggeredBy() .Executes (() => { }); - public override ISbomGeneratorBuilder ConfigureSbomGenerationInfoBuilder (Solution solution) - { - var version = ((IBuildMetadata)this).GetBaseVersion(); - - var semanticVersion = SemanticVersion.Parse(version); - var shortenedVersion = $"{semanticVersion.Major}.{semanticVersion.Minor}.{semanticVersion.Patch}"; - - var blacklistedProjects = new[] - { - "Web.Dependencies.Javascript", - "*.Analyzers*" - // We disregard test projects when generating the sbom already, so these are not required here. - }; - - var packageJsonPath = solution.Directory / "Remotion" / "Web" / "Dependencies.JavaScript" / "package.json"; - var packageJsonWithVersion = TemporaryDirectory / "sbom" / "package.json"; - - AddVersionToPackageJson(packageJsonPath, packageJsonWithVersion, shortenedVersion); - - var outputFolderPath = ((IBaseBuild)this).OutputFolder / "SBOM"; - outputFolderPath.CreateDirectory(); - - var outputSbomPath = outputFolderPath / "re-motion.sbom.json"; - - // We do not require github auth because we do not do enough requests for licenses and package infos - var builder = new SolutionSbomGeneratorBuilder(solution, semanticVersion.ToString(), TemporaryDirectory / "sbomGeneration", outputSbomPath, "", "") - .WithProjectsBlackListed(blacklistedProjects) - .WithPackageJsonFile(packageJsonWithVersion); - - return builder; - } - public override void ConfigureProjects (ProjectsBuilder projects) { [CanBeNull] From 15a7320307134b94c7efedaeac0c6cf97828be46 Mon Sep 17 00:00:00 2001 From: Michael Ludwig Date: Wed, 30 Jul 2025 10:06:32 +0200 Subject: [PATCH 6/6] [tmp] use net462 instead of net48 --- .nuke/parameters.ci.json | 2 +- .nuke/parameters.full.json | 2 +- .nuke/parameters.local.json | 2 +- .nuke/parameters.nightly.json | 2 +- Build/Build.cs | 16 ++++++++-------- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.nuke/parameters.ci.json b/.nuke/parameters.ci.json index 6de66fbe8..a254caa2d 100644 --- a/.nuke/parameters.ci.json +++ b/.nuke/parameters.ci.json @@ -4,7 +4,7 @@ "TestConfigurations": [ "Debug" ], "TestExecutionRuntimes": [ "Docker_Win_NET48", "EnforcedLocalMachine" ], "TestPlatforms": [ "x86" ], - "TestTargetRuntimes": [ "NET48" ], + "TestTargetRuntimes": [ "NET462" ], "TestBrowsers": [ "NoBrowser" ], "TestSqlServers": [ "NoDB" ], "SkipCleanProjects": "False", diff --git a/.nuke/parameters.full.json b/.nuke/parameters.full.json index 9b951871b..d36dc0f3b 100644 --- a/.nuke/parameters.full.json +++ b/.nuke/parameters.full.json @@ -4,7 +4,7 @@ "TestConfigurations": [ "Debug", "Release" ], "TestExecutionRuntimes": [ "Docker_Win_NET48", "EnforcedLocalMachine" ], "TestPlatforms": [ "x86", "x64" ], - "TestTargetRuntimes": [ "NET48" ], + "TestTargetRuntimes": [ "NET462" ], "TestBrowsers": [ "NoBrowser" ], "TestSqlServers": [ "NoDB" ], "SkipCleanProjects": "False", diff --git a/.nuke/parameters.local.json b/.nuke/parameters.local.json index d8d8788d7..30764fa49 100644 --- a/.nuke/parameters.local.json +++ b/.nuke/parameters.local.json @@ -4,7 +4,7 @@ "TestConfigurations": [ "Debug" ], "TestExecutionRuntimes": [ "LocalMachine" ], "TestPlatforms": [ "x86" ], - "TestTargetRuntimes": [ "NET48" ], + "TestTargetRuntimes": [ "NET462" ], "TestBrowsers": [ "NoBrowser" ], "TestSqlServers": [ "NoDB" ], "SkipCleanProjects": "False", diff --git a/.nuke/parameters.nightly.json b/.nuke/parameters.nightly.json index e484531c1..c729c27fb 100644 --- a/.nuke/parameters.nightly.json +++ b/.nuke/parameters.nightly.json @@ -4,7 +4,7 @@ "TestConfigurations": [ "Debug", "Release" ], "TestExecutionRuntimes": [ "Docker_Win_NET48", "EnforcedLocalMachine" ], "TestPlatforms": [ "x86", "x64" ], - "TestTargetRuntimes": [ "NET48" ], + "TestTargetRuntimes": [ "NET462" ], "TestBrowsers": [ "NoBrowser" ], "TestSqlServers": [ "NoDB" ], "SkipCleanProjects": "False", diff --git a/Build/Build.cs b/Build/Build.cs index c276cca9c..d44122dc8 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -128,16 +128,16 @@ public override void ConfigureTestMatrix (TestMatricesBuilder builder) "NormalTestMatrix", new TestDimension[,] { - { Windows, Docker_Win_NET48, NET48, NoDB, Debug, x86 }, - { Windows, Docker_Win_NET48, NET48, NoDB, Release, x86 }, - { Windows, Docker_Win_NET48, NET48, NoDB, Debug, x64 }, - { Windows, Docker_Win_NET48, NET48, NoDB, Release, x64 }, + { Windows, Docker_Win_NET48, NET462, NoDB, Debug, x86 }, + { Windows, Docker_Win_NET48, NET462, NoDB, Release, x86 }, + { Windows, Docker_Win_NET48, NET462, NoDB, Debug, x64 }, + { Windows, Docker_Win_NET48, NET462, NoDB, Release, x64 }, // Local--> - { Windows, LocalMachine, NET48, NoDB, Debug, x86 }, - { Windows, LocalMachine, NET48, NoDB, Release, x86 }, - { Windows, LocalMachine, NET48, NoDB, Debug, x64 }, - { Windows, LocalMachine, NET48, NoDB, Release, x64 }, + { Windows, LocalMachine, NET462, NoDB, Debug, x86 }, + { Windows, LocalMachine, NET462, NoDB, Release, x86 }, + { Windows, LocalMachine, NET462, NoDB, Debug, x64 }, + { Windows, LocalMachine, NET462, NoDB, Release, x64 }, // Exercise compatibility between installed .NET version, target framework and SQL Server { Windows, Docker_Win_NET48, NET472, NoDB, Release, x64 },