diff --git a/.appveyor.yml b/.appveyor.yml index db0db4c..f1047d3 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,4 +1,4 @@ -image: Visual Studio 2019 +image: Visual Studio 2022 matrix: fast_finish: true environment: @@ -15,14 +15,16 @@ skip_commits: install: - git submodule update --init - cmd: | - cinst python3 -n - cinst transifex-client + choco install transifex-cli + choco install dotnet-5.0-sdk dotnet-6.0-sdk dotnet-7.0-sdk 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/.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 + 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: {} 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 diff --git a/recipe.cake b/recipe.cake index ed46675..a5b6122 100644 --- a/recipe.cake +++ b/recipe.cake @@ -21,11 +21,56 @@ 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); +// 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(); 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 - - - - 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)' == ''"/> - - -