You've already forked linux-packaging-mono
Imported Upstream version 4.2.0.179
Former-commit-id: 0a113cb3a6feb7873f632839b1307cc6033cd595
This commit is contained in:
committed by
Jo Shields
parent
183bba2c9a
commit
6992685b86
@@ -9,6 +9,7 @@ LIBRARY = Microsoft.Build.Tasks.dll
|
||||
|
||||
LIBRARY_NAME = Microsoft.Build.Tasks$(NAME_SUFFIX).dll
|
||||
|
||||
LIB_REFS = System System.Core System.Xml System.Windows.Forms
|
||||
LIB_MCS_FLAGS = \
|
||||
/r:$(corlib) \
|
||||
/r:System.dll \
|
||||
|
||||
@@ -311,25 +311,44 @@ namespace Microsoft.Build.Tasks {
|
||||
SearchPath.HintPath, specific_version);
|
||||
}
|
||||
|
||||
static Dictionary<string, AssemblyName> assemblyNameCache = new Dictionary<string, AssemblyName> ();
|
||||
class CachedAssemblyName
|
||||
{
|
||||
public DateTime Time;
|
||||
public AssemblyName Name;
|
||||
}
|
||||
|
||||
static Dictionary<string, CachedAssemblyName> assemblyNameCache = new Dictionary<string, CachedAssemblyName> ();
|
||||
public bool TryGetAssemblyNameFromFile (string filename, out AssemblyName aname)
|
||||
{
|
||||
filename = Path.GetFullPath (filename);
|
||||
if (assemblyNameCache.TryGetValue (filename, out aname))
|
||||
FileInfo info = new FileInfo (filename);
|
||||
if (!info.Exists) {
|
||||
aname = null;
|
||||
LogSearchMessage ("Considered '{0}' as a file, but the file does not exist",
|
||||
filename);
|
||||
return false;
|
||||
}
|
||||
filename = info.FullName;
|
||||
CachedAssemblyName cachedName;
|
||||
if (assemblyNameCache.TryGetValue (filename, out cachedName) && cachedName.Time == info.LastWriteTime) {
|
||||
aname = cachedName.Name;
|
||||
return aname != null;
|
||||
}
|
||||
|
||||
cachedName = new CachedAssemblyName ();
|
||||
cachedName.Time = info.LastWriteTime;
|
||||
aname = null;
|
||||
try {
|
||||
aname = AssemblyName.GetAssemblyName (filename);
|
||||
cachedName.Name = aname = AssemblyName.GetAssemblyName (filename);
|
||||
} catch (FileNotFoundException) {
|
||||
LogSearchMessage ("Considered '{0}' as a file, but the file does not exist",
|
||||
filename);
|
||||
return false;
|
||||
} catch (BadImageFormatException) {
|
||||
LogSearchMessage ("Considered '{0}' as a file, but it is an invalid assembly",
|
||||
filename);
|
||||
}
|
||||
|
||||
assemblyNameCache [filename] = aname;
|
||||
assemblyNameCache [filename] = cachedName;
|
||||
return aname != null;
|
||||
}
|
||||
|
||||
|
||||
@@ -208,9 +208,36 @@ namespace Microsoft.Build.Tasks {
|
||||
if (!TryGetSpecificVersionValue (item, out specific_version))
|
||||
return null;
|
||||
|
||||
var spath_index = 0;
|
||||
foreach (string spath in search_paths) {
|
||||
if (string.IsNullOrEmpty (spath))
|
||||
continue;
|
||||
assembly_resolver.LogSearchMessage ("For searchpath {0}", spath);
|
||||
|
||||
// The first value of search_paths can be the parent assembly directory.
|
||||
// In that case the value would be treated as a directory.
|
||||
// This code checks if we should treat the value as a TargetFramework assembly.
|
||||
// Doing so avoids CopyLocal beeing set to true.
|
||||
if (spath_index++ == 0 && targetFrameworkDirectories != null) {
|
||||
foreach (string fpath in targetFrameworkDirectories) {
|
||||
if (string.IsNullOrEmpty (fpath))
|
||||
continue;
|
||||
if (String.Compare (
|
||||
Path.GetFullPath (spath).TrimEnd (Path.DirectorySeparatorChar),
|
||||
Path.GetFullPath (fpath).TrimEnd (Path.DirectorySeparatorChar),
|
||||
StringComparison.InvariantCulture) != 0)
|
||||
continue;
|
||||
|
||||
resolved = assembly_resolver.FindInTargetFramework (item,
|
||||
fpath, specific_version);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (resolved != null)
|
||||
break;
|
||||
}
|
||||
|
||||
if (String.Compare (spath, "{HintPathFromItem}") == 0) {
|
||||
resolved = assembly_resolver.ResolveHintPathReference (item, specific_version);
|
||||
} else if (String.Compare (spath, "{TargetFrameworkDirectory}") == 0) {
|
||||
|
||||
@@ -93,6 +93,12 @@ namespace Microsoft.Build.Tasks {
|
||||
else
|
||||
commandLine.AppendSwitch ("/optionstrict-");
|
||||
|
||||
if (Bag ["OptionInfer"] != null)
|
||||
if (OptionInfer)
|
||||
commandLine.AppendSwitch ("/optioninfer+");
|
||||
else
|
||||
commandLine.AppendSwitch ("/optioninfer-");
|
||||
|
||||
// OptionStrictType
|
||||
|
||||
// Platform
|
||||
@@ -116,6 +122,9 @@ namespace Microsoft.Build.Tasks {
|
||||
commandLine.AppendSwitchIfNotNull ("/sdkpath:", SdkPath);
|
||||
|
||||
// TargetCompactFramework
|
||||
|
||||
if (String.Compare (VBRuntime, "Embed", StringComparison.OrdinalIgnoreCase) == 0)
|
||||
commandLine.AppendSwitch ("/vbruntime*");
|
||||
|
||||
// Verbosity
|
||||
|
||||
@@ -274,6 +283,12 @@ namespace Microsoft.Build.Tasks {
|
||||
get { return (string) Bag ["OptionStrictType"]; }
|
||||
set { Bag ["OptionStrictType"] = value; }
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public bool OptionInfer {
|
||||
get { return GetBoolParameterWithDefault ("OptionInfer", false); }
|
||||
set { Bag ["OptionInfer"] = value; }
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public string Platform {
|
||||
@@ -318,6 +333,12 @@ namespace Microsoft.Build.Tasks {
|
||||
set { Bag ["UseHostCompilerIfAvailable"] = value; }
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public string VBRuntime {
|
||||
get { return (string) Bag ["VBRuntime"]; }
|
||||
set { Bag ["VBRuntime"] = value; }
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public string Verbosity {
|
||||
get { return (string) Bag ["Verbosity"]; }
|
||||
|
||||
@@ -79,6 +79,7 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
<Message Text='Text5' Importance='normal'/>
|
||||
<Message Text='Text6' Importance='high'/>
|
||||
<Message Text='Text7' />
|
||||
<Message Text='%22abc test%22 123 %22def%22' />
|
||||
<Message Text='Text8' Importance='weird_importance'/>
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -102,7 +103,8 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
Assert.AreEqual (0, testLogger.CheckAny ("Text5", MessageImportance.Normal), "A5");
|
||||
Assert.AreEqual (0, testLogger.CheckAny ("Text6", MessageImportance.High), "A6");
|
||||
Assert.AreEqual (0, testLogger.CheckAny ("Text7", MessageImportance.Normal), "A7");
|
||||
Assert.AreEqual (1, testLogger.CheckAny ("Text8", MessageImportance.Normal), "A8");
|
||||
Assert.AreEqual (0, testLogger.CheckAny ("\"abc test\" 123 \"def\"", MessageImportance.Normal), "A8");
|
||||
Assert.AreEqual (1, testLogger.CheckAny ("Text8", MessageImportance.Normal), "A9");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,6 +90,38 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category("NotWorking")] // this fails due to an xbuild bug, it works on MS.NET
|
||||
public void TestLineWithEscapedSemicolon ()
|
||||
{
|
||||
string[] lines = new string[] { "abc%3Btest%3B%3B", "%3Bdef" };
|
||||
CreateProjectAndCheck (full_filepath, lines, false, true, delegate () {
|
||||
CheckFileExists (full_filepath, true);
|
||||
CheckLines (full_filepath, new string [] {"abc;test;;", ";def"});
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category("NotWorking")] // this fails due to an xbuild bug, it works on MS.NET
|
||||
public void TestLineWithEscapedSpace ()
|
||||
{
|
||||
string[] lines = new string[] { " %20%20abc%20test ", " def%20%20" };
|
||||
CreateProjectAndCheck (full_filepath, lines, false, true, delegate () {
|
||||
CheckFileExists (full_filepath, true);
|
||||
CheckLines (full_filepath, new string [] {" abc test", "def "});
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestLineWithEscapedQuote ()
|
||||
{
|
||||
string[] lines = new string[] { "%22abc test%22 123 %22def%22" };
|
||||
CreateProjectAndCheck (full_filepath, lines, false, true, delegate () {
|
||||
CheckFileExists (full_filepath, true);
|
||||
CheckLines (full_filepath, new string [] {"\"abc test\" 123 \"def\""});
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestNoOverwrite ()
|
||||
{
|
||||
@@ -210,7 +242,7 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
string[] actual = File.ReadAllLines (full_filepath);
|
||||
Assert.AreEqual (expected != null ? expected.Length : 0, actual.Length, "Number of lines written don't match");
|
||||
|
||||
if (expected != null)
|
||||
if (expected == null)
|
||||
return;
|
||||
int i = 0;
|
||||
foreach (string line in actual)
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version ="1.0"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="3.5.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Build.Engine" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="3.5.0.0"/>
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user