///
/// Copyright © 2003-2008 JetBrains s.r.o.
/// You may distribute under the terms of the GNU General Public License, as published by the Free Software Foundation, version 2 (see License.txt in the repository root folder).
///
using System;
using System.Collections.Generic;
using JetBrains.Build.Omea.Infra;
using Microsoft.Build.Framework;
namespace JetBrains.Build.Omea.Tasks
{
///
/// Creates a WiX source with the product biaries described in it.
///
public class WixProductBinaries : WixAndProductTask
{
#region Attributes
///
/// Gets or sets the ID of the media into which the binaries will be packed.
///
[Required]
public string DiskId
{
get
{
return Bag.Get(AttributeName.DiskId, 0).ToString();
}
set
{
Bag.Set(AttributeName.DiskId, int.Parse(value));
}
}
///
/// Gets or sets the path to the file that caches the component GUIDs for the generated components.
///
[Required]
public ITaskItem GuidCacheFile
{
get
{
return Bag.Get(AttributeName.GuidCacheFile);
}
set
{
Bag.Set(AttributeName.GuidCacheFile, value);
}
}
///
/// Gets or sets whether to include the debug info databases along with the assemblies.
///
[Required]
public bool IncludePdb
{
get
{
return Bag.Get(AttributeName.IncludePdb);
}
set
{
Bag.Set(AttributeName.IncludePdb, value);
}
}
///
/// Gets or sets whether to include the Publisher Policy assembly files along with the assemblies.
/// When set to True, at least one pubilsher policy assembly is required for each of the assemblies.
///
[Required]
public bool IncludePublisherPolicy
{
get
{
return Bag.Get(AttributeName.IncludePublisherPolicy);
}
set
{
Bag.Set(AttributeName.IncludePublisherPolicy, value);
}
}
///
/// Gets or sets whether to include the XmlDoc xml files along with the assemblies.
///
[Required]
public bool IncludeXmlDoc
{
get
{
return Bag.Get(AttributeName.IncludeXmlDoc);
}
set
{
Bag.Set(AttributeName.IncludeXmlDoc, value);
}
}
///
/// Gets or sets the full path to the output WiX source code file.
///
[Required]
public ITaskItem OutputFile
{
get
{
return Bag.Get(AttributeName.OutputFile);
}
set
{
if(value == null)
throw new ArgumentNullException("value");
Bag.Set(AttributeName.OutputFile, value);
}
}
///
/// Requires all of the assemblies in the AllAssembliesXml list to have a strong name.
///
[Required]
public bool RequireStrongName
{
get
{
return Bag.Get(AttributeName.RequireStrongName);
}
set
{
Bag.Set(AttributeName.RequireStrongName, value);
}
}
///
/// Gets or sets the WiX ComponentGroup ID that will be created in the fragment and populated with the newly-created components, so that it could be mounted into the feature tree.
///
[Required]
public string WixComponentGroupId
{
get
{
return Bag.Get(AttributeName.WixComponentGroupId);
}
set
{
if(value == null)
throw new ArgumentNullException("value");
Bag.Set(AttributeName.WixComponentGroupId, value);
}
}
///
/// Gets or sets the WiX Directory ID in the WiX sources into which the created components should be mounted.
/// The directory must be defined somewhere in the directories tree, and a DirectoryRef element will be added to the generated source file referencing the given ID.
///
[Required]
public string WixDirectoryId
{
get
{
return Bag.Get(AttributeName.WixDirectoryId);
}
set
{
if(value == null)
throw new ArgumentNullException("value");
Bag.Set(AttributeName.WixDirectoryId, value);
}
}
#endregion
#region Overrides
///
/// Gets the list of attributes that must contain the probing directories.
///
protected override ICollection ProbingDirectoryAttributes
{
get
{
var retval = new List(base.ProbingDirectoryAttributes);
retval.Add(AttributeName.ProductBinariesDir);
return retval;
}
}
#endregion
}
}