Ejemplo n.º 1
0
 protected static NPMProject CreateNPMProject(
     StandardGlobalInfo globalInfo,
     NPMSolution npmSolution,
     SimplePackageJsonFile json,
     NormalizedPath outputPath)
 {
     return(new NPMProject(globalInfo, npmSolution, json, outputPath));
 }
Ejemplo n.º 2
0
        NPMPublishedProject(StandardGlobalInfo globalInfo, NPMSolution npmSolution, SimplePackageJsonFile json, NormalizedPath outputPath)
            : base(globalInfo, npmSolution, json, outputPath)
        {
            ArtifactInstance = new ArtifactInstance(new Artifact("NPM", json.Name), globalInfo.Version);
            string tgz = json.Name.Replace("@", "").Replace('/', '-');

            TGZName = tgz + "-" + globalInfo.Version.ToString() + ".tgz";
        }
        NPMPublishedProject(StandardGlobalInfo globalInfo, NPMSolution npmSolution, SimplePackageJsonFile json, NormalizedPath outputPath)
            : base(globalInfo, npmSolution, json, outputPath)
        {
            _ckliLocalFeedMode = json.CKliLocalFeedMode;
            ArtifactInstance   = new ArtifactInstance(new Artifact("NPM", json.Name), globalInfo.BuildInfo.Version);
            string tgz = json.Name.Replace("@", "").Replace('/', '-');

            TGZName = tgz + "-" + globalInfo.BuildInfo.Version.WithBuildMetaData("").ToNormalizedString() + ".tgz";
        }
Ejemplo n.º 4
0
 protected NPMProject(
     StandardGlobalInfo globalInfo,
     NPMSolution npmSolution,
     SimplePackageJsonFile json,
     NormalizedPath outputPath)
 {
     DirectoryPath = json.JsonFilePath.RemoveLastPart();
     PackageJson   = json;
     OutputPath    = outputPath;
     NPMRCPath     = DirectoryPath.AppendPart(".npmrc");
     GlobalInfo    = globalInfo;
     NpmSolution   = npmSolution;
 }
        /// <summary>
        /// Create a <see cref="NPMProject"/> that can be a <see cref="NPMPublishedProject"/>.
        /// </summary>
        /// <param name="globalInfo">The global info of the CodeCakeBuilder.</param>
        /// <param name="dirPath">The directory path where is located the npm package.</param>
        /// <param name="outputPath">The directory path where the build output is. It can be the same than <paramref name="dirPath"/>.</param>
        /// <returns></returns>
        public static NPMProject Create(StandardGlobalInfo globalInfo, NPMSolution solution, NormalizedPath dirPath, NormalizedPath outputPath)
        {
            var        json = SimplePackageJsonFile.Create(globalInfo.Cake, dirPath);
            NPMProject output;

            if (json.IsPrivate)
            {
                output = CreateNPMProject(globalInfo, solution, json, outputPath);
            }
            else
            {
                output = new NPMPublishedProject(globalInfo, solution, json, outputPath);
            }
            return(output);
        }