(ded4a3e0a) v0.9.0.7
This commit is contained in:
+88
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>10.0.0</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{E2D9E2AE-AD75-D3D6-A3BA-75696C642E54}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>MonoGame.Build.Tasks</RootNamespace>
|
||||
<AssemblyName>MonoGame.Build.Tasks</AssemblyName>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<NoWarn>1591,0436</NoWarn>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
<LangVersion>Default</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<Optimize>false</Optimize>
|
||||
<DebugType>full</DebugType>
|
||||
<EnableUnmanagedDebugging>true</EnableUnmanagedDebugging>
|
||||
<OutputPath>bin\Linux\AnyCPU\Debug</OutputPath>
|
||||
<IntermediateOutputPath>obj\Linux\AnyCPU\Debug</IntermediateOutputPath>
|
||||
<DocumentationFile>bin\Linux\AnyCPU\Debug\MonoGame.Build.Tasks.xml</DocumentationFile>
|
||||
<DefineConstants>DEBUG;PLATFORM_LINUX</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>none</DebugType>
|
||||
<OutputPath>bin\Linux\AnyCPU\Release</OutputPath>
|
||||
<IntermediateOutputPath>obj\Linux\AnyCPU\Release</IntermediateOutputPath>
|
||||
<DocumentationFile>bin\Linux\AnyCPU\Release\MonoGame.Build.Tasks.xml</DocumentationFile>
|
||||
<DefineConstants>PLATFORM_LINUX</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.Build" />
|
||||
<Reference Include="Microsoft.Build.Framework" />
|
||||
<Reference Include="Microsoft.Build.Tasks.v4.0" />
|
||||
<Reference Include="Microsoft.Build.Utilities.v4.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Tasks\CollectContentReferences.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<_PostBuildHookTimestamp>@(IntermediateAssembly->'%(FullPath).timestamp')</_PostBuildHookTimestamp>
|
||||
<_PostBuildHookHostPlatform>$(Platform)</_PostBuildHookHostPlatform>
|
||||
</PropertyGroup>
|
||||
<Target Name="PostBuildHooks" Inputs="@(IntermediateAssembly);@(ReferencePath)" Outputs="@(IntermediateAssembly);$(_PostBuildHookTimestamp)" AfterTargets="CoreCompile" BeforeTargets="AfterCompile">
|
||||
<Touch Files="$(_PostBuildHookTimestamp)" AlwaysCreate="True" />
|
||||
</Target>
|
||||
<ItemGroup />
|
||||
<ProjectExtensions>
|
||||
<MonoDevelop>
|
||||
<Properties><Policies>
|
||||
<TextStylePolicy inheritsSet="VisualStudio" inheritsScope="text/plain" scope="text/x-csharp" />
|
||||
<CSharpFormattingPolicy IndentSwitchSection="True" NewLinesForBracesInProperties="True" NewLinesForBracesInAccessors="True" NewLinesForBracesInAnonymousMethods="True" NewLinesForBracesInControlBlocks="True" NewLinesForBracesInAnonymousTypes="True" NewLinesForBracesInObjectCollectionArrayInitializers="True" NewLinesForBracesInLambdaExpressionBody="True" NewLineForElse="True" NewLineForCatch="True" NewLineForFinally="True" NewLineForMembersInObjectInit="True" NewLineForMembersInAnonymousTypes="True" NewLineForClausesInQuery="True" SpacingAfterMethodDeclarationName="False" SpaceAfterMethodCallName="False" SpaceBeforeOpenSquareBracket="False" inheritsSet="Mono" inheritsScope="text/x-csharp" scope="text/x-csharp" />
|
||||
</Policies>
|
||||
</Properties>
|
||||
</MonoDevelop>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>10.0.0</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{E2D9E2AE-B875-D3D6-92B1-ECDC6C642E54}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>MonoGame.Build.Tasks</RootNamespace>
|
||||
<AssemblyName>MonoGame.Build.Tasks</AssemblyName>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<NoWarn>1591,0436</NoWarn>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
<LangVersion>Default</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<Optimize>false</Optimize>
|
||||
<DebugType>full</DebugType>
|
||||
<EnableUnmanagedDebugging>true</EnableUnmanagedDebugging>
|
||||
<OutputPath>bin\Windows\AnyCPU\Debug</OutputPath>
|
||||
<IntermediateOutputPath>obj\Windows\AnyCPU\Debug</IntermediateOutputPath>
|
||||
<DocumentationFile>bin\Windows\AnyCPU\Debug\MonoGame.Build.Tasks.xml</DocumentationFile>
|
||||
<DefineConstants>DEBUG;PLATFORM_WINDOWS</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>none</DebugType>
|
||||
<OutputPath>bin\Windows\AnyCPU\Release</OutputPath>
|
||||
<IntermediateOutputPath>obj\Windows\AnyCPU\Release</IntermediateOutputPath>
|
||||
<DocumentationFile>bin\Windows\AnyCPU\Release\MonoGame.Build.Tasks.xml</DocumentationFile>
|
||||
<DefineConstants>PLATFORM_WINDOWS</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.Build" />
|
||||
<Reference Include="Microsoft.Build.Framework" />
|
||||
<Reference Include="Microsoft.Build.Tasks.v4.0" />
|
||||
<Reference Include="Microsoft.Build.Utilities.v4.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Tasks\CollectContentReferences.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<_PostBuildHookTimestamp>@(IntermediateAssembly->'%(FullPath).timestamp')</_PostBuildHookTimestamp>
|
||||
<_PostBuildHookHostPlatform>$(Platform)</_PostBuildHookHostPlatform>
|
||||
</PropertyGroup>
|
||||
<Target Name="PostBuildHooks" Inputs="@(IntermediateAssembly);@(ReferencePath)" Outputs="@(IntermediateAssembly);$(_PostBuildHookTimestamp)" AfterTargets="CoreCompile" BeforeTargets="AfterCompile">
|
||||
<Touch Files="$(_PostBuildHookTimestamp)" AlwaysCreate="True" />
|
||||
</Target>
|
||||
<ItemGroup />
|
||||
<ProjectExtensions>
|
||||
<MonoDevelop>
|
||||
<Properties><Policies>
|
||||
<TextStylePolicy inheritsSet="VisualStudio" inheritsScope="text/plain" scope="text/x-csharp" />
|
||||
<CSharpFormattingPolicy IndentSwitchSection="True" NewLinesForBracesInProperties="True" NewLinesForBracesInAccessors="True" NewLinesForBracesInAnonymousMethods="True" NewLinesForBracesInControlBlocks="True" NewLinesForBracesInAnonymousTypes="True" NewLinesForBracesInObjectCollectionArrayInitializers="True" NewLinesForBracesInLambdaExpressionBody="True" NewLineForElse="True" NewLineForCatch="True" NewLineForFinally="True" NewLineForMembersInObjectInit="True" NewLineForMembersInAnonymousTypes="True" NewLineForClausesInQuery="True" SpacingAfterMethodDeclarationName="False" SpaceAfterMethodCallName="False" SpaceBeforeOpenSquareBracket="False" inheritsSet="Mono" inheritsScope="text/x-csharp" scope="text/x-csharp" />
|
||||
</Policies>
|
||||
</Properties>
|
||||
</MonoDevelop>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: AssemblyTitle("MonoGame.Build.Tasks")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("MonoGame Team")]
|
||||
[assembly: AssemblyProduct("MonoGame.Framework")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2009-2017 MonoGame Team")]
|
||||
[assembly: AssemblyTrademark("MonoGame® is a registered trademark of the MonoGame Team")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
||||
[assembly: AssemblyVersion("0.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("0.0.0.0")]
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
// MIT License - Copyright (C) The Mono.Xna Team
|
||||
// This file is subject to the terms and conditions defined in
|
||||
// file 'LICENSE.txt', which is part of this source code package.
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Build.Framework;
|
||||
using Microsoft.Build.Utilities;
|
||||
|
||||
namespace MonoGame.Build.Tasks
|
||||
{
|
||||
public static class StringExt
|
||||
{
|
||||
public static string NormalisePath(this string path)
|
||||
{
|
||||
return path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar);
|
||||
}
|
||||
}
|
||||
|
||||
public class CollectContentReferences : Task
|
||||
{
|
||||
[Required]
|
||||
public ITaskItem[] ContentReferences { get; set; }
|
||||
|
||||
[Required]
|
||||
public string MonoGamePlatform { get; set; }
|
||||
|
||||
[Output]
|
||||
public ITaskItem[] Output { get; set; }
|
||||
|
||||
public override bool Execute()
|
||||
{
|
||||
var output = new List<ITaskItem>();
|
||||
foreach (var content in ContentReferences)
|
||||
{
|
||||
var relative = content.GetMetadata("RelativeDir").NormalisePath();
|
||||
var fp = content.GetMetadata("FullPath").NormalisePath();
|
||||
var link = content.GetMetadata("Link").NormalisePath();
|
||||
var metaData = new Dictionary<string, string>();
|
||||
var contentFolder = String.Empty;
|
||||
if (!string.IsNullOrEmpty(link))
|
||||
{
|
||||
contentFolder = Path.GetFileName(Path.GetDirectoryName(link));
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(relative))
|
||||
{
|
||||
contentFolder = Path.GetFileName(Path.GetDirectoryName(relative));
|
||||
}
|
||||
var outputPath = Path.GetFileNameWithoutExtension(fp);
|
||||
if (!outputPath.EndsWith(contentFolder, StringComparison.OrdinalIgnoreCase))
|
||||
outputPath = Path.Combine(outputPath, contentFolder);
|
||||
metaData.Add("ContentDirectory", !string.IsNullOrEmpty(contentFolder) ? contentFolder + Path.DirectorySeparatorChar : "");
|
||||
metaData.Add("RelativeFullPath", !string.IsNullOrEmpty(relative) ? Path.GetFullPath(relative) : "");
|
||||
metaData.Add("ContentOutputDir", Path.Combine("bin", MonoGamePlatform, outputPath));
|
||||
metaData.Add("ContentIntermediateOutputDir", Path.Combine("obj", MonoGamePlatform, outputPath));
|
||||
output.Add(new TaskItem(fp, metaData));
|
||||
}
|
||||
Output = output.ToArray();
|
||||
return !Log.HasLoggedErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user