Skip to content
Permalink
Browse files

[Build] Moved Xenko.Samples.Templates version in a single unified loc…

…ation to simplify future maintenance
  • Loading branch information
xen2 committed Oct 3, 2019
1 parent 7ca99e7 commit 46bcd063df35ee48dd6edde062ed4b9ac7451da3
@@ -405,7 +405,7 @@ private static void CopyAssetPacks(SessionTemplateGeneratorParameters parameters
{
var logger = parameters.Logger;

var presentationPackageFile = PackageStore.Instance.GetPackageFileName("Xenko.Samples.Templates", new PackageVersionRange(new PackageVersion("3.1.0.1")));
var presentationPackageFile = PackageStore.Instance.GetPackageFileName("Xenko.Samples.Templates", new PackageVersionRange(new PackageVersion(Xenko.Samples.Templates.ThisPackageVersion.Current)));
var assetPackagesDir = UDirectory.Combine(presentationPackageFile.GetFullDirectory(), @"Templates\Samples\Templates\Packs");
var assetPacks = parameters.TryGetTag(AssetsKey);
if (assetPacks == null)
@@ -57,6 +57,7 @@
<Compile Include="..\..\shared\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\Xenko.Samples.Templates\ThisPackageVersion.cs" Link="ThisPackageVersion.cs" />
<None Include="app.config" />
<None Include="*.cd" />
<Page Include="**\*.xaml" SubType="Designer" Generator="MSBuild:Compile" />
@@ -88,7 +88,7 @@ public static void LoadDefaultTemplates()
{
// Load templates
// Currently hardcoded, this will need to change with plugin system
foreach (var packageInfo in new[] { new { Name = "Xenko.Assets.Presentation", Version = XenkoVersion.NuGetVersion }, new { Name = "Xenko.SpriteStudio.Offline", Version = XenkoVersion.NuGetVersion }, new { Name = "Xenko.Samples.Templates", Version = "3.1.0.1" } })
foreach (var packageInfo in new[] { new { Name = "Xenko.Assets.Presentation", Version = XenkoVersion.NuGetVersion }, new { Name = "Xenko.SpriteStudio.Offline", Version = XenkoVersion.NuGetVersion }, new { Name = "Xenko.Samples.Templates", Version = Xenko.Samples.Templates.ThisPackageVersion.Current } })
{
var logger = new LoggerResult();
var packageFile = PackageStore.Instance.GetPackageFileName(packageInfo.Name, new PackageVersionRange(new PackageVersion(packageInfo.Version)));
@@ -0,0 +1,8 @@
namespace Xenko.Samples.Templates
{
static class ThisPackageVersion
{
// we version this package manually because most of the time the samples are big and don't need to be updated
public static string Current = "3.1.0.1";
}
}
@@ -5,11 +5,14 @@
<XenkoPackAssets>true</XenkoPackAssets>
<TargetFramework>$(TargetFrameworkTool)</TargetFramework>
<EnableDefaultItems>false</EnableDefaultItems>
<!-- Note: we version this package manually because most of the time the samples are big and don't need to be updated.
PLEASE UPDATE XenkoDefaultAssetsPlugin.LoadDefaultTemplates() accordingly! -->
<PackageVersion>3.1.0.1</PackageVersion>
<PackageVersion Condition="'$(XenkoOfficialBuild)' != 'true'">$(PackageVersion)</PackageVersion>
<!-- Extract PackageVersion from ThisPackageVersion.cs -->
<_XenkoThisPackageVersionLines>$([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)ThisPackageVersion.cs'))</_XenkoThisPackageVersionLines>
<PackageVersion>$([System.Text.RegularExpressions.Regex]::Match($(_XenkoThisPackageVersionLines), `.*Current = \"(.*)\";.*`).Groups[1].Value)</PackageVersion>
</PropertyGroup>

<Import Project="$(XenkoPostSettingsTargets)" />

<ItemGroup>
<Compile Include="ThisPackageVersion.cs" />
</ItemGroup>
</Project>

0 comments on commit 46bcd06

Please sign in to comment.
You can’t perform that action at this time.