Imported Upstream version 3.10.0

Former-commit-id: 172c8e3c300b39d5785c7a3e8dfb08ebdbc1a99b
This commit is contained in:
Jo Shields
2014-10-04 11:27:48 +01:00
parent fe777c5c82
commit 8b9b85e7f5
970 changed files with 20242 additions and 31308 deletions

View File

@ -55,10 +55,8 @@ using System.Runtime.InteropServices;
[assembly: Guid ("1ea4dbf0-3c3b-11cf-810c-00aa00389b71")]
[assembly: AllowPartiallyTrustedCallers]
#if !TARGET_JVM
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../msfinal.pub")]
#endif
[assembly: ImportedFromTypeLib ("Accessibility")]

View File

@ -16,15 +16,6 @@ build_SUBDIRS := \
Mono.Posix \
System.Core
net_1_1_java_SUBDIRS = \
System.Xml \
System.Data \
System.Drawing \
Novell.Directory.Ldap \
System.DirectoryServices \
System.Runtime.Serialization.Formatters.Soap \
System.Runtime.Remoting
net_2_0_dirs := \
corlib \
System \

View File

@ -100,7 +100,7 @@ TEST_DISTFILES = \
EXTRA_DISTFILES = \
README System.Windows.Forms.dll.resources \
$(RESX_RESOURCES:.resources=.resx) $(CUR_RESOURCES) $(PREBUILT) build-csproj build-csproj2k5 \
$(RESX_RESOURCES:.resources=.resx) $(CUR_RESOURCES) $(PREBUILT) \
$(IMAGES_RESOURCES) \
$(TEST_DISTFILES)

View File

@ -1,217 +0,0 @@
#!/bin/bash
#
# I got tired of editing the SWF.csproj
# This script will generate it from our System.Windows.Forms.dll.sources
#
#
tr=tr
OutFile=SWF.csproj
Source=System.Windows.Forms.dll.sources
Resource=System.Windows.Forms.dll.resources
SWFhead()
{
cat << EOT
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{5E6430B2-6B9F-4E76-802E-20207EF80391}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "System.Windows.Forms"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Library"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = ""
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "true"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "NET_1_1 ONLY_1_1"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\Debug\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "1"
/>
<Config
Name = "Debug 2.0"
AllowUnsafeBlocks = "true"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "NET_2_0"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\Debug\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "1"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "true"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "NET_1_1 ONLY_1_1"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\Release\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "1"
/>
<Config
Name = "Release 2.0"
AllowUnsafeBlocks = "true"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "NET_2_0"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\Release\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "1"
/>
</Settings>
<References>
<Reference
Name = "Accessibility"
AssemblyName = "Accessibility"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Accessibility.dll"
/>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
/>
<Reference
Name = "System.Data"
AssemblyName = "System.Data"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
/>
<Reference
Name = "System.Drawing"
AssemblyName = "System.Drawing"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
/>
<Reference
Name = "System.Data"
AssemblyName = "System.Data"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
/>
<Reference
Name = "System.XML"
AssemblyName = "System.XML"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
/>
</References>
</Build>
<Files>
<Include>
EOT
}
SWFfilelist()
{
cat $Source | while read SRC; do
# Don't do AssemblyInfo, it's got signing requests and such that we don't want
if [ "x$SRC" != "xAssembly/AssemblyInfo.cs" ] ; then
SRC=`echo $SRC | $tr '/' '\\\\'`
cat << EOT
<File
RelPath = "$SRC"
SubType = "Code"
BuildAction = "Compile"
/>
EOT
fi
done
}
SWFresourcelist()
{
cat $Resource | while read SRC; do
SRC=`echo $SRC | $tr '/' '\\\\'`
SRC=`echo $SRC | sed 's/-resource://' | awk -F , '{print " RelPath = \"" $1 "\"\n CustomToolNameSpace = \"" $2 "\""}' | fgrep -v \"\"`
cat << EOT
<File
$SRC
BuildAction = "EmbeddedResource"
/>
EOT
done
}
SWFtail()
{
cat << EOT
<File
RelPath = "Consts.cs"
Link = "common/Consts.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "MonoTODOAttribute.cs"
Link = "common/MonoTODOAttribute.cs"
SubType = "Code"
BuildAction = "Compile"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>
EOT
}
SWFhead > $OutFile
SWFfilelist >> $OutFile
SWFresourcelist >> $OutFile
SWFtail >> $OutFile

View File

@ -1,247 +0,0 @@
#!/bin/bash
#
# This script will generate SWF.cs.target from our System.Windows.Forms.dll.sources
#
#
exec > SWF2k5.csproj
Source=System.Windows.Forms.dll.sources
Resource=System.Windows.Forms.dll.resources
SWFhead()
{
cat <<EOF
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{5E6430B2-6B9F-4E76-802E-20207EF80391}</ProjectGuid>
<Configuration Condition=" '\$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '\$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<RootNamespace>
</RootNamespace>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
</PropertyGroup>
<PropertyGroup Condition=" '\$(Configuration)|\$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>NET_1_1 NET_2_0 MWF_ON_MSRUNTIME</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>612,618,3021</NoWarn>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>3</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
<OutputType>Library</OutputType>
<AssemblyName>System.Windows.Forms</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '\$(Configuration)|\$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>NET_1_1 NET_2_0 MWF_ON_MSRUNTIME</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>612,618,3021</NoWarn>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>3</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>
<OutputType>Library</OutputType>
<AssemblyName>System.Windows.Forms</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '\$(Configuration)|\$(Platform)' == 'Debug 1.1|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>NET_1_1 ONLY_1_1 MWF_ON_MSRUNTIME</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>612,618,3021</NoWarn>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>3</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
<OutputType>Library</OutputType>
<AssemblyName>System.Windows.Forms</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '\$(Configuration)|\$(Platform)' == 'Release 1.1|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>NET_1_1 ONLY_1_1 MWF_ON_MSRUNTIME</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>612,618,3021</NoWarn>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>3</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>
<OutputType>Library</OutputType>
<AssemblyName>System.Windows.Forms</AssemblyName>
</PropertyGroup>
<ItemGroup>
<Reference Include="Accessibility">
<Name>Accessibility</Name>
</Reference>
<Reference Include="System">
<Name>System</Name>
</Reference>
<Reference Include="System.configuration" />
<Reference Include="System.Data">
<Name>System.Data</Name>
</Reference>
<Reference Include="System.Data">
<Name>System.Data</Name>
</Reference>
<Reference Include="System.Drawing">
<Name>System.Drawing</Name>
</Reference>
<Reference Include="System.Xml">
<Name>System.Xml</Name>
</Reference>
<Reference Include="Mono.WebBrowser2K5">
<Name>Mono.WebBrowser2K5</Name>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Mono.WebBrowser\Mono.WebBrowser2K5.csproj">
<Project>{5E6C996A-007F-40CE-B244-006EFCFB77D2}</Project>
<Name>Mono.WebBrowser2K5</Name>
</ProjectReference>
</ItemGroup>
EOF
}
SWFtail()
{
cat <<EOF
<ItemGroup>
<None Include="System.Windows.Forms\ChangeLog" />
</ItemGroup>
<ItemGroup>
<None Include="ChangeLog" />
</ItemGroup>
<Import Project="\$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
EOF
}
SWFfilelist()
{
echo " <ItemGroup>"
cat $Source | while read SRC; do
# Don't do AssemblyInfo, it's got signing requests and such that we don't want
if [ "x$SRC" != "xAssembly/AssemblyInfo.cs" ] ; then
SRC=`echo $SRC | sed 's/..\/..\/build\///'`
SRC=`echo $SRC | tr '/' '\\\\'`
cat <<EOF
<Compile Include="$SRC" />
EOF
fi
done
echo " </ItemGroup>"
}
SWFresourcelist()
{
echo " <ItemGroup>"
cat $Resource | while read SRC; do
CUSTOMTOOLNAMESPACE=""
# strip out that -resource:
SRC=`echo $SRC | sed 's/-resource://'`
CUSTOMTOOLNAMESPACE=`echo $SRC | awk -F, '{print $2}'`
INCLUDE=`echo $SRC | awk -F, '{print $1}'`
if test -f $INCLUDE.prebuilt; then
INCLUDE=$INCLUDE.prebuilt
fi
# strip off the path from the name of the resource and the .prebuilt if there is one
LOGICALNAME=`echo $INCLUDE | sed 's/resources\///;s/.prebuilt//'`
# convert all /'s to \\'s
INCLUDE=`echo $INCLUDE | sed 's/\//\\\\/'`
echo " <EmbeddedResource Include=\"$INCLUDE\">"
if test "x$CUSTOMTOOLNAMESPACE" != "x"; then
echo " <LogicalName>$CUSTOMTOOLNAMESPACE</LogicalName>"
else
echo " <LogicalName>$LOGICALNAME</LogicalName>"
fi
echo " </EmbeddedResource>"
done
echo " </ItemGroup>"
}
SWFhead
SWFfilelist
SWFresourcelist
SWFtail

View File

@ -78,43 +78,38 @@ namespace Microsoft.Build.BuildEngine {
if (propertyName != null)
element.SetAttribute ("PropertyName", propertyName);
}
[MonoTODO]
public bool Execute ()
{
bool result = false;
TaskEngine taskEngine;
LogTaskStarted ();
ITask task = null;
ITask task;
try {
try {
task = InitializeTask ();
} catch (Exception e) {
LogError ("Error initializing task {0}: {1}", taskElement.LocalName, e.Message);
LogMessage (MessageImportance.Low, "Error initializing task {0}: {1}",
taskElement.LocalName, e.ToString ());
return false;
}
try {
taskEngine = new TaskEngine (parentTarget.Project);
taskEngine.Prepare (task, this.taskElement, GetParameters (), this.Type);
result = taskEngine.Execute ();
if (result)
taskEngine.PublishOutput ();
} catch (Exception e) {
task_logger.LogError ("Error executing task {0}: {1}", taskElement.LocalName, e.Message);
task_logger.LogMessage (MessageImportance.Low,
"Error executing task {0}: {1}", taskElement.LocalName, e.ToString ());
result = false;
}
} finally {
LogTaskFinished (result);
task = InitializeTask ();
} catch (Exception e) {
LogError ("Error initializing task {0}: {1}", taskElement.LocalName, e.Message);
LogMessage (MessageImportance.Low, "Error initializing task {0}: {1}",
taskElement.LocalName, e.ToString ());
return false;
}
return result;
try {
taskEngine = new TaskEngine (parentTarget.Project, task, Type);
taskEngine.Prepare (GetParameters ());
var result = taskEngine.Execute ();
if (result)
taskEngine.PublishOutput (taskElement, taskEngine.ValueFromExecution);
LogTaskFinished (result);
return result;
} catch (Exception e) {
task_logger.LogError ("Error executing task {0}: {1}", taskElement.LocalName, e.Message);
task_logger.LogMessage (MessageImportance.Low,
"Error executing task {0}: {1}", taskElement.LocalName, e.ToString ());
return false;
}
}
@ -140,6 +135,21 @@ namespace Microsoft.Build.BuildEngine {
return taskElement.GetAttribute (attributeName);
}
bool IBuildTask.ResolveOutputItems ()
{
var taskEngine = new TaskEngine (parentTarget.Project, null, Type);
taskEngine.PublishOutput (taskElement, l => {
var pv = GetParameterValue (l.Name);
Expression exp = new Expression ();
exp.Parse (pv, ParseOptions.AllowItemsMetadataAndSplit);
return exp.ConvertTo (parentTarget.Project, l.PropertyType);
});
return true;
}
public void SetParameterValue (string parameterName,
string parameterValue)

View File

@ -73,6 +73,11 @@ namespace Microsoft.Build.BuildEngine
foreach (XmlAttribute attrib in XmlElement.Attributes)
yield return attrib.Value;
}
public bool ResolveOutputItems ()
{
return true;
}
}
}

View File

@ -52,7 +52,11 @@ namespace Microsoft.Build.BuildEngine {
{
return GetAttributes ();
}
public bool ResolveOutputItems ()
{
return true;
}
}
}

View File

@ -38,6 +38,7 @@ namespace Microsoft.Build.BuildEngine {
}
bool Execute ();
bool ResolveOutputItems ();
IEnumerable<string> GetAttributes ();
}

View File

@ -36,7 +36,6 @@ using System.Xml;
using Microsoft.Build.Framework;
namespace Microsoft.Build.BuildEngine {
internal class TargetBatchingImpl : BatchingImplBase
{
string inputs;
@ -58,17 +57,6 @@ namespace Microsoft.Build.BuildEngine {
{
executeOnErrors = false;
try {
string reason;
if (!BuildTargetNeeded (out reason)) {
LogTargetStarted (target);
LogTargetSkipped (target, reason);
LogTargetFinished (target, true);
return true;
}
if (!String.IsNullOrEmpty (reason))
target.Engine.LogMessage (MessageImportance.Low, reason);
Init ();
ParseTargetAttributes (target);
@ -104,24 +92,52 @@ namespace Microsoft.Build.BuildEngine {
executeOnErrors = false;
LogTargetStarted (target);
if (bucket != null)
project.PushBatch (bucket, commonItemsByName);
try {
string reason;
if (!BuildTargetNeeded (out reason)) {
LogTargetSkipped (target, reason);
return true;
}
if (!String.IsNullOrEmpty (reason))
target.Engine.LogMessage (MessageImportance.Low, reason);
try {
TaskExecutionMode taskExecutionMode;
string reason;
bool skip_completely;
if (!BuildTargetNeeded (out reason, out skip_completely)) {
LogTargetSkipped (target, reason);
if (skip_completely)
return true;
taskExecutionMode = TaskExecutionMode.SkipAndSetOutput;
} else {
taskExecutionMode = TaskExecutionMode.Complete;
if (!String.IsNullOrEmpty (reason))
target.Engine.LogMessage (MessageImportance.Low, reason);
}
for (int i = 0; i < target.BuildTasks.Count; i ++) {
//FIXME: parsing attributes repeatedly
IBuildTask bt = target.BuildTasks [i];
// HACK: need some form of cross references checks
var tem = taskExecutionMode;
if (tem == TaskExecutionMode.SkipAndSetOutput) {
var bti = bt as BuildTask;
//
// BuildTargetNeeded checks only files timestamps but ignores any metadata dependencies
// that way we can end up in the situation when output metadata are populated but from
// incomplete dependencies.
//
// E.g.
// <CreateItem Include="$(IntermediateOutputPath)%(_PngImage.LogicalName)" AdditionalMetadata="LogicalName=%(_PngImage.LogicalName)">
// <Output TaskParameter="Include" />
// </CreateItem>
//
if (bti != null && bti.Name == "CreateItem")
tem = TaskExecutionMode.Complete;
}
TaskBatchingImpl batchingImpl = new TaskBatchingImpl (project);
bool task_result = batchingImpl.Build (bt, out executeOnErrors);
bool task_result = batchingImpl.Build (bt, tem, out executeOnErrors);
if (task_result)
continue;
@ -138,6 +154,7 @@ namespace Microsoft.Build.BuildEngine {
} finally {
if (bucket != null)
project.PopBatch ();
LogTargetFinished (target, target_result);
}
@ -155,15 +172,17 @@ namespace Microsoft.Build.BuildEngine {
ParseAttribute (outputs);
}
bool BuildTargetNeeded (out string reason)
bool BuildTargetNeeded (out string reason, out bool skipCompletely)
{
reason = String.Empty;
ITaskItem [] inputFiles;
ITaskItem [] outputFiles;
DateTime youngestInput, oldestOutput;
skipCompletely = false;
if (String.IsNullOrEmpty (inputs.Trim ()))
if (String.IsNullOrEmpty (inputs.Trim ())) {
return true;
}
if (String.IsNullOrEmpty (outputs.Trim ())) {
project.ParentEngine.LogError ("Target {0} has inputs but no outputs specified.", name);
@ -184,6 +203,7 @@ namespace Microsoft.Build.BuildEngine {
}
if (inputFiles == null || inputFiles.Length == 0) {
skipCompletely = true;
reason = String.Format ("No input files were specified for target {0}, skipping.", name);
return false;
}

View File

@ -40,7 +40,7 @@ namespace Microsoft.Build.BuildEngine {
{
}
public bool Build (IBuildTask buildTask, out bool executeOnErrors)
public bool Build (IBuildTask buildTask, TaskExecutionMode taskExecutionMode, out bool executeOnErrors)
{
executeOnErrors = false;
try {
@ -49,15 +49,11 @@ namespace Microsoft.Build.BuildEngine {
// populate list of referenced items and metadata
ParseTaskAttributes (buildTask);
if (consumedMetadataReferences.Count == 0) {
// No batching required
if (ConditionParser.ParseAndEvaluate (buildTask.Condition, project))
return buildTask.Execute ();
else // skipped, it should be logged
return true;
return Execute (buildTask, taskExecutionMode);
}
BatchAndPrepareBuckets ();
return Run (buildTask, out executeOnErrors);
return Run (buildTask, taskExecutionMode, out executeOnErrors);
} finally {
consumedItemsByName = null;
consumedMetadataReferences = null;
@ -68,7 +64,7 @@ namespace Microsoft.Build.BuildEngine {
}
}
bool Run (IBuildTask buildTask, out bool executeOnErrors)
bool Run (IBuildTask buildTask, TaskExecutionMode taskExecutionMode, out bool executeOnErrors)
{
executeOnErrors = false;
@ -76,11 +72,9 @@ namespace Microsoft.Build.BuildEngine {
bool retval = true;
if (buckets.Count == 0) {
// batched mode, but no values in the corresponding items!
if (ConditionParser.ParseAndEvaluate (buildTask.Condition, project)) {
retval = buildTask.Execute ();
if (!retval && !buildTask.ContinueOnError)
executeOnErrors = true;
}
retval = Execute (buildTask, taskExecutionMode);
if (!retval && !buildTask.ContinueOnError)
executeOnErrors = true;
return retval;
}
@ -89,12 +83,10 @@ namespace Microsoft.Build.BuildEngine {
foreach (Dictionary<string, BuildItemGroup> bucket in buckets) {
project.PushBatch (bucket, commonItemsByName);
try {
if (ConditionParser.ParseAndEvaluate (buildTask.Condition, project)) {
retval = buildTask.Execute ();
if (!retval && !buildTask.ContinueOnError) {
executeOnErrors = true;
break;
}
retval = Execute (buildTask, taskExecutionMode);
if (!retval && !buildTask.ContinueOnError) {
executeOnErrors = true;
break;
}
} finally {
project.PopBatch ();
@ -104,6 +96,22 @@ namespace Microsoft.Build.BuildEngine {
return retval;
}
bool Execute (IBuildTask buildTask, TaskExecutionMode taskExecutionMode)
{
if (ConditionParser.ParseAndEvaluate (buildTask.Condition, project)) {
switch (taskExecutionMode) {
case TaskExecutionMode.Complete:
return buildTask.Execute ();
case TaskExecutionMode.SkipAndSetOutput:
return buildTask.ResolveOutputItems ();
default:
throw new NotImplementedException ();
}
}
return true;
}
// Parse task attributes to get list of referenced metadata and items
// to determine batching

View File

@ -38,10 +38,9 @@ using Microsoft.Build.Utilities;
namespace Microsoft.Build.BuildEngine {
internal class TaskEngine {
ITask task;
XmlElement taskElement;
Type taskType;
Project parentProject;
ITask task;
static Type requiredAttribute;
static Type outputAttribute;
@ -52,9 +51,11 @@ namespace Microsoft.Build.BuildEngine {
outputAttribute = typeof (Microsoft.Build.Framework.OutputAttribute);
}
public TaskEngine (Project project)
public TaskEngine (Project project, ITask task, Type taskType)
{
parentProject = project;
this.task = task;
this.taskType = taskType;
}
// Rules (inferred) for property values incase of empty data
@ -69,17 +70,13 @@ namespace Microsoft.Build.BuildEngine {
// string/
// ITaskItem[] empty/whitespace null No
public void Prepare (ITask task, XmlElement taskElement,
IDictionary <string, string> parameters, Type taskType)
public void Prepare (IDictionary <string, string> parameters)
{
Dictionary <string, object> values;
PropertyInfo currentProperty;
PropertyInfo[] properties;
object value;
this.task = task;
this.taskElement = taskElement;
this.taskType = taskType;
values = new Dictionary <string, object> (StringComparer.OrdinalIgnoreCase);
foreach (KeyValuePair <string, string> de in parameters) {
@ -131,20 +128,18 @@ namespace Microsoft.Build.BuildEngine {
InitializeParameter (pi, val);
}
}
public bool Execute ()
{
return task.Execute ();
}
public void PublishOutput ()
public void PublishOutput (XmlElement taskElement, Func<PropertyInfo, object> valueProvider)
{
XmlElement xmlElement;
PropertyInfo propertyInfo;
string propertyName;
string taskParameter;
string itemName;
object o;
foreach (XmlNode xmlNode in taskElement.ChildNodes) {
if (!(xmlNode is XmlElement))
@ -165,16 +160,17 @@ namespace Microsoft.Build.BuildEngine {
taskParameter = xmlElement.GetAttribute ("TaskParameter");
itemName = xmlElement.GetAttribute ("ItemName");
propertyName = xmlElement.GetAttribute ("PropertyName");
propertyInfo = taskType.GetProperty (taskParameter, BindingFlags.Public | BindingFlags.Instance |
BindingFlags.IgnoreCase);
var propertyInfo = taskType.GetProperty (taskParameter, BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase);
if (propertyInfo == null)
throw new InvalidProjectFileException (String.Format (
"The parameter '{0}' was not found for the '{1}' task.", taskParameter, taskElement.Name));
throw new InvalidProjectFileException (String.Format ("The parameter '{0}' was not found for the '{1}' task.", taskParameter, taskElement.Name));
if (!propertyInfo.IsDefined (outputAttribute, false))
throw new InvalidProjectFileException ("This is not output property.");
throw new InvalidProjectFileException ("This is not output property.");
o = propertyInfo.GetValue (task, null);
var o = valueProvider (propertyInfo);
if (itemName != String.Empty) {
PublishItemGroup (propertyInfo, o, itemName);
} else {
@ -260,5 +256,10 @@ namespace Microsoft.Build.BuildEngine {
return true;
}
public object ValueFromExecution (PropertyInfo propertyInfo)
{
return propertyInfo.GetValue (task, null);
}
}
}

View File

@ -0,0 +1,36 @@
//
// TaskExecutionMode.cs
//
// Authors:
// Marek Safar <marek.safar@gmail.com>
//
// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace Microsoft.Build.BuildEngine
{
enum TaskExecutionMode
{
Complete = 0,
SkipAndSetOutput = 1
}
}

View File

@ -65,6 +65,7 @@ Microsoft.Build.BuildEngine/TargetCollection.cs
Microsoft.Build.BuildEngine/Target.cs
Microsoft.Build.BuildEngine/TaskDatabase.cs
Microsoft.Build.BuildEngine/TaskEngine.cs
Microsoft.Build.BuildEngine/TaskExecutionMode.cs
Microsoft.Build.BuildEngine/Token.cs
Microsoft.Build.BuildEngine/Toolset.cs
Microsoft.Build.BuildEngine/ToolsetCollection.cs

View File

@ -1402,6 +1402,8 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
}
[Test]
// Fails on wrench
[Category ("NotWorking")]
public void TestItemsWithWildcards ()
{
Engine engine = new Engine (Consts.BinPath);
@ -1476,6 +1478,8 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
}
[Test]
// Fails on wrench
[Category ("NotWorking")]
public void TestReservedMetadata ()
{
Engine engine = new Engine (Consts.BinPath);

View File

@ -83,6 +83,11 @@ namespace Microsoft.Build.Framework
get {
return message;
}
#if NET_4_0
protected set {
message = value;
}
#endif
}
public string SenderName {

View File

@ -26,12 +26,12 @@ namespace Microsoft.Build.Framework
{
}
public BuildEventContext (int nodeId, int projectInstanceId, int targetId, int projectContextId, int taskId)
: this (rnd.Next (), nodeId, projectInstanceId, targetId, projectContextId, taskId)
public BuildEventContext (int nodeId, int projectInstanceId, int projectContextId, int targetId, int taskId)
: this (rnd.Next (), nodeId, projectInstanceId, projectContextId, targetId, taskId)
{
}
public BuildEventContext (int submissionId, int nodeId, int projectInstanceId, int targetId, int projectContextId, int taskId)
public BuildEventContext (int submissionId, int nodeId, int projectInstanceId, int projectContextId, int targetId, int taskId)
{
SubmissionId = submissionId;
NodeId = nodeId;
@ -56,9 +56,9 @@ namespace Microsoft.Build.Framework
public int TaskId { get; private set; }
// MSDN document says "true if the references are equal, false otherwise." but that doesn't make sense.
public override bool Equals (object other)
public override bool Equals (object obj)
{
var o = other as BuildEventContext;
var o = obj as BuildEventContext;
return (object) o != null &&
o.NodeId == NodeId &&
o.ProjectContextId == ProjectContextId &&

View File

@ -32,7 +32,7 @@ using System;
namespace Microsoft.Build.Framework
{
[Serializable]
public abstract class LazyFormattedBuildEventArgs : BuildEventArgs {
public class LazyFormattedBuildEventArgs : BuildEventArgs {
string message, format;
object[] args;

View File

@ -3,8 +3,8 @@ namespace Microsoft.Build.Framework
{
public enum RegisteredTaskObjectLifetime
{
AppDomain,
Build
Build,
AppDomain
}
}
#endif

View File

@ -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)

Some files were not shown because too many files have changed in this diff Show More