DlrTaskFactory Class

MSBuild Extension Pack

DlrTaskFactory Class MSBuild Extension Pack Help 4.0.12.0
A task factory that enables inline scripts to execute as part of an MSBuild-based build.
Inheritance Hierarchy

SystemObject  MSBuild.ExtensionPack.TaskFactoryDlrTaskFactory

Namespace: MSBuild.ExtensionPack.TaskFactory
Assembly: MSBuild.ExtensionPack.TaskFactory.Dlr (in MSBuild.ExtensionPack.TaskFactory.Dlr.dll) Version: 4.0.0.0

The DlrTaskFactory type exposes the following members.

Constructors

  NameDescription
Public methodDlrTaskFactory
Top
Methods

  NameDescription
Public methodCleanupTask
Cleans up the task.
Public methodCreateTask
Creates the task.
Public methodGetTaskParameters
Gets the task parameters.
Public methodInitialize
Initialize
Top
Properties

  NameDescription
Public propertyFactoryName
Gets the name of the factory.
Public propertyTaskType
Gets the type of the task.
Top
Examples

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0"
         DefaultTargets="Build"
         xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <UsingTask
    TaskName="HelloWorld"
    TaskFactory="DlrTaskFactory"
    AssemblyFile="$(TaskFactoryPath)MSBuild.ExtensionPack.TaskFactory.Dlr.dll">
    <ParameterGroup>
      <Name Required="true"/>
      <TaskMessage Output="true"/>
    </ParameterGroup>
    <Task>
      <Code Type="Fragment"
            Language="rb">
           <!-- Make this a proper CDATA section before running. -->
        [CDATA[
        self.task_message = "Hello #{name} from Ruby".to_clr_string
        log.log_message(task_message);
        ]
      </Code>
    </Task>
  </UsingTask>
  <PropertyGroup>
    <YourName Condition=" '$(YourName)'=='' ">World</YourName>
  </PropertyGroup>
  <Target Name="Build">
    <HelloWorld Name="$(YourName)">
      <Output PropertyName="RubyOut"
              TaskParameter="TaskMessage"/>
    </HelloWorld>
    <Message Text="Message from task: $(RubyOut)"
             Importance="high" />
  </Target>
</Project>
See Also

Reference