Example #1
0
        public CSBuildProject(
            string moduleName,
            string projectPathName,
            Bam.Core.PackageIdentifier packageId,
            Bam.Core.ProxyModulePath proxyPath)
        {
            this.ProjectName = moduleName;
            this.PathName = projectPathName;
            this.PackageDirectory = packageId.Location;
            if (null != proxyPath)
            {
                this.PackageDirectory = proxyPath.Combine(packageId.Location);
            }

            var packagePath = this.PackageDirectory.GetLocations()[0].AbsolutePath;

            var isPackageDirAbsolute = Bam.Core.RelativePathUtilities.IsPathAbsolute(packagePath);
            var kind = isPackageDirAbsolute ? System.UriKind.Absolute : System.UriKind.Relative;

            if (packagePath[packagePath.Length - 1] == System.IO.Path.DirectorySeparatorChar)
            {
                this.PackageUri = new System.Uri(packagePath, kind);
            }
            else
            {
                this.PackageUri = new System.Uri(packagePath + System.IO.Path.DirectorySeparatorChar, kind);
            }

            this.ProjectGuid = new DeterministicGuid(this.PathName).Guid;
        }