Skip to content
Permalink
Browse files

[Build] Removed Xenko.xkpkg

  • Loading branch information
xen2 committed Nov 26, 2018
1 parent 95f15bd commit 0032576a4b45e8309304e4d0409783b9db2d7b31

This file was deleted.

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!--
Build file used to build Xenko and package it from the command line.
Example of use:
@@ -8,9 +8,9 @@ Example of use:
<PropertyGroup>
<XenkoRoot>$(MSBuildThisFileDirectory)..\</XenkoRoot>
<XenkoRootBin>$(XenkoRoot)Bin\Windows\</XenkoRootBin>
<XenkoPackage>$(XenkoRoot)Xenko.xkpkg</XenkoPackage>
<XenkoSolution>$(XenkoRoot)build\Xenko</XenkoSolution>
<XenkoSolutionLauncher>$(XenkoRoot)build\Xenko.Launcher</XenkoSolutionLauncher>
<XenkoPlatforms Condition="'$(XenkoPlatforms)' == ''">Windows</XenkoPlatforms>
<BuildProperties>Configuration=Release;NoWarn=1591;DeployExtension=false;XenkoPlatforms=$(XenkoPlatforms)</BuildProperties>
<BuildProperties Condition="'$(XenkoSign)' != ''">$(BuildProperties);XenkoSign=$(XenkoSign)</BuildProperties>
<BuildProperties Condition="'$(XenkoOfficialBuild)' != ''">$(BuildProperties);XenkoOfficialBuild=$(XenkoOfficialBuild)</BuildProperties>
@@ -22,25 +22,12 @@ Example of use:

<UsingTask TaskName="Xenko.Core.Tasks.PackageUpdateVersionTask" AssemblyFile="$(XenkoRoot)sources\core\Xenko.Core.Tasks\bin\Release\Xenko.Core.Tasks.exe" />
<!-- TODO: those tasks will work only if the Direct3D11 files have been copied to top folder (currently works thanks to BuildEditorShaders being run before) -->
<UsingTask TaskName="Xenko.Assets.Tasks.PackageArchiveTask" AssemblyFile="$(XenkoRootBin)Xenko.Assets.dll" />
<UsingTask TaskName="Xenko.Assets.Tasks.PackageGetVersionTask" AssemblyFile="$(XenkoRootBin)Xenko.Assets.dll" />

<Target Name="Help">
<Message Importance="high" Text="TODO"/>
</Target>

<!--
Package Xenko to a nupkg
-->
<Target Name="Package">
<ItemGroup>
<FilesToDeletePackage Include="$(MSBuildThisFileDirectory)Xenko.?.*.nupkg"/>
</ItemGroup>

<Delete Files="@(FilesToDeletePackage)"/>
<PackageArchiveTask File="$(XenkoPackage)"/>
</Target>

<!--
VSIX Xenko plugin
Don't forget to build for VS2013 by using MSBuild 12.0,
@@ -112,8 +99,8 @@ Example of use:
<MSBuild Targets="30-CoreDesign\Xenko_Core_Tasks" Projects="$(XenkoSolution).sln" Properties="$(BuildProperties);Platform=Mixed Platforms"/>

<!-- Create SharedAssemblyInfo.NuGet.cs with Git information (different between official build and internal builds) -->
<PackageUpdateVersionTask Condition="'$(XenkoOfficialBuild)' == 'true'" PackageFile="$(XenkoPackage)" VersionFile="$(XenkoRoot)sources\shared\SharedAssemblyInfo.cs" GeneratedVersionFile="$(XenkoRoot)sources\shared\SharedAssemblyInfo.NuGet.cs" />
<PackageUpdateVersionTask Condition="'$(XenkoOfficialBuild)' != 'true'" PackageFile="$(XenkoPackage)" VersionFile="$(XenkoRoot)sources\shared\SharedAssemblyInfo.cs" GeneratedVersionFile="$(XenkoRoot)sources\shared\SharedAssemblyInfo.NuGet.cs" SpecialVersion="beta" SpecialVersionGitHeight="true" SpecialVersionGitCommit="true" />
<PackageUpdateVersionTask Condition="'$(XenkoOfficialBuild)' == 'true'" RootDirectory="$(XenkoRoot)" VersionFile="$(XenkoRoot)sources\shared\SharedAssemblyInfo.cs" GeneratedVersionFile="$(XenkoRoot)sources\shared\SharedAssemblyInfo.NuGet.cs" />
<PackageUpdateVersionTask Condition="'$(XenkoOfficialBuild)' != 'true'" RootDirectory="$(XenkoRoot)" VersionFile="$(XenkoRoot)sources\shared\SharedAssemblyInfo.cs" GeneratedVersionFile="$(XenkoRoot)sources\shared\SharedAssemblyInfo.NuGet.cs" SpecialVersion="beta" SpecialVersionGitHeight="true" SpecialVersionGitCommit="true" />
</Target>
<Target Name="BuildForPackage" DependsOnTargets="PreparePackageBuild;BuildWindows;BuildEditorShaders;VSIXPlugin"/>
<Target Name="GeneratePackage" DependsOnTargets="PreparePackageBuild;PrerequisitesInstaller;Package;WritePackageVersionToFile"/>
@@ -208,7 +195,7 @@ Example of use:
</Target>

<Target Name="WritePackageVersionToFile">
<PackageGetVersionTask File="$(XenkoPackage)">
<PackageGetVersionTask>
<Output TaskParameter="NuGetVersion" PropertyName="XenkoPackageVersion"/>
</PackageGetVersionTask>
<Delete Files="$(MSBuildThisFileDirectory)Xenko.version"/>
@@ -70,7 +70,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "00-Config", "00-Config", "{7662CECF-2A3D-4DBA-AB3D-77FD8536E7A3}"
ProjectSection(SolutionItems) = preProject
..\sources\shared\SharedAssemblyInfo.cs = ..\sources\shared\SharedAssemblyInfo.cs
..\Xenko.xkpkg = ..\Xenko.xkpkg
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Xenko.Shared", "Xenko.Shared", "{1AC70118-C90F-4EC6-9D8B-C628BDF900F7}"
@@ -2,9 +2,9 @@
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.

using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using Xenko.Core;
using Xenko.Core.Yaml;
using Xenko.Core.Yaml.Serialization;

namespace Nerdbank.GitVersioning
{
@@ -57,19 +57,16 @@ public static VersionOptions GetVersion(LibGit2Sharp.Commit commit, string packa
private static VersionOptions GetVersionFromStream(Stream stream)
{
// Load the asset as a YamlNode object
var input = new StreamReader(stream);
var yamlStream = new YamlStream();
yamlStream.Load(input);

// Version is stored in Meta.Version
var rootNode = (YamlMappingNode)yamlStream.Documents[0].RootNode;
var metaNode = rootNode?.Children[new YamlScalarNode("Meta")] as YamlMappingNode;
if (metaNode == null)
return null;
using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
{
var text = reader.ReadToEnd();

var versionNode = (YamlScalarNode)metaNode.Children[new YamlScalarNode("Version")];
var publicVersion = Regex.Match(text, "PublicVersion = (.*);");
if (!publicVersion.Success)
return null;

return new VersionOptions { Version = new PackageVersion((string)versionNode) };
return new VersionOptions { Version = new PackageVersion((string)publicVersion.Groups[0].Value) };
}
}
}
}
@@ -8,6 +8,7 @@
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Xenko.Core;
using Xenko.Core.IO;

namespace Xenko.Core.Tasks
{
@@ -27,11 +28,10 @@ public class PackageUpdateVersionTask : Task
public ITaskItem GeneratedVersionFile { get; set; }

/// <summary>
/// Gets or sets the package file.
/// Gets or sets the root directory.
/// </summary>
/// <value>The version file.</value>
[Required]
public ITaskItem PackageFile { get; set; }
public ITaskItem RootDirectory { get; set; }

public string SpecialVersion { get; set; }

@@ -41,7 +41,7 @@ public class PackageUpdateVersionTask : Task

public override bool Execute()
{
if (PackageFile == null || !File.Exists(PackageFile.ItemSpec))
if (RootDirectory == null || !Directory.Exists(RootDirectory.ItemSpec))
{
Log.LogError("PackageFile is not set or doesn't exist");
return false;
@@ -68,7 +68,7 @@ public override bool Execute()
// For now we assume top level package directory is git folder
try
{
var rootDirectory = Path.GetDirectoryName(PackageFile.ItemSpec);
var rootDirectory = RootDirectory.ItemSpec;

NativeLibrary.PreloadLibrary("git2-1196807.dll");
var repo = LibGit2Sharp.Repository.IsValid(rootDirectory) ? new LibGit2Sharp.Repository(rootDirectory) : null;
@@ -89,8 +89,8 @@ public override bool Execute()
if (SpecialVersionGitHeight)
{
// Compute version based on Git info
var xenkoPackageFileName = Path.GetFileName(PackageFile.ItemSpec);
var height = Nerdbank.GitVersioning.GitExtensions.GetVersionHeight(repo, xenkoPackageFileName);
var versionFileRelative = new UFile(VersionFile.ItemSpec).MakeRelative(rootDirectory).ToWindowsPath();
var height = Nerdbank.GitVersioning.GitExtensions.GetVersionHeight(repo, versionFileRelative);
versionSuffix += height.ToString("D5");
}
if (SpecialVersionGitCommit && headCommitSha != null)
@@ -121,12 +121,6 @@ public override bool Execute()
// Write back new file
File.WriteAllText(GeneratedVersionFile.ItemSpec, versionFileData);

// Also patch .xkpkg (necessary when compiling editor shaders)
// TODO: Find a better way to override this without overwriting file during builds
var packageFileContent = File.ReadAllText(PackageFile.ItemSpec);
packageFileContent = Regex.Replace(packageFileContent, "^ Version: (.*)$", $" Version: {XenkoVersion.NuGetVersionSimple + versionSuffix}", RegexOptions.Multiline);
File.WriteAllText(PackageFile.ItemSpec, packageFileContent);

return true;
}
catch (Exception e)

0 comments on commit 0032576

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