/// <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); } }
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); }
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); }
public abstract void CopyTo(IFile destination);
public GeneratePackageTask(IFile specFile) { _specFile = specFile; }
public GenerateAssemblyInfo(IFile destination) { _destination = destination; Attributes = new List<Expression<Action<Attribute>>>(); }
public GenerateNuGetSpecTask(IFile destination) { _destination = destination; }
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); }
/// <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; }
public void Add(string entityPath, IFile file) { _sourceFiles.Add(new FileToCompress(file, entityPath)); }
public CompressTask(IFile destination) { Destination = destination; }
public FileToCompress(IFile file, string entityPath) { File = file; EntityPath = entityPath; }
public override void CopyTo(IFile destination) { ((FileStub) destination).Content = Content; }
public PushPackageTask(IFile packageFile) { _packageFile = packageFile; Options = new List<Option>(); }