Skip to content

Commit

Permalink
Merge commit '31ff596f50d9c565d0262db6c65f003a463e4ac7' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiringWorm committed Aug 16, 2024
2 parents c7e7b62 + 31ff596 commit d98c120
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 44 deletions.
10 changes: 6 additions & 4 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: Visual Studio 2019
image: Visual Studio 2022
matrix:
fast_finish: true
environment:
Expand All @@ -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"
15 changes: 8 additions & 7 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -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.<lang>.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.<lang>.resx
source_file = src/Cake.Transifex/Exceptions.resx
source_lang = en
type = RESX
type = RESX

5 changes: 5 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
next-version: 3.0.0
branches: {}
ignore:
sha: []
merge-message-formats: {}
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
codecov:
ci:
- appveyor
- !travis-ci
- '!travis-ci'

coverage:
range: 80..100
Expand Down
47 changes: 46 additions & 1 deletion recipe.cake
Original file line number Diff line number Diff line change
Expand Up @@ -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();
5 changes: 1 addition & 4 deletions src/Cake.Transifex.Tests/Cake.Transifex.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Include="Cake.Testing" Version="3.0.0" />
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/Cake.Transifex/Cake.Transifex.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Supports Cake $(CakeVersion)+
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Roslynator.Analyzers" Version="4.1.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
4 changes: 0 additions & 4 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
</ItemGroup>
</Project>
23 changes: 0 additions & 23 deletions src/Directory.Build.targets

This file was deleted.

0 comments on commit d98c120

Please sign in to comment.