From d3173f6af0f13849d169803472bc2bbb41fd848d Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Thu, 11 May 2023 07:32:48 +0200 Subject: [PATCH 01/10] (build) Fix codecov yaml configuration --- codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index c203cc9..55bd997 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,7 +1,7 @@ codecov: ci: - appveyor - - !travis-ci + - '!travis-ci' coverage: range: 80..100 From 7d52782b71cb186a239fcf94348d3cc4f0d8446d Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Thu, 11 May 2023 07:35:06 +0200 Subject: [PATCH 02/10] (build) Update appveyor image to VS2022 --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index db0db4c..ddd72b0 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,4 +1,4 @@ -image: Visual Studio 2019 +image: Visual Studio 2022 matrix: fast_finish: true environment: From 23f45898fd16078771b4fe8f8309a9602a129f94 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Thu, 11 May 2023 07:35:44 +0200 Subject: [PATCH 03/10] (build) Correct transifex installation --- .appveyor.yml | 3 +-- .tx/config | 15 ++++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index ddd72b0..2f89ffe 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -15,8 +15,7 @@ skip_commits: install: - git submodule update --init - cmd: | - cinst python3 -n - cinst transifex-client + choco install transifex-cli build: off test: off diff --git a/.tx/config b/.tx/config index f078280..3b06258 100644 --- a/.tx/config +++ b/.tx/config @@ -1,15 +1,16 @@ [main] -host = https://www.transifex.com +host = https://app.transifex.com lang_map = en_GB: en-GB, en_US: en-US -[caketransifex.commonresx] -source_file = src/Cake.Transifex/Common.resx +[o:cake-contrib:p:caketransifex:r:commonresx] file_filter = src/Cake.Transifex/Common..resx +source_file = src/Cake.Transifex/Common.resx source_lang = en -type = RESX +type = RESX -[caketransifex.exceptionsresx] -source_file = src/Cake.Transifex/Exceptions.resx +[o:cake-contrib:p:caketransifex:r:exceptionsresx] file_filter = src/Cake.Transifex/Exceptions..resx +source_file = src/Cake.Transifex/Exceptions.resx source_lang = en -type = RESX +type = RESX + From 03b1222d7e4c851957a373486dbffccad7ff8674 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Thu, 11 May 2023 08:12:29 +0200 Subject: [PATCH 04/10] (build) Add transifex token for appveyor build --- .appveyor.yml | 4 +++- recipe.cake | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 2f89ffe..0867613 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -21,7 +21,9 @@ build: off test: off build_script: - - pwsh: ./build.ps1 --target=CI --verbosity=Diagnostic + - pwsh: | + $env:TX_TOKEN = "$env:TRANSIFEX_API_TOKEN" + ./build.ps1 --target=CI --verbosity=Diagnostic cache: - "tools -> .build/dotnet-tools.json,recipe.cake,.build/sonarcloud.cake" diff --git a/recipe.cake b/recipe.cake index ed46675..5409509 100644 --- a/recipe.cake +++ b/recipe.cake @@ -28,4 +28,6 @@ ToolSettings.SetToolPreprocessorDirectives( BuildParameters.PrintParameters(Context); +((CakeTask)BuildParameters.Tasks.TransifexSetupTask.Task).Actions.Clear(); + Build.RunDotNetCore(); From fcbd83c097b3ed023c589038dd3455cbb8c0453e Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Thu, 11 May 2023 09:01:45 +0200 Subject: [PATCH 05/10] (maint) Add git version config to control version --- GitVersion.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 GitVersion.yml diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 0000000..fa4aa96 --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1,5 @@ +next-version: 3.0.0 +branches: {} +ignore: + sha: [] +merge-message-formats: {} From 8f5eac888a2ecb65452cba3f0de8b0c0533d4877 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Thu, 11 May 2023 09:12:35 +0200 Subject: [PATCH 06/10] (maint) Remove target file for custom coverlet options --- src/Directory.Build.targets | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 src/Directory.Build.targets diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets deleted file mode 100644 index 5cd0b11..0000000 --- a/src/Directory.Build.targets +++ /dev/null @@ -1,23 +0,0 @@ - - - - - $([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)')) - - - - - - - - - - - <_LocalTopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/> - - - From 87b5a30391e68d16b3356b9d1c6250a414f9f2ba Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Wed, 14 Aug 2024 22:31:49 +0200 Subject: [PATCH 07/10] (maint) Move SourceLink package to projects --- src/Cake.Transifex.Tests/Cake.Transifex.Tests.csproj | 5 +---- src/Cake.Transifex/Cake.Transifex.csproj | 1 + src/Directory.Build.props | 4 ---- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Cake.Transifex.Tests/Cake.Transifex.Tests.csproj b/src/Cake.Transifex.Tests/Cake.Transifex.Tests.csproj index 75996b4..db5ca7e 100644 --- a/src/Cake.Transifex.Tests/Cake.Transifex.Tests.csproj +++ b/src/Cake.Transifex.Tests/Cake.Transifex.Tests.csproj @@ -5,15 +5,12 @@ + - - runtime; build; native; contentfiles; analyzers - all - diff --git a/src/Cake.Transifex/Cake.Transifex.csproj b/src/Cake.Transifex/Cake.Transifex.csproj index 4db634e..5eab570 100644 --- a/src/Cake.Transifex/Cake.Transifex.csproj +++ b/src/Cake.Transifex/Cake.Transifex.csproj @@ -52,6 +52,7 @@ Supports Cake $(CakeVersion)+ all runtime; build; native; contentfiles; analyzers; buildtransitive + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 926d9fc..a023cb3 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -4,8 +4,4 @@ true true - - - - From a4beb153a6c1dd8569b87b2fa4c165e9ddc6a162 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Wed, 14 Aug 2024 22:32:24 +0200 Subject: [PATCH 08/10] (maint) Fix coverage exclusions --- recipe.cake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/recipe.cake b/recipe.cake index 5409509..cd0b05b 100644 --- a/recipe.cake +++ b/recipe.cake @@ -21,13 +21,16 @@ BuildParameters.SetParameters( shouldUseDeterministicBuilds: true, shouldUseTargetFrameworkPath: false); -ToolSettings.SetToolSettings(context: Context); +ToolSettings.SetToolSettings( + context: Context, + testCoverageExcludeByFile: "**/*Designer.cs,*/*.g.cs;**/*.g.i.cs", + testCoverageExcludeByAttribute: "Obsolete;GeneratedCodeAttribute;CompilerGeneratedAttribute"); ToolSettings.SetToolPreprocessorDirectives( codecovTool: "#tool nuget:?package=CodecovUploader&version=0.5.0" ); BuildParameters.PrintParameters(Context); -((CakeTask)BuildParameters.Tasks.TransifexSetupTask.Task).Actions.Clear(); +//((CakeTask)BuildParameters.Tasks.TransifexSetupTask.Task).Actions.Clear(); Build.RunDotNetCore(); From b59fe4e1254adf77bbfb61cd82345f490ff764f0 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Wed, 14 Aug 2024 22:44:20 +0200 Subject: [PATCH 09/10] (ci) Add missing SDKs for appveyor build --- .appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.appveyor.yml b/.appveyor.yml index 0867613..f1047d3 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -16,6 +16,7 @@ install: - git submodule update --init - cmd: | choco install transifex-cli + choco install dotnet-5.0-sdk dotnet-6.0-sdk dotnet-7.0-sdk build: off test: off From 31ff596f50d9c565d0262db6c65f003a463e4ac7 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Fri, 16 Aug 2024 23:40:20 +0200 Subject: [PATCH 10/10] (maint) Add overriddes for recipe implementation This adds overload replacements for Cake.Recipe for the functionality we have when uploading or pulling translations/source files from Transifex. --- recipe.cake | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/recipe.cake b/recipe.cake index cd0b05b..a5b6122 100644 --- a/recipe.cake +++ b/recipe.cake @@ -31,6 +31,46 @@ ToolSettings.SetToolPreprocessorDirectives( BuildParameters.PrintParameters(Context); -//((CakeTask)BuildParameters.Tasks.TransifexSetupTask.Task).Actions.Clear(); +// Temporary Overrides needed to work properly with TX.Exe + +((CakeTask)BuildParameters.Tasks.TransifexSetupTask.Task).Actions.Clear(); +((CakeTask)BuildParameters.Tasks.TransifexPushSourceResource.Task).Actions.Clear(); +((CakeTask)BuildParameters.Tasks.TransifexPullTranslations.Task).Actions.Clear(); +((CakeTask)BuildParameters.Tasks.TransifexPushTranslations.Task).Actions.Clear(); + +private static void AddGlobalOptions(TransifexRunnerSettings settings) +{ + if (!string.IsNullOrEmpty(BuildParameters.Transifex.ApiToken)) + { + settings.ArgumentCustomization = args => args.PrependSwitchQuotedSecret("--token", " ", BuildParameters.Transifex.ApiToken); + }; +} + +BuildParameters.Tasks.TransifexPushSourceResource.Does(() => +{ + var settings = new TransifexPushSettings + { + UploadSourceFiles = true, + Force = string.Equals(BuildParameters.Target, "Transifex-Push-SourceFiles", StringComparison.OrdinalIgnoreCase), + }; + + AddGlobalOptions(settings); + + TransifexPush(settings); +}); + +BuildParameters.Tasks.TransifexPullTranslations.Does(() => +{ + var settings = new TransifexPullSettings + { + All = true, + Mode = BuildParameters.TransifexPullMode, + MinimumPercentage = BuildParameters.TransifexPullPercentage + }; + + AddGlobalOptions(settings); + + TransifexPull(settings); +}); Build.RunDotNetCore();