Example #1
0
 public ContentBuilder(Project project, ISourceSetFingerprintFactory fingerprintFactory, [SuiteRoot] IFileSystemDirectory suiteRoot, [TargetRoot] IFileSystemDirectory targetRoot)
 {
     this.project            = project;
     this.fingerprintFactory = fingerprintFactory;
     this.suiteRoot          = suiteRoot;
     this.targetRoot         = targetRoot;
 }
Example #2
0
        public void SetUp()
        {
            kernel = new StandardKernel();

            tmp     = new TempDirectory();
            rootDir = new LocalFileSystemDirectory(tmp);
            using (var writer = rootDir.CreateTextFile("file1"))
                writer.WriteLine("Contents of file 1");
            using (var writer = rootDir.CreateTextFile("file2"))
                writer.WriteLine("Contents of file 2");
            using (var writer = rootDir.CreateTextFile("file3"))
                writer.WriteLine("Contents of file 3");

            sourceSet1 = new SourceSet("test1");
            sourceSet1.Add(new SuiteRelativePath("file1"));
            sourceSet1.Add(new SuiteRelativePath("file2"));

            sourceSet2 = new SourceSet("test2");
            sourceSet2.Add(new SuiteRelativePath("file1"));
            sourceSet2.Add(new SuiteRelativePath("file3"));

            kernel.Bind <IFileSystemDirectory>().ToConstant(rootDir).WhenTargetHas <SuiteRootAttribute>();

            var factoryMock = new Mock <ISourceSetFingerprintFactory>();

            factoryMock.Setup(
                f =>
                f.CreateSourceSetFingerprint(It.IsAny <IEnumerable <SuiteRelativePath> >(), It.IsAny <Func <string, bool> >(), It.IsAny <bool>()))
            .Returns <IEnumerable <SuiteRelativePath>, Func <string, bool>, bool>(
                (files, exclusions, fullDependency) => new SourceSetFingerprint(rootDir, files, exclusions, fullDependency));
            fingerprintFactory = factoryMock.Object;
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AppConfigBuilder"/> class.
 /// </summary>
 /// <param name="project">The project.</param>
 /// <param name="fingerprintFactory">The fingerprint factory</param>
 /// <param name="suiteRoot">Suite's root directory</param>
 /// <param name="targetRoot">Target root directory</param>
 public AppConfigBuilder(Project project, ISourceSetFingerprintFactory fingerprintFactory, [SuiteRoot] IFileSystemDirectory suiteRoot, [TargetRoot] IFileSystemDirectory targetRoot)
 {
     this.project    = project;
     this.suiteRoot  = suiteRoot;
     this.targetRoot = targetRoot;
     dependencies    = new SourceSetDependencies(fingerprintFactory, project.GetSourceSet(appConfigSourceSetName));
 }
Example #4
0
        public void SetUp()
        {
            kernel = new StandardKernel();

            tmp = new TempDirectory();
            rootDir = new LocalFileSystemDirectory(tmp);
            using (var writer = rootDir.CreateTextFile("file1"))
                writer.WriteLine("Contents of file 1");
            using (var writer = rootDir.CreateTextFile("file2"))
                writer.WriteLine("Contents of file 2");
            using (var writer = rootDir.CreateTextFile("file3"))
                writer.WriteLine("Contents of file 3");

            sourceSet1 = new SourceSet("test1");
            sourceSet1.Add(new SuiteRelativePath("file1"));
            sourceSet1.Add(new SuiteRelativePath("file2"));

            sourceSet2 = new SourceSet("test2");
            sourceSet2.Add(new SuiteRelativePath("file1"));
            sourceSet2.Add(new SuiteRelativePath("file3"));

            kernel.Bind<IFileSystemDirectory>().ToConstant(rootDir).WhenTargetHas<SuiteRootAttribute>();

            var factoryMock = new Mock<ISourceSetFingerprintFactory>();
            factoryMock.Setup(
                f =>
                f.CreateSourceSetFingerprint(It.IsAny<IEnumerable<SuiteRelativePath>>(), It.IsAny<Func<string, bool>>(), It.IsAny<bool>()))
                       .Returns<IEnumerable<SuiteRelativePath>, Func<string, bool>, bool>(
                            (files, exclusions, fullDependency) => new SourceSetFingerprint(rootDir, files, exclusions, fullDependency));
            fingerprintFactory = factoryMock.Object;
        }
Example #5
0
 public PythonScriptedBuilder(Project project, IBuildScript buildScript, ISourceSetFingerprintFactory fingerprintFactory, IProjectBuildScriptRunner scriptRunner)
 {
     this.project            = project;
     this.buildScript        = buildScript;
     this.fingerprintFactory = fingerprintFactory;
     this.scriptRunner       = scriptRunner;
 }
Example #6
0
 public ContentBuilder(Project project, ISourceSetFingerprintFactory fingerprintFactory, [SuiteRoot] IFileSystemDirectory suiteRoot, [TargetRoot] IFileSystemDirectory targetRoot)
 {
     this.project = project;
     this.fingerprintFactory = fingerprintFactory;
     this.suiteRoot = suiteRoot;
     this.targetRoot = targetRoot;
 }
        public PythonScriptedProjectBuilderFactory(Suite suite, ISourceSetFingerprintFactory fingerprintFactory, IProjectBuildScriptRunner scriptRunner)
        {
            if (suite.HasParameters("build-scripts"))
                buildScriptMappings = suite.GetParameters<BuildScriptMappings>("build-scripts");
            else
                buildScriptMappings = new BuildScriptMappings();

            this.fingerprintFactory = fingerprintFactory;
            this.scriptRunner = scriptRunner;
        }
Example #8
0
        public PythonScriptedBuilder(Project project, IBuildScript buildScript, ISourceSetFingerprintFactory fingerprintFactory, IProjectBuildScriptRunner scriptRunner)
        {
            this.project      = project;
            this.buildScript  = buildScript;
            this.scriptRunner = scriptRunner;

            dependencies = new Lazy <IDependencies>(() => MultipleDependenciesHelper.CreateMultipleDependencies(
                                                        new HashSet <IDependencies>(new IDependencies[]
            {
                new SourceSetDependencies(fingerprintFactory, project.GetSourceSet(buildScript.SourceSetName)),
                new ScriptDependency(buildScript)
            })));
        }
        public PythonScriptedProjectBuilderFactory(Suite suite, ISourceSetFingerprintFactory fingerprintFactory, IProjectBuildScriptRunner scriptRunner)
        {
            if (suite.HasParameters("build-scripts"))
            {
                buildScriptMappings = suite.GetParameters <BuildScriptMappings>("build-scripts");
            }
            else
            {
                buildScriptMappings = new BuildScriptMappings();
            }

            this.fingerprintFactory = fingerprintFactory;
            this.scriptRunner       = scriptRunner;
        }
Example #10
0
 /// <summary>
 /// Constructs the dependency object
 /// </summary>
 /// <param name="fingerprintFactory">The interface to create new fingerprint instances</param>
 /// <param name="sourceSet">The source set on which we are depending on</param>
 /// <param name="exclusions">Exclusion function, if returns true for a file name, it won't be taken into account as a dependency</param>
 public SourceSetDependencies(ISourceSetFingerprintFactory fingerprintFactory, ISourceSet sourceSet, Func <string, bool> exclusions = null)
 {
     this.fingerprintFactory = fingerprintFactory;
     this.sourceSet          = sourceSet;
     this.exclusions         = exclusions;
 }
 /// <summary>
 /// Constructs the dependency object
 /// </summary>
 /// <param name="fingerprintFactory">The interface to create new fingerprint instances</param>
 /// <param name="sourceSet">The source set on which we are depending on</param>
 /// <param name="exclusions">Exclusion function, if returns true for a file name, it won't be taken into account as a dependency</param>
 public SourceSetStructureDependency(ISourceSetFingerprintFactory fingerprintFactory, ISourceSet sourceSet, Func<string, bool> exclusions = null)
 {
     this.fingerprintFactory = fingerprintFactory;
     this.sourceSet = sourceSet;
     this.exclusions = exclusions;
 }