DeployLX Software Protection System

MSBuild Targets

DeployLX comes with a few default targets for easily adding veiling to your MSBuild Projects. The targets are defined in the DeployLX.CodeVeil.targets in the DeployLX application folder.

General Veil Targets

To start with, you will need to include the CodeVeil project file that you're going to use. To do that, you will want to add it as the following example shows. This needs to be done prior to your import calls, see below.

<ItemGroup>
     <VeilProjects Include="MsBuildProject.cvp" />
</ItemGroup>

To use the targets provided by CodeVeil you will import the DeployLX.CodeVeil.targets file into your project. Once added DeployLX CodeVeil can automatically handle the veiling process. To do so, have the DeployLX.CodeVeil.targets import statement following line follow after you import your language targets.

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="%(ProgramFiles)\XHEO\DeployLX\v5.0\DeployLX.CodeVeil.targets" />

If you explictly wanted to control when the veiling process occurs, reverse the above import tags, and add the Veil command to your target. The Veil target will perform any project and assembly veil tasks and CleanVeil can be used to clean up any veiled assemblies. To run the Veil target you can either launch MSBuild and target Veil directly, or you can add it to the AfterBuild task. The CleanVeil task already adds itself to the general Clean target.

<Target Name="AfterBuild" DependsOnTargets="Veil" />

Project Targets

The veil project targets are used to process all the assemblies defined separately in a CVP project created with the CodeVeil Project Editor. The project targets make use of the following items and properties.

Item Groups

VeilProjects

The collection of CVP project paths to process.

_ResolvedVeilProjectInputs

Created by the ResolveVeilProjects target to determine the physical locations of the project input assemblies.

_ResolvedVeilProjectOutputs

Created by the ResolveVeilProjects target to determine the physical locations of the project output assemblies.

Property Groups

ShowVeilUi

True or false, indicates if the veiling process should display the progress dialog while processing.

VeilNotificationLevel

The level of detail to include in the build log. Possible values are None, Error, Warning, Batch, Primary, Secondary, Parsing, Verbose. Default is Secondary.

VeilThreads

The number of threads to use when processing. The maximum allowed depends on the license. See the license agreement for details. -1 uses the maximum licensed for the current hardware.

The ResolveVeilProjects Target

The ResolveVeilProjects target is used to calculate the exact location of the assembly inputs and outputs. Used by the VeilProjects target's Inputs and Outputs conditions.

VeilProjects Target

The VeilProjects target performs the actual processing of the projects in the VeilProjects group.

CleanVeilProjects Target

The CleanVeilProjects target will delete all the veil outputs defined in the _ResolvedVeilProjectOutputs.

Assembly Targets

The veil assembly targets are used to process individual assemblies and can be used to automatically process assembly outputs during a build.

Item Groups

VeilAssemblies

The collection of assemblies to veil.

VeilRules

Collection of obfuscation rules to apply to the veil.

Meta Data Description
Include

The rule search pattern.

%IsRegex

Indicates if the pattern should be treated as a regular expression.

%Obfuscate

Indicates if matching assembly members should be obfuscated or left alone.

%Visibility

The member visibility to match against. Possible values are Public, Protected, ProtectedInternal, Internal, Private, AllPublic, AllPrivate, All. Multiple visibilities can be separated by commas.

%ObjectTypes

The types of assembly members to match. Possible values are Classes, Methods, Events, Fields, Properties, All. Multiple object types can be separated by commas.

VeilSearchPaths

Additional paths to search when resolving dependent assemblies.

_ResolvedVeilAssembliesInputs

Created by the ResolveVeilAssemblies target to determine the physical locations of the input assemblies.

_ResolvedVeilAssembliesOutputs

Created by the ResolveVeilAssemblies target to determine the physical locations of the output assemblies.

Property Groups

ShowVeilUi

True or false, indicates if the veiling process should display the progress dialog while processing.

VeilRootPath

The root path where all relative paths should be relative to. Normally this is the path to the folder where the CVP project is located.

VeilNotificationLevel

The level of detail to include in the build log. Possible values are None, Error, Warning, Batch, Primary, Secondary, Parsing, Verbose. Default is Secondary.

VeilThreads

The number of threads to use when processing. The maximum allowed depends on the license. See the license agreement for details.

The ResolveVeilAssemblies Target

The ResolveVeilAssemblies target is used to calculate the exact location of the assembly inputs and outputs. Used by the VeilAssemblies target's Inputs and Outputs conditions.

VeilAssemblies Target

The VeilAssemblies target performs the actual processing of the assemblies in the VeilAssemblies group.

CleanVeilAssemblies Target

The CleanVeilAssemblies target will delete all the veil outputs defined in the _ResolvedVeilAssembliesOutputs.

See Also