Пример #1
0
        private IBuildMetaData CreateBuildMetaData(DirectoryInfo buildFolder, string buildFile)
        {
            var buildFileResolver = new BuildFileResolver();

            var buildFilePath = buildFileResolver.Resolve(buildFolder, buildFile).BuildFile;

            try
            {
                configReader = factory.Create<BooConfigReader>(buildFilePath);
            }
            catch (InvalidOperationException e)
            {
                throw new MissingBuildFileException(buildFolder, e);
            }

            configReader.Prepare();

            foreach (var packageInfo in configReader.PackageMetaData.PackageInfo)
            {
                if(packageInfo.Key == "version")
                    continue;

                configReader.BuildMetaData.ProjectInfo.Add(packageInfo.Key, packageInfo.Value);
            }

            configReader.PackageMetaData.PackageInfo.Clear();

            configReader.BuildMetaData.Version = buildFileResolver.Version;

            return configReader.BuildMetaData;
        }
Пример #2
0
        private void AssertHornMetaData(BooConfigReader reader)
        {
            Assert.NotNull(reader);

            Assert.Equal("horn", reader.BuildMetaData.InstallName);

            Assert.Equal(Description, reader.BuildMetaData.Description);

            Assert.IsAssignableFrom<SVNSourceControl>(reader.BuildMetaData.SourceControl);

            Assert.Equal(SvnUrl, reader.BuildMetaData.SourceControl.Url);

            Assert.IsAssignableFrom<MSBuildBuildTool>(reader.BuildMetaData.BuildEngine.BuildTool);

            Assert.Equal(BuildFile, reader.BuildMetaData.BuildEngine.BuildFile);

            Assert.Equal(".", reader.BuildMetaData.BuildEngine.SharedLibrary);

            Assert.Equal("Output", reader.BuildMetaData.BuildEngine.BuildRootDirectory);

            Assert.Equal(5, reader.BuildMetaData.BuildEngine.Dependencies.Count);

            Assert.Equal("log4net", reader.BuildMetaData.BuildEngine.Dependencies[0].PackageName);

            Assert.Equal("lib", reader.BuildMetaData.BuildEngine.Dependencies[0].Library);

            Assert.Equal(3, reader.PackageMetaData.PackageInfo.Count);

            Assert.Equal(3, reader.BuildMetaData.BuildEngine.Exclusions.Count);
        }
Пример #3
0
        private IBuildMetaData CreateBuildMetaData(DirectoryInfo buildFolder, string buildFile)
        {
            var buildFileResolver = new BuildFileResolver();

            var buildFilePath = buildFileResolver.Resolve(buildFolder, buildFile).BuildFile;

            try
            {
                configReader = factory.Create <BooConfigReader>(buildFilePath);
            }
            catch (InvalidOperationException e)
            {
                throw new MissingBuildFileException(buildFolder, e);
            }

            configReader.Prepare();

            foreach (var packageInfo in configReader.PackageMetaData.PackageInfo)
            {
                if (packageInfo.Key == "version")
                {
                    continue;
                }

                configReader.BuildMetaData.ProjectInfo.Add(packageInfo.Key, packageInfo.Value);
            }

            configReader.PackageMetaData.PackageInfo.Clear();

            configReader.BuildMetaData.Version = buildFileResolver.Version;

            return(configReader.BuildMetaData);
        }
        private IBuildMetaData GetBuildMetaData(BooConfigReader baseConfigReader)
        {
            var buildTool = new BuildToolStub();

            var buildEngine = new BuildEngineStub(buildTool, "Test", FrameworkVersion.FrameworkVersion35, CreateStub<IDependencyDispatcher>());

            baseConfigReader.BuildMetaData.BuildEngine = buildEngine;

            var buildMetaData = CreateStub<IBuildMetaData>();

            buildMetaData.SourceControl = new SourceControlDoubleWithFakeFileSystem("Svn://some.url");

            buildMetaData.BuildEngine = buildEngine;

            return buildMetaData;
        }
Пример #5
0
 protected override void Because()
 {
     configReader = factory.Create<BooConfigReader>(@"BuildConfigs/Horn/horn.boo");
     configReader.Prepare();
 }
Пример #6
0
 protected override void Because()
 {
     configReader = factory.Create<BooConfigReader>(@"BuildConfigs/Horn/versioneddependency.boo");
     configReader.Prepare();
 }