Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectDescription"/> class.
        /// </summary>
        /// <param name="packageName">
        ///     The package name.
        /// </param>
        /// <param name="projectFileName">
        ///     The project file name.
        /// </param>
        /// <param name="projectType">
        ///     The project type or types
        /// </param>
        /// <param name="internalDependencies">
        ///     The internal dependencies.
        /// </param>
        public ProjectDescription(
            string packageName,
            string projectFileName,
            EnProjectType projectType,
            string[] internalDependencies = null)
        {
            this.PackageName = packageName;
            this.InternalDependencies = internalDependencies ?? new string[0];
            this.ProjectFileName = projectFileName;
            this.ProjectType = projectType;

            if (projectFileName == null)
            {
                throw new ArgumentNullException(nameof(projectFileName));
            }

            this.ProjectDirectory = Path.GetDirectoryName(Path.GetFullPath(projectFileName));

            if (this.ProjectDirectory == null)
            {
                throw new ArgumentNullException(nameof(projectFileName));
            }

            this.ProjectName = Path.GetFileNameWithoutExtension(projectFileName);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProjectDescription"/> class.
 /// </summary>
 /// <param name="projectFileName">
 ///     The project file name.
 /// </param>
 /// <param name="projectType">
 ///     The project type or types
 /// </param>
 /// <param name="internalDependencies">
 ///     The internal dependencies.
 /// </param>
 public ProjectDescription(string projectFileName, EnProjectType projectType, string[] internalDependencies = null)
     : this(null, projectFileName, projectType, internalDependencies)
 {
     if (!string.IsNullOrEmpty(projectFileName))
     {
         this.PackageName = string.Join(
             ".",
             projectFileName.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries).Take(2));
     }
 }