Skip to content

Commit

Permalink
Integrate template localizer into arcade (#8233)
Browse files Browse the repository at this point in the history
  • Loading branch information
bekir-ozturk authored Dec 3, 2021
1 parent cb149c8 commit c984096
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
4 changes: 4 additions & 0 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-symuploader</Uri>
<Sha>62ceb439e80bf0814d0ffa17f022d4624ea4aa6c</Sha>
</Dependency>
<Dependency Name="Microsoft.TemplateEngine.Tasks" Version="7.0.100-alpha.1.21601.1">
<Uri>https://github.com/dotnet/templating</Uri>
<Sha />
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.21602.3">
Expand Down
1 change: 1 addition & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,6 @@
<MicrosoftDeploymentDotNetReleasesVersion>1.0.0-preview1.1.21116.1</MicrosoftDeploymentDotNetReleasesVersion>
<!-- Used to flow Source Link version through Arcade SDK -->
<MicrosoftSourceLinkVersion>$(MicrosoftSourceLinkGitHubVersion)</MicrosoftSourceLinkVersion>
<MicrosoftTemplateEngineTasksVersion>7.0.100-alpha.1.21601.1</MicrosoftTemplateEngineTasksVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<MicrosoftDotNetXliffTasksVersion>$(MicrosoftDotNetXliffTasksVersion)</MicrosoftDotNetXliffTasksVersion>
<MicrosoftDotNetMaestroTasksVersion>$(MicrosoftDotNetMaestroTasksVersion)</MicrosoftDotNetMaestroTasksVersion>
<MicrosoftSymbolUploaderBuildTaskVersion>$(MicrosoftSymbolUploaderBuildTaskVersion)</MicrosoftSymbolUploaderBuildTaskVersion>
<MicrosoftTemplateEngineTasksVersion>$(MicrosoftTemplateEngineTasksVersion)</MicrosoftTemplateEngineTasksVersion>
</PropertyGroup>
</Project>]]>
</_SdkVersionPropsContent>
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.DotNet.Arcade.Sdk/tools/Imports.targets
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<Import Project="Tests.targets" Condition="'$(DisableArcadeTestFramework)' != 'true'" />

<Import Project="Performance.targets" Condition="'$(DisableArcadeTestFramework)' != 'true'" />
<Import Project="Localization.targets" Condition="'$(UsingToolXliff)' == 'true'"/>
<Import Project="Localization.targets" />
<Import Project="VisualStudio.targets" Condition="'$(UsingToolVSSDK)' == 'true' and ('$(IsVsixProject)' == 'true' or '$(IsSwixProject)' == 'true' or '$(GeneratePkgDefFile)' == 'true') and '$(MSBuildRuntimeType)' != 'Core'"/>
<Import Project="OptimizationData.targets" Condition="'$(UsingToolIbcOptimization)' == 'true'"/>
<Import Project="SymStore.targets" Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(OS)' == 'Windows_NT'"/>
Expand Down
16 changes: 14 additions & 2 deletions src/Microsoft.DotNet.Arcade.Sdk/tools/Localization.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<Project>

<!--
XliffTasks for localizing .resx files and generating satellite assemblies.
When not building in CI, automatically sync .xlf files to .resx files on build.
Otherwise, let the build fail to catch .xlf files that are not up-to-date.
-->

<PropertyGroup>
<PropertyGroup Condition="'$(UsingToolXliff)' == 'true'">
<!--
It is only intended to automatically run update during dev cycle. However, it will fail the build on CI if the XLF file is not updated.
XLF file should be checked in and loc team will update the XLF it with translated version.
Expand All @@ -25,4 +25,16 @@
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.XliffTasks" Version="$(MicrosoftDotNetXliffTasksVersion)" PrivateAssets="all" IsImplicitlyDefined="true" Condition="'$(IsShippingAssembly)' == 'true'" />
</ItemGroup>


<!-- TemplateLocalizer for localizing 'dotnet new' templates -->
<PropertyGroup Condition="'$(UsingToolTemplateLocalizer)' == 'true'">
<!-- Run localizer when building on dev machine. -->
<LocalizeTemplates Condition="'$(ContinuousIntegrationBuild)' != 'true'">true</LocalizeTemplates>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.TemplateEngine.Tasks" Version="$(MicrosoftTemplateEngineTasksVersion)" PrivateAssets="all" IsImplicitlyDefined="true" Condition="'$(UsingToolTemplateLocalizer)' == 'true'" />
</ItemGroup>

</Project>

0 comments on commit c984096

Please sign in to comment.