상속: FileSystemItem
예제 #1
0
 /// <summary>
 /// Writes a string to a file.
 /// </summary>
 /// <param name="content">string content</param>
 /// <param name="file">destination file</param>
 public void WriteStringToFile(string content, IFile file)
 {
     using (var writer = new StreamWriter(file.WriteStream))
     {
         writer.Write(content);
     }
 }
예제 #2
0
        public override void CopyTo(IFile destination)
        {
            if (!Exists)
            {
                throw new Exception(string.Format("File {0} does not exist!", AbsolutePath));
            }

            File.Copy(AbsolutePath, destination.AbsolutePath, true);
        }
예제 #3
0
        private static InitializationResult InitializeWorkflow(
            RosaliaOptions options,
            IDirectory workDirectory,
            ILogRenderer logRenderer,
            IFile inputFile)
        {
            var runner = new Runner();

            var runningOptions = new RunningOptions
            {
                InputFile = inputFile,
                WorkflowBuildOutputPath = options.WorkflowBuildOutputPath,
                WorkflowProjectBuildConfiguration = options.WorkflowProjectBuildConfiguration,
                LogRenderer = logRenderer,
                WorkDirectory = workDirectory,
                Properties = options.Properties
            };

            return runner.Init(runningOptions);
        }
예제 #4
0
파일: IFile.cs 프로젝트: rosaliafx/Rosalia
 public abstract void CopyTo(IFile destination);
예제 #5
0
 public GeneratePackageTask(IFile specFile)
 {
     _specFile = specFile;
 }
예제 #6
0
 public GenerateAssemblyInfo(IFile destination)
 {
     _destination = destination;
     Attributes = new List<Expression<Action<Attribute>>>();
 }
예제 #7
0
 public GenerateNuGetSpecTask(IFile destination)
 {
     _destination = destination;
 }
예제 #8
0
 public GenerateNuGetSpecTask WithFile(IFile file, string target, string exclude = null)
 {
     var path = file.GetRelativePath(_destination.Directory); // todo: check
         //file.AbsolutePath;
     return WithFile(path, target, exclude);
 }
예제 #9
0
        /// <summary>
        /// Reads dependencies from packages.config file.
        /// </summary>
        public GenerateNuGetSpecTask WithDependenciesFromPackagesConfig(IFile packagesConfigFile, bool ignoreFrameworkVersion = false)
        {
            using (Stream stream = packagesConfigFile.ReadStream)
            {
                XDocument document = XDocument.Load(stream);
                foreach (var package in document.Descendants("package"))
                {
                    XAttribute versionAttribute = package.Attribute("version");
                    XAttribute frameworkVersionAttribute = package.Attribute("targetFramework");

                    string frameworkVersion = (ignoreFrameworkVersion || frameworkVersionAttribute == null) ?
                        null :
                        frameworkVersionAttribute.Value;

                    WithDependency(
                        package.Attribute("id").Value,
                        versionAttribute == null ? null : versionAttribute.Value,
                        frameworkVersion);
                }
            }

            return this;
        }
예제 #10
0
 public void Add(string entityPath, IFile file)
 {
     _sourceFiles.Add(new FileToCompress(file, entityPath));
 }
예제 #11
0
 public CompressTask(IFile destination)
 {
     Destination = destination;
 }
예제 #12
0
 public FileToCompress(IFile file, string entityPath)
 {
     File = file;
     EntityPath = entityPath;
 }
예제 #13
0
 public override void CopyTo(IFile destination)
 {
     ((FileStub) destination).Content = Content;
 }
예제 #14
0
        public PushPackageTask(IFile packageFile)
        {
            _packageFile = packageFile;

            Options = new List<Option>();
        }