SubFolder() public method

Creates a new Directory object for a subdirectory
The folder does not need to exist to use this method
public SubFolder ( string path ) : Directory
path string The subfolder below the current Directory
return Directory
Example #1
0
        public DebugBuild()
        {
            _baseDirectory = new Directory(Properties.CurrentDirectory);
            _compileDirectory = _baseDirectory.SubFolder("compile");
            _toolsDirectory = _baseDirectory.SubFolder("tools");

            _outputAssembly = _compileDirectory.File("output.dll");
            _creditCardProcessor = _toolsDirectory.File("CreditCardDevelopment.dll");

            AddTask(Clean);
            AddTask(Compile);
        }
        public FluentFileSample()
        {
            var file = new FluentFs.Core.File(@"c:\temp\test.txt");

            file.Copy.To(@"c:\temp\test2.txt");
            file.Move.To(@"c:\NewDirectory");
            file.Move.ContinueOnError.To(@"c:\DirectoryThatMayNotExist");
            file.Rename.To("test41.txt");
            file.Delete(OnError.Continue);

            var directory = new FluentFs.Core.Directory(@"c:\temp\sample");

            directory.Delete(OnError.Continue).Create(OnError.Fail);
            directory.Files();                                    //returns all files in the folder
            directory.Files("*.txt");                             //returns all files ending in .txt
            var childFolder = directory.SubFolder("childFolder"); //creates a new Directory object with a path of c:\temp\sample\childFolder

            directory.ToString();                                 //returns the path of the folder
            directory.File("test.txt");                           // returns back a FluentFilesystem.File object with a path of c:\temp\sample\test.txt

            var fileset = new FluentFs.Core.FileSet();

            fileset.Include(@"c:\Project\GUI\*.cs").RecurseAllSubDirectories
            .Exclude("assemblyInfo.cs")
            .Include(@"c:\Project\globalconfig.xml");

            ReadOnlyCollection <string> files = fileset.Files;

            fileset.Copy.To(@"c:\temp");
        }
Example #3
0
        public Default()
        {
            directory_base = new Directory(System.IO.Directory.GetCurrentDirectory());
            directory_compile = directory_base.SubFolder("compile");
            AssemblyFluentFsRelease = directory_compile.File("FluentFs.dll");

            AddTask(Clean);
            AddTask(CompileCoreWithoutTests);
        }
        public MultiTargetingSample()
        {
            _baseDirectory = new Directory(Properties.CurrentDirectory);
            _compileDirectory = _baseDirectory.SubFolder("compile");
            _outputAssembly = _compileDirectory.File("output.dll");

            AddTask(Clean);
            AddTask("Compile .NET 2.0", Compile_20);
            AddTask(Clean);
            AddTask("Compile .NET 3.0", Compile_30);
        }
Example #5
0
        public DefaultSample()
        {
            directory_base = new Directory(Properties.CurrentDirectory);
            directory_compile = directory_base.SubFolder("compile");
            directory_release = directory_base.SubFolder("release");
            directory_tools = directory_base.SubFolder("tools");

            assembly_FluentBuild = directory_compile.File("FluentBuild.dll");
            assembly_FluentBuild_Tests = directory_compile.File("FluentBuild.Tests.dll");
            thirdparty_nunit = directory_tools.File("nunit.framework.dll");
            thirdparty_rhino = directory_tools.File("rhino.mocks.dll");

            AddTask(Clean);
            AddTask(CompileSources);
            AddTask(CompileTests);
            AddTask(RunTests);
            AddTask(Package);

            //set the verbosity. Can also be set via command line
            Defaults.Logger.Verbosity = VerbosityLevel.TaskNamesOnly;
        }
Example #6
0
        public void DirectoryExamples()
        {
            var dir = new Directory(@"c:\temp");
            dir.Create(OnError.Continue);
            dir.Delete(OnError.Continue);

            var stuffDir = dir.SubFolder("stuff");
            var allFiles = dir.Files();
            var dllFiles = dir.Files("*.dll");

            var file = dir.File("web.config");
        }
Example #7
0
        public Default()
        {
            directory_base = new Directory(System.IO.Directory.GetCurrentDirectory());
            directory_compile = directory_base.SubFolder("compile");
            directory_release = directory_base.SubFolder("release");
            directory_tools = directory_base.SubFolder("tools");
            directory_src_core = directory_base.SubFolder("src").SubFolder("FluentBuild");
            directory_src_runner = directory_base.SubFolder("src").SubFolder("FluentBuild.BuildExe");
            directory_src_converter = directory_base.SubFolder("src").SubFolder("FluentBuild.BuildFileConverter");
            file_src_UI = directory_base.SubFolder("src").SubFolder("FluentBuild.BuildUI").File("FluentBuild.BuildUI.csproj");

            assembly_BuildFileConverter_WithTests = directory_compile.File("BuildFileConverter.exe");
            assembly_FluentBuild_UI = directory_compile.File("fb.ui.exe");
            assembly_FluentBuild_WithTests_Partial = directory_compile.File("FluentBuildWithTests_partial.dll");
            assembly_FluentBuild_WithTests_Merged = directory_compile.File("FluentBuild.dll");
            assembly_Functional_Tests = directory_compile.File("FluentBuild_Functional_Tests.dll");

            assembly_FluentBuild_Runner = directory_compile.File("fb.exe");

            thirdparty_nunit = directory_tools.SubFolder("nunit").File("nunit.framework.dll");
            thirdparty_rhino = directory_tools.SubFolder("rhino").File("rhino.mocks.dll");
            thirdparty_sharpzip = directory_base.SubFolder("lib").SubFolder("SharpZipLib-net2.0").File("ICSharpCode.SharpZipLib.dll");
            thirdparty_fluentFs = directory_base.SubFolder("lib").SubFolder("FluentFs").File("FluentFs.dll");

            _version = "0.0.0.0";

            Defaults.FrameworkVersion = FrameworkVersion.NET4_0.Full;

            AddTask(Clean);
            AddTask(GenerateAssemblyInfoFiles);
            AddTask(CopyDependantAssembliesToCompileDir);
            AddTask(CompileCoreSources);
            AddTask(CompileRunnerSources);
            AddTask(RunTests);
            AddTask(CompileFunctionalTests);
            //AddTask(RunFunctionalTests);
            AddTask(CompileBuildFileConverter);
            AddTask(TestBuildFileConverter);
            AddTask(CompileBuildUi);
        }
        public CompilationTaskSamples()
        {
            //Task.Build.Csc.Target.Executable(); //a command line exe
            //Task.Build.Csc.Target.Library(); //a dll
            //Task.Build.Csc.Target.Module(); //a module
            //Task.Build.Csc.Target.WindowsExecutable(); //a windows EXE

            var baseDir    = new FluentFs.Core.Directory(Environment.CurrentDirectory);
            var compileDir = baseDir.SubFolder("compile");

            compileDir.Delete(OnError.Continue).Create();
            var sampleOutput = compileDir.File("sample.dll");

            var sourceFiles = new FileSet().Include(@"c:\Sample\*.cs").RecurseAllSubDirectories;

            Task.Build.Csc.Target.Library(compiler => compiler.AddSources(sourceFiles)
                                          .OutputFileTo(sampleOutput));

            Task.Build.MsBuild(compiler => compiler.ProjectOrSolutionFilePath(@"c:\Sample\MyProject.csproj").OutputDirectory(compileDir));

            var outputAssemblyInfoFile = compileDir.File("assemblyInfo.cs");

            Task.CreateAssemblyInfo.Language.CSharp(build => build.OutputPath(outputAssemblyInfoFile)
                                                    .ClsCompliant(true)
                                                    .ComVisible(true)
                                                    .Company("My Company")
                                                    .Copyright("Copyright " + DateTime.Now.Year)
                                                    .Culture("EN-US")
                                                    .DelaySign(false)
                                                    .Description("Sample Project")
                                                    .FileVersion("1.2.0.0")
                                                    .InformationalVersion("1.2.0.0")
                                                    .KeyFile(@"c:\mykey.snk")
                                                    .KeyName("KeyName")
                                                    .Product("Product Name")
                                                    .Title("Title")
                                                    .Trademark("TM")
                                                    .Version("1.2.0.0")
                                                    .AddCustomAttribute("namespace.for.attribute", "AttributeName", true, "attributeValue"));

            var returnCode = Task.Run.Executable(exe => exe.ExecutablePath(@"c:\temp\myapp.exe").InWorkingDirectory(@"c:\temp\").AddArgument("c", "action1").AddArgument("s"));

            Task.Run.Executable(exe => exe.ExecutablePath(@"c:\temp\myapp.exe").ContinueOnError.SetTimeout(200));


            Task.Run.Zip.Compress(x => x.SourceFile("temp.txt")
                                  .UsingCompressionLevel.Eight
                                  .UsingPassword("secretPassword")
                                  .To("output.zip"));

            Task.Run.Zip.Decompress(x => x.Path("output.zip")
                                    .To(@"c:\temp\")
                                    .UsingPassword("secretPassword"));

            Defaults.Logger.WriteDebugMessage("Debug message");
            Defaults.Logger.WriteWarning("MyTask", "Warning");
            Defaults.Logger.WriteError("MyTask", "Error");

            Defaults.Logger.Verbosity = VerbosityLevel.None;
            Defaults.Logger.Verbosity = VerbosityLevel.Full;
            Defaults.Logger.Verbosity = VerbosityLevel.TaskDetails;
            Defaults.Logger.Verbosity = VerbosityLevel.TaskNamesOnly;

            Task.Run.Executable(exe => exe.ExecutablePath(@"c:\temp.exe"));
            using (Defaults.Logger.ShowDebugMessages)
            {
                Task.Run.Executable(exe => exe.ExecutablePath(@"c:\TempProcess.exe"));
            }

            Task.Run.Debugger();

            Properties.CommandLineProperties.GetProperty("ServerUsername");

            Task.Publish.Ftp(ftp => ftp.Server("ftp.myserver.com")
                             .UserName("username")
                             .Password("password")
                             .LocalFilePath(@"c:\temp\project.zip")
                             .RemoteFilePath(@"\release\project.zip")
                             );

            Task.Publish.ToGoogleCode(google => google.UserName("user")
                                      .Password("pass")
                                      .LocalFileName(@"c:\temp\project.zip")
                                      .TargetFileName("project-1.0.0.0.zip")
                                      .ProjectName("projectName")
                                      .Summary("Summary for upload")
                                      );
        }
Example #9
0
        public CompilationTaskSamples()
        {
            //Task.Build.Csc.Target.Executable(); //a command line exe
            //Task.Build.Csc.Target.Library(); //a dll
            //Task.Build.Csc.Target.Module(); //a module
            //Task.Build.Csc.Target.WindowsExecutable(); //a windows EXE

            var baseDir = new FluentFs.Core.Directory(Environment.CurrentDirectory);
            var compileDir = baseDir.SubFolder("compile");
            compileDir.Delete(OnError.Continue).Create();
            var sampleOutput = compileDir.File("sample.dll");

            var sourceFiles = new FileSet().Include(@"c:\Sample\*.cs").RecurseAllSubDirectories;
            Task.Build.Csc.Target.Library(compiler => compiler.AddSources(sourceFiles)
                                                              .OutputFileTo(sampleOutput));

            Task.Build.MsBuild(compiler => compiler.ProjectOrSolutionFilePath(@"c:\Sample\MyProject.csproj").OutputDirectory(compileDir));

            var outputAssemblyInfoFile = compileDir.File("assemblyInfo.cs");

            Task.CreateAssemblyInfo.Language.CSharp(build=>build.OutputPath(outputAssemblyInfoFile)
                    .ClsCompliant(true)
                    .ComVisible(true)
                    .Company("My Company")
                    .Copyright("Copyright " + DateTime.Now.Year)
                    .Culture("EN-US")
                    .DelaySign(false)
                    .Description("Sample Project")
                    .FileVersion("1.2.0.0")
                    .InformationalVersion("1.2.0.0")
                    .KeyFile(@"c:\mykey.snk")
                    .KeyName("KeyName")
                    .Product("Product Name")
                    .Title("Title")
                    .Trademark("TM")
                    .Version("1.2.0.0")
                    .AddCustomAttribute("namespace.for.attribute", "AttributeName", true, "attributeValue"));

            var returnCode = Task.Run.Executable(exe => exe.ExecutablePath(@"c:\temp\myapp.exe").InWorkingDirectory(@"c:\temp\").AddArgument("c", "action1").AddArgument("s"));
            Task.Run.Executable(exe => exe.ExecutablePath(@"c:\temp\myapp.exe").ContinueOnError.SetTimeout(200));

            Task.Run.Zip.Compress(x=>x.SourceFile("temp.txt")
                .UsingCompressionLevel.Eight
                .UsingPassword("secretPassword")
                .To("output.zip"));

            Task.Run.Zip.Decompress(x=>x.Path("output.zip")
                .To(@"c:\temp\")
                .UsingPassword("secretPassword"));

            Defaults.Logger.WriteDebugMessage("Debug message");
            Defaults.Logger.WriteWarning("MyTask", "Warning");
            Defaults.Logger.WriteError("MyTask", "Error");

            Defaults.Logger.Verbosity = VerbosityLevel.None;
            Defaults.Logger.Verbosity = VerbosityLevel.Full;
            Defaults.Logger.Verbosity = VerbosityLevel.TaskDetails;
            Defaults.Logger.Verbosity = VerbosityLevel.TaskNamesOnly;

            Task.Run.Executable(exe => exe.ExecutablePath(@"c:\temp.exe"));
            using(Defaults.Logger.ShowDebugMessages)
            {
                Task.Run.Executable(exe => exe.ExecutablePath(@"c:\TempProcess.exe"));
            }

            Task.Run.Debugger();

            Properties.CommandLineProperties.GetProperty("ServerUsername");

            Task.Publish.Ftp(ftp => ftp.Server("ftp.myserver.com")
                .UserName("username")
                .Password("password")
                .LocalFilePath(@"c:\temp\project.zip")
                .RemoteFilePath(@"\release\project.zip")
                );

            Task.Publish.ToGoogleCode(google => google.UserName("user")
                .Password("pass")
                .LocalFileName(@"c:\temp\project.zip")
                .TargetFileName("project-1.0.0.0.zip")
                .ProjectName("projectName")
                .Summary("Summary for upload")
                );
        }
Example #10
0
        public FluentFileSample()
        {
            var file = new FluentFs.Core.File(@"c:\temp\test.txt");
            file.Copy.To(@"c:\temp\test2.txt");
            file.Move.To(@"c:\NewDirectory");
            file.Move.ContinueOnError.To(@"c:\DirectoryThatMayNotExist");
            file.Rename.To("test41.txt");
            file.Delete(OnError.Continue);

            var directory = new FluentFs.Core.Directory(@"c:\temp\sample");
            directory.Delete(OnError.Continue).Create(OnError.Fail);
            directory.Files(); //returns all files in the folder
            directory.Files("*.txt"); //returns all files ending in .txt
            var childFolder = directory.SubFolder("childFolder"); //creates a new Directory object with a path of c:\temp\sample\childFolder
            directory.ToString(); //returns the path of the folder
            directory.File("test.txt"); // returns back a FluentFilesystem.File object with a path of c:\temp\sample\test.txt

            var fileset = new FluentFs.Core.FileSet();
            fileset.Include(@"c:\Project\GUI\*.cs").RecurseAllSubDirectories
              .Exclude("assemblyInfo.cs")
              .Include(@"c:\Project\globalconfig.xml");

            ReadOnlyCollection<string> files = fileset.Files;

            fileset.Copy.To(@"c:\temp");
        }