You've already forked linux-packaging-mono
Imported Upstream version 3.10.0
Former-commit-id: 172c8e3c300b39d5785c7a3e8dfb08ebdbc1a99b
This commit is contained in:
@@ -41,7 +41,7 @@ using System.Collections.Specialized;
|
||||
|
||||
namespace Microsoft.Build.Tasks
|
||||
{
|
||||
public class CodeTaskFactory : ITaskFactory2
|
||||
public class CodeTaskFactory : ITaskFactory
|
||||
{
|
||||
public CodeTaskFactory ()
|
||||
{
|
||||
@@ -51,11 +51,12 @@ namespace Microsoft.Build.Tasks
|
||||
public void CleanupTask (ITask task)
|
||||
{
|
||||
}
|
||||
public ITask CreateTask (IBuildEngine taskFactoryLoggingHost)
|
||||
public ITask CreateTask (IBuildEngine loggingHost)
|
||||
{
|
||||
return CreateTask (taskFactoryLoggingHost, null);
|
||||
return CreateTask (loggingHost, null);
|
||||
}
|
||||
public ITask CreateTask (IBuildEngine taskFactoryLoggingHost, IDictionary<string, string> taskIdentityParameters)
|
||||
|
||||
ITask CreateTask (IBuildEngine taskFactoryLoggingHost, IDictionary<string, string> taskIdentityParameters)
|
||||
{
|
||||
if (assembly == null)
|
||||
return null;
|
||||
@@ -66,11 +67,11 @@ namespace Microsoft.Build.Tasks
|
||||
{
|
||||
return parameter_group != null ? parameter_group.Values.ToArray () : new TaskPropertyInfo [0];
|
||||
}
|
||||
public bool Initialize (string taskName, IDictionary<string, TaskPropertyInfo> parameterGroup, string taskBody, IBuildEngine taskFactoryLoggingHost)
|
||||
public bool Initialize (string taskName, IDictionary<string, TaskPropertyInfo> taskParameters, string taskElementContents, IBuildEngine taskFactoryLoggingHost)
|
||||
{
|
||||
return Initialize (taskName, null, parameterGroup, taskBody, taskFactoryLoggingHost);
|
||||
return Initialize (taskName, null, taskParameters, taskElementContents, taskFactoryLoggingHost);
|
||||
}
|
||||
public bool Initialize (string taskName, IDictionary<string, string> factoryIdentityParameters, IDictionary<string, TaskPropertyInfo> parameterGroup, string taskBody, IBuildEngine taskFactoryLoggingHost)
|
||||
bool Initialize (string taskName, IDictionary<string, string> factoryIdentityParameters, IDictionary<string, TaskPropertyInfo> parameterGroup, string taskBody, IBuildEngine taskFactoryLoggingHost)
|
||||
{
|
||||
task_name = taskName;
|
||||
if (parameterGroup != null)
|
||||
|
@@ -122,7 +122,7 @@ namespace Microsoft.Build.Tasks {
|
||||
|
||||
protected abstract string CreateManifestName (string fileName,
|
||||
string linkFileName,
|
||||
string rootNamespace,
|
||||
string rootNamespaceName,
|
||||
string dependentUponFileName,
|
||||
Stream binaryStream);
|
||||
|
||||
|
@@ -26,7 +26,7 @@
|
||||
///// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
/////
|
||||
|
||||
#if NET_2_0
|
||||
#if !NET_4_0
|
||||
|
||||
using System;
|
||||
using Microsoft.Build.Framework;
|
||||
|
@@ -25,8 +25,6 @@
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#if NET_2_0
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.Build.Framework;
|
||||
@@ -102,12 +100,12 @@ namespace Microsoft.Build.Tasks {
|
||||
//
|
||||
if (References != null)
|
||||
foreach (ITaskItem item in References) {
|
||||
string aliases = item.GetMetadata ("Aliases") ?? String.Empty;
|
||||
aliases = aliases.Trim ();
|
||||
if (aliases.Length > 0)
|
||||
commandLine.AppendSwitchIfNotNull ("/reference:" + aliases + "=", item.ItemSpec);
|
||||
else
|
||||
string aliases = item.GetMetadata ("Aliases");
|
||||
if (!string.IsNullOrEmpty (aliases)) {
|
||||
AddAliasesReference (commandLine, aliases, item.ItemSpec);
|
||||
} else {
|
||||
commandLine.AppendSwitchIfNotNull ("/reference:", item.ItemSpec);
|
||||
}
|
||||
}
|
||||
|
||||
if (ResponseFiles != null)
|
||||
@@ -125,6 +123,21 @@ namespace Microsoft.Build.Tasks {
|
||||
commandLine.AppendSwitchIfNotNull ("/win32res:", Win32Resource);
|
||||
}
|
||||
|
||||
static void AddAliasesReference (CommandLineBuilderExtension commandLine, string aliases, string reference)
|
||||
{
|
||||
foreach (var alias in aliases.Split (',')) {
|
||||
var a = alias.Trim ();
|
||||
if (a.Length == null)
|
||||
continue;
|
||||
|
||||
var r = "/reference:";
|
||||
if (!string.Equals (a, "global", StringComparison.OrdinalIgnoreCase))
|
||||
r += a + "=";
|
||||
|
||||
commandLine.AppendSwitchIfNotNull (r, reference);
|
||||
}
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
protected override bool CallHostObjectToExecute ()
|
||||
{
|
||||
@@ -232,4 +245,3 @@ namespace Microsoft.Build.Tasks {
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -122,13 +122,13 @@ namespace Microsoft.Build.Tasks {
|
||||
Log.LogMessage (MessageImportance.Normal, "Executing: " + command);
|
||||
}
|
||||
|
||||
protected override void LogEventsFromTextOutput (string singleLine, MessageImportance importance)
|
||||
protected override void LogEventsFromTextOutput (string singleLine, MessageImportance messageImportance)
|
||||
{
|
||||
#if NET_4_0
|
||||
if (IgnoreStandardErrorWarningFormat ||
|
||||
(!errorMatcher (singleLine) && !warningMatcher (singleLine)))
|
||||
#endif
|
||||
Log.LogMessage (importance, singleLine);
|
||||
Log.LogMessage (messageImportance, singleLine);
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
|
@@ -36,7 +36,7 @@ using Microsoft.Build.Utilities;
|
||||
|
||||
namespace Microsoft.Build.Tasks {
|
||||
//FIXME: This should be in v3.5 only
|
||||
public sealed class FindAppConfigFile : TaskExtension {
|
||||
public class FindAppConfigFile : TaskExtension {
|
||||
|
||||
public FindAppConfigFile ()
|
||||
{
|
||||
|
@@ -222,7 +222,6 @@ namespace Microsoft.Build.Tasks
|
||||
"It should have either 2 or 3 comma separated components.", moniker_literal);
|
||||
}
|
||||
|
||||
[Required]
|
||||
public string TargetFrameworkMoniker { get; set; }
|
||||
|
||||
public string RootPath { get; set; }
|
||||
@@ -233,10 +232,10 @@ namespace Microsoft.Build.Tasks
|
||||
public string TargetFrameworkMonikerDisplayName { get; set; }
|
||||
|
||||
[Output]
|
||||
public string[] ReferenceAssemblyPaths { get; set; }
|
||||
public string[] ReferenceAssemblyPaths { get; private set; }
|
||||
|
||||
[Output]
|
||||
public string[] FullFrameworkReferenceAssemblyPaths { get; set; }
|
||||
public string[] FullFrameworkReferenceAssemblyPaths { get; private set; }
|
||||
|
||||
static string DefaultFrameworksBasePath {
|
||||
get {
|
||||
|
@@ -53,7 +53,6 @@ namespace Microsoft.Build.Tasks {
|
||||
bool findRelatedFiles;
|
||||
bool findSatellites;
|
||||
bool findSerializationAssemblies;
|
||||
string[] installedAssemblyTables;
|
||||
ITaskItem[] relatedFiles;
|
||||
ITaskItem[] resolvedDependencyFiles;
|
||||
ITaskItem[] resolvedFiles;
|
||||
@@ -156,6 +155,9 @@ namespace Microsoft.Build.Tasks {
|
||||
|
||||
LogWithPrecedingNewLine (MessageImportance.Low, "Primary Reference {0}", item.ItemSpec);
|
||||
ResolvedReference resolved_ref = ResolveReference (item, searchPaths, true);
|
||||
if (resolved_ref == null)
|
||||
resolved_ref = ResolveWithAlternateName (item, allowedAssemblyExtensions ?? default_assembly_extensions);
|
||||
|
||||
if (resolved_ref == null) {
|
||||
Log.LogWarning ("Reference '{0}' not resolved", item.ItemSpec);
|
||||
assembly_resolver.LogSearchLoggerMessages (MessageImportance.Normal);
|
||||
@@ -182,6 +184,19 @@ namespace Microsoft.Build.Tasks {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ResolvedReference ResolveWithAlternateName (ITaskItem item, string[] extensions)
|
||||
{
|
||||
foreach (string extn in extensions) {
|
||||
if (item.ItemSpec.EndsWith (extn)) {
|
||||
ITaskItem altitem = new TaskItem (item.ItemSpec.Substring (0, item.ItemSpec.Length - extn.Length));
|
||||
item.CopyMetadataTo (altitem);
|
||||
return ResolveReference (altitem, searchPaths, true);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Use @search_paths to resolve the reference
|
||||
ResolvedReference ResolveReference (ITaskItem item, IEnumerable<string> search_paths, bool set_copy_local)
|
||||
{
|
||||
@@ -610,12 +625,15 @@ namespace Microsoft.Build.Tasks {
|
||||
get { return findSerializationAssemblies; }
|
||||
set { findSerializationAssemblies = value; }
|
||||
}
|
||||
|
||||
public string[] InstalledAssemblyTables {
|
||||
get { return installedAssemblyTables; }
|
||||
set { installedAssemblyTables = value; }
|
||||
}
|
||||
|
||||
|
||||
public
|
||||
#if NET_4_0
|
||||
ITaskItem[]
|
||||
#else
|
||||
string[]
|
||||
#endif
|
||||
InstalledAssemblyTables { get; set; }
|
||||
|
||||
[Output]
|
||||
public ITaskItem[] RelatedFiles {
|
||||
get { return relatedFiles; }
|
||||
|
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// UpdateManifest.cs
|
||||
// VCBuild.cs
|
||||
//
|
||||
// Author:
|
||||
// Leszek Ciesielski <skolima@gmail.com>
|
||||
@@ -26,7 +26,7 @@
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#if NET_2_0
|
||||
#if !NET_4_0
|
||||
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
|
@@ -158,7 +158,7 @@ namespace Microsoft.Build.Tasks {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override void LogEventsFromTextOutput (string singleLine, MessageImportance importance)
|
||||
protected override void LogEventsFromTextOutput (string singleLine, MessageImportance messageImportance)
|
||||
{
|
||||
singleLine = singleLine.Trim ();
|
||||
if (singleLine.Length == 0)
|
||||
@@ -173,7 +173,7 @@ namespace Microsoft.Build.Tasks {
|
||||
|
||||
Match match = ErrorRegex.Match (singleLine);
|
||||
if (!match.Success) {
|
||||
Log.LogMessage (importance, singleLine);
|
||||
Log.LogMessage (messageImportance, singleLine);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ namespace Microsoft.Build.Tasks {
|
||||
Log.LogError (null, code, null, filename, lineNumber, columnNumber, -1,
|
||||
-1, text, null);
|
||||
} else {
|
||||
Log.LogMessage (importance, singleLine);
|
||||
Log.LogMessage (messageImportance, singleLine);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -433,6 +433,24 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
Assert.AreEqual (String.Empty, c2.ToString (), "A2");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestReferencesAlias ()
|
||||
{
|
||||
CscExtended csc = new CscExtended ();
|
||||
CommandLineBuilderExtension c1 = new CommandLineBuilderExtension ();
|
||||
CommandLineBuilderExtension c2 = new CommandLineBuilderExtension ();
|
||||
|
||||
TaskItem ti1 = new TaskItem ("A");
|
||||
ti1.SetMetadata ("Aliases", "r1,global,r2");
|
||||
|
||||
csc.References = new ITaskItem[2] { ti1, new TaskItem ("B") };
|
||||
csc.ARFC (c1);
|
||||
csc.ACLC (c2);
|
||||
|
||||
Assert.AreEqual ("/reference:r1=A /reference:A /reference:r2=A /reference:B", c1.ToString (), "A1");
|
||||
Assert.AreEqual (String.Empty, c2.ToString (), "A2");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestResponseFiles ()
|
||||
{
|
||||
|
@@ -227,6 +227,52 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
";
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSystemDll ()
|
||||
{
|
||||
var gacDir = GetGacDir ();
|
||||
|
||||
if (gacDir == null || !System.IO.Directory.Exists (gacDir))
|
||||
Assert.Ignore ("GAC not found.");
|
||||
|
||||
string documentString = @"
|
||||
<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
|
||||
<ItemGroup>
|
||||
<Reference Include='System.dll' />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<SearchPaths>
|
||||
{CandidateAssemblyFiles};
|
||||
$(ReferencePath);
|
||||
{HintPathFromItem};
|
||||
{TargetFrameworkDirectory};
|
||||
{AssemblyFolders};
|
||||
{GAC};
|
||||
{RawFileName};
|
||||
$(OutputPath)
|
||||
</SearchPaths>
|
||||
</PropertyGroup>
|
||||
<Target Name='A'>
|
||||
<ResolveAssemblyReference
|
||||
Assemblies='@(Reference)'
|
||||
SearchPaths='$(SearchPaths)'
|
||||
>
|
||||
<Output TaskParameter='ResolvedFiles' ItemName='ResolvedFiles'/>
|
||||
</ResolveAssemblyReference>
|
||||
</Target>
|
||||
</Project>
|
||||
";
|
||||
|
||||
engine = new Engine (Consts.BinPath);
|
||||
project = engine.CreateNewProject ();
|
||||
project.LoadXml (documentString);
|
||||
|
||||
Assert.IsTrue (project.Build ("A"), "A1");
|
||||
big = project.GetEvaluatedItemsByName ("ResolvedFiles");
|
||||
Assert.AreEqual (1, big.Count, "A2");
|
||||
Assert.IsTrue (big [0].Include.EndsWith (".dll"), "A3");
|
||||
}
|
||||
|
||||
string GetGacDir ()
|
||||
{
|
||||
// copied from mcs/tools/gacutil/driver.cs
|
||||
|
Reference in New Issue
Block a user