示例#1
0
        internal void Clean(SSoTmeProject project, bool preserveZFS)
        {
            Console.WriteLine("CLEANING: " + this.RelativePath + ": " + this.Name);
            Console.WriteLine("CommandLine:> ssotme {0}", this.CommandLine);
            var di = new DirectoryInfo(Path.Combine(project.RootPath, this.RelativePath.Trim("\\/".ToCharArray())));

            if (!di.Exists)
            {
                di.Create();
            }
            Environment.CurrentDirectory = di.FullName;
            var zfsDI = project.GetZFSDI(this.RelativePath);

            String zsfFileName = String.Format("{0}/{1}.zfs", zfsDI.FullName, this.Name.ToTitle().ToLower().Replace(" ", "-"));
            var    zfsFI       = new FileInfo(zsfFileName);

            if (zfsFI.Exists)
            {
                var zippedFileSet = File.ReadAllBytes(zfsFI.FullName);
                zippedFileSet.CleanZippedFileSet();
                if (!preserveZFS)
                {
                    File.Delete(zfsFI.FullName);
                }
            }
        }
示例#2
0
 public void Describe(SSoTmeProject project)
 {
     Console.WriteLine("\n-----------------------------------");
     Console.WriteLine("---- {0}{1}", this.Name, this.IsDisabled ? "    **** DISABLED ****" : "");
     Console.WriteLine("---- .{0}/", this.RelativePath.Replace("\\", "/"));
     Console.WriteLine("-----------------------------------");
     Console.WriteLine("\nCommand Line:> ssotme {0}\n", this.CommandLine);
 }
示例#3
0
        internal void Rebuild(SSoTmeProject project)
        {
            Console.WriteLine("\n\nRE-transpiling: " + this.RelativePath + ": " + this.Name);
            Console.WriteLine("CommandLine:> ssotme {0}", this.CommandLine);
            var transpileRootDI = new DirectoryInfo(Path.Combine(project.RootPath, this.RelativePath.Trim("\\/".ToCharArray())));

            if (!transpileRootDI.Exists)
            {
                transpileRootDI.Create();
            }

            Environment.CurrentDirectory = transpileRootDI.FullName;
            var cliHandler = SSoTmeCLIHandler.CreateHandler(this.CommandLine);
            var cliResult  = cliHandler.TranspileProject(this);

            if (cliResult != 0)
            {
                throw new Exception("Error RE-Transpiling");
            }
        }
示例#4
0
        public void LoadInputAndOuputFiles(SSoTmeProject project, bool includeContents)
        {
            var cliHandler = SSoTmeCLIHandler.CreateHandler(this.CommandLine);

            if (!includeContents)
            {
                foreach (var fsf in cliHandler.FileSet.FileSetFiles)
                {
                    fsf.ClearContents();
                }
                cliHandler.inputFileSetXml = String.Empty;
                cliHandler.SSoTmeProject   = null;
            }

            if (!ReferenceEquals(this.MatchedTranspiler, null))
            {
                cliHandler.SSoTmeProject = project;
                cliHandler.LoadOutputFiles(this.MatchedTranspiler.LowerHyphenName, this.GetProjectRelativePath(project), includeContents);
                cliHandler.SSoTmeProject = null;
            }
            this.CLIHandler = cliHandler;
        }
示例#5
0
        public String GetProjectRelativePath(SSoTmeProject project)
        {
            var fullPath = Path.Combine(project.RootPath, this.RelativePath.Trim("\\/".ToCharArray()));

            return(fullPath.Substring(project.RootPath.Length).Replace("\\", "/"));
        }