/// /// 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 JetBrains.Annotations; using JetBrains.Build.InstallationData; namespace JetBrains.Omea.Base.Install { /// /// Adds one or more arbitrary files to the installation. /// The files may reside either in Lib or Bin folders. /// [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] public class InstallFileAttribute : Attribute { #region Data [NotNull] private readonly string _FilesMask; [NotNull] private readonly string _Id; private readonly Guid _MsiGuid; [NotNull] private readonly string _SourceRelativeDir; private readonly SourceRootXml _SourceRoot; [NotNull] private readonly string _TargetRelativeDir; private readonly TargetRootXml _TargetRoot; #endregion #region Init /// /// Adds one or more arbitrary files to the installation. /// /// Base folder on the installation site. /// Relative path from the base folder on the installation site. /// Base folder on the compilation site. /// Relative path from the base folder on the compilation site. /// Mask for picking the files from the folder on the compilation site (source). More than one file is OK. File names will be the same on the installation site (target). /// The unique identifier for this installation entry. public InstallFileAttribute([NotNull] string id, TargetRootXml targetroot, [NotNull] string sTargetRelativeDir, SourceRootXml sourceroot, [NotNull] string sSourceRelativeDir, [NotNull] string sFilesMask, string sMsiGuid) { if(sTargetRelativeDir == null) throw new ArgumentNullException("sTargetRelativeDir"); if(sSourceRelativeDir == null) throw new ArgumentNullException("sSourceRelativeDir"); if(sFilesMask == null) throw new ArgumentNullException("sFilesMask"); if(id == null) throw new ArgumentNullException("id"); _TargetRoot = targetroot; _Id = id; _TargetRelativeDir = sTargetRelativeDir; _SourceRoot = sourceroot; _SourceRelativeDir = sSourceRelativeDir; _FilesMask = sFilesMask; _MsiGuid = new Guid(sMsiGuid); } #endregion #region Attributes /// /// Mask for picking the files from the folder on the compilation site (source). More than one file is OK. File names will be the same on the installation site (target). /// [NotNull] public string FilesMask { get { return _FilesMask; } } /// /// The unique identifier for this installation entry. /// [NotNull] public string Id { get { return _Id; } } public Guid MsiGuid { get { return _MsiGuid; } } /// /// Relative path from the base folder on the compilation site. /// [NotNull] public string SourceRelativeDir { get { return _SourceRelativeDir; } } /// /// Base folder on the compilation site. /// public SourceRootXml SourceRoot { get { return _SourceRoot; } } /// /// Relative path from the base folder on the installation site. /// [NotNull] public string TargetRelativeDir { get { return _TargetRelativeDir; } } /// /// Base folder on the installation site. /// public TargetRootXml TargetRoot { get { return _TargetRoot; } } #endregion } }