├── packages ├── TinyIoC.1.2 │ ├── TinyIoC.1.2.nupkg │ └── TinyIoC.1.2.nuspec ├── xunit.1.9.2 │ ├── lib │ │ └── net20 │ │ │ ├── xunit.dll │ │ │ ├── xunit.runner.msbuild.dll │ │ │ ├── xunit.runner.tdnet.dll │ │ │ ├── xunit.runner.utility.dll │ │ │ └── xunit.dll.tdnet │ ├── xunit.1.9.2.nupkg │ └── xunit.1.9.2.nuspec ├── Moq.4.2.1402.2112 │ ├── lib │ │ ├── net35 │ │ │ └── Moq.dll │ │ ├── net40 │ │ │ └── Moq.dll │ │ └── sl4 │ │ │ └── Moq.Silverlight.dll │ └── Moq.4.2.1402.2112.nupkg ├── NuGet.CommandLine.2.8.2 │ ├── tools │ │ └── NuGet.exe │ └── NuGet.CommandLine.2.8.2.nupkg ├── xunit.runners.1.9.2 │ ├── tools │ │ ├── xunit.gui.exe │ │ ├── xunit.console.exe │ │ ├── xunit.gui.x86.exe │ │ ├── xunit.gui.clr4.exe │ │ ├── xunit.console.clr4.exe │ │ ├── xunit.console.x86.exe │ │ ├── xunit.gui.clr4.x86.exe │ │ ├── xunit.runner.msbuild.dll │ │ ├── xunit.runner.utility.dll │ │ ├── xunit.console.clr4.x86.exe │ │ ├── xunit.console.exe.config │ │ ├── xunit.console.clr4.exe.config │ │ ├── xunit.console.x86.exe.config │ │ └── xunit.console.clr4.x86.exe.config │ ├── xunit.runners.1.9.2.nupkg │ └── xunit.runners.1.9.2.nuspec ├── ScriptCs.Contracts.0.10.2 │ ├── ScriptCs.Contracts.0.10.2.nupkg │ └── lib │ │ └── net45 │ │ └── ScriptCs.Contracts.dll └── repositories.config ├── .nuget └── packages.config ├── DotNetBuild.Core ├── Facilities │ ├── IFacility.cs │ ├── IFacilityProvider.cs │ ├── State │ │ ├── IStateReader.cs │ │ └── IStateWriter.cs │ └── Logging │ │ └── ILogger.cs ├── IConfigurator.cs ├── IParameterProvider.cs ├── ITargetRegistry.cs ├── IConfigurationRegistry.cs ├── ITarget.cs ├── TargetDependencyBuilder.cs ├── package.nuspec ├── TargetBuilderDecorator.cs ├── TargetExecutionContext.cs ├── ConfigurationBuilder.cs ├── ConfigurationSettings.cs ├── Properties │ └── AssemblyInfo.cs ├── ConfigurationBuilderExtension.cs └── TargetBuilderExtension.cs ├── packagesForNuGet ├── DotNetBuild.Core.1.0.0.nupkg ├── DotNetBuild.Core.1.1.0.nupkg ├── DotNetBuild.Runner.1.0.0.nupkg ├── DotNetBuild.Runner.1.1.0.nupkg ├── DotNetBuild.Tasks.1.0.0.nupkg ├── DotNetBuild.Tasks.1.1.0.nupkg ├── DotNetBuild.Core.1.0.0-alpha.nupkg ├── DotNetBuild.Core.1.0.0-alpha2.nupkg ├── DotNetBuild.Core.1.0.0-alpha3.nupkg ├── DotNetBuild.Tasks.1.0.0-alpha.nupkg ├── DotNetBuild.Runner.1.0.0-alpha.nupkg ├── DotNetBuild.Runner.1.0.0-alpha2.nupkg ├── DotNetBuild.Runner.1.0.0-alpha3.nupkg ├── DotNetBuild.Tasks.1.0.0-alpha2.nupkg ├── DotNetBuild.Tasks.1.0.0-alpha3.nupkg ├── DotNetBuild.Runner.Assembly.1.0.0.nupkg ├── DotNetBuild.Runner.Assembly.1.1.0.nupkg ├── DotNetBuild.Runner.ScriptCs.1.0.0.nupkg ├── DotNetBuild.Runner.ScriptCs.1.1.0.nupkg ├── DotNetBuild.Runner.Assembly.1.0.0-alpha.nupkg ├── DotNetBuild.Runner.ScriptCs.1.0.0-alpha.nupkg ├── DotNetBuild.Runner.Assembly.1.0.0-alpha2.nupkg ├── DotNetBuild.Runner.Assembly.1.0.0-alpha3.nupkg ├── DotNetBuild.Runner.ScriptCs.1.0.0-alpha2.nupkg └── DotNetBuild.Runner.ScriptCs.1.0.0-alpha3.nupkg ├── DotNetBuild.Runner ├── packages.config ├── Infrastructure │ ├── Logging │ │ ├── ILoggerFactory.cs │ │ ├── ILogger.cs │ │ ├── LoggerFactory.cs │ │ └── Loggers │ │ │ ├── StandardLogger.cs │ │ │ └── TeamCityLogger.cs │ └── Reflection │ │ ├── TypeFilter.cs │ │ ├── AssemblyLoader.cs │ │ └── TypeActivator.cs ├── ParameterConstants.cs ├── Exceptions │ ├── UnableToFindTargetException.cs │ ├── UnableToLoadAssemblyException.cs │ ├── UnableToResolveConfiguratorException.cs │ ├── UnableToFindConfigurationException.cs │ ├── UnableToActivateTypeWithNoDefaultConstructorException.cs │ ├── UnableToActivateConfiguratorException.cs │ ├── DotNetBuildException.cs │ ├── UnableToExecuteTargetException.cs │ ├── UnableToDetermineCorrectImplementationException.cs │ └── UnableToExecuteTargetWithCircularDependenciesException.cs ├── Facilities │ ├── State │ │ ├── StateReader.cs │ │ ├── StateWriter.cs │ │ └── StateRegistry.cs │ ├── Logging │ │ └── Logger.cs │ └── FacilityProvider.cs ├── package.nuspec ├── ParameterProvider.cs ├── TargetRegistry.cs ├── ConfigurationRegistry.cs ├── TargetInspector.cs ├── ConfiguratorResolver.cs └── Properties │ └── AssemblyInfo.cs ├── DotNetBuild.Build.ScriptCs.Fluent ├── scriptcs_bin │ ├── DotNetBuild.Core.dll │ ├── DotNetBuild.Core.pdb │ ├── DotNetBuild.Runner.dll │ ├── DotNetBuild.Runner.pdb │ ├── DotNetBuild.Tasks.dll │ ├── DotNetBuild.Tasks.pdb │ ├── ScriptCs.Contracts.dll │ ├── DotNetBuild.Runner.ScriptCs.dll │ └── DotNetBuild.Runner.ScriptCs.pdb ├── buildCI.bat └── buildDeploy.bat ├── DotNetBuild.Runner.ScriptCs ├── packages.config ├── DotNetBuildScriptPack.cs ├── package.nuspec └── Properties │ └── AssemblyInfo.cs ├── DotNetBuild.Build.ScriptCs.NonFluent ├── scriptcs_bin │ ├── DotNetBuild.Core.dll │ ├── DotNetBuild.Core.pdb │ ├── DotNetBuild.Runner.dll │ ├── DotNetBuild.Runner.pdb │ ├── DotNetBuild.Tasks.dll │ ├── DotNetBuild.Tasks.pdb │ ├── ScriptCs.Contracts.dll │ ├── DotNetBuild.Runner.ScriptCs.dll │ └── DotNetBuild.Runner.ScriptCs.pdb ├── configuration.csx ├── targets.deploy.csx ├── targets.compilation.buildRelease.csx ├── targets.ci.csx ├── targets.testing.runTests.csx ├── buildCI.bat ├── buildDeploy.bat ├── build.csx ├── targets.nuget.createCorePackage.csx ├── targets.nuget.createTasksPackage.csx ├── targets.nuget.createRunnerPackage.csx ├── targets.nuget.publishCorePackage.csx ├── targets.nuget.publishRunnerPackage.csx ├── targets.nuget.publishTasksPackage.csx ├── targets.nuget.createRunnerAssemblyPackage.csx ├── targets.nuget.createRunnerScriptCsPackage.csx ├── targets.nuget.publishRunnerAssemblyPackage.csx └── targets.nuget.publishRunnerScriptCsPackage.csx ├── DotNetBuild.Build.Assembly.Fluent ├── buildCI.bat ├── buildDeploy.bat └── Properties │ └── AssemblyInfo.cs ├── DotNetBuild.Build.Assembly.NonFluent ├── buildCI.bat ├── buildDeploy.bat ├── Configurator.cs ├── Configuration │ └── DefaultConfigurationSettings.cs ├── Targets │ ├── Deploy.cs │ ├── Compilation │ │ └── BuildRelease.cs │ ├── Testing │ │ └── RunTests.cs │ ├── CI.cs │ └── NuGet │ │ ├── CreateCorePackage.cs │ │ ├── CreateTasksPackage.cs │ │ ├── CreateRunnerPackage.cs │ │ ├── PublishCorePackage.cs │ │ ├── PublishTasksPackage.cs │ │ ├── PublishRunnerPackage.cs │ │ ├── CreateRunnerAssemblyPackage.cs │ │ └── CreateRunnerScriptCsPackage.cs └── Properties │ └── AssemblyInfo.cs ├── DotNetBuild.Runner.Assembly ├── App.config ├── Program.cs ├── package.nuspec └── Properties │ └── AssemblyInfo.cs ├── DotNetBuild.Tests ├── packages.config ├── Runner │ ├── Facilities │ │ ├── TestFacility.cs │ │ ├── State │ │ │ ├── StateRegistryTests │ │ │ │ ├── Get_state_with_unexisting_key.cs │ │ │ │ ├── Get_state.cs │ │ │ │ ├── Get_state_with_different_case.cs │ │ │ │ ├── Add_state.cs │ │ │ │ ├── Get_state_with_wrong_type.cs │ │ │ │ ├── Add_state_without_passing_in_a_key.cs │ │ │ │ ├── Add_state_without_passing_in_a_value.cs │ │ │ │ └── Add_state_with_existing_key.cs │ │ │ ├── StateWriterTests │ │ │ │ └── Add_state.cs │ │ │ └── StateReaderTests │ │ │ │ └── Get_state.cs │ │ └── Logging │ │ │ └── LoggerTests │ │ │ ├── LogInfo.cs │ │ │ └── LogError.cs │ ├── TargetRegistryTests │ │ ├── Get_target_without_passing_in_a_key.cs │ │ ├── Get_target_with_unexisting_key.cs │ │ ├── Get_target.cs │ │ ├── Get_target_with_different_casing.cs │ │ ├── Add_target.cs │ │ ├── Add_target_without_passing_in_a_value.cs │ │ ├── Add_target_without_passing_in_a_key.cs │ │ └── Add_target_with_existing_key.cs │ ├── ConfigurationRegistryTests │ │ ├── Get_configuration_settings_without_passing_in_a_key.cs │ │ ├── Get_configuration_settings_with_unexisting_key.cs │ │ ├── Get_configuration_settings.cs │ │ ├── Get_configuration_settings_with_different_casing.cs │ │ ├── Add_configuration_settings_without_passing_in_a_value.cs │ │ ├── Add_configuration_settings.cs │ │ ├── Add_configuration_settings_without_passing_in_a_key.cs │ │ └── Add_configuration_settings_with_existing_key.cs │ ├── Infrastructure │ │ └── Reflection │ │ │ ├── TypeFilterTests │ │ │ └── Get_its_Filter.cs │ │ │ ├── AssemblyLoaderTests │ │ │ ├── Load_an_invalid_Assembly.cs │ │ │ └── Load_a_Assembly.cs │ │ │ ├── TypeActivatorTests │ │ │ ├── Activate_a_Type.cs │ │ │ ├── Activate_a_Type_with_no_Type.cs │ │ │ └── Activate_a_Type_with_no_default_constructor.cs │ │ │ └── AssemblyWrapperTests │ │ │ ├── Get_one_type_with_no_filter.cs │ │ │ └── Get_one_type_with_a_filter.cs │ ├── ConfiguratorResolverTests │ │ └── Resolve_a_Configurator_with_no_assembly_wrapper.cs │ ├── ParameterProviderTests │ │ └── Get_value.cs │ └── TargetExecutorTests │ │ └── Execute_a_null_Target.cs ├── TestSpecification.cs ├── TestHelpers.cs ├── TestData.cs ├── Core │ ├── ConfigurationSettingsTests │ │ ├── Get_setting_without_passing_in_a_key.cs │ │ ├── Get_setting_with_unexisting_key.cs │ │ ├── Get_setting_with_unexisting_key_default_value.cs │ │ ├── Get_setting.cs │ │ ├── Add_setting.cs │ │ ├── Add_setting_without_passing_in_a_key.cs │ │ ├── Add_setting_without_passing_in_a_value.cs │ │ ├── Get_setting_of_the_wrong_type.cs │ │ └── Add_setting_with_existing_key.cs │ ├── TargetBuilderTests │ │ ├── Build_with_no_name.cs │ │ ├── Set_ContinueOnError.cs │ │ ├── Set_ExecuteFunc.cs │ │ ├── Set_DependsOn_target.cs │ │ └── Build_with_valid_arguments.cs │ └── ConfigurationBuilderTests │ │ ├── Build_with_no_name.cs │ │ ├── Add_setting.cs │ │ └── Build_with_valid_arguments.cs └── Properties │ └── AssemblyInfo.cs ├── DotNetBuild.Tests.TestAssembly ├── DummyConfigurator.cs ├── Dummy2Target.cs ├── Dummy1Target.cs └── Properties │ └── AssemblyInfo.cs ├── appveyor.yml ├── DotNetBuild.Tasks ├── ExecTask.cs ├── XunitTask.cs ├── package.nuspec ├── NuGet │ ├── Push.cs │ └── Pack.cs └── Properties │ └── AssemblyInfo.cs ├── LICENSE.txt └── .gitignore /packages/TinyIoC.1.2/TinyIoC.1.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/TinyIoC.1.2/TinyIoC.1.2.nupkg -------------------------------------------------------------------------------- /packages/xunit.1.9.2/lib/net20/xunit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/xunit.1.9.2/lib/net20/xunit.dll -------------------------------------------------------------------------------- /packages/xunit.1.9.2/xunit.1.9.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/xunit.1.9.2/xunit.1.9.2.nupkg -------------------------------------------------------------------------------- /.nuget/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /DotNetBuild.Core/Facilities/IFacility.cs: -------------------------------------------------------------------------------- 1 | namespace DotNetBuild.Core.Facilities 2 | { 3 | public interface IFacility 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /packages/Moq.4.2.1402.2112/lib/net35/Moq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/Moq.4.2.1402.2112/lib/net35/Moq.dll -------------------------------------------------------------------------------- /packages/Moq.4.2.1402.2112/lib/net40/Moq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/Moq.4.2.1402.2112/lib/net40/Moq.dll -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Core.1.0.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Core.1.0.0.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Core.1.1.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Core.1.1.0.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Runner.1.0.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Runner.1.0.0.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Runner.1.1.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Runner.1.1.0.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Tasks.1.0.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Tasks.1.0.0.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Tasks.1.1.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Tasks.1.1.0.nupkg -------------------------------------------------------------------------------- /DotNetBuild.Core/IConfigurator.cs: -------------------------------------------------------------------------------- 1 | namespace DotNetBuild.Core 2 | { 3 | public interface IConfigurator 4 | { 5 | void Configure(); 6 | } 7 | } -------------------------------------------------------------------------------- /packages/Moq.4.2.1402.2112/Moq.4.2.1402.2112.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/Moq.4.2.1402.2112/Moq.4.2.1402.2112.nupkg -------------------------------------------------------------------------------- /packages/NuGet.CommandLine.2.8.2/tools/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/NuGet.CommandLine.2.8.2/tools/NuGet.exe -------------------------------------------------------------------------------- /packages/xunit.runners.1.9.2/tools/xunit.gui.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/xunit.runners.1.9.2/tools/xunit.gui.exe -------------------------------------------------------------------------------- /packages/xunit.runners.1.9.2/tools/xunit.console.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/xunit.runners.1.9.2/tools/xunit.console.exe -------------------------------------------------------------------------------- /packages/xunit.runners.1.9.2/tools/xunit.gui.x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/xunit.runners.1.9.2/tools/xunit.gui.x86.exe -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Core.1.0.0-alpha.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Core.1.0.0-alpha.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Core.1.0.0-alpha2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Core.1.0.0-alpha2.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Core.1.0.0-alpha3.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Core.1.0.0-alpha3.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Tasks.1.0.0-alpha.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Tasks.1.0.0-alpha.nupkg -------------------------------------------------------------------------------- /DotNetBuild.Runner/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /packages/Moq.4.2.1402.2112/lib/sl4/Moq.Silverlight.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/Moq.4.2.1402.2112/lib/sl4/Moq.Silverlight.dll -------------------------------------------------------------------------------- /packages/xunit.1.9.2/lib/net20/xunit.runner.msbuild.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/xunit.1.9.2/lib/net20/xunit.runner.msbuild.dll -------------------------------------------------------------------------------- /packages/xunit.1.9.2/lib/net20/xunit.runner.tdnet.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/xunit.1.9.2/lib/net20/xunit.runner.tdnet.dll -------------------------------------------------------------------------------- /packages/xunit.1.9.2/lib/net20/xunit.runner.utility.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/xunit.1.9.2/lib/net20/xunit.runner.utility.dll -------------------------------------------------------------------------------- /packages/xunit.runners.1.9.2/tools/xunit.gui.clr4.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/xunit.runners.1.9.2/tools/xunit.gui.clr4.exe -------------------------------------------------------------------------------- /packages/xunit.runners.1.9.2/xunit.runners.1.9.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/xunit.runners.1.9.2/xunit.runners.1.9.2.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Runner.1.0.0-alpha.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Runner.1.0.0-alpha.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Runner.1.0.0-alpha2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Runner.1.0.0-alpha2.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Runner.1.0.0-alpha3.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Runner.1.0.0-alpha3.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Tasks.1.0.0-alpha2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Tasks.1.0.0-alpha2.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Tasks.1.0.0-alpha3.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Tasks.1.0.0-alpha3.nupkg -------------------------------------------------------------------------------- /packages/xunit.runners.1.9.2/tools/xunit.console.clr4.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/xunit.runners.1.9.2/tools/xunit.console.clr4.exe -------------------------------------------------------------------------------- /packages/xunit.runners.1.9.2/tools/xunit.console.x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/xunit.runners.1.9.2/tools/xunit.console.x86.exe -------------------------------------------------------------------------------- /packages/xunit.runners.1.9.2/tools/xunit.gui.clr4.x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/xunit.runners.1.9.2/tools/xunit.gui.clr4.x86.exe -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Runner.Assembly.1.0.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Runner.Assembly.1.0.0.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Runner.Assembly.1.1.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Runner.Assembly.1.1.0.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Runner.ScriptCs.1.0.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Runner.ScriptCs.1.0.0.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Runner.ScriptCs.1.1.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Runner.ScriptCs.1.1.0.nupkg -------------------------------------------------------------------------------- /packages/xunit.runners.1.9.2/tools/xunit.runner.msbuild.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/xunit.runners.1.9.2/tools/xunit.runner.msbuild.dll -------------------------------------------------------------------------------- /packages/xunit.runners.1.9.2/tools/xunit.runner.utility.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/xunit.runners.1.9.2/tools/xunit.runner.utility.dll -------------------------------------------------------------------------------- /packages/NuGet.CommandLine.2.8.2/NuGet.CommandLine.2.8.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/NuGet.CommandLine.2.8.2/NuGet.CommandLine.2.8.2.nupkg -------------------------------------------------------------------------------- /packages/xunit.runners.1.9.2/tools/xunit.console.clr4.x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/xunit.runners.1.9.2/tools/xunit.console.clr4.x86.exe -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Runner.Assembly.1.0.0-alpha.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Runner.Assembly.1.0.0-alpha.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Runner.ScriptCs.1.0.0-alpha.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Runner.ScriptCs.1.0.0-alpha.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Runner.Assembly.1.0.0-alpha2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Runner.Assembly.1.0.0-alpha2.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Runner.Assembly.1.0.0-alpha3.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Runner.Assembly.1.0.0-alpha3.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Runner.ScriptCs.1.0.0-alpha2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Runner.ScriptCs.1.0.0-alpha2.nupkg -------------------------------------------------------------------------------- /packagesForNuGet/DotNetBuild.Runner.ScriptCs.1.0.0-alpha3.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packagesForNuGet/DotNetBuild.Runner.ScriptCs.1.0.0-alpha3.nupkg -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.Fluent/scriptcs_bin/DotNetBuild.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/DotNetBuild.Build.ScriptCs.Fluent/scriptcs_bin/DotNetBuild.Core.dll -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.Fluent/scriptcs_bin/DotNetBuild.Core.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/DotNetBuild.Build.ScriptCs.Fluent/scriptcs_bin/DotNetBuild.Core.pdb -------------------------------------------------------------------------------- /DotNetBuild.Runner.ScriptCs/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /packages/ScriptCs.Contracts.0.10.2/ScriptCs.Contracts.0.10.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/ScriptCs.Contracts.0.10.2/ScriptCs.Contracts.0.10.2.nupkg -------------------------------------------------------------------------------- /packages/ScriptCs.Contracts.0.10.2/lib/net45/ScriptCs.Contracts.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/packages/ScriptCs.Contracts.0.10.2/lib/net45/ScriptCs.Contracts.dll -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.Fluent/scriptcs_bin/DotNetBuild.Runner.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/DotNetBuild.Build.ScriptCs.Fluent/scriptcs_bin/DotNetBuild.Runner.dll -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.Fluent/scriptcs_bin/DotNetBuild.Runner.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/DotNetBuild.Build.ScriptCs.Fluent/scriptcs_bin/DotNetBuild.Runner.pdb -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.Fluent/scriptcs_bin/DotNetBuild.Tasks.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/DotNetBuild.Build.ScriptCs.Fluent/scriptcs_bin/DotNetBuild.Tasks.dll -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.Fluent/scriptcs_bin/DotNetBuild.Tasks.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/DotNetBuild.Build.ScriptCs.Fluent/scriptcs_bin/DotNetBuild.Tasks.pdb -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.Fluent/scriptcs_bin/ScriptCs.Contracts.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/DotNetBuild.Build.ScriptCs.Fluent/scriptcs_bin/ScriptCs.Contracts.dll -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/scriptcs_bin/DotNetBuild.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/DotNetBuild.Build.ScriptCs.NonFluent/scriptcs_bin/DotNetBuild.Core.dll -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/scriptcs_bin/DotNetBuild.Core.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/DotNetBuild.Build.ScriptCs.NonFluent/scriptcs_bin/DotNetBuild.Core.pdb -------------------------------------------------------------------------------- /DotNetBuild.Core/IParameterProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Core 4 | { 5 | public interface IParameterProvider 6 | { 7 | String Get(String key); 8 | } 9 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/scriptcs_bin/DotNetBuild.Runner.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/DotNetBuild.Build.ScriptCs.NonFluent/scriptcs_bin/DotNetBuild.Runner.dll -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/scriptcs_bin/DotNetBuild.Runner.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/DotNetBuild.Build.ScriptCs.NonFluent/scriptcs_bin/DotNetBuild.Runner.pdb -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/scriptcs_bin/DotNetBuild.Tasks.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/DotNetBuild.Build.ScriptCs.NonFluent/scriptcs_bin/DotNetBuild.Tasks.dll -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/scriptcs_bin/DotNetBuild.Tasks.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/DotNetBuild.Build.ScriptCs.NonFluent/scriptcs_bin/DotNetBuild.Tasks.pdb -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/scriptcs_bin/ScriptCs.Contracts.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/DotNetBuild.Build.ScriptCs.NonFluent/scriptcs_bin/ScriptCs.Contracts.dll -------------------------------------------------------------------------------- /DotNetBuild.Runner/Infrastructure/Logging/ILoggerFactory.cs: -------------------------------------------------------------------------------- 1 | namespace DotNetBuild.Runner.Infrastructure.Logging 2 | { 3 | public interface ILoggerFactory 4 | { 5 | ILogger CreateLogger(); 6 | } 7 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.Fluent/scriptcs_bin/DotNetBuild.Runner.ScriptCs.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/DotNetBuild.Build.ScriptCs.Fluent/scriptcs_bin/DotNetBuild.Runner.ScriptCs.dll -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.Fluent/scriptcs_bin/DotNetBuild.Runner.ScriptCs.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/DotNetBuild.Build.ScriptCs.Fluent/scriptcs_bin/DotNetBuild.Runner.ScriptCs.pdb -------------------------------------------------------------------------------- /DotNetBuild.Build.Assembly.Fluent/buildCI.bat: -------------------------------------------------------------------------------- 1 | ..\DotNetBuild.Runner.Assembly\bin\Debug\DotNetBuild.Runner.Assembly.exe assembly:.\bin\Debug\DotNetBuild.Build.Assembly.Fluent.dll target:CI configuration:defaultConfig 2 | pause -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/scriptcs_bin/DotNetBuild.Runner.ScriptCs.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/DotNetBuild.Build.ScriptCs.NonFluent/scriptcs_bin/DotNetBuild.Runner.ScriptCs.dll -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/scriptcs_bin/DotNetBuild.Runner.ScriptCs.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenlauwers22/DotNetBuild/HEAD/DotNetBuild.Build.ScriptCs.NonFluent/scriptcs_bin/DotNetBuild.Runner.ScriptCs.pdb -------------------------------------------------------------------------------- /DotNetBuild.Build.Assembly.NonFluent/buildCI.bat: -------------------------------------------------------------------------------- 1 | ..\DotNetBuild.Runner.Assembly\bin\Debug\DotNetBuild.Runner.Assembly.exe assembly:.\bin\Debug\DotNetBuild.Build.Assembly.NonFluent.dll target:CI configuration:defaultConfig 2 | pause -------------------------------------------------------------------------------- /DotNetBuild.Runner.Assembly/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DotNetBuild.Core/Facilities/IFacilityProvider.cs: -------------------------------------------------------------------------------- 1 | namespace DotNetBuild.Core.Facilities 2 | { 3 | public interface IFacilityProvider 4 | { 5 | TFacility Get() 6 | where TFacility : IFacility; 7 | } 8 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /DotNetBuild.Build.Assembly.Fluent/buildDeploy.bat: -------------------------------------------------------------------------------- 1 | ..\DotNetBuild.Runner.Assembly\bin\Debug\DotNetBuild.Runner.Assembly.exe assembly:.\bin\Debug\DotNetBuild.Build.Assembly.Fluent.dll target:Deploy configuration:defaultConfig versionNumber:1.1.0 2 | pause -------------------------------------------------------------------------------- /DotNetBuild.Core/Facilities/State/IStateReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Core.Facilities.State 4 | { 5 | public interface IStateReader 6 | : IFacility 7 | { 8 | T Get(String key); 9 | } 10 | } -------------------------------------------------------------------------------- /DotNetBuild.Core/ITargetRegistry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Core 4 | { 5 | public interface ITargetRegistry 6 | { 7 | ITarget Get(String key); 8 | void Add(String key, ITarget value); 9 | } 10 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.Assembly.NonFluent/buildDeploy.bat: -------------------------------------------------------------------------------- 1 | ..\DotNetBuild.Runner.Assembly\bin\Debug\DotNetBuild.Runner.Assembly.exe assembly:.\bin\Debug\DotNetBuild.Build.Assembly.NonFluent.dll target:Deploy configuration:defaultConfig versionNumber:1.1.0 2 | pause -------------------------------------------------------------------------------- /packages/xunit.1.9.2/lib/net20/xunit.dll.tdnet: -------------------------------------------------------------------------------- 1 | 2 | xUnit.net {0}.{1}.{2} build {3} 3 | xunit.runner.tdnet.dll 4 | Xunit.Runner.TdNet.TdNetRunner 5 | -------------------------------------------------------------------------------- /DotNetBuild.Core/Facilities/State/IStateWriter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Core.Facilities.State 4 | { 5 | public interface IStateWriter 6 | : IFacility 7 | { 8 | void Add(String key, Object value); 9 | } 10 | } -------------------------------------------------------------------------------- /DotNetBuild.Core/IConfigurationRegistry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Core 4 | { 5 | public interface IConfigurationRegistry 6 | { 7 | IConfigurationSettings Get(String key); 8 | void Add(String key, IConfigurationSettings value); 9 | } 10 | } -------------------------------------------------------------------------------- /packages/repositories.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DotNetBuild.Core/Facilities/Logging/ILogger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Core.Facilities.Logging 4 | { 5 | public interface ILogger 6 | : IFacility 7 | { 8 | void LogInfo(String message); 9 | void LogError(String message, Exception exception); 10 | } 11 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Facilities/TestFacility.cs: -------------------------------------------------------------------------------- 1 | using DotNetBuild.Core.Facilities; 2 | 3 | namespace DotNetBuild.Tests.Runner.Facilities 4 | { 5 | public interface ITestFacility 6 | : IFacility 7 | { 8 | } 9 | 10 | public class TestFacility 11 | : ITestFacility 12 | { 13 | } 14 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/ParameterConstants.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Runner 4 | { 5 | public class ParameterConstants 6 | { 7 | public const String Assembly = "assembly"; 8 | public const String Target = "target"; 9 | public const String Configuration = "configuration"; 10 | } 11 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests.TestAssembly/DummyConfigurator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | 4 | namespace DotNetBuild.Tests.TestAssembly 5 | { 6 | public class DummyConfigurator : IConfigurator 7 | { 8 | public void Configure() 9 | { 10 | throw new NotImplementedException(); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | branches: 2 | only: 3 | - master 4 | 5 | os: Windows Server 2012 6 | 7 | init: 8 | - git config --global core.autocrlf input 9 | - cinst scriptcs -y 10 | 11 | build_script: 12 | - C:\ProgramData\chocolatey\bin\scriptcs.exe .\DotNetBuild.Build.ScriptCs.Fluent\build.csx -- target:ci configuration:appveyorConfig 13 | 14 | test: off -------------------------------------------------------------------------------- /DotNetBuild.Core/ITarget.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace DotNetBuild.Core 5 | { 6 | public interface ITarget 7 | { 8 | String Description { get; } 9 | Boolean ContinueOnError { get; } 10 | IEnumerable DependsOn { get; } 11 | 12 | Boolean Execute(TargetExecutionContext context); 13 | } 14 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/Infrastructure/Logging/ILogger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Runner.Infrastructure.Logging 4 | { 5 | public interface ILogger 6 | { 7 | void Write(String message); 8 | void WriteBlockStart(String message); 9 | void WriteBlockEnd(String message); 10 | void WriteError(String message, Exception exception); 11 | } 12 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/configuration.csx: -------------------------------------------------------------------------------- 1 | public class DefaultConfigurationSettings : ConfigurationSettings 2 | { 3 | public DefaultConfigurationSettings() 4 | { 5 | Add("SolutionDirectory", @"..\"); 6 | Add("PathToNuGetExe", @"packages\NuGet.CommandLine.2.8.2\tools\NuGet.exe"); 7 | Add("NuGetApiKey", ""); 8 | Add("PathToXUnitRunnerExe", @"packages\xunit.runners.1.9.2\tools\xunit.console.clr4.exe"); 9 | } 10 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner.Assembly/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner.Configuration; 3 | using DotNetBuild.Runner.Infrastructure.TinyIoC; 4 | 5 | namespace DotNetBuild.Runner.Assembly 6 | { 7 | public class Program 8 | { 9 | public static int Main(String[] args) 10 | { 11 | var container = TinyIoCContainer.Current.RegisterDotNetBuild(); 12 | var dotNetBuild = new DotNetBuild(args, container); 13 | return dotNetBuild.Run(); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /DotNetBuild.Tasks/ExecTask.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Tasks 4 | { 5 | public class ExecTask 6 | : CommandLineToolTask 7 | { 8 | public String ToolExe { get; set; } 9 | public String ToolArguments { get; set; } 10 | 11 | protected override String GetToolPath() 12 | { 13 | return ToolExe; 14 | } 15 | 16 | protected override String GetToolArguments() 17 | { 18 | return ToolArguments; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/TestSpecification.cs: -------------------------------------------------------------------------------- 1 | namespace DotNetBuild.Tests 2 | { 3 | public abstract class TestSpecification 4 | { 5 | protected T Sut; 6 | 7 | protected TestSpecification() 8 | { 9 | Arrange(); 10 | Sut = CreateSubjectUnderTest(); 11 | Act(); 12 | } 13 | 14 | protected virtual void Arrange() 15 | { 16 | } 17 | 18 | protected abstract T CreateSubjectUnderTest(); 19 | 20 | protected abstract void Act(); 21 | } 22 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.Assembly.NonFluent/Configurator.cs: -------------------------------------------------------------------------------- 1 | using DotNetBuild.Build.Assembly.NonFluent.Configuration; 2 | using DotNetBuild.Build.Assembly.NonFluent.Targets; 3 | using DotNetBuild.Core; 4 | 5 | namespace DotNetBuild.Build.Assembly.NonFluent 6 | { 7 | public class Configurator : IConfigurator 8 | { 9 | public void Configure() 10 | { 11 | "ci".Target(new CI()); 12 | "deploy".Target(new Deploy()); 13 | 14 | "defaultConfig".Configure(new DefaultConfigurationSettings()); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/Exceptions/UnableToFindTargetException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Runner.Exceptions 4 | { 5 | public class UnableToFindTargetException 6 | : DotNetBuildException 7 | { 8 | private readonly String _target; 9 | 10 | public UnableToFindTargetException(String target) 11 | : base(-13, String.Format("Target with name '{0}' could not be found", target)) 12 | { 13 | _target = target; 14 | } 15 | 16 | public String Target 17 | { 18 | get { return _target; } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.Assembly.NonFluent/Configuration/DefaultConfigurationSettings.cs: -------------------------------------------------------------------------------- 1 | using DotNetBuild.Core; 2 | 3 | namespace DotNetBuild.Build.Assembly.NonFluent.Configuration 4 | { 5 | public class DefaultConfigurationSettings : ConfigurationSettings 6 | { 7 | public DefaultConfigurationSettings() 8 | { 9 | Add("SolutionDirectory", @"..\"); 10 | Add("PathToNuGetExe", @"packages\NuGet.CommandLine.2.8.2\tools\NuGet.exe"); 11 | Add("NuGetApiKey", ""); 12 | Add("PathToXUnitRunnerExe", @"packages\xunit.runners.1.9.2\tools\xunit.console.clr4.exe"); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/Exceptions/UnableToLoadAssemblyException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Runner.Exceptions 4 | { 5 | public class UnableToLoadAssemblyException 6 | : DotNetBuildException 7 | { 8 | private readonly String _assembly; 9 | 10 | public UnableToLoadAssemblyException(String assembly) 11 | : base(-10, String.Format("Assembly with name '{0}' could not be loaded", assembly)) 12 | { 13 | _assembly = assembly; 14 | } 15 | 16 | public String Assembly 17 | { 18 | get { return _assembly; } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /DotNetBuild.Tasks/XunitTask.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | namespace DotNetBuild.Tasks 5 | { 6 | public class XunitTask 7 | : CommandLineToolTask 8 | { 9 | public String XunitExe { get; set; } 10 | public String Assembly { get; set; } 11 | 12 | protected override String GetToolPath() 13 | { 14 | return XunitExe; 15 | } 16 | 17 | protected override String GetToolArguments() 18 | { 19 | var parameters = new StringBuilder(); 20 | parameters.Append(Assembly + " "); 21 | 22 | return parameters.ToString(); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/TestHelpers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Tests 4 | { 5 | public class TestHelpers 6 | { 7 | public static Exception CatchException(Action action) 8 | { 9 | return CatchException(action); 10 | } 11 | 12 | public static T CatchException(Action action) 13 | where T : Exception 14 | { 15 | try 16 | { 17 | action(); 18 | } 19 | catch (T exception) 20 | { 21 | return exception; 22 | } 23 | 24 | return null; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /packages/xunit.runners.1.9.2/tools/xunit.console.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 14 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /packages/xunit.runners.1.9.2/tools/xunit.console.clr4.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 14 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /packages/xunit.runners.1.9.2/tools/xunit.console.x86.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 14 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /DotNetBuild.Runner/Exceptions/UnableToResolveConfiguratorException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Runner.Exceptions 4 | { 5 | public class UnableToResolveConfiguratorException 6 | : DotNetBuildException 7 | { 8 | private readonly String _assembly; 9 | 10 | public UnableToResolveConfiguratorException(String assembly) 11 | : base(-11, String.Format("An implementation of IConfigurator could not be found in assembly '{0}'", assembly)) 12 | { 13 | _assembly = assembly; 14 | } 15 | 16 | public String Assembly 17 | { 18 | get { return _assembly; } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /packages/xunit.runners.1.9.2/tools/xunit.console.clr4.x86.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 14 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /DotNetBuild.Runner/Exceptions/UnableToFindConfigurationException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Runner.Exceptions 4 | { 5 | public class UnableToFindConfigurationException 6 | : DotNetBuildException 7 | { 8 | private readonly String _configuration; 9 | 10 | public UnableToFindConfigurationException(String configuration) 11 | : base(-13, String.Format("Configuration with name '{0}' could not be found", configuration)) 12 | { 13 | _configuration = configuration; 14 | } 15 | 16 | public String Configuration 17 | { 18 | get { return _configuration; } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/Exceptions/UnableToActivateTypeWithNoDefaultConstructorException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Runner.Exceptions 4 | { 5 | public class UnableToActivateTypeWithNoDefaultConstructorException 6 | : DotNetBuildException 7 | { 8 | private readonly Type _type; 9 | 10 | public UnableToActivateTypeWithNoDefaultConstructorException(Type type) 11 | : base(-17, String.Format("Type '{0}' could not be activated, no default constructor was found", type.Name)) 12 | { 13 | _type = type; 14 | } 15 | 16 | public Type Type 17 | { 18 | get { return _type; } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/Facilities/State/StateReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core.Facilities.State; 3 | 4 | namespace DotNetBuild.Runner.Facilities.State 5 | { 6 | public class StateReader 7 | : IStateReader 8 | { 9 | private readonly IStateRegistry _stateRegistry; 10 | 11 | public StateReader(IStateRegistry stateRegistry) 12 | { 13 | if (stateRegistry == null) 14 | throw new ArgumentNullException("stateRegistry"); 15 | 16 | _stateRegistry = stateRegistry; 17 | } 18 | 19 | public T Get(String key) 20 | { 21 | return _stateRegistry.Get(key); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /DotNetBuild.Core/TargetDependencyBuilder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Core 4 | { 5 | public interface ITargetDependencyBuilder 6 | : ITargetBuilder 7 | { 8 | ITargetDependencyBuilder And(String target); 9 | } 10 | 11 | public class TargetDependencyBuilder 12 | : TargetBuilderDecorator, ITargetDependencyBuilder 13 | { 14 | public TargetDependencyBuilder(ITargetBuilder targetBuilder) 15 | : base(targetBuilder) 16 | { 17 | } 18 | 19 | public ITargetDependencyBuilder And(String target) 20 | { 21 | TargetBuilder.DependsOn(target); 22 | return this; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/Facilities/State/StateWriter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core.Facilities.State; 3 | 4 | namespace DotNetBuild.Runner.Facilities.State 5 | { 6 | public class StateWriter 7 | : IStateWriter 8 | { 9 | private readonly IStateRegistry _stateRegistry; 10 | 11 | public StateWriter(IStateRegistry stateRegistry) 12 | { 13 | if (stateRegistry == null) 14 | throw new ArgumentNullException("stateRegistry"); 15 | 16 | _stateRegistry = stateRegistry; 17 | } 18 | 19 | public void Add(String key, Object value) 20 | { 21 | _stateRegistry.Add(key, value); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/Exceptions/UnableToActivateConfiguratorException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Runner.Exceptions 4 | { 5 | public class UnableToActivateConfiguratorException 6 | : DotNetBuildException 7 | { 8 | private readonly Type _configuratorType; 9 | 10 | public UnableToActivateConfiguratorException(Type configuratorType) 11 | : base(-12, String.Format("Configurator of type '{0}' could not be activated", configuratorType.FullName)) 12 | { 13 | _configuratorType = configuratorType; 14 | } 15 | 16 | public Type ConfiguratorType 17 | { 18 | get { return _configuratorType; } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/Infrastructure/Reflection/TypeFilter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Runner.Infrastructure.Reflection 4 | { 5 | public interface ITypeFilter 6 | { 7 | Func Filter { get; } 8 | } 9 | 10 | public class TypeFilter 11 | : ITypeFilter 12 | { 13 | private readonly Func _filter; 14 | 15 | public TypeFilter(Func filter) 16 | { 17 | if (filter == null) 18 | throw new ArgumentNullException("filter"); 19 | 20 | _filter = filter; 21 | } 22 | 23 | public Func Filter 24 | { 25 | get { return _filter; } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/Exceptions/DotNetBuildException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Runner.Exceptions 4 | { 5 | public abstract class DotNetBuildException 6 | : Exception 7 | { 8 | private readonly int _errorCode; 9 | 10 | protected DotNetBuildException(int errorCode, String message) 11 | : this(errorCode, message, null) 12 | { 13 | } 14 | 15 | protected DotNetBuildException(int errorCode, String message, Exception innerException) 16 | : base(message, innerException) 17 | { 18 | _errorCode = errorCode; 19 | } 20 | 21 | public int ErrorCode 22 | { 23 | get { return _errorCode; } 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/Infrastructure/Logging/LoggerFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner.Infrastructure.Logging.Loggers; 3 | 4 | namespace DotNetBuild.Runner.Infrastructure.Logging 5 | { 6 | public class LoggerFactory : ILoggerFactory 7 | { 8 | public ILogger CreateLogger() 9 | { 10 | var runningFromTeamCity = Environment.GetEnvironmentVariable("TEAMCITY_PROJECT_NAME") != null; 11 | if (runningFromTeamCity) 12 | return new TeamCityLogger(); 13 | 14 | var runningFromAppVeyor = Environment.GetEnvironmentVariable("APPVEYOR") != null; 15 | if (runningFromAppVeyor) 16 | return new AppVeyorLogger(); 17 | 18 | return new StandardLogger(); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /DotNetBuild.Core/package.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DotNetBuild.Core 5 | $version$ 6 | DotNetBuild.Core 7 | Steven Lauwers 8 | Steven Lauwers 9 | Use .NET scripts to build your .NET code 10 | en-US 11 | https://github.com/stevenlauwers22/dotnetbuild 12 | false 13 | DotNetBuild.Core DotNetBuild DotNet MSBuild 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /DotNetBuild.Runner/Infrastructure/Reflection/AssemblyLoader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Reflection; 4 | 5 | namespace DotNetBuild.Runner.Infrastructure.Reflection 6 | { 7 | public interface IAssemblyLoader 8 | { 9 | IAssemblyWrapper Load(String assembly); 10 | } 11 | 12 | public class AssemblyLoader 13 | : IAssemblyLoader 14 | { 15 | public IAssemblyWrapper Load(String assembly) 16 | { 17 | var assemblyFileInfo = new FileInfo(assembly); 18 | if (!assemblyFileInfo.Exists) 19 | return null; 20 | 21 | var assemblyFile = Assembly.LoadFrom(assembly); 22 | var assemblyWrapper = new AssemblyWrapper(assemblyFile); 23 | return assemblyWrapper; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /DotNetBuild.Tasks/package.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DotNetBuild.Tasks 5 | $version$ 6 | DotNetBuild.Tasks 7 | Steven Lauwers 8 | Steven Lauwers 9 | Common tasks for DotNetBuild scripts 10 | en-US 11 | https://github.com/stevenlauwers22/dotnetbuild 12 | false 13 | DotNetBuild.Tasks DotNetBuild DotNet MSBuild 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /packages/TinyIoC.1.2/TinyIoC.1.2.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TinyIoC 5 | 1.2 6 | TinyIoC 7 | Steven Robbins 8 | Steven Robbins 9 | https://github.com/grumpydev/TinyIoC/blob/master/src/licence.txt 10 | https://github.com/grumpydev/TinyIoC 11 | false 12 | An easy to use, hassle free, Inversion of Control Container for small projects, libraries and beginners alike 13 | 14 | 15 | 16 | IoC 17 | 18 | -------------------------------------------------------------------------------- /DotNetBuild.Tests.TestAssembly/Dummy2Target.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using DotNetBuild.Core; 5 | 6 | namespace DotNetBuild.Tests.TestAssembly 7 | { 8 | public class Dummy2Target : ITarget 9 | { 10 | public String Description 11 | { 12 | get { return "Dummy target 2"; } 13 | } 14 | 15 | public Boolean ContinueOnError 16 | { 17 | get { return false; } 18 | } 19 | 20 | public IEnumerable DependsOn 21 | { 22 | get { return null; } 23 | } 24 | 25 | public Boolean Execute(TargetExecutionContext context) 26 | { 27 | Debug.WriteLine("{0} - executing", Description); 28 | return true; 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/Facilities/Logging/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core.Facilities.Logging; 3 | 4 | namespace DotNetBuild.Runner.Facilities.Logging 5 | { 6 | public class Logger 7 | : ILogger 8 | { 9 | private readonly Infrastructure.Logging.ILogger _logger; 10 | 11 | public Logger(Infrastructure.Logging.ILogger logger) 12 | { 13 | if (logger == null) 14 | throw new ArgumentNullException("logger"); 15 | 16 | _logger = logger; 17 | } 18 | 19 | public void LogInfo(String message) 20 | { 21 | _logger.Write(message); 22 | } 23 | 24 | public void LogError(String message, Exception exception) 25 | { 26 | _logger.WriteError(message, exception); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/Exceptions/UnableToExecuteTargetException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Runner.Exceptions 4 | { 5 | public class UnableToExecuteTargetException 6 | : DotNetBuildException 7 | { 8 | private readonly Type _targetType; 9 | 10 | public UnableToExecuteTargetException(Type targetType) 11 | : this(targetType, null) 12 | { 13 | } 14 | 15 | public UnableToExecuteTargetException(Type targetType, Exception innerException) 16 | : base(-15, String.Format("An error occured while executing target '{0}'", targetType.FullName), innerException) 17 | { 18 | _targetType = targetType; 19 | } 20 | 21 | public Type TargetType 22 | { 23 | get { return _targetType; } 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/TestData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Tests 4 | { 5 | public class TestData 6 | { 7 | public static Guid GenerateGuid() 8 | { 9 | return Guid.NewGuid(); 10 | } 11 | 12 | public static String GenerateString() 13 | { 14 | return Guid.NewGuid().ToString(); 15 | } 16 | 17 | public static Decimal GenerateDecimal() 18 | { 19 | var generator = new Random(); 20 | var value = new Decimal(generator.NextDouble() * generator.Next()); 21 | return value; 22 | } 23 | 24 | public static Boolean GenerateBoolean() 25 | { 26 | var generator = new Random(); 27 | var value = generator.Next(); 28 | return value % 2 == 0; 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/targets.deploy.csx: -------------------------------------------------------------------------------- 1 | public class Deploy : ITarget 2 | { 3 | public String Description 4 | { 5 | get { return "Deploy to NuGet"; } 6 | } 7 | 8 | public Boolean ContinueOnError 9 | { 10 | get { return false; } 11 | } 12 | 13 | public IEnumerable DependsOn 14 | { 15 | get 16 | { 17 | return new List 18 | { 19 | new PublishCorePackage(), 20 | new PublishRunnerPackage(), 21 | new PublishRunnerAssemblyPackage(), 22 | new PublishRunnerScriptCsPackage(), 23 | new PublishTasksPackage() 24 | }; 25 | } 26 | } 27 | 28 | public Boolean Execute(TargetExecutionContext context) 29 | { 30 | return true; 31 | } 32 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/Facilities/FacilityProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using DotNetBuild.Core.Facilities; 5 | 6 | namespace DotNetBuild.Runner.Facilities 7 | { 8 | public class FacilityProvider 9 | : IFacilityProvider 10 | { 11 | private readonly IEnumerable _facilities; 12 | 13 | public FacilityProvider(IEnumerable facilities) 14 | { 15 | if (facilities == null) 16 | throw new ArgumentNullException("facilities"); 17 | 18 | _facilities = facilities; 19 | } 20 | 21 | public TFacility Get() where TFacility : IFacility 22 | { 23 | var facility = _facilities.OfType().SingleOrDefault(); 24 | return facility; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DotNetBuild.Tests.TestAssembly/Dummy1Target.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using DotNetBuild.Core; 5 | 6 | namespace DotNetBuild.Tests.TestAssembly 7 | { 8 | public class Dummy1Target : ITarget 9 | { 10 | public String Description 11 | { 12 | get { return "Dummy target 1"; } 13 | } 14 | 15 | public Boolean ContinueOnError 16 | { 17 | get { return false; } 18 | } 19 | 20 | public IEnumerable DependsOn 21 | { 22 | get { return new List { new Dummy2Target() }; } 23 | } 24 | 25 | public Boolean Execute(TargetExecutionContext context) 26 | { 27 | Debug.WriteLine("{0} - executing", Description); 28 | return true; 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/Infrastructure/Reflection/TypeActivator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner.Exceptions; 3 | 4 | namespace DotNetBuild.Runner.Infrastructure.Reflection 5 | { 6 | public interface ITypeActivator 7 | { 8 | T Activate(Type targetType); 9 | } 10 | 11 | public class TypeActivator 12 | : ITypeActivator 13 | { 14 | public T Activate(Type type) 15 | { 16 | if (type == null) 17 | throw new ArgumentNullException("type"); 18 | 19 | var defaultConstructor = type.GetConstructor(Type.EmptyTypes); 20 | if (defaultConstructor == null) 21 | throw new UnableToActivateTypeWithNoDefaultConstructorException(type); 22 | 23 | var target = Activator.CreateInstance(type); 24 | return (T) target; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /packages/xunit.runners.1.9.2/xunit.runners.1.9.2.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | xunit.runners 5 | 1.9.2 6 | xUnit.net: Runners 7 | James Newkirk, Brad Wilson 8 | James Newkirk, Brad Wilson 9 | http://xunit.codeplex.com/license 10 | http://xunit.codeplex.com/ 11 | http://download.codeplex.com/Download?ProjectName=xunit&DownloadId=365445 12 | false 13 | Runners for the xUnit.net framework, including Console, GUI, and MSBuild. 14 | 15 | 16 | en-US 17 | 18 | -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/TargetRegistryTests/Get_target_without_passing_in_a_key.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Runner.TargetRegistryTests 6 | { 7 | public class Get_target_without_passing_in_a_key 8 | : TestSpecification 9 | { 10 | private String _key; 11 | private Object _result; 12 | 13 | protected override void Arrange() 14 | { 15 | _key = null; 16 | } 17 | 18 | protected override TargetRegistry CreateSubjectUnderTest() 19 | { 20 | return new TargetRegistry(); 21 | } 22 | 23 | protected override void Act() 24 | { 25 | _result = Sut.Get(_key); 26 | } 27 | 28 | [Fact] 29 | public void Returns_null() 30 | { 31 | Assert.Null(_result); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/TargetRegistryTests/Get_target_with_unexisting_key.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Runner.TargetRegistryTests 6 | { 7 | public class Get_target_with_unexisting_key 8 | : TestSpecification 9 | { 10 | private String _key; 11 | private Object _result; 12 | 13 | protected override void Arrange() 14 | { 15 | _key = TestData.GenerateString(); 16 | } 17 | 18 | protected override TargetRegistry CreateSubjectUnderTest() 19 | { 20 | return new TargetRegistry(); 21 | } 22 | 23 | protected override void Act() 24 | { 25 | _result = Sut.Get(_key); 26 | } 27 | 28 | [Fact] 29 | public void Returns_null() 30 | { 31 | Assert.Null(_result); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/package.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DotNetBuild.Runner 5 | $version$ 6 | DotNetBuild.Runner 7 | Steven Lauwers 8 | Steven Lauwers 9 | Runner support for DotNetBuild scripts 10 | en-US 11 | https://github.com/stevenlauwers22/dotnetbuild 12 | false 13 | DotNetBuild.Runner DotNetBuild DotNet MSBuild 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/targets.compilation.buildRelease.csx: -------------------------------------------------------------------------------- 1 | using DotNetBuild.Tasks; 2 | 3 | public class BuildRelease : ITarget 4 | { 5 | public String Description 6 | { 7 | get { return "Build in release mode"; } 8 | } 9 | 10 | public Boolean ContinueOnError 11 | { 12 | get { return false; } 13 | } 14 | 15 | public IEnumerable DependsOn 16 | { 17 | get { return null; } 18 | } 19 | 20 | public Boolean Execute(TargetExecutionContext context) 21 | { 22 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 23 | var msBuildTask = new MsBuildTask 24 | { 25 | Project = Path.Combine(solutionDirectory, "DotNetBuild.sln"), 26 | Target = "Rebuild", 27 | Parameters = "Configuration=Release" 28 | }; 29 | 30 | return msBuildTask.Execute(); 31 | } 32 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/ParameterProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | 4 | namespace DotNetBuild.Runner 5 | { 6 | public class ParameterProvider : IParameterProvider 7 | { 8 | private readonly String[] _parameters; 9 | 10 | public ParameterProvider(String[] parameters) 11 | { 12 | _parameters = parameters; 13 | } 14 | 15 | public String Get(String key) 16 | { 17 | foreach (var parameter in _parameters) 18 | { 19 | if (parameter == null) 20 | continue; 21 | 22 | if (parameter.StartsWith(key + ":", StringComparison.OrdinalIgnoreCase)) 23 | { 24 | var value = parameter.Substring(key.Length + 1); 25 | return value; 26 | } 27 | } 28 | 29 | return null; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Core/ConfigurationSettingsTests/Get_setting_without_passing_in_a_key.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Core.ConfigurationSettingsTests 6 | { 7 | public class Get_setting_without_passing_in_a_key 8 | : TestSpecification 9 | { 10 | private String _key; 11 | private String _result; 12 | 13 | protected override void Arrange() 14 | { 15 | _key = null; 16 | } 17 | 18 | protected override ConfigurationSettings CreateSubjectUnderTest() 19 | { 20 | return new ConfigurationSettings(); 21 | } 22 | 23 | protected override void Act() 24 | { 25 | _result = Sut.Get(_key); 26 | } 27 | 28 | [Fact] 29 | public void Returns_the_setting() 30 | { 31 | Assert.Null(_result); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Core/ConfigurationSettingsTests/Get_setting_with_unexisting_key.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Core.ConfigurationSettingsTests 6 | { 7 | public class Get_setting_with_unexisting_key 8 | : TestSpecification 9 | { 10 | private String _key; 11 | private String _result; 12 | 13 | protected override void Arrange() 14 | { 15 | _key = TestData.GenerateString(); 16 | } 17 | 18 | protected override ConfigurationSettings CreateSubjectUnderTest() 19 | { 20 | return new ConfigurationSettings(); 21 | } 22 | 23 | protected override void Act() 24 | { 25 | _result = Sut.Get(_key); 26 | } 27 | 28 | [Fact] 29 | public void Returns_the_setting() 30 | { 31 | Assert.Null(_result); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/targets.ci.csx: -------------------------------------------------------------------------------- 1 | public class CI : ITarget 2 | { 3 | public String Description 4 | { 5 | get { return "Continuous integration target"; } 6 | } 7 | 8 | public Boolean ContinueOnError 9 | { 10 | get { return false; } 11 | } 12 | 13 | public IEnumerable DependsOn 14 | { 15 | get 16 | { 17 | return new List 18 | { 19 | new UpdateVersionNumber(), 20 | new BuildRelease(), 21 | new RunTests(), 22 | new CreateCorePackage(), 23 | new CreateRunnerPackage(), 24 | new CreateRunnerAssemblyPackage(), 25 | new CreateRunnerScriptCsPackage(), 26 | new CreateTasksPackage() 27 | }; 28 | } 29 | } 30 | 31 | public Boolean Execute(TargetExecutionContext context) 32 | { 33 | return true; 34 | } 35 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Facilities/State/StateRegistryTests/Get_state_with_unexisting_key.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner.Facilities.State; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Runner.Facilities.State.StateRegistryTests 6 | { 7 | public class Get_state_with_unexisting_key 8 | : TestSpecification 9 | { 10 | private String _key; 11 | private Object _result; 12 | 13 | protected override void Arrange() 14 | { 15 | _key = TestData.GenerateString(); 16 | } 17 | 18 | protected override StateRegistry CreateSubjectUnderTest() 19 | { 20 | return new StateRegistry(); 21 | } 22 | 23 | protected override void Act() 24 | { 25 | _result = Sut.Get(_key); 26 | } 27 | 28 | [Fact] 29 | public void Returns_null() 30 | { 31 | Assert.Null(_result); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/ConfigurationRegistryTests/Get_configuration_settings_without_passing_in_a_key.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Runner.ConfigurationRegistryTests 6 | { 7 | public class Get_configuration_settings_without_passing_in_a_key 8 | : TestSpecification 9 | { 10 | private String _key; 11 | private Object _result; 12 | 13 | protected override void Arrange() 14 | { 15 | _key = null; 16 | } 17 | 18 | protected override ConfigurationRegistry CreateSubjectUnderTest() 19 | { 20 | return new ConfigurationRegistry(); 21 | } 22 | 23 | protected override void Act() 24 | { 25 | _result = Sut.Get(_key); 26 | } 27 | 28 | [Fact] 29 | public void Returns_null() 30 | { 31 | Assert.Null(_result); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/ConfigurationRegistryTests/Get_configuration_settings_with_unexisting_key.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Runner.ConfigurationRegistryTests 6 | { 7 | public class Get_configuration_settings_with_unexisting_key 8 | : TestSpecification 9 | { 10 | private String _key; 11 | private Object _result; 12 | 13 | protected override void Arrange() 14 | { 15 | _key = TestData.GenerateString(); 16 | } 17 | 18 | protected override ConfigurationRegistry CreateSubjectUnderTest() 19 | { 20 | return new ConfigurationRegistry(); 21 | } 22 | 23 | protected override void Act() 24 | { 25 | _result = Sut.Get(_key); 26 | } 27 | 28 | [Fact] 29 | public void Returns_null() 30 | { 31 | Assert.Null(_result); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Core/ConfigurationSettingsTests/Get_setting_with_unexisting_key_default_value.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Core.ConfigurationSettingsTests 6 | { 7 | public class Get_setting_with_unexisting_key_default_value 8 | : TestSpecification 9 | { 10 | private String _key; 11 | private int _result; 12 | 13 | protected override void Arrange() 14 | { 15 | _key = TestData.GenerateString(); 16 | } 17 | 18 | protected override ConfigurationSettings CreateSubjectUnderTest() 19 | { 20 | return new ConfigurationSettings(); 21 | } 22 | 23 | protected override void Act() 24 | { 25 | _result = Sut.Get(_key); 26 | } 27 | 28 | [Fact] 29 | public void Returns_the_setting() 30 | { 31 | Assert.Equal(0, _result); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Infrastructure/Reflection/TypeFilterTests/Get_its_Filter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner.Infrastructure.Reflection; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Runner.Infrastructure.Reflection.TypeFilterTests 6 | { 7 | public class Get_its_Filter 8 | : TestSpecification 9 | { 10 | private Func _filter; 11 | private Func _result; 12 | 13 | protected override void Arrange() 14 | { 15 | _filter = t => true; 16 | } 17 | 18 | protected override TypeFilter CreateSubjectUnderTest() 19 | { 20 | return new TypeFilter(_filter); 21 | } 22 | 23 | protected override void Act() 24 | { 25 | _result = Sut.Filter; 26 | } 27 | 28 | [Fact] 29 | public void Returns_the_Filter_passed_in_its_constructor() 30 | { 31 | Assert.Equal(_filter, _result); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/targets.testing.runTests.csx: -------------------------------------------------------------------------------- 1 | using DotNetBuild.Tasks; 2 | 3 | public class RunTests : ITarget 4 | { 5 | public String Description 6 | { 7 | get { return "Run tests"; } 8 | } 9 | 10 | public Boolean ContinueOnError 11 | { 12 | get { return false; } 13 | } 14 | 15 | public IEnumerable DependsOn 16 | { 17 | get { return null; } 18 | } 19 | 20 | public Boolean Execute(TargetExecutionContext context) 21 | { 22 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 23 | var xunitExe = context.ConfigurationSettings.Get("PathToXUnitRunnerExe"); 24 | var xunitTask = new XunitTask 25 | { 26 | XunitExe = Path.Combine(solutionDirectory, xunitExe), 27 | Assembly = Path.Combine(solutionDirectory, @"DotNetBuild.Tests\bin\Release\DotNetBuild.Tests.dll") 28 | }; 29 | 30 | return xunitTask.Execute(); 31 | } 32 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Infrastructure/Reflection/AssemblyLoaderTests/Load_an_invalid_Assembly.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner.Infrastructure.Reflection; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Runner.Infrastructure.Reflection.AssemblyLoaderTests 6 | { 7 | public class Load_an_invalid_Assembly 8 | : TestSpecification 9 | { 10 | private String _assembly; 11 | private IAssemblyWrapper _result; 12 | 13 | protected override void Arrange() 14 | { 15 | _assembly = TestData.GenerateString(); 16 | } 17 | 18 | protected override AssemblyLoader CreateSubjectUnderTest() 19 | { 20 | return new AssemblyLoader(); 21 | } 22 | 23 | protected override void Act() 24 | { 25 | _result = Sut.Load(_assembly); 26 | } 27 | 28 | [Fact] 29 | public void Wraps_the_assembly() 30 | { 31 | Assert.Null(_result); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /packages/xunit.1.9.2/xunit.1.9.2.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | xunit 5 | 1.9.2 6 | xUnit.net 7 | James Newkirk, Brad Wilson 8 | James Newkirk, Brad Wilson 9 | http://xunit.codeplex.com/license 10 | http://xunit.codeplex.com/ 11 | http://download.codeplex.com/Download?ProjectName=xunit&DownloadId=365445 12 | false 13 | xUnit.net is a developer testing framework, built to support Test Driven Development, with a design goal of extreme simplicity and alignment with framework features. 14 | 15 | 16 | en-US 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /DotNetBuild.Core/TargetBuilderDecorator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Core 4 | { 5 | public abstract class TargetBuilderDecorator 6 | : ITargetBuilder 7 | { 8 | protected readonly ITargetBuilder TargetBuilder; 9 | 10 | protected TargetBuilderDecorator(ITargetBuilder targetBuilder) 11 | { 12 | if (targetBuilder == null) 13 | throw new ArgumentNullException("targetBuilder"); 14 | 15 | TargetBuilder = targetBuilder; 16 | } 17 | 18 | public ITargetBuilder ContinueOnError(Boolean continueOnError) 19 | { 20 | return TargetBuilder.ContinueOnError(continueOnError); 21 | } 22 | 23 | public ITargetDependencyBuilder DependsOn(String target) 24 | { 25 | return TargetBuilder.DependsOn(target); 26 | } 27 | 28 | public ITargetBuilder Do(Func executeFunc) 29 | { 30 | return TargetBuilder.Do(executeFunc); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner.ScriptCs/DotNetBuildScriptPack.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner.Configuration; 3 | using DotNetBuild.Runner.Infrastructure.TinyIoC; 4 | using ScriptCs.Contracts; 5 | 6 | namespace DotNetBuild.Runner.ScriptCs 7 | { 8 | public class DotNetBuildScriptPack : IScriptPack 9 | { 10 | private String[] _args; 11 | 12 | public void Initialize(IScriptPackSession session) 13 | { 14 | _args = session.ScriptArgs; 15 | 16 | session.ImportNamespace("DotNetBuild.Core"); 17 | session.ImportNamespace("DotNetBuild.Runner"); 18 | session.ImportNamespace("DotNetBuild.Runner.ScriptCs"); 19 | } 20 | 21 | public IScriptPackContext GetContext() 22 | { 23 | var container = TinyIoCContainer.Current.RegisterDotNetBuild(); 24 | var dotNetBuild = new DotNetBuildScriptPackContext(_args, container); 25 | return dotNetBuild; 26 | } 27 | 28 | public void Terminate() 29 | { 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/Exceptions/UnableToDetermineCorrectImplementationException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace DotNetBuild.Runner.Exceptions 5 | { 6 | public class UnableToDetermineCorrectImplementationException 7 | : DotNetBuildException 8 | { 9 | private readonly Type _type; 10 | private readonly IEnumerable _typeImplementations; 11 | 12 | public UnableToDetermineCorrectImplementationException(Type type, IEnumerable typeImplementations) 13 | : base(-16, String.Format("Implementation for type '{0}' could not be determined, multiple matching types were found", type.FullName)) 14 | { 15 | _type = type; 16 | _typeImplementations = typeImplementations; 17 | } 18 | 19 | public Type Type 20 | { 21 | get { return _type; } 22 | } 23 | 24 | public IEnumerable TypeImplementations 25 | { 26 | get { return _typeImplementations; } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Core/TargetBuilderTests/Build_with_no_name.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using DotNetBuild.Runner; 4 | using Xunit; 5 | 6 | namespace DotNetBuild.Tests.Core.TargetBuilderTests 7 | { 8 | public class Build_with_no_name : TestSpecification 9 | { 10 | private String _name; 11 | private ArgumentNullException _exception; 12 | 13 | protected override void Arrange() 14 | { 15 | _name = null; 16 | } 17 | 18 | protected override TargetBuilder CreateSubjectUnderTest() 19 | { 20 | return null; 21 | } 22 | 23 | protected override void Act() 24 | { 25 | _exception = TestHelpers.CatchException(() => new TargetBuilder(new TargetRegistry(), _name, _name)); 26 | } 27 | 28 | [Fact] 29 | public void Throws_an_ArgumentNullException() 30 | { 31 | Assert.NotNull(_exception); 32 | Assert.Equal("name", _exception.ParamName); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner.ScriptCs/package.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DotNetBuild.Runner.ScriptCs 5 | $version$ 6 | DotNetBuild.Runner.ScriptCs 7 | Steven Lauwers 8 | Steven Lauwers 9 | ScriptCs runner support for DotNetBuild scripts 10 | en-US 11 | https://github.com/stevenlauwers22/dotnetbuild 12 | false 13 | DotNetBuild.Runner.ScriptCs DotNetBuild.Runner DotNetBuild DotNet MSBuild 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /DotNetBuild.Tests/Core/TargetBuilderTests/Set_ContinueOnError.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using DotNetBuild.Runner; 4 | using Xunit; 5 | 6 | namespace DotNetBuild.Tests.Core.TargetBuilderTests 7 | { 8 | public class Set_ContinueOnError : TestSpecification 9 | { 10 | private Boolean _continueOnError; 11 | 12 | protected override void Arrange() 13 | { 14 | _continueOnError = TestData.GenerateBoolean(); 15 | } 16 | 17 | protected override TargetBuilder CreateSubjectUnderTest() 18 | { 19 | return new TargetBuilder(new TargetRegistry(), TestData.GenerateString(), TestData.GenerateString()); 20 | } 21 | 22 | protected override void Act() 23 | { 24 | Sut.ContinueOnError(_continueOnError); 25 | } 26 | 27 | [Fact] 28 | public void Sets_the_ContinueOnError() 29 | { 30 | var target = Sut.GetTarget(); 31 | Assert.Equal(_continueOnError, target.ContinueOnError); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.Fluent/buildCI.bat: -------------------------------------------------------------------------------- 1 | copy ..\DotNetBuild.Core\bin\Debug\DotNetBuild.Core.dll .\scriptcs_bin\DotNetBuild.Core.dll /y 2 | copy ..\DotNetBuild.Core\bin\Debug\DotNetBuild.Core.pdb .\scriptcs_bin\DotNetBuild.Core.pdb /y 3 | copy ..\DotNetBuild.Runner\bin\Debug\DotNetBuild.Runner.dll .\scriptcs_bin\DotNetBuild.Runner.dll /y 4 | copy ..\DotNetBuild.Runner\bin\Debug\DotNetBuild.Runner.pdb .\scriptcs_bin\DotNetBuild.Runner.pdb /y 5 | copy ..\DotNetBuild.Runner.ScriptCs\bin\Debug\DotNetBuild.Runner.ScriptCs.dll .\scriptcs_bin\DotNetBuild.Runner.ScriptCs.dll /y 6 | copy ..\DotNetBuild.Runner.ScriptCs\bin\Debug\DotNetBuild.Runner.ScriptCs.pdb .\scriptcs_bin\DotNetBuild.Runner.ScriptCs.pdb /y 7 | copy ..\DotNetBuild.Runner.ScriptCs\bin\Debug\ScriptCs.Contracts.dll .\scriptcs_bin\ScriptCs.Contracts.dll /y 8 | copy ..\DotNetBuild.Tasks\bin\Debug\DotNetBuild.Tasks.dll .\scriptcs_bin\DotNetBuild.Tasks.dll /y 9 | copy ..\DotNetBuild.Tasks\bin\Debug\DotNetBuild.Tasks.pdb .\scriptcs_bin\DotNetBuild.Tasks.pdb /y 10 | 11 | scriptcs build.csx -- target:ci configuration:defaultConfig 12 | pause -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/buildCI.bat: -------------------------------------------------------------------------------- 1 | copy ..\DotNetBuild.Core\bin\Debug\DotNetBuild.Core.dll .\scriptcs_bin\DotNetBuild.Core.dll /y 2 | copy ..\DotNetBuild.Core\bin\Debug\DotNetBuild.Core.pdb .\scriptcs_bin\DotNetBuild.Core.pdb /y 3 | copy ..\DotNetBuild.Runner\bin\Debug\DotNetBuild.Runner.dll .\scriptcs_bin\DotNetBuild.Runner.dll /y 4 | copy ..\DotNetBuild.Runner\bin\Debug\DotNetBuild.Runner.pdb .\scriptcs_bin\DotNetBuild.Runner.pdb /y 5 | copy ..\DotNetBuild.Runner.ScriptCs\bin\Debug\DotNetBuild.Runner.ScriptCs.dll .\scriptcs_bin\DotNetBuild.Runner.ScriptCs.dll /y 6 | copy ..\DotNetBuild.Runner.ScriptCs\bin\Debug\DotNetBuild.Runner.ScriptCs.pdb .\scriptcs_bin\DotNetBuild.Runner.ScriptCs.pdb /y 7 | copy ..\DotNetBuild.Runner.ScriptCs\bin\Debug\ScriptCs.Contracts.dll .\scriptcs_bin\ScriptCs.Contracts.dll /y 8 | copy ..\DotNetBuild.Tasks\bin\Debug\DotNetBuild.Tasks.dll .\scriptcs_bin\DotNetBuild.Tasks.dll /y 9 | copy ..\DotNetBuild.Tasks\bin\Debug\DotNetBuild.Tasks.pdb .\scriptcs_bin\DotNetBuild.Tasks.pdb /y 10 | 11 | scriptcs build.csx -- target:ci configuration:defaultConfig 12 | pause -------------------------------------------------------------------------------- /DotNetBuild.Tests/Core/TargetBuilderTests/Set_ExecuteFunc.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using DotNetBuild.Runner; 4 | using Xunit; 5 | 6 | namespace DotNetBuild.Tests.Core.TargetBuilderTests 7 | { 8 | public class Set_ExecuteFunc : TestSpecification 9 | { 10 | private Func _executeFunc; 11 | 12 | protected override void Arrange() 13 | { 14 | _executeFunc = configurationSettings => true; 15 | } 16 | 17 | protected override TargetBuilder CreateSubjectUnderTest() 18 | { 19 | return new TargetBuilder(new TargetRegistry(), TestData.GenerateString(), TestData.GenerateString()); 20 | } 21 | 22 | protected override void Act() 23 | { 24 | Sut.Do(_executeFunc); 25 | } 26 | 27 | [Fact] 28 | public void Sets_the_ExecuteFunc() 29 | { 30 | var target = (TargetBuilder.GenericTarget) Sut.GetTarget(); 31 | Assert.Equal(_executeFunc, target.ExecuteFunc); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Infrastructure/Reflection/AssemblyLoaderTests/Load_a_Assembly.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using DotNetBuild.Runner.Infrastructure.Reflection; 4 | using Xunit; 5 | 6 | namespace DotNetBuild.Tests.Runner.Infrastructure.Reflection.AssemblyLoaderTests 7 | { 8 | public class Load_a_Assembly 9 | : TestSpecification 10 | { 11 | private String _assembly; 12 | private IAssemblyWrapper _result; 13 | 14 | protected override void Arrange() 15 | { 16 | _assembly = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DotNetBuild.Tests.TestAssembly.dll"); 17 | } 18 | 19 | protected override AssemblyLoader CreateSubjectUnderTest() 20 | { 21 | return new AssemblyLoader(); 22 | } 23 | 24 | protected override void Act() 25 | { 26 | _result = Sut.Load(_assembly); 27 | } 28 | 29 | [Fact] 30 | public void Wraps_the_assembly() 31 | { 32 | Assert.NotNull(_result); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner.Assembly/package.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DotNetBuild.Runner.Assembly 5 | $version$ 6 | DotNetBuild.Runner.Assembly 7 | Steven Lauwers 8 | Steven Lauwers 9 | Assembly runner support for DotNetBuild scripts 10 | en-US 11 | https://github.com/stevenlauwers22/dotnetbuild 12 | false 13 | DotNetBuild.Runner.Assembly DotNetBuild.Runner DotNetBuild DotNet MSBuild 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Facilities/Logging/LoggerTests/LogInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner.Facilities.Logging; 3 | using Moq; 4 | using Xunit; 5 | 6 | namespace DotNetBuild.Tests.Runner.Facilities.Logging.LoggerTests 7 | { 8 | public class LogInfo 9 | : TestSpecification 10 | { 11 | private Mock _logger; 12 | private String _message; 13 | 14 | protected override void Arrange() 15 | { 16 | _message = TestData.GenerateString(); 17 | _logger = new Mock(); 18 | } 19 | 20 | protected override Logger CreateSubjectUnderTest() 21 | { 22 | return new Logger(_logger.Object); 23 | } 24 | 25 | protected override void Act() 26 | { 27 | Sut.LogInfo(_message); 28 | } 29 | 30 | [Fact] 31 | public void Writes_the_message_to_the_log() 32 | { 33 | _logger.Verify(r => r.Write(_message)); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Core/ConfigurationBuilderTests/Build_with_no_name.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using DotNetBuild.Runner; 4 | using Xunit; 5 | 6 | namespace DotNetBuild.Tests.Core.ConfigurationBuilderTests 7 | { 8 | public class Build_with_no_name : TestSpecification 9 | { 10 | private String _name; 11 | private ArgumentNullException _exception; 12 | 13 | protected override void Arrange() 14 | { 15 | _name = null; 16 | } 17 | 18 | protected override ConfigurationBuilder CreateSubjectUnderTest() 19 | { 20 | return null; 21 | } 22 | 23 | protected override void Act() 24 | { 25 | _exception = TestHelpers.CatchException(() => new ConfigurationBuilder(new ConfigurationRegistry(), _name)); 26 | } 27 | 28 | [Fact] 29 | public void Throws_an_ArgumentNullException() 30 | { 31 | Assert.NotNull(_exception); 32 | Assert.Equal("name", _exception.ParamName); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Facilities/State/StateRegistryTests/Get_state.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner.Facilities.State; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Runner.Facilities.State.StateRegistryTests 6 | { 7 | public class Get_state 8 | : TestSpecification 9 | { 10 | private String _key; 11 | private Object _value; 12 | private Object _result; 13 | 14 | protected override void Arrange() 15 | { 16 | _key = TestData.GenerateString(); 17 | _value = new Object(); 18 | } 19 | 20 | protected override StateRegistry CreateSubjectUnderTest() 21 | { 22 | var sut = new StateRegistry(); 23 | sut.Add(_key, _value); 24 | 25 | return sut; 26 | } 27 | 28 | protected override void Act() 29 | { 30 | _result = Sut.Get(_key); 31 | } 32 | 33 | [Fact] 34 | public void Returns_the_correct_value() 35 | { 36 | Assert.Equal(_value, _result); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.Fluent/buildDeploy.bat: -------------------------------------------------------------------------------- 1 | copy ..\DotNetBuild.Core\bin\Debug\DotNetBuild.Core.dll .\scriptcs_bin\DotNetBuild.Core.dll /y 2 | copy ..\DotNetBuild.Core\bin\Debug\DotNetBuild.Core.pdb .\scriptcs_bin\DotNetBuild.Core.pdb /y 3 | copy ..\DotNetBuild.Runner\bin\Debug\DotNetBuild.Runner.dll .\scriptcs_bin\DotNetBuild.Runner.dll /y 4 | copy ..\DotNetBuild.Runner\bin\Debug\DotNetBuild.Runner.pdb .\scriptcs_bin\DotNetBuild.Runner.pdb /y 5 | copy ..\DotNetBuild.Runner.ScriptCs\bin\Debug\DotNetBuild.Runner.ScriptCs.dll .\scriptcs_bin\DotNetBuild.Runner.ScriptCs.dll /y 6 | copy ..\DotNetBuild.Runner.ScriptCs\bin\Debug\DotNetBuild.Runner.ScriptCs.pdb .\scriptcs_bin\DotNetBuild.Runner.ScriptCs.pdb /y 7 | copy ..\DotNetBuild.Runner.ScriptCs\bin\Debug\ScriptCs.Contracts.dll .\scriptcs_bin\ScriptCs.Contracts.dll /y 8 | copy ..\DotNetBuild.Tasks\bin\Debug\DotNetBuild.Tasks.dll .\scriptcs_bin\DotNetBuild.Tasks.dll /y 9 | copy ..\DotNetBuild.Tasks\bin\Debug\DotNetBuild.Tasks.pdb .\scriptcs_bin\DotNetBuild.Tasks.pdb /y 10 | 11 | scriptcs build.csx -- target:deploy configuration:defaultConfig versionNumber:1.1.0 12 | pause -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/buildDeploy.bat: -------------------------------------------------------------------------------- 1 | copy ..\DotNetBuild.Core\bin\Debug\DotNetBuild.Core.dll .\scriptcs_bin\DotNetBuild.Core.dll /y 2 | copy ..\DotNetBuild.Core\bin\Debug\DotNetBuild.Core.pdb .\scriptcs_bin\DotNetBuild.Core.pdb /y 3 | copy ..\DotNetBuild.Runner\bin\Debug\DotNetBuild.Runner.dll .\scriptcs_bin\DotNetBuild.Runner.dll /y 4 | copy ..\DotNetBuild.Runner\bin\Debug\DotNetBuild.Runner.pdb .\scriptcs_bin\DotNetBuild.Runner.pdb /y 5 | copy ..\DotNetBuild.Runner.ScriptCs\bin\Debug\DotNetBuild.Runner.ScriptCs.dll .\scriptcs_bin\DotNetBuild.Runner.ScriptCs.dll /y 6 | copy ..\DotNetBuild.Runner.ScriptCs\bin\Debug\DotNetBuild.Runner.ScriptCs.pdb .\scriptcs_bin\DotNetBuild.Runner.ScriptCs.pdb /y 7 | copy ..\DotNetBuild.Runner.ScriptCs\bin\Debug\ScriptCs.Contracts.dll .\scriptcs_bin\ScriptCs.Contracts.dll /y 8 | copy ..\DotNetBuild.Tasks\bin\Debug\DotNetBuild.Tasks.dll .\scriptcs_bin\DotNetBuild.Tasks.dll /y 9 | copy ..\DotNetBuild.Tasks\bin\Debug\DotNetBuild.Tasks.pdb .\scriptcs_bin\DotNetBuild.Tasks.pdb /y 10 | 11 | scriptcs build.csx -- target:deploy configuration:defaultConfig versionNumber:1.1.0 12 | pause -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/TargetRegistryTests/Get_target.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using DotNetBuild.Runner; 4 | using Moq; 5 | using Xunit; 6 | 7 | namespace DotNetBuild.Tests.Runner.TargetRegistryTests 8 | { 9 | public class Get_target 10 | : TestSpecification 11 | { 12 | private String _key; 13 | private ITarget _value; 14 | private ITarget _result; 15 | 16 | protected override void Arrange() 17 | { 18 | _key = TestData.GenerateString(); 19 | _value = new Mock().Object; 20 | } 21 | 22 | protected override TargetRegistry CreateSubjectUnderTest() 23 | { 24 | var sut = new TargetRegistry(); 25 | sut.Add(_key, _value); 26 | 27 | return sut; 28 | } 29 | 30 | protected override void Act() 31 | { 32 | _result = Sut.Get(_key); 33 | } 34 | 35 | [Fact] 36 | public void Returns_the_correct_value() 37 | { 38 | Assert.Equal(_value, _result); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Core/ConfigurationBuilderTests/Add_setting.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using DotNetBuild.Runner; 4 | using Xunit; 5 | 6 | namespace DotNetBuild.Tests.Core.ConfigurationBuilderTests 7 | { 8 | public class Add_setting : TestSpecification 9 | { 10 | private String _key; 11 | private String _value; 12 | 13 | protected override void Arrange() 14 | { 15 | _key = TestData.GenerateString(); 16 | _value = TestData.GenerateString(); 17 | } 18 | 19 | protected override ConfigurationBuilder CreateSubjectUnderTest() 20 | { 21 | return new ConfigurationBuilder(new ConfigurationRegistry(), TestData.GenerateString()); 22 | } 23 | 24 | protected override void Act() 25 | { 26 | Sut.AddSetting(_key, _value); 27 | } 28 | 29 | [Fact] 30 | public void Adds_the_setting() 31 | { 32 | var configurationSettings = Sut.GetSettings(); 33 | Assert.Equal(configurationSettings.Get(_key), _value); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Steven Lauwers 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /DotNetBuild.Tests/Core/ConfigurationSettingsTests/Get_setting.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Core.ConfigurationSettingsTests 6 | { 7 | public class Get_setting 8 | : TestSpecification 9 | { 10 | private String _key; 11 | private String _value; 12 | private String _result; 13 | 14 | protected override void Arrange() 15 | { 16 | _key = TestData.GenerateString(); 17 | _value = TestData.GenerateString(); 18 | } 19 | 20 | protected override ConfigurationSettings CreateSubjectUnderTest() 21 | { 22 | var configurationSettings = new ConfigurationSettings(); 23 | configurationSettings.Add(_key, _value); 24 | 25 | return configurationSettings; 26 | } 27 | 28 | protected override void Act() 29 | { 30 | _result = Sut.Get(_key); 31 | } 32 | 33 | [Fact] 34 | public void Returns_the_setting() 35 | { 36 | Assert.Equal(_value, _result); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Facilities/State/StateRegistryTests/Get_state_with_different_case.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner.Facilities.State; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Runner.Facilities.State.StateRegistryTests 6 | { 7 | public class Get_state_with_different_case 8 | : TestSpecification 9 | { 10 | private String _key; 11 | private Object _value; 12 | private Object _result; 13 | 14 | protected override void Arrange() 15 | { 16 | _key = TestData.GenerateString(); 17 | _value = new Object(); 18 | } 19 | 20 | protected override StateRegistry CreateSubjectUnderTest() 21 | { 22 | var sut = new StateRegistry(); 23 | sut.Add(_key, _value); 24 | 25 | return sut; 26 | } 27 | 28 | protected override void Act() 29 | { 30 | _result = Sut.Get(_key.ToUpper()); 31 | } 32 | 33 | [Fact] 34 | public void Returns_the_correct_value() 35 | { 36 | Assert.Equal(_value, _result); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Facilities/State/StateWriterTests/Add_state.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner.Facilities.State; 3 | using Moq; 4 | using Xunit; 5 | 6 | namespace DotNetBuild.Tests.Runner.Facilities.State.StateWriterTests 7 | { 8 | public class Add_state 9 | : TestSpecification 10 | { 11 | private Mock _stateRegistry; 12 | private String _key; 13 | private Object _value; 14 | 15 | protected override void Arrange() 16 | { 17 | _key = TestData.GenerateString(); 18 | _value = new Object(); 19 | 20 | _stateRegistry = new Mock(); 21 | } 22 | 23 | protected override StateWriter CreateSubjectUnderTest() 24 | { 25 | return new StateWriter(_stateRegistry.Object); 26 | } 27 | 28 | protected override void Act() 29 | { 30 | Sut.Add(_key, _value); 31 | } 32 | 33 | [Fact] 34 | public void Adds_the_state_to_the_registry() 35 | { 36 | _stateRegistry.Verify(r => r.Add(_key, _value)); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/build.csx: -------------------------------------------------------------------------------- 1 | #r "DotNetBuild.Core.dll" 2 | #r "DotNetBuild.Runner.dll" 3 | #r "DotNetBuild.Runner.ScriptCs.dll" 4 | #r "DotNetBuild.Tasks.dll" 5 | 6 | #load configuration.csx 7 | #load targets.ci.csx 8 | #load targets.deploy.csx 9 | #load targets.compilation.buildRelease.csx 10 | #load targets.nuget.createCorePackage.csx 11 | #load targets.nuget.createRunnerAssemblyPackage.csx 12 | #load targets.nuget.createRunnerPackage.csx 13 | #load targets.nuget.createRunnerScriptCsPackage.csx 14 | #load targets.nuget.createTasksPackage.csx 15 | #load targets.nuget.publishCorePackage.csx 16 | #load targets.nuget.publishRunnerAssemblyPackage.csx 17 | #load targets.nuget.publishRunnerPackage.csx 18 | #load targets.nuget.publishRunnerScriptCsPackage.csx 19 | #load targets.nuget.publishTasksPackage.csx 20 | #load targets.testing.runTests.csx 21 | #load targets.versioning.updateVersionNumber.csx 22 | 23 | var dotNetBuild = Require(); 24 | dotNetBuild.AddTarget("ci", new CI()); 25 | dotNetBuild.AddTarget("deploy", new Deploy()); 26 | dotNetBuild.AddConfiguration("defaultConfig", new DefaultConfigurationSettings()); 27 | dotNetBuild.Run(); -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/TargetRegistryTests/Get_target_with_different_casing.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using DotNetBuild.Runner; 4 | using Moq; 5 | using Xunit; 6 | 7 | namespace DotNetBuild.Tests.Runner.TargetRegistryTests 8 | { 9 | public class Get_target_with_different_casing 10 | : TestSpecification 11 | { 12 | private String _key; 13 | private ITarget _value; 14 | private ITarget _result; 15 | 16 | protected override void Arrange() 17 | { 18 | _key = TestData.GenerateString(); 19 | _value = new Mock().Object; 20 | } 21 | 22 | protected override TargetRegistry CreateSubjectUnderTest() 23 | { 24 | var sut = new TargetRegistry(); 25 | sut.Add(_key, _value); 26 | 27 | return sut; 28 | } 29 | 30 | protected override void Act() 31 | { 32 | _result = Sut.Get(_key.ToUpper()); 33 | } 34 | 35 | [Fact] 36 | public void Returns_the_correct_value() 37 | { 38 | Assert.Equal(_value, _result); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Core/ConfigurationSettingsTests/Add_setting.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using DotNetBuild.Core; 4 | using Xunit; 5 | 6 | namespace DotNetBuild.Tests.Core.ConfigurationSettingsTests 7 | { 8 | public class Add_setting 9 | : TestSpecification 10 | { 11 | private String _key; 12 | private Object _value; 13 | 14 | protected override void Arrange() 15 | { 16 | _key = TestData.GenerateString(); 17 | _value = new Object(); 18 | } 19 | 20 | protected override ConfigurationSettings CreateSubjectUnderTest() 21 | { 22 | return new ConfigurationSettings(); 23 | } 24 | 25 | protected override void Act() 26 | { 27 | Sut.Add(_key, _value); 28 | } 29 | 30 | [Fact] 31 | public void Registry_contains_the_setting() 32 | { 33 | var item = Sut.Registrations.SingleOrDefault(kvp => kvp.Key == _key); 34 | Assert.NotNull(item); 35 | Assert.Equal(_key, item.Key); 36 | Assert.Equal(_value, item.Value); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /DotNetBuild.Tasks/NuGet/Push.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | namespace DotNetBuild.Tasks.NuGet 5 | { 6 | public class Push 7 | : CommandLineToolTask 8 | { 9 | public String NuGetExe { get; set; } 10 | public String NuPkgFile { get; set; } 11 | public String Source { get; set; } 12 | public String ApiKey { get; set; } 13 | 14 | protected override String GetToolPath() 15 | { 16 | if (IsValidExe(NuGetExe)) 17 | return NuGetExe; 18 | 19 | throw new InvalidOperationException("NuGetExe could not be found."); 20 | } 21 | 22 | protected override String GetToolArguments() 23 | { 24 | var parameters = new StringBuilder(); 25 | parameters.Append("push "); 26 | parameters.Append(NuPkgFile + " "); 27 | 28 | if (!String.IsNullOrEmpty(Source)) 29 | parameters.Append("-Source " + Source + " "); 30 | 31 | if (!String.IsNullOrEmpty(ApiKey)) 32 | parameters.Append("-ApiKey " + ApiKey + " "); 33 | 34 | return parameters.ToString(); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Facilities/State/StateRegistryTests/Add_state.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using DotNetBuild.Runner.Facilities.State; 4 | using Xunit; 5 | 6 | namespace DotNetBuild.Tests.Runner.Facilities.State.StateRegistryTests 7 | { 8 | public class Add_state 9 | : TestSpecification 10 | { 11 | private String _key; 12 | private Object _value; 13 | 14 | protected override void Arrange() 15 | { 16 | _key = TestData.GenerateString(); 17 | _value = new Object(); 18 | } 19 | 20 | protected override StateRegistry CreateSubjectUnderTest() 21 | { 22 | return new StateRegistry(); 23 | } 24 | 25 | protected override void Act() 26 | { 27 | Sut.Add(_key, _value); 28 | } 29 | 30 | [Fact] 31 | public void Registry_contains_the_state() 32 | { 33 | var item = Sut.Registrations.SingleOrDefault(kvp => kvp.Key == _key); 34 | Assert.NotNull(item); 35 | Assert.Equal(_key, item.Key); 36 | Assert.Equal(_value, item.Value); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.Assembly.NonFluent/Targets/Deploy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using DotNetBuild.Build.Assembly.NonFluent.Targets.NuGet; 4 | using DotNetBuild.Core; 5 | 6 | namespace DotNetBuild.Build.Assembly.NonFluent.Targets 7 | { 8 | public class Deploy : ITarget 9 | { 10 | public String Description 11 | { 12 | get { return "Deploy to NuGet"; } 13 | } 14 | 15 | public Boolean ContinueOnError 16 | { 17 | get { return false; } 18 | } 19 | 20 | public IEnumerable DependsOn 21 | { 22 | get 23 | { 24 | return new List 25 | { 26 | new PublishCorePackage(), 27 | new PublishRunnerPackage(), 28 | new PublishRunnerAssemblyPackage(), 29 | new PublishRunnerScriptCsPackage(), 30 | new PublishTasksPackage() 31 | }; 32 | } 33 | } 34 | 35 | public Boolean Execute(TargetExecutionContext context) 36 | { 37 | return true; 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/Infrastructure/Logging/Loggers/StandardLogger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Runner.Infrastructure.Logging.Loggers 4 | { 5 | public class StandardLogger 6 | : ILogger 7 | { 8 | public void Write(String message) 9 | { 10 | Console.WriteLine(message); 11 | } 12 | 13 | public void WriteBlockStart(String message) 14 | { 15 | Console.WriteLine("START: " + message); 16 | Console.WriteLine("------------------"); 17 | } 18 | 19 | public void WriteBlockEnd(String message) 20 | { 21 | Console.WriteLine("END: " + message); 22 | Console.WriteLine("------------------"); 23 | } 24 | 25 | public void WriteError(String message, Exception exception) 26 | { 27 | Console.ForegroundColor = ConsoleColor.Red; 28 | Console.Error.WriteLine(String.Empty); 29 | Console.Error.WriteLine(exception.Message); 30 | Console.Error.WriteLine(exception.StackTrace); 31 | Console.Error.WriteLine("------------------"); 32 | Console.ResetColor(); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /DotNetBuild.Tasks/NuGet/Pack.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | namespace DotNetBuild.Tasks.NuGet 5 | { 6 | public class Pack 7 | : CommandLineToolTask 8 | { 9 | public String NuGetExe { get; set; } 10 | public String NuSpecFile { get; set; } 11 | public String OutputDir { get; set; } 12 | public String Version { get; set; } 13 | 14 | protected override String GetToolPath() 15 | { 16 | if (IsValidExe(NuGetExe)) 17 | return NuGetExe; 18 | 19 | throw new InvalidOperationException("NuGetExe could not be found."); 20 | } 21 | 22 | protected override String GetToolArguments() 23 | { 24 | var parameters = new StringBuilder(); 25 | parameters.Append("pack "); 26 | parameters.Append(NuSpecFile + " "); 27 | 28 | if (!String.IsNullOrEmpty(OutputDir)) 29 | parameters.Append("-OutputDir " + OutputDir + " "); 30 | 31 | if (!String.IsNullOrEmpty(Version)) 32 | parameters.Append("-Version " + Version + " "); 33 | 34 | return parameters.ToString(); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/TargetRegistryTests/Add_target.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using DotNetBuild.Core; 4 | using DotNetBuild.Runner; 5 | using Moq; 6 | using Xunit; 7 | 8 | namespace DotNetBuild.Tests.Runner.TargetRegistryTests 9 | { 10 | public class Add_target 11 | : TestSpecification 12 | { 13 | private String _key; 14 | private ITarget _value; 15 | 16 | protected override void Arrange() 17 | { 18 | _key = TestData.GenerateString(); 19 | _value = new Mock().Object; 20 | } 21 | 22 | protected override TargetRegistry CreateSubjectUnderTest() 23 | { 24 | return new TargetRegistry(); 25 | } 26 | 27 | protected override void Act() 28 | { 29 | Sut.Add(_key, _value); 30 | } 31 | 32 | [Fact] 33 | public void Registry_contains_the_target() 34 | { 35 | var item = Sut.Registrations.SingleOrDefault(kvp => kvp.Key == _key); 36 | Assert.NotNull(item); 37 | Assert.Equal(_key, item.Key); 38 | Assert.Equal(_value, item.Value); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Infrastructure/Reflection/TypeActivatorTests/Activate_a_Type.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner.Infrastructure.Reflection; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Runner.Infrastructure.Reflection.TypeActivatorTests 6 | { 7 | public class Activate_a_Type 8 | : TestSpecification 9 | { 10 | private Type _type; 11 | private IType _result; 12 | 13 | protected override void Arrange() 14 | { 15 | _type = typeof(DummyType); 16 | } 17 | 18 | protected override TypeActivator CreateSubjectUnderTest() 19 | { 20 | return new TypeActivator(); 21 | } 22 | 23 | protected override void Act() 24 | { 25 | _result = Sut.Activate(_type); 26 | } 27 | 28 | [Fact] 29 | public void Creates_an_instance_of_the_Target() 30 | { 31 | Assert.NotNull(_result); 32 | Assert.True(_type.IsInstanceOfType(_result)); 33 | } 34 | 35 | private interface IType 36 | { 37 | } 38 | 39 | private class DummyType : IType 40 | { 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Infrastructure/Reflection/TypeActivatorTests/Activate_a_Type_with_no_Type.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner.Infrastructure.Reflection; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Runner.Infrastructure.Reflection.TypeActivatorTests 6 | { 7 | public class Activate_a_Type_with_no_Type 8 | : TestSpecification 9 | { 10 | private Type _type; 11 | private ArgumentNullException _exception; 12 | 13 | protected override void Arrange() 14 | { 15 | _type = null; 16 | } 17 | 18 | protected override TypeActivator CreateSubjectUnderTest() 19 | { 20 | return new TypeActivator(); 21 | } 22 | 23 | protected override void Act() 24 | { 25 | _exception = TestHelpers.CatchException(() => Sut.Activate(_type)); 26 | } 27 | 28 | [Fact] 29 | public void Throws_an_exception() 30 | { 31 | Assert.NotNull(_exception); 32 | Assert.Equal("type", _exception.ParamName); 33 | } 34 | 35 | private interface IType 36 | { 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Core/ConfigurationBuilderTests/Build_with_valid_arguments.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using Moq; 4 | using Xunit; 5 | 6 | namespace DotNetBuild.Tests.Core.ConfigurationBuilderTests 7 | { 8 | public class Build_with_valid_arguments : TestSpecification 9 | { 10 | private Mock _configurationRegistry; 11 | private String _name; 12 | private IConfigurationSettings _result; 13 | 14 | protected override void Arrange() 15 | { 16 | _configurationRegistry = new Mock(); 17 | _name = TestData.GenerateString(); 18 | } 19 | 20 | protected override ConfigurationBuilder CreateSubjectUnderTest() 21 | { 22 | return null; 23 | } 24 | 25 | protected override void Act() 26 | { 27 | _result = new ConfigurationBuilder(_configurationRegistry.Object, _name).GetSettings(); 28 | } 29 | 30 | [Fact] 31 | public void Adds_the_configuration_to_the_registry() 32 | { 33 | _configurationRegistry.Verify(r => r.Add(_name, _result)); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Core/ConfigurationSettingsTests/Add_setting_without_passing_in_a_key.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Core.ConfigurationSettingsTests 6 | { 7 | public class Add_setting_without_passing_in_a_key 8 | : TestSpecification 9 | { 10 | private String _key; 11 | private Object _value; 12 | private ArgumentNullException _exception; 13 | 14 | protected override void Arrange() 15 | { 16 | _key = null; 17 | _value = new Object(); 18 | } 19 | 20 | protected override ConfigurationSettings CreateSubjectUnderTest() 21 | { 22 | return new ConfigurationSettings(); 23 | } 24 | 25 | protected override void Act() 26 | { 27 | _exception = TestHelpers.CatchException(() => Sut.Add(_key, _value)); 28 | } 29 | 30 | [Fact] 31 | public void Throws_an_ArgumentNullException_for_the_key_parameter() 32 | { 33 | Assert.NotNull(_exception); 34 | Assert.Equal("key", _exception.ParamName); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Facilities/State/StateRegistryTests/Get_state_with_wrong_type.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner.Facilities.State; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Runner.Facilities.State.StateRegistryTests 6 | { 7 | public class Get_state_with_wrong_type 8 | : TestSpecification 9 | { 10 | private String _key; 11 | private Object _value; 12 | private InvalidCastException _exception; 13 | 14 | protected override void Arrange() 15 | { 16 | _key = TestData.GenerateString(); 17 | _value = new Object(); 18 | } 19 | 20 | protected override StateRegistry CreateSubjectUnderTest() 21 | { 22 | var sut = new StateRegistry(); 23 | sut.Add(_key, _value); 24 | 25 | return sut; 26 | } 27 | 28 | protected override void Act() 29 | { 30 | _exception = TestHelpers.CatchException(() => Sut.Get(_key)); 31 | } 32 | 33 | [Fact] 34 | public void Throws_an_InvalidCastException() 35 | { 36 | Assert.NotNull(_exception); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Facilities/Logging/LoggerTests/LogError.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner.Facilities.Logging; 3 | using Moq; 4 | using Xunit; 5 | 6 | namespace DotNetBuild.Tests.Runner.Facilities.Logging.LoggerTests 7 | { 8 | public class LogError 9 | : TestSpecification 10 | { 11 | private Mock _logger; 12 | private String _message; 13 | private Exception _exception; 14 | 15 | protected override void Arrange() 16 | { 17 | _message = TestData.GenerateString(); 18 | _exception = new Exception(); 19 | _logger = new Mock(); 20 | } 21 | 22 | protected override Logger CreateSubjectUnderTest() 23 | { 24 | return new Logger(_logger.Object); 25 | } 26 | 27 | protected override void Act() 28 | { 29 | Sut.LogError(_message, _exception); 30 | } 31 | 32 | [Fact] 33 | public void Writes_the_message_to_the_log() 34 | { 35 | _logger.Verify(r => r.WriteError(_message, _exception)); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Facilities/State/StateRegistryTests/Add_state_without_passing_in_a_key.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner.Facilities.State; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Runner.Facilities.State.StateRegistryTests 6 | { 7 | public class Add_state_without_passing_in_a_key 8 | : TestSpecification 9 | { 10 | private String _key; 11 | private Object _value; 12 | private ArgumentNullException _exception; 13 | 14 | protected override void Arrange() 15 | { 16 | _key = null; 17 | _value = new Object(); 18 | } 19 | 20 | protected override StateRegistry CreateSubjectUnderTest() 21 | { 22 | return new StateRegistry(); 23 | } 24 | 25 | protected override void Act() 26 | { 27 | _exception = TestHelpers.CatchException(() => Sut.Add(_key, _value)); 28 | } 29 | 30 | [Fact] 31 | public void Throws_an_ArgumentNullException_for_the_key_parameter() 32 | { 33 | Assert.NotNull(_exception); 34 | Assert.Equal("key", _exception.ParamName); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.Assembly.NonFluent/Targets/Compilation/BuildRelease.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using DotNetBuild.Core; 5 | using DotNetBuild.Tasks; 6 | 7 | namespace DotNetBuild.Build.Assembly.NonFluent.Targets.Compilation 8 | { 9 | public class BuildRelease : ITarget 10 | { 11 | public String Description 12 | { 13 | get { return "Build in release mode"; } 14 | } 15 | 16 | public Boolean ContinueOnError 17 | { 18 | get { return false; } 19 | } 20 | 21 | public IEnumerable DependsOn 22 | { 23 | get { return null; } 24 | } 25 | 26 | public Boolean Execute(TargetExecutionContext context) 27 | { 28 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 29 | var msBuildTask = new MsBuildTask 30 | { 31 | Project = Path.Combine(solutionDirectory, @"DotNetBuild.sln"), 32 | Target = "Rebuild", 33 | Parameters = "Configuration=Release" 34 | }; 35 | 36 | return msBuildTask.Execute(); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Core/ConfigurationSettingsTests/Add_setting_without_passing_in_a_value.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Core.ConfigurationSettingsTests 6 | { 7 | public class Add_setting_without_passing_in_a_value 8 | : TestSpecification 9 | { 10 | private String _key; 11 | private Object _value; 12 | private ArgumentNullException _exception; 13 | 14 | protected override void Arrange() 15 | { 16 | _key = TestData.GenerateString(); 17 | _value = null; 18 | } 19 | 20 | protected override ConfigurationSettings CreateSubjectUnderTest() 21 | { 22 | return new ConfigurationSettings(); 23 | } 24 | 25 | protected override void Act() 26 | { 27 | _exception = TestHelpers.CatchException(() => Sut.Add(_key, _value)); 28 | } 29 | 30 | [Fact] 31 | public void Throws_an_ArgumentNullException_for_the_value_parameter() 32 | { 33 | Assert.NotNull(_exception); 34 | Assert.Equal("value", _exception.ParamName); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/ConfigurationRegistryTests/Get_configuration_settings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using DotNetBuild.Runner; 4 | using Moq; 5 | using Xunit; 6 | 7 | namespace DotNetBuild.Tests.Runner.ConfigurationRegistryTests 8 | { 9 | public class Get_configuration_settings 10 | : TestSpecification 11 | { 12 | private String _key; 13 | private IConfigurationSettings _value; 14 | private IConfigurationSettings _result; 15 | 16 | protected override void Arrange() 17 | { 18 | _key = TestData.GenerateString(); 19 | _value = new Mock().Object; 20 | } 21 | 22 | protected override ConfigurationRegistry CreateSubjectUnderTest() 23 | { 24 | var sut = new ConfigurationRegistry(); 25 | sut.Add(_key, _value); 26 | 27 | return sut; 28 | } 29 | 30 | protected override void Act() 31 | { 32 | _result = Sut.Get(_key); 33 | } 34 | 35 | [Fact] 36 | public void Returns_the_correct_value() 37 | { 38 | Assert.Equal(_value, _result); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/TargetRegistryTests/Add_target_without_passing_in_a_value.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using DotNetBuild.Runner; 4 | using Xunit; 5 | 6 | namespace DotNetBuild.Tests.Runner.TargetRegistryTests 7 | { 8 | public class Add_target_without_passing_in_a_value 9 | : TestSpecification 10 | { 11 | private String _key; 12 | private ITarget _value; 13 | private ArgumentNullException _exception; 14 | 15 | protected override void Arrange() 16 | { 17 | _key = TestData.GenerateString(); 18 | _value = null; 19 | } 20 | 21 | protected override TargetRegistry CreateSubjectUnderTest() 22 | { 23 | return new TargetRegistry(); 24 | } 25 | 26 | protected override void Act() 27 | { 28 | _exception = TestHelpers.CatchException(() => Sut.Add(_key, _value)); 29 | } 30 | 31 | [Fact] 32 | public void Throws_an_ArgumentNullException_for_the_value_parameter() 33 | { 34 | Assert.NotNull(_exception); 35 | Assert.Equal("value", _exception.ParamName); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/TargetRegistry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using DotNetBuild.Core; 5 | 6 | namespace DotNetBuild.Runner 7 | { 8 | public class TargetRegistry : ITargetRegistry 9 | { 10 | private static IDictionary _registrations; 11 | 12 | public TargetRegistry() 13 | { 14 | _registrations = new Dictionary(); 15 | } 16 | 17 | public IEnumerable> Registrations 18 | { 19 | get { return _registrations; } 20 | } 21 | 22 | public ITarget Get(String key) 23 | { 24 | var value = _registrations.SingleOrDefault(registration => String.Equals(registration.Key, key, StringComparison.OrdinalIgnoreCase)).Value; 25 | return value; 26 | } 27 | 28 | public void Add(String key, ITarget value) 29 | { 30 | if (String.IsNullOrEmpty(key)) 31 | throw new ArgumentNullException("key"); 32 | 33 | if (value == null) 34 | throw new ArgumentNullException("value"); 35 | 36 | _registrations[key] = value; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/TargetRegistryTests/Add_target_without_passing_in_a_key.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using DotNetBuild.Runner; 4 | using Moq; 5 | using Xunit; 6 | 7 | namespace DotNetBuild.Tests.Runner.TargetRegistryTests 8 | { 9 | public class Add_target_without_passing_in_a_key 10 | : TestSpecification 11 | { 12 | private String _key; 13 | private ITarget _value; 14 | private ArgumentNullException _exception; 15 | 16 | protected override void Arrange() 17 | { 18 | _key = null; 19 | _value = new Mock().Object; 20 | } 21 | 22 | protected override TargetRegistry CreateSubjectUnderTest() 23 | { 24 | return new TargetRegistry(); 25 | } 26 | 27 | protected override void Act() 28 | { 29 | _exception = TestHelpers.CatchException(() => Sut.Add(_key, _value)); 30 | } 31 | 32 | [Fact] 33 | public void Throws_an_ArgumentNullException_for_the_key_parameter() 34 | { 35 | Assert.NotNull(_exception); 36 | Assert.Equal("key", _exception.ParamName); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /DotNetBuild.Core/TargetExecutionContext.cs: -------------------------------------------------------------------------------- 1 | using DotNetBuild.Core.Facilities; 2 | 3 | namespace DotNetBuild.Core 4 | { 5 | public class TargetExecutionContext 6 | { 7 | private readonly IConfigurationSettings _configurationSettings; 8 | private readonly IParameterProvider _parameterProvider; 9 | private readonly IFacilityProvider _facilityProvider; 10 | 11 | public TargetExecutionContext( 12 | IConfigurationSettings configurationSettings, 13 | IParameterProvider parameterProvider, 14 | IFacilityProvider facilityProvider) 15 | { 16 | _configurationSettings = configurationSettings; 17 | _parameterProvider = parameterProvider; 18 | _facilityProvider = facilityProvider; 19 | } 20 | 21 | public IConfigurationSettings ConfigurationSettings 22 | { 23 | get { return _configurationSettings; } 24 | } 25 | 26 | public IParameterProvider ParameterProvider 27 | { 28 | get { return _parameterProvider; } 29 | } 30 | 31 | public IFacilityProvider FacilityProvider 32 | { 33 | get { return _facilityProvider; } 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Facilities/State/StateRegistryTests/Add_state_without_passing_in_a_value.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner.Facilities.State; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Runner.Facilities.State.StateRegistryTests 6 | { 7 | public class Add_state_without_passing_in_a_value 8 | : TestSpecification 9 | { 10 | private String _key; 11 | private Object _value; 12 | private ArgumentNullException _exception; 13 | 14 | protected override void Arrange() 15 | { 16 | _key = TestData.GenerateString(); 17 | _value = null; 18 | } 19 | 20 | protected override StateRegistry CreateSubjectUnderTest() 21 | { 22 | return new StateRegistry(); 23 | } 24 | 25 | protected override void Act() 26 | { 27 | _exception = TestHelpers.CatchException(() => Sut.Add(_key, _value)); 28 | } 29 | 30 | [Fact] 31 | public void Throws_an_ArgumentNullException_for_the_value_parameter() 32 | { 33 | Assert.NotNull(_exception); 34 | Assert.Equal("value", _exception.ParamName); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/targets.nuget.createCorePackage.csx: -------------------------------------------------------------------------------- 1 | using DotNetBuild.Core.Facilities.State; 2 | using DotNetBuild.Tasks.NuGet; 3 | 4 | public class CreateCorePackage : ITarget 5 | { 6 | public String Description 7 | { 8 | get { return "Create Core NuGet package"; } 9 | } 10 | 11 | public Boolean ContinueOnError 12 | { 13 | get { return false; } 14 | } 15 | 16 | public IEnumerable DependsOn 17 | { 18 | get { return null; } 19 | } 20 | 21 | public Boolean Execute(TargetExecutionContext context) 22 | { 23 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 24 | var nugetExe = context.ConfigurationSettings.Get("PathToNuGetExe"); 25 | var nugetPackTask = new Pack 26 | { 27 | NuGetExe = Path.Combine(solutionDirectory, nugetExe), 28 | NuSpecFile = Path.Combine(solutionDirectory, @"DotNetBuild.Core\package.nuspec"), 29 | OutputDir = Path.Combine(solutionDirectory, @"packagesForNuGet\"), 30 | Version = context.FacilityProvider.Get().Get("VersionNumber") 31 | }; 32 | 33 | return nugetPackTask.Execute(); 34 | } 35 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/targets.nuget.createTasksPackage.csx: -------------------------------------------------------------------------------- 1 | using DotNetBuild.Core.Facilities.State; 2 | using DotNetBuild.Tasks.NuGet; 3 | 4 | public class CreateTasksPackage : ITarget 5 | { 6 | public String Description 7 | { 8 | get { return "Create Tasks NuGet package"; } 9 | } 10 | 11 | public Boolean ContinueOnError 12 | { 13 | get { return false; } 14 | } 15 | 16 | public IEnumerable DependsOn 17 | { 18 | get { return null; } 19 | } 20 | 21 | public Boolean Execute(TargetExecutionContext context) 22 | { 23 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 24 | var nugetExe = context.ConfigurationSettings.Get("PathToNuGetExe"); 25 | var nugetPackTask = new Pack 26 | { 27 | NuGetExe = Path.Combine(solutionDirectory, nugetExe), 28 | NuSpecFile = Path.Combine(solutionDirectory, @"DotNetBuild.Tasks\package.nuspec"), 29 | OutputDir = Path.Combine(solutionDirectory, @"packagesForNuGet\"), 30 | Version = context.FacilityProvider.Get().Get("VersionNumber") 31 | }; 32 | 33 | return nugetPackTask.Execute(); 34 | } 35 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Core/ConfigurationSettingsTests/Get_setting_of_the_wrong_type.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Core.ConfigurationSettingsTests 6 | { 7 | public class Get_setting_of_the_wrong_type 8 | : TestSpecification 9 | { 10 | private String _key; 11 | private decimal _value; 12 | private InvalidCastException _exception; 13 | 14 | protected override void Arrange() 15 | { 16 | _key = TestData.GenerateString(); 17 | _value = TestData.GenerateDecimal(); 18 | } 19 | 20 | protected override ConfigurationSettings CreateSubjectUnderTest() 21 | { 22 | var configurationSettings = new ConfigurationSettings(); 23 | configurationSettings.Add(_key, _value); 24 | 25 | return configurationSettings; 26 | } 27 | 28 | protected override void Act() 29 | { 30 | _exception = TestHelpers.CatchException(() => Sut.Get(_key)); 31 | } 32 | 33 | [Fact] 34 | public void Throws_an_exception() 35 | { 36 | Assert.NotNull(_exception); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/targets.nuget.createRunnerPackage.csx: -------------------------------------------------------------------------------- 1 | using DotNetBuild.Core.Facilities.State; 2 | using DotNetBuild.Tasks.NuGet; 3 | 4 | public class CreateRunnerPackage : ITarget 5 | { 6 | public String Description 7 | { 8 | get { return "Create Runner NuGet package"; } 9 | } 10 | 11 | public Boolean ContinueOnError 12 | { 13 | get { return false; } 14 | } 15 | 16 | public IEnumerable DependsOn 17 | { 18 | get { return null; } 19 | } 20 | 21 | public Boolean Execute(TargetExecutionContext context) 22 | { 23 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 24 | var nugetExe = context.ConfigurationSettings.Get("PathToNuGetExe"); 25 | var nugetPackTask = new Pack 26 | { 27 | NuGetExe = Path.Combine(solutionDirectory, nugetExe), 28 | NuSpecFile = Path.Combine(solutionDirectory, @"DotNetBuild.Runner\package.nuspec"), 29 | OutputDir = Path.Combine(solutionDirectory, @"packagesForNuGet\"), 30 | Version = context.FacilityProvider.Get().Get("VersionNumber") 31 | }; 32 | 33 | return nugetPackTask.Execute(); 34 | } 35 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/targets.nuget.publishCorePackage.csx: -------------------------------------------------------------------------------- 1 | using DotNetBuild.Tasks.NuGet; 2 | 3 | public class PublishCorePackage : ITarget 4 | { 5 | public String Description 6 | { 7 | get { return "Publish Core NuGet package"; } 8 | } 9 | 10 | public Boolean ContinueOnError 11 | { 12 | get { return false; } 13 | } 14 | 15 | public IEnumerable DependsOn 16 | { 17 | get { return null; } 18 | } 19 | 20 | public Boolean Execute(TargetExecutionContext context) 21 | { 22 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 23 | var nugetExe = context.ConfigurationSettings.Get("PathToNuGetExe"); 24 | var nugetApiKey = context.ConfigurationSettings.Get("NuGetApiKey"); 25 | var nupkgFile = string.Format(@"packagesForNuGet\DotNetBuild.Core.{0}.nupkg", context.ParameterProvider.Get("VersionNumber")); 26 | var nugetPackTask = new Push 27 | { 28 | NuGetExe = Path.Combine(solutionDirectory, nugetExe), 29 | NuPkgFile = Path.Combine(solutionDirectory, nupkgFile), 30 | ApiKey = nugetApiKey 31 | }; 32 | 33 | return nugetPackTask.Execute(); 34 | } 35 | } -------------------------------------------------------------------------------- /DotNetBuild.Core/ConfigurationBuilder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Core 4 | { 5 | public interface IConfigurationBuilder 6 | { 7 | IConfigurationBuilder AddSetting(String key, Object value); 8 | } 9 | 10 | public class ConfigurationBuilder 11 | : IConfigurationBuilder 12 | { 13 | private readonly IConfigurationRegistry _configurationRegistry; 14 | private readonly IConfigurationSettings _configurationSettings; 15 | 16 | public ConfigurationBuilder(IConfigurationRegistry configurationRegistry, String name) 17 | { 18 | if (String.IsNullOrEmpty(name)) 19 | throw new ArgumentNullException("name"); 20 | 21 | _configurationSettings = new ConfigurationSettings(); 22 | _configurationRegistry = configurationRegistry; 23 | _configurationRegistry.Add(name, _configurationSettings); 24 | } 25 | 26 | public IConfigurationSettings GetSettings() 27 | { 28 | return _configurationSettings; 29 | } 30 | 31 | public IConfigurationBuilder AddSetting(String key, Object value) 32 | { 33 | _configurationSettings.Add(key, value); 34 | return this; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/targets.nuget.publishRunnerPackage.csx: -------------------------------------------------------------------------------- 1 | using DotNetBuild.Tasks.NuGet; 2 | 3 | public class PublishRunnerPackage : ITarget 4 | { 5 | public String Description 6 | { 7 | get { return "Publish Runner NuGet package"; } 8 | } 9 | 10 | public Boolean ContinueOnError 11 | { 12 | get { return false; } 13 | } 14 | 15 | public IEnumerable DependsOn 16 | { 17 | get { return null; } 18 | } 19 | 20 | public Boolean Execute(TargetExecutionContext context) 21 | { 22 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 23 | var nugetExe = context.ConfigurationSettings.Get("PathToNuGetExe"); 24 | var nugetApiKey = context.ConfigurationSettings.Get("NuGetApiKey"); 25 | var nupkgFile = string.Format(@"packagesForNuGet\DotNetBuild.Runner.{0}.nupkg", context.ParameterProvider.Get("VersionNumber")); 26 | var nugetPackTask = new Push 27 | { 28 | NuGetExe = Path.Combine(solutionDirectory, nugetExe), 29 | NuPkgFile = Path.Combine(solutionDirectory, nupkgFile), 30 | ApiKey = nugetApiKey 31 | }; 32 | 33 | return nugetPackTask.Execute(); 34 | } 35 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/targets.nuget.publishTasksPackage.csx: -------------------------------------------------------------------------------- 1 | using DotNetBuild.Tasks.NuGet; 2 | 3 | public class PublishTasksPackage : ITarget 4 | { 5 | public String Description 6 | { 7 | get { return "Publish Tasks NuGet package"; } 8 | } 9 | 10 | public Boolean ContinueOnError 11 | { 12 | get { return false; } 13 | } 14 | 15 | public IEnumerable DependsOn 16 | { 17 | get { return null; } 18 | } 19 | 20 | public Boolean Execute(TargetExecutionContext context) 21 | { 22 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 23 | var nugetExe = context.ConfigurationSettings.Get("PathToNuGetExe"); 24 | var nugetApiKey = context.ConfigurationSettings.Get("NuGetApiKey"); 25 | var nupkgFile = string.Format(@"packagesForNuGet\DotNetBuild.Tasks.{0}.nupkg", context.ParameterProvider.Get("VersionNumber")); 26 | var nugetPackTask = new Push 27 | { 28 | NuGetExe = Path.Combine(solutionDirectory, nugetExe), 29 | NuPkgFile = Path.Combine(solutionDirectory, nupkgFile), 30 | ApiKey = nugetApiKey 31 | }; 32 | 33 | return nugetPackTask.Execute(); 34 | } 35 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/ConfigurationRegistryTests/Get_configuration_settings_with_different_casing.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using DotNetBuild.Runner; 4 | using Moq; 5 | using Xunit; 6 | 7 | namespace DotNetBuild.Tests.Runner.ConfigurationRegistryTests 8 | { 9 | public class Get_configuration_settings_with_different_casing 10 | : TestSpecification 11 | { 12 | private String _key; 13 | private IConfigurationSettings _value; 14 | private IConfigurationSettings _result; 15 | 16 | protected override void Arrange() 17 | { 18 | _key = TestData.GenerateString(); 19 | _value = new Mock().Object; 20 | } 21 | 22 | protected override ConfigurationRegistry CreateSubjectUnderTest() 23 | { 24 | var sut = new ConfigurationRegistry(); 25 | sut.Add(_key, _value); 26 | 27 | return sut; 28 | } 29 | 30 | protected override void Act() 31 | { 32 | _result = Sut.Get(_key.ToUpper()); 33 | } 34 | 35 | [Fact] 36 | public void Returns_the_correct_value() 37 | { 38 | Assert.Equal(_value, _result); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/Exceptions/UnableToExecuteTargetWithCircularDependenciesException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace DotNetBuild.Runner.Exceptions 6 | { 7 | public class UnableToExecuteTargetWithCircularDependenciesException 8 | : DotNetBuildException 9 | { 10 | private readonly IEnumerable _circularDependencies; 11 | 12 | public UnableToExecuteTargetWithCircularDependenciesException(ICollection circularDependencies) 13 | : base(-14, String.Format("A circular dependency was found: {0}", GetCircularDependencyChain(circularDependencies))) 14 | { 15 | _circularDependencies = circularDependencies; 16 | } 17 | 18 | public IEnumerable CircularDependencies 19 | { 20 | get { return _circularDependencies; } 21 | } 22 | 23 | private static Object GetCircularDependencyChain(IEnumerable circularDependencies) 24 | { 25 | var callTree = Environment.NewLine + circularDependencies.Aggregate(String.Empty, (current, circularDependency) => current + (" => " + circularDependency + Environment.NewLine)) + " => repeat from beginning ..."; 26 | return callTree; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.Assembly.NonFluent/Targets/Testing/RunTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using DotNetBuild.Core; 5 | using DotNetBuild.Tasks; 6 | 7 | namespace DotNetBuild.Build.Assembly.NonFluent.Targets.Testing 8 | { 9 | public class RunTests : ITarget 10 | { 11 | public String Description 12 | { 13 | get { return "Run tests"; } 14 | } 15 | 16 | public Boolean ContinueOnError 17 | { 18 | get { return false; } 19 | } 20 | 21 | public IEnumerable DependsOn 22 | { 23 | get { return null; } 24 | } 25 | 26 | public Boolean Execute(TargetExecutionContext context) 27 | { 28 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 29 | var xunitExe = context.ConfigurationSettings.Get("PathToXUnitRunnerExe"); 30 | var xunitTask = new XunitTask 31 | { 32 | XunitExe = Path.Combine(solutionDirectory, xunitExe), 33 | Assembly = Path.Combine(solutionDirectory, @"DotNetBuild.Tests\bin\Release\DotNetBuild.Tests.dll") 34 | }; 35 | 36 | return xunitTask.Execute(); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/targets.nuget.createRunnerAssemblyPackage.csx: -------------------------------------------------------------------------------- 1 | using DotNetBuild.Core.Facilities.State; 2 | using DotNetBuild.Tasks.NuGet; 3 | 4 | public class CreateRunnerAssemblyPackage : ITarget 5 | { 6 | public String Description 7 | { 8 | get { return "Create Assembly Runner NuGet package"; } 9 | } 10 | 11 | public Boolean ContinueOnError 12 | { 13 | get { return false; } 14 | } 15 | 16 | public IEnumerable DependsOn 17 | { 18 | get { return null; } 19 | } 20 | 21 | public Boolean Execute(TargetExecutionContext context) 22 | { 23 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 24 | var nugetExe = context.ConfigurationSettings.Get("PathToNuGetExe"); 25 | var nugetPackTask = new Pack 26 | { 27 | NuGetExe = Path.Combine(solutionDirectory, nugetExe), 28 | NuSpecFile = Path.Combine(solutionDirectory, @"DotNetBuild.Runner.Assembly\package.nuspec"), 29 | OutputDir = Path.Combine(solutionDirectory, @"packagesForNuGet\"), 30 | Version = context.FacilityProvider.Get().Get("VersionNumber") 31 | }; 32 | 33 | return nugetPackTask.Execute(); 34 | } 35 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/targets.nuget.createRunnerScriptCsPackage.csx: -------------------------------------------------------------------------------- 1 | using DotNetBuild.Core.Facilities.State; 2 | using DotNetBuild.Tasks.NuGet; 3 | 4 | public class CreateRunnerScriptCsPackage : ITarget 5 | { 6 | public String Description 7 | { 8 | get { return "Create ScriptCs Runner NuGet package"; } 9 | } 10 | 11 | public Boolean ContinueOnError 12 | { 13 | get { return false; } 14 | } 15 | 16 | public IEnumerable DependsOn 17 | { 18 | get { return null; } 19 | } 20 | 21 | public Boolean Execute(TargetExecutionContext context) 22 | { 23 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 24 | var nugetExe = context.ConfigurationSettings.Get("PathToNuGetExe"); 25 | var nugetPackTask = new Pack 26 | { 27 | NuGetExe = Path.Combine(solutionDirectory, nugetExe), 28 | NuSpecFile = Path.Combine(solutionDirectory, @"DotNetBuild.Runner.ScriptCs\package.nuspec"), 29 | OutputDir = Path.Combine(solutionDirectory, @"packagesForNuGet\"), 30 | Version = context.FacilityProvider.Get().Get("VersionNumber") 31 | }; 32 | 33 | return nugetPackTask.Execute(); 34 | } 35 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/ConfigurationRegistryTests/Add_configuration_settings_without_passing_in_a_value.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using DotNetBuild.Runner; 4 | using Xunit; 5 | 6 | namespace DotNetBuild.Tests.Runner.ConfigurationRegistryTests 7 | { 8 | public class Add_configuration_settings_without_passing_in_a_value 9 | : TestSpecification 10 | { 11 | private String _key; 12 | private IConfigurationSettings _value; 13 | private ArgumentNullException _exception; 14 | 15 | protected override void Arrange() 16 | { 17 | _key = TestData.GenerateString(); 18 | _value = null; 19 | } 20 | 21 | protected override ConfigurationRegistry CreateSubjectUnderTest() 22 | { 23 | return new ConfigurationRegistry(); 24 | } 25 | 26 | protected override void Act() 27 | { 28 | _exception = TestHelpers.CatchException(() => Sut.Add(_key, _value)); 29 | } 30 | 31 | [Fact] 32 | public void Throws_an_ArgumentNullException_for_the_value_parameter() 33 | { 34 | Assert.NotNull(_exception); 35 | Assert.Equal("value", _exception.ParamName); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/targets.nuget.publishRunnerAssemblyPackage.csx: -------------------------------------------------------------------------------- 1 | using DotNetBuild.Tasks.NuGet; 2 | 3 | public class PublishRunnerAssemblyPackage : ITarget 4 | { 5 | public String Description 6 | { 7 | get { return "Publish Assembly Runner NuGet package"; } 8 | } 9 | 10 | public Boolean ContinueOnError 11 | { 12 | get { return false; } 13 | } 14 | 15 | public IEnumerable DependsOn 16 | { 17 | get { return null; } 18 | } 19 | 20 | public Boolean Execute(TargetExecutionContext context) 21 | { 22 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 23 | var nugetExe = context.ConfigurationSettings.Get("PathToNuGetExe"); 24 | var nugetApiKey = context.ConfigurationSettings.Get("NuGetApiKey"); 25 | var nupkgFile = string.Format(@"packagesForNuGet\DotNetBuild.Runner.Assembly.{0}.nupkg", context.ParameterProvider.Get("VersionNumber")); 26 | var nugetPackTask = new Push 27 | { 28 | NuGetExe = Path.Combine(solutionDirectory, nugetExe), 29 | NuPkgFile = Path.Combine(solutionDirectory, nupkgFile), 30 | ApiKey = nugetApiKey 31 | }; 32 | 33 | return nugetPackTask.Execute(); 34 | } 35 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.ScriptCs.NonFluent/targets.nuget.publishRunnerScriptCsPackage.csx: -------------------------------------------------------------------------------- 1 | using DotNetBuild.Tasks.NuGet; 2 | 3 | public class PublishRunnerScriptCsPackage : ITarget 4 | { 5 | public String Description 6 | { 7 | get { return "Publish ScriptCs Runner NuGet package"; } 8 | } 9 | 10 | public Boolean ContinueOnError 11 | { 12 | get { return false; } 13 | } 14 | 15 | public IEnumerable DependsOn 16 | { 17 | get { return null; } 18 | } 19 | 20 | public Boolean Execute(TargetExecutionContext context) 21 | { 22 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 23 | var nugetExe = context.ConfigurationSettings.Get("PathToNuGetExe"); 24 | var nugetApiKey = context.ConfigurationSettings.Get("NuGetApiKey"); 25 | var nupkgFile = string.Format(@"packagesForNuGet\DotNetBuild.Runner.ScriptCs.{0}.nupkg", context.ParameterProvider.Get("VersionNumber")); 26 | var nugetPackTask = new Push 27 | { 28 | NuGetExe = Path.Combine(solutionDirectory, nugetExe), 29 | NuPkgFile = Path.Combine(solutionDirectory, nupkgFile), 30 | ApiKey = nugetApiKey 31 | }; 32 | 33 | return nugetPackTask.Execute(); 34 | } 35 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/ConfigurationRegistryTests/Add_configuration_settings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using DotNetBuild.Core; 4 | using DotNetBuild.Runner; 5 | using Moq; 6 | using Xunit; 7 | 8 | namespace DotNetBuild.Tests.Runner.ConfigurationRegistryTests 9 | { 10 | public class Add_configuration_settings 11 | : TestSpecification 12 | { 13 | private String _key; 14 | private IConfigurationSettings _value; 15 | 16 | protected override void Arrange() 17 | { 18 | _key = TestData.GenerateString(); 19 | _value = new Mock().Object; 20 | } 21 | 22 | protected override ConfigurationRegistry CreateSubjectUnderTest() 23 | { 24 | return new ConfigurationRegistry(); 25 | } 26 | 27 | protected override void Act() 28 | { 29 | Sut.Add(_key, _value); 30 | } 31 | 32 | [Fact] 33 | public void Registry_contains_the_configuration_settings() 34 | { 35 | var item = Sut.Registrations.SingleOrDefault(kvp => kvp.Key == _key); 36 | Assert.NotNull(item); 37 | Assert.Equal(_key, item.Key); 38 | Assert.Equal(_value, item.Value); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Infrastructure/Reflection/AssemblyWrapperTests/Get_one_type_with_no_filter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Reflection; 4 | using DotNetBuild.Core; 5 | using DotNetBuild.Runner.Infrastructure.Reflection; 6 | using DotNetBuild.Tests.TestAssembly; 7 | using Xunit; 8 | 9 | namespace DotNetBuild.Tests.Runner.Infrastructure.Reflection.AssemblyWrapperTests 10 | { 11 | public class Get_one_type_with_no_filter 12 | : TestSpecification 13 | { 14 | private Assembly _assembly; 15 | private Type _result; 16 | 17 | protected override void Arrange() 18 | { 19 | _assembly = Assembly.LoadFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DotNetBuild.Tests.TestAssembly.dll")); 20 | } 21 | 22 | protected override AssemblyWrapper CreateSubjectUnderTest() 23 | { 24 | return new AssemblyWrapper(_assembly); 25 | } 26 | 27 | protected override void Act() 28 | { 29 | _result = Sut.Get(); 30 | } 31 | 32 | [Fact] 33 | public void Throws_an_exception() 34 | { 35 | Assert.NotNull(_result); 36 | Assert.Equal(typeof(DummyConfigurator).FullName, _result.FullName); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/ConfigurationRegistry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using DotNetBuild.Core; 5 | 6 | namespace DotNetBuild.Runner 7 | { 8 | public class ConfigurationRegistry : IConfigurationRegistry 9 | { 10 | private static IDictionary _registrations; 11 | 12 | public ConfigurationRegistry() 13 | { 14 | _registrations = new Dictionary(); 15 | } 16 | 17 | public IEnumerable> Registrations 18 | { 19 | get { return _registrations; } 20 | } 21 | 22 | public IConfigurationSettings Get(String key) 23 | { 24 | var value = _registrations.SingleOrDefault(registration => String.Equals(registration.Key, key, StringComparison.OrdinalIgnoreCase)).Value; 25 | return value; 26 | } 27 | 28 | public void Add(String key, IConfigurationSettings value) 29 | { 30 | if (String.IsNullOrEmpty(key)) 31 | throw new ArgumentNullException("key"); 32 | 33 | if (value == null) 34 | throw new ArgumentNullException("value"); 35 | 36 | _registrations[key] = value; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/ConfigurationRegistryTests/Add_configuration_settings_without_passing_in_a_key.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using DotNetBuild.Runner; 4 | using Moq; 5 | using Xunit; 6 | 7 | namespace DotNetBuild.Tests.Runner.ConfigurationRegistryTests 8 | { 9 | public class Add_configuration_settings_without_passing_in_a_key 10 | : TestSpecification 11 | { 12 | private String _key; 13 | private IConfigurationSettings _value; 14 | private ArgumentNullException _exception; 15 | 16 | protected override void Arrange() 17 | { 18 | _key = null; 19 | _value = new Mock().Object; 20 | } 21 | 22 | protected override ConfigurationRegistry CreateSubjectUnderTest() 23 | { 24 | return new ConfigurationRegistry(); 25 | } 26 | 27 | protected override void Act() 28 | { 29 | _exception = TestHelpers.CatchException(() => Sut.Add(_key, _value)); 30 | } 31 | 32 | [Fact] 33 | public void Throws_an_ArgumentNullException_for_the_key_parameter() 34 | { 35 | Assert.NotNull(_exception); 36 | Assert.Equal("key", _exception.ParamName); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Core/ConfigurationSettingsTests/Add_setting_with_existing_key.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using DotNetBuild.Core; 4 | using Xunit; 5 | 6 | namespace DotNetBuild.Tests.Core.ConfigurationSettingsTests 7 | { 8 | public class Add_setting_with_existing_key 9 | : TestSpecification 10 | { 11 | private String _key; 12 | private Object _value; 13 | private Object _valueNew; 14 | 15 | protected override void Arrange() 16 | { 17 | _key = TestData.GenerateString(); 18 | _value = new Object(); 19 | _valueNew = new Object(); 20 | } 21 | 22 | protected override ConfigurationSettings CreateSubjectUnderTest() 23 | { 24 | var sut = new ConfigurationSettings(); 25 | sut.Add(_key, _value); 26 | 27 | return sut; 28 | } 29 | 30 | protected override void Act() 31 | { 32 | Sut.Add(_key, _valueNew); 33 | } 34 | 35 | [Fact] 36 | public void Registry_contains_the_new_setting() 37 | { 38 | var item = Sut.Registrations.SingleOrDefault(kvp => kvp.Key == _key); 39 | Assert.NotNull(item); 40 | Assert.Equal(_key, item.Key); 41 | Assert.Equal(_valueNew, item.Value); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/ConfiguratorResolverTests/Resolve_a_Configurator_with_no_assembly_wrapper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner; 3 | using DotNetBuild.Runner.Infrastructure.Reflection; 4 | using Moq; 5 | using Xunit; 6 | 7 | namespace DotNetBuild.Tests.Runner.ConfiguratorResolverTests 8 | { 9 | public class Resolve_a_Configurator_with_no_assembly_wrapper 10 | : TestSpecification 11 | { 12 | private IAssemblyWrapper _assemblyWrapper; 13 | private Mock _typeActivator; 14 | private ArgumentNullException _exception; 15 | 16 | protected override void Arrange() 17 | { 18 | _assemblyWrapper = null; 19 | _typeActivator = new Mock(); 20 | } 21 | 22 | protected override ConfiguratorResolver CreateSubjectUnderTest() 23 | { 24 | return new ConfiguratorResolver(_typeActivator.Object); 25 | } 26 | 27 | protected override void Act() 28 | { 29 | _exception = TestHelpers.CatchException(() => Sut.Resolve(_assemblyWrapper)); 30 | } 31 | 32 | [Fact] 33 | public void Throws_an_exception() 34 | { 35 | Assert.NotNull(_exception); 36 | Assert.Equal("assembly", _exception.ParamName); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Facilities/State/StateRegistryTests/Add_state_with_existing_key.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using DotNetBuild.Runner.Facilities.State; 4 | using Xunit; 5 | 6 | namespace DotNetBuild.Tests.Runner.Facilities.State.StateRegistryTests 7 | { 8 | public class Add_state_with_existing_key 9 | : TestSpecification 10 | { 11 | private String _key; 12 | private Object _value; 13 | private Object _valueNew; 14 | 15 | protected override void Arrange() 16 | { 17 | _key = TestData.GenerateString(); 18 | _value = new Object(); 19 | _valueNew = new Object(); 20 | } 21 | 22 | protected override StateRegistry CreateSubjectUnderTest() 23 | { 24 | var sut = new StateRegistry(); 25 | sut.Add(_key, _value); 26 | 27 | return sut; 28 | } 29 | 30 | protected override void Act() 31 | { 32 | Sut.Add(_key, _valueNew); 33 | } 34 | 35 | [Fact] 36 | public void Registry_contains_the_new_state() 37 | { 38 | var item = Sut.Registrations.SingleOrDefault(kvp => kvp.Key == _key); 39 | Assert.NotNull(item); 40 | Assert.Equal(_key, item.Key); 41 | Assert.Equal(_valueNew, item.Value); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/TargetRegistryTests/Add_target_with_existing_key.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using DotNetBuild.Core; 4 | using DotNetBuild.Runner; 5 | using Moq; 6 | using Xunit; 7 | 8 | namespace DotNetBuild.Tests.Runner.TargetRegistryTests 9 | { 10 | public class Add_target_with_existing_key 11 | : TestSpecification 12 | { 13 | private String _key; 14 | private ITarget _value; 15 | private ITarget _valueNew; 16 | 17 | protected override void Arrange() 18 | { 19 | _key = TestData.GenerateString(); 20 | _value = new Mock().Object; 21 | _valueNew = new Mock().Object; 22 | } 23 | 24 | protected override TargetRegistry CreateSubjectUnderTest() 25 | { 26 | var sut = new TargetRegistry(); 27 | sut.Add(_key, _value); 28 | 29 | return sut; 30 | } 31 | 32 | protected override void Act() 33 | { 34 | Sut.Add(_key, _valueNew); 35 | } 36 | 37 | [Fact] 38 | public void Registry_contains_the_new_target() 39 | { 40 | var item = Sut.Registrations.SingleOrDefault(kvp => kvp.Key == _key); 41 | Assert.NotNull(item); 42 | Assert.Equal(_key, item.Key); 43 | Assert.Equal(_valueNew, item.Value); 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Core/TargetBuilderTests/Set_DependsOn_target.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using DotNetBuild.Core; 4 | using DotNetBuild.Runner; 5 | using Xunit; 6 | 7 | namespace DotNetBuild.Tests.Core.TargetBuilderTests 8 | { 9 | public class Set_DependsOn_target : TestSpecification 10 | { 11 | private String _dependentTargetName; 12 | private ITarget _dependentTarget; 13 | private ITargetRegistry _targetRegistry; 14 | 15 | protected override void Arrange() 16 | { 17 | _targetRegistry = new TargetRegistry(); 18 | _dependentTargetName = "dependentTarget"; 19 | _dependentTarget = new TargetBuilder(_targetRegistry, _dependentTargetName, _dependentTargetName).GetTarget(); 20 | } 21 | 22 | protected override TargetBuilder CreateSubjectUnderTest() 23 | { 24 | return new TargetBuilder(_targetRegistry, TestData.GenerateString(), TestData.GenerateString()); 25 | } 26 | 27 | protected override void Act() 28 | { 29 | Sut.DependsOn(_dependentTargetName); 30 | } 31 | 32 | [Fact] 33 | public void Adds_the_dependency() 34 | { 35 | var target = Sut.GetTarget(); 36 | Assert.Equal(1, target.DependsOn.Count()); 37 | Assert.True(target.DependsOn.Contains(_dependentTarget)); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Facilities/State/StateReaderTests/Get_state.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner.Facilities.State; 3 | using Moq; 4 | using Xunit; 5 | 6 | namespace DotNetBuild.Tests.Runner.Facilities.State.StateReaderTests 7 | { 8 | public class Get_state 9 | : TestSpecification 10 | { 11 | private Mock _stateRegistry; 12 | private String _key; 13 | private Object _value; 14 | private Object _result; 15 | 16 | protected override void Arrange() 17 | { 18 | _key = TestData.GenerateString(); 19 | _value = new Object(); 20 | 21 | _stateRegistry = new Mock(); 22 | _stateRegistry.Setup(r => r.Get(_key)).Returns(_value); 23 | } 24 | 25 | protected override StateReader CreateSubjectUnderTest() 26 | { 27 | return new StateReader(_stateRegistry.Object); 28 | } 29 | 30 | protected override void Act() 31 | { 32 | _result = Sut.Get(_key); 33 | } 34 | 35 | [Fact] 36 | public void Gets_the_state_from_the_registry() 37 | { 38 | _stateRegistry.Verify(r => r.Get(_key)); 39 | } 40 | 41 | [Fact] 42 | public void Returns_the_correct_state() 43 | { 44 | Assert.Equal(_value, _result); 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /DotNetBuild.Core/ConfigurationSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace DotNetBuild.Core 5 | { 6 | public interface IConfigurationSettings 7 | { 8 | T Get(String key); 9 | void Add(String key, Object value); 10 | } 11 | 12 | public class ConfigurationSettings : IConfigurationSettings 13 | { 14 | private readonly IDictionary _registrations; 15 | 16 | public ConfigurationSettings() 17 | { 18 | _registrations = new Dictionary(); 19 | } 20 | 21 | public IEnumerable> Registrations 22 | { 23 | get { return _registrations; } 24 | } 25 | 26 | public T Get(String key) 27 | { 28 | if (String.IsNullOrEmpty(key)) 29 | return default(T); 30 | 31 | if (!_registrations.ContainsKey(key)) 32 | return default(T); 33 | 34 | var value = _registrations[key]; 35 | return (T)value; 36 | } 37 | 38 | public void Add(String key, Object value) 39 | { 40 | if (String.IsNullOrEmpty(key)) 41 | throw new ArgumentNullException("key"); 42 | 43 | if (value == null) 44 | throw new ArgumentNullException("value"); 45 | 46 | _registrations[key] = value; 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Core/TargetBuilderTests/Build_with_valid_arguments.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using Moq; 4 | using Xunit; 5 | 6 | namespace DotNetBuild.Tests.Core.TargetBuilderTests 7 | { 8 | public class Build_with_valid_arguments : TestSpecification 9 | { 10 | private Mock _targetRegistry; 11 | private String _name; 12 | private String _description; 13 | private ITarget _result; 14 | 15 | protected override void Arrange() 16 | { 17 | _targetRegistry = new Mock(); 18 | _name = TestData.GenerateString(); 19 | _description = TestData.GenerateString(); 20 | } 21 | 22 | protected override TargetBuilder CreateSubjectUnderTest() 23 | { 24 | return null; 25 | } 26 | 27 | protected override void Act() 28 | { 29 | _result = new TargetBuilder(_targetRegistry.Object, _name, _description).GetTarget(); 30 | } 31 | 32 | [Fact] 33 | public void Adds_the_target_to_the_registry() 34 | { 35 | _targetRegistry.Verify(r => r.Add(_name, _result)); 36 | } 37 | 38 | [Fact] 39 | public void Fills_in_the_appropriate_description() 40 | { 41 | Assert.NotNull(_result); 42 | Assert.Equal(_description, _result.Description); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/TargetInspector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using DotNetBuild.Core; 5 | 6 | namespace DotNetBuild.Runner 7 | { 8 | public interface ITargetInspector 9 | { 10 | IEnumerable CheckForCircularDependencies(ITarget target); 11 | } 12 | 13 | public class TargetInspector 14 | : ITargetInspector 15 | { 16 | public IEnumerable CheckForCircularDependencies(ITarget target) 17 | { 18 | var targetTypes = new List(); 19 | if (HasCircularDependencies(target, targetTypes)) 20 | return targetTypes; 21 | 22 | return new List(); 23 | } 24 | 25 | private static Boolean HasCircularDependencies(ITarget target, ICollection targetTypes) 26 | { 27 | var targetType = target.GetType(); 28 | if (targetTypes.Count(t => t == targetType) == 1) 29 | return true; 30 | 31 | targetTypes.Add(targetType); 32 | 33 | if (target.DependsOn == null || !target.DependsOn.Any()) 34 | return false; 35 | 36 | foreach (var dependentTarget in target.DependsOn) 37 | { 38 | if (HasCircularDependencies(dependentTarget, targetTypes)) 39 | return true; 40 | } 41 | 42 | return false; 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /DotNetBuild.Build.Assembly.Fluent/obj 2 | /DotNetBuild.Build.Assembly.Fluent/bin 3 | /DotNetBuild.Build.Assembly.Fluent/DotNetBuild.Build.Assembly.Fluent.csproj.user 4 | 5 | /DotNetBuild.Build.Assembly.NonFluent/obj 6 | /DotNetBuild.Build.Assembly.NonFluent/bin 7 | /DotNetBuild.Build.Assembly.Fluent/DotNetBuild.Build.Assembly.NonFluent.csproj.user 8 | 9 | /DotNetBuild.Core/obj 10 | /DotNetBuild.Core/bin 11 | /DotNetBuild.Core/DotNetBuild.Core.csproj.user 12 | 13 | /DotNetBuild.Runner/bin 14 | /DotNetBuild.Runner/obj 15 | /DotNetBuild.Runner/DotNetBuild.Runner.csproj.user 16 | 17 | /DotNetBuild.Runner.Assembly/bin 18 | /DotNetBuild.Runner.Assembly/obj 19 | /DotNetBuild.Runner.Assembly/DotNetBuild.Runner.Assembly.csproj.user 20 | 21 | /DotNetBuild.Runner.ScriptCs/obj 22 | /DotNetBuild.Runner.ScriptCs/bin 23 | /DotNetBuild.Runner.ScriptCs/DotNetBuild.Runner.ScriptCs.csproj.user 24 | 25 | /DotNetBuild.Tasks/obj 26 | /DotNetBuild.Tasks/bin 27 | /DotNetBuild.Tasks/DotNetBuild.Tasks.csproj.user 28 | 29 | /DotNetBuild.Tests/bin 30 | /DotNetBuild.Tests/obj 31 | /DotNetBuild.Tests/DotNetBuild.Tests.csproj.user 32 | 33 | /DotNetBuild.Tests.TestAssembly/bin 34 | /DotNetBuild.Tests.TestAssembly/obj 35 | /DotNetBuild.Tests.TestAssembly/DotNetBuild.Tests.TestAssembly.csproj.user 36 | 37 | /DotNetBuild.ncrunchsolution 38 | /DotNetBuild.ncrunchsolution.user 39 | /DotNetBuild.sln.DotSettings 40 | /DotNetBuild.sln.DotSettings.user 41 | /DotNetBuild.v11.suo 42 | /DotNetBuild.v12.suo -------------------------------------------------------------------------------- /DotNetBuild.Runner/ConfiguratorResolver.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Core; 3 | using DotNetBuild.Runner.Exceptions; 4 | using DotNetBuild.Runner.Infrastructure.Reflection; 5 | 6 | namespace DotNetBuild.Runner 7 | { 8 | public interface IConfiguratorResolver 9 | { 10 | IConfigurator Resolve(IAssemblyWrapper assembly); 11 | } 12 | 13 | public class ConfiguratorResolver 14 | : IConfiguratorResolver 15 | { 16 | private readonly ITypeActivator _typeActivator; 17 | 18 | public ConfiguratorResolver(ITypeActivator typeActivator) 19 | { 20 | if (typeActivator == null) 21 | throw new ArgumentNullException("typeActivator"); 22 | 23 | _typeActivator = typeActivator; 24 | } 25 | 26 | public IConfigurator Resolve(IAssemblyWrapper assembly) 27 | { 28 | if (assembly == null) 29 | throw new ArgumentNullException("assembly"); 30 | 31 | var configuratorType = assembly.Get(); 32 | if (configuratorType == null) 33 | throw new UnableToResolveConfiguratorException(assembly.Assembly.FullName); 34 | 35 | var configurator = _typeActivator.Activate(configuratorType); 36 | if (configurator == null) 37 | throw new UnableToActivateConfiguratorException(configuratorType); 38 | 39 | return configurator; 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/Facilities/State/StateRegistry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace DotNetBuild.Runner.Facilities.State 6 | { 7 | public interface IStateRegistry 8 | { 9 | T Get(String key); 10 | void Add(String key, Object value); 11 | } 12 | 13 | public class StateRegistry 14 | : IStateRegistry 15 | { 16 | private static IDictionary _registrations; 17 | 18 | public StateRegistry() 19 | { 20 | _registrations = new Dictionary(); 21 | } 22 | 23 | public IEnumerable> Registrations 24 | { 25 | get { return _registrations; } 26 | } 27 | 28 | public T Get(String key) 29 | { 30 | var value = _registrations.SingleOrDefault(registration => String.Equals(registration.Key, key, StringComparison.OrdinalIgnoreCase)).Value; 31 | if (value == null) 32 | return default(T); 33 | 34 | return (T) value; 35 | } 36 | 37 | public void Add(String key, Object value) 38 | { 39 | if (String.IsNullOrEmpty(key)) 40 | throw new ArgumentNullException("key"); 41 | 42 | if (value == null) 43 | throw new ArgumentNullException("value"); 44 | 45 | _registrations[key] = value; 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Infrastructure/Reflection/AssemblyWrapperTests/Get_one_type_with_a_filter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Reflection; 4 | using DotNetBuild.Core; 5 | using DotNetBuild.Runner.Infrastructure.Reflection; 6 | using DotNetBuild.Tests.TestAssembly; 7 | using Xunit; 8 | 9 | namespace DotNetBuild.Tests.Runner.Infrastructure.Reflection.AssemblyWrapperTests 10 | { 11 | public class Get_one_type_with_a_filter 12 | : TestSpecification 13 | { 14 | private Assembly _assembly; 15 | private String _target; 16 | private Type _result; 17 | 18 | protected override void Arrange() 19 | { 20 | _assembly = Assembly.LoadFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DotNetBuild.Tests.TestAssembly.dll")); 21 | _target = "Dummy1Target"; 22 | } 23 | 24 | protected override AssemblyWrapper CreateSubjectUnderTest() 25 | { 26 | return new AssemblyWrapper(_assembly); 27 | } 28 | 29 | protected override void Act() 30 | { 31 | _result = Sut.Get(new DotNetBuild.Runner.Infrastructure.Reflection.TypeFilter(t => String.Equals(t.Name, _target))); 32 | } 33 | 34 | [Fact] 35 | public void Gets_the_specified_type() 36 | { 37 | Assert.NotNull(_result); 38 | Assert.Equal(typeof(Dummy1Target).FullName, _result.FullName); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("DotNetBuild.Tests")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("DotNetBuild.Tests")] 12 | [assembly: AssemblyCopyright("Copyright © 2014")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("6f876937-3dbe-4d3b-a937-82c003114d26")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | [assembly: AssemblyVersion("1.0.0.0")] 34 | [assembly: AssemblyFileVersion("1.0.0.0")] 35 | -------------------------------------------------------------------------------- /DotNetBuild.Build.Assembly.NonFluent/Targets/CI.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using DotNetBuild.Build.Assembly.NonFluent.Targets.Compilation; 4 | using DotNetBuild.Build.Assembly.NonFluent.Targets.NuGet; 5 | using DotNetBuild.Build.Assembly.NonFluent.Targets.Testing; 6 | using DotNetBuild.Build.Assembly.NonFluent.Targets.Versioning; 7 | using DotNetBuild.Core; 8 | 9 | namespace DotNetBuild.Build.Assembly.NonFluent.Targets 10 | { 11 | public class CI : ITarget 12 | { 13 | public String Description 14 | { 15 | get { return "Continuous integration target"; } 16 | } 17 | 18 | public Boolean ContinueOnError 19 | { 20 | get { return false; } 21 | } 22 | 23 | public IEnumerable DependsOn 24 | { 25 | get 26 | { 27 | return new List 28 | { 29 | new UpdateVersionNumber(), 30 | new BuildRelease(), 31 | new RunTests(), 32 | new CreateCorePackage(), 33 | new CreateRunnerPackage(), 34 | new CreateRunnerAssemblyPackage(), 35 | new CreateRunnerScriptCsPackage(), 36 | new CreateTasksPackage() 37 | }; 38 | } 39 | } 40 | 41 | public Boolean Execute(TargetExecutionContext context) 42 | { 43 | return true; 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests.TestAssembly/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("DotNetBuild.Tests.TestAssembly")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("DotNetBuild.Tests.TestAssembly")] 12 | [assembly: AssemblyCopyright("Copyright © 2014")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("27a5dbaa-b24a-4a18-a181-c54fbb913bc6")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | [assembly: AssemblyVersion("1.0.0.0")] 34 | [assembly: AssemblyFileVersion("1.0.0.0")] 35 | -------------------------------------------------------------------------------- /DotNetBuild.Build.Assembly.Fluent/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("DotNetBuild.Build.Assembly.Fluent")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("DotNetBuild.Build.Assembly.Fluent")] 12 | [assembly: AssemblyCopyright("Copyright © 2014")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("82dbb35d-ee49-4590-bc15-9f80574f79b6")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | [assembly: AssemblyVersion("1.0.0.0")] 34 | [assembly: AssemblyFileVersion("1.0.0.0")] 35 | -------------------------------------------------------------------------------- /DotNetBuild.Core/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("DotNetBuild.Core")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("DotNetBuild.Core")] 12 | [assembly: AssemblyCopyright("Copyright © 2014")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("6ec9fc42-e881-4662-8597-634607441c20")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | [assembly: AssemblyVersion("1.1.0.0")] 34 | [assembly: AssemblyFileVersion("1.1.0.0")] 35 | [assembly: AssemblyInformationalVersion("1.1.0")] 36 | -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/ParameterProviderTests/Get_value.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using DotNetBuild.Runner; 3 | using Xunit; 4 | 5 | namespace DotNetBuild.Tests.Runner.ParameterProviderTests 6 | { 7 | public class Get_value 8 | : TestSpecification 9 | { 10 | private String[] _parameters; 11 | private String _assembly; 12 | private String _target; 13 | private String _configuration; 14 | private String _result; 15 | 16 | protected override void Arrange() 17 | { 18 | _assembly = TestData.GenerateString(); 19 | _target = TestData.GenerateString(); 20 | _configuration = TestData.GenerateString(); 21 | 22 | _parameters = new[] 23 | { 24 | ParameterConstants.Assembly + ":" + _assembly, 25 | ParameterConstants.Target + ":" + _target, 26 | ParameterConstants.Configuration + ":" + _configuration, 27 | "foo:bar", 28 | null 29 | }; 30 | } 31 | 32 | protected override ParameterProvider CreateSubjectUnderTest() 33 | { 34 | return new ParameterProvider(_parameters); 35 | } 36 | 37 | protected override void Act() 38 | { 39 | _result = Sut.Get(ParameterConstants.Target); 40 | } 41 | 42 | [Fact] 43 | public void Reads_the_requested_parameter() 44 | { 45 | Assert.Equal(_target, _result); 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.Assembly.NonFluent/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("DotNetBuild.Build.Assembly.NonFluent")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("DotNetBuild.Build.Assembly.NonFluent")] 12 | [assembly: AssemblyCopyright("Copyright © 2014")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("15c8cb74-1ba2-493c-8431-bbc25b63f06a")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | [assembly: AssemblyVersion("1.0.0.0")] 34 | [assembly: AssemblyFileVersion("1.0.0.0")] 35 | -------------------------------------------------------------------------------- /DotNetBuild.Tasks/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("DotNetBuild.Tasks")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("DotNetBuild.Tasks")] 12 | [assembly: AssemblyCopyright("Copyright © 2014")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("6d80fe9a-98bb-47ca-8166-c2875498aa3b")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | [assembly: AssemblyVersion("1.1.0.0")] 34 | [assembly: AssemblyFileVersion("1.1.0.0")] 35 | [assembly: AssemblyInformationalVersion("1.1.0")] 36 | -------------------------------------------------------------------------------- /DotNetBuild.Build.Assembly.NonFluent/Targets/NuGet/CreateCorePackage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using DotNetBuild.Core; 5 | using DotNetBuild.Core.Facilities.State; 6 | using DotNetBuild.Tasks.NuGet; 7 | 8 | namespace DotNetBuild.Build.Assembly.NonFluent.Targets.NuGet 9 | { 10 | public class CreateCorePackage : ITarget 11 | { 12 | public String Description 13 | { 14 | get { return "Create Core NuGet package"; } 15 | } 16 | 17 | public Boolean ContinueOnError 18 | { 19 | get { return false; } 20 | } 21 | 22 | public IEnumerable DependsOn 23 | { 24 | get { return null; } 25 | } 26 | 27 | public Boolean Execute(TargetExecutionContext context) 28 | { 29 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 30 | var nugetExe = context.ConfigurationSettings.Get("PathToNuGetExe"); 31 | var nugetPackTask = new Pack 32 | { 33 | NuGetExe = Path.Combine(solutionDirectory, nugetExe), 34 | NuSpecFile = Path.Combine(solutionDirectory, @"DotNetBuild.Core\package.nuspec"), 35 | OutputDir = Path.Combine(solutionDirectory, @"packagesForNuGet\"), 36 | Version = context.FacilityProvider.Get().Get("VersionNumber") 37 | }; 38 | 39 | return nugetPackTask.Execute(); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("DotNetBuild.Runner")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("DotNetBuild.Runner")] 12 | [assembly: AssemblyCopyright("Copyright © 2014")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("5f753c46-3f28-4072-b7b7-1d200d21e5bc")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | [assembly: AssemblyVersion("1.1.0.0")] 34 | [assembly: AssemblyFileVersion("1.1.0.0")] 35 | [assembly: AssemblyInformationalVersion("1.1.0")] 36 | -------------------------------------------------------------------------------- /DotNetBuild.Build.Assembly.NonFluent/Targets/NuGet/CreateTasksPackage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using DotNetBuild.Core; 5 | using DotNetBuild.Core.Facilities.State; 6 | using DotNetBuild.Tasks.NuGet; 7 | 8 | namespace DotNetBuild.Build.Assembly.NonFluent.Targets.NuGet 9 | { 10 | public class CreateTasksPackage : ITarget 11 | { 12 | public String Description 13 | { 14 | get { return "Create Tasks NuGet package"; } 15 | } 16 | 17 | public Boolean ContinueOnError 18 | { 19 | get { return false; } 20 | } 21 | 22 | public IEnumerable DependsOn 23 | { 24 | get { return null; } 25 | } 26 | 27 | public Boolean Execute(TargetExecutionContext context) 28 | { 29 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 30 | var nugetExe = context.ConfigurationSettings.Get("PathToNuGetExe"); 31 | var nugetPackTask = new Pack 32 | { 33 | NuGetExe = Path.Combine(solutionDirectory, nugetExe), 34 | NuSpecFile = Path.Combine(solutionDirectory, @"DotNetBuild.Tasks\package.nuspec"), 35 | OutputDir = Path.Combine(solutionDirectory, @"packagesForNuGet\"), 36 | Version = context.FacilityProvider.Get().Get("VersionNumber") 37 | }; 38 | 39 | return nugetPackTask.Execute(); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/ConfigurationRegistryTests/Add_configuration_settings_with_existing_key.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using DotNetBuild.Core; 4 | using DotNetBuild.Runner; 5 | using Moq; 6 | using Xunit; 7 | 8 | namespace DotNetBuild.Tests.Runner.ConfigurationRegistryTests 9 | { 10 | public class Add_configuration_settings_with_existing_key 11 | : TestSpecification 12 | { 13 | private String _key; 14 | private IConfigurationSettings _value; 15 | private IConfigurationSettings _valueNew; 16 | 17 | protected override void Arrange() 18 | { 19 | _key = TestData.GenerateString(); 20 | _value = new Mock().Object; 21 | _valueNew = new Mock().Object; 22 | } 23 | 24 | protected override ConfigurationRegistry CreateSubjectUnderTest() 25 | { 26 | var sut = new ConfigurationRegistry(); 27 | sut.Add(_key, _value); 28 | 29 | return sut; 30 | } 31 | 32 | protected override void Act() 33 | { 34 | Sut.Add(_key, _valueNew); 35 | } 36 | 37 | [Fact] 38 | public void Registry_contains_the_new_configuration_settings() 39 | { 40 | var item = Sut.Registrations.SingleOrDefault(kvp => kvp.Key == _key); 41 | Assert.NotNull(item); 42 | Assert.Equal(_key, item.Key); 43 | Assert.Equal(_valueNew, item.Value); 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.Assembly.NonFluent/Targets/NuGet/CreateRunnerPackage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using DotNetBuild.Core; 5 | using DotNetBuild.Core.Facilities.State; 6 | using DotNetBuild.Tasks.NuGet; 7 | 8 | namespace DotNetBuild.Build.Assembly.NonFluent.Targets.NuGet 9 | { 10 | public class CreateRunnerPackage : ITarget 11 | { 12 | public String Description 13 | { 14 | get { return "Create Runner NuGet package"; } 15 | } 16 | 17 | public Boolean ContinueOnError 18 | { 19 | get { return false; } 20 | } 21 | 22 | public IEnumerable DependsOn 23 | { 24 | get { return null; } 25 | } 26 | 27 | public Boolean Execute(TargetExecutionContext context) 28 | { 29 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 30 | var nugetExe = context.ConfigurationSettings.Get("PathToNuGetExe"); 31 | var nugetPackTask = new Pack 32 | { 33 | NuGetExe = Path.Combine(solutionDirectory, nugetExe), 34 | NuSpecFile = Path.Combine(solutionDirectory, @"DotNetBuild.Runner\package.nuspec"), 35 | OutputDir = Path.Combine(solutionDirectory, @"packagesForNuGet\"), 36 | Version = context.FacilityProvider.Get().Get("VersionNumber") 37 | }; 38 | 39 | return nugetPackTask.Execute(); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.Assembly.NonFluent/Targets/NuGet/PublishCorePackage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using DotNetBuild.Core; 5 | using DotNetBuild.Tasks.NuGet; 6 | 7 | namespace DotNetBuild.Build.Assembly.NonFluent.Targets.NuGet 8 | { 9 | public class PublishCorePackage : ITarget 10 | { 11 | public String Description 12 | { 13 | get { return "Publish Core NuGet package"; } 14 | } 15 | 16 | public Boolean ContinueOnError 17 | { 18 | get { return false; } 19 | } 20 | 21 | public IEnumerable DependsOn 22 | { 23 | get { return null; } 24 | } 25 | 26 | public Boolean Execute(TargetExecutionContext context) 27 | { 28 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 29 | var nugetExe = context.ConfigurationSettings.Get("PathToNuGetExe"); 30 | var nugetApiKey = context.ConfigurationSettings.Get("NuGetApiKey"); 31 | var nupkgFile = string.Format(@"packagesForNuGet\DotNetBuild.Core.{0}.nupkg", context.ParameterProvider.Get("VersionNumber")); 32 | var nugetPackTask = new Push 33 | { 34 | NuGetExe = Path.Combine(solutionDirectory, nugetExe), 35 | NuPkgFile = Path.Combine(solutionDirectory, nupkgFile), 36 | ApiKey = nugetApiKey 37 | }; 38 | 39 | return nugetPackTask.Execute(); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.Assembly.NonFluent/Targets/NuGet/PublishTasksPackage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using DotNetBuild.Core; 5 | using DotNetBuild.Tasks.NuGet; 6 | 7 | namespace DotNetBuild.Build.Assembly.NonFluent.Targets.NuGet 8 | { 9 | public class PublishTasksPackage : ITarget 10 | { 11 | public String Description 12 | { 13 | get { return "Publish Tasks NuGet package"; } 14 | } 15 | 16 | public Boolean ContinueOnError 17 | { 18 | get { return false; } 19 | } 20 | 21 | public IEnumerable DependsOn 22 | { 23 | get { return null; } 24 | } 25 | 26 | public Boolean Execute(TargetExecutionContext context) 27 | { 28 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 29 | var nugetExe = context.ConfigurationSettings.Get("PathToNuGetExe"); 30 | var nugetApiKey = context.ConfigurationSettings.Get("NuGetApiKey"); 31 | var nupkgFile = string.Format(@"packagesForNuGet\DotNetBuild.Tasks.{0}.nupkg", context.ParameterProvider.Get("VersionNumber")); 32 | var nugetPackTask = new Push 33 | { 34 | NuGetExe = Path.Combine(solutionDirectory, nugetExe), 35 | NuPkgFile = Path.Combine(solutionDirectory, nupkgFile), 36 | ApiKey = nugetApiKey 37 | }; 38 | 39 | return nugetPackTask.Execute(); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.Assembly.NonFluent/Targets/NuGet/PublishRunnerPackage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using DotNetBuild.Core; 5 | using DotNetBuild.Tasks.NuGet; 6 | 7 | namespace DotNetBuild.Build.Assembly.NonFluent.Targets.NuGet 8 | { 9 | public class PublishRunnerPackage : ITarget 10 | { 11 | public String Description 12 | { 13 | get { return "Publish Runner NuGet package"; } 14 | } 15 | 16 | public Boolean ContinueOnError 17 | { 18 | get { return false; } 19 | } 20 | 21 | public IEnumerable DependsOn 22 | { 23 | get { return null; } 24 | } 25 | 26 | public Boolean Execute(TargetExecutionContext context) 27 | { 28 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 29 | var nugetExe = context.ConfigurationSettings.Get("PathToNuGetExe"); 30 | var nugetApiKey = context.ConfigurationSettings.Get("NuGetApiKey"); 31 | var nupkgFile = string.Format(@"packagesForNuGet\DotNetBuild.Runner.{0}.nupkg", context.ParameterProvider.Get("VersionNumber")); 32 | var nugetPackTask = new Push 33 | { 34 | NuGetExe = Path.Combine(solutionDirectory, nugetExe), 35 | NuPkgFile = Path.Combine(solutionDirectory, nupkgFile), 36 | ApiKey = nugetApiKey 37 | }; 38 | 39 | return nugetPackTask.Execute(); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner.Assembly/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("DotNetBuild.Runner.Assembly")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("DotNetBuild.Runner.Assembly")] 12 | [assembly: AssemblyCopyright("Copyright © 2014")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("7588fb39-3329-4407-8a6b-b70324502195")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | [assembly: AssemblyVersion("1.1.0.0")] 34 | [assembly: AssemblyFileVersion("1.1.0.0")] 35 | [assembly: AssemblyInformationalVersion("1.1.0")] 36 | -------------------------------------------------------------------------------- /DotNetBuild.Runner.ScriptCs/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("DotNetBuild.Runner.ScriptCs")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("DotNetBuild.Runner.ScriptCs")] 12 | [assembly: AssemblyCopyright("Copyright © 2014")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("55e4d7c3-b5e8-4ce0-bf1b-4339bc6cfa6c")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | [assembly: AssemblyVersion("1.1.0.0")] 34 | [assembly: AssemblyFileVersion("1.1.0.0")] 35 | [assembly: AssemblyInformationalVersion("1.1.0")] 36 | -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/TargetExecutorTests/Execute_a_null_Target.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using DotNetBuild.Core; 4 | using DotNetBuild.Runner; 5 | using DotNetBuild.Runner.Infrastructure.Logging; 6 | using Moq; 7 | using Xunit; 8 | 9 | namespace DotNetBuild.Tests.Runner.TargetExecutorTests 10 | { 11 | public class Execute_a_null_Target 12 | : TestSpecification 13 | { 14 | private ITarget _target; 15 | private Mock _targetInspector; 16 | private Mock _logger; 17 | private ArgumentNullException _exception; 18 | 19 | protected override void Arrange() 20 | { 21 | _target = null; 22 | 23 | _targetInspector = new Mock(); 24 | _targetInspector.Setup(ti => ti.CheckForCircularDependencies(_target)).Returns(new List()); 25 | 26 | _logger = new Mock(); 27 | } 28 | 29 | protected override TargetExecutor CreateSubjectUnderTest() 30 | { 31 | return new TargetExecutor(_targetInspector.Object, _logger.Object); 32 | } 33 | 34 | protected override void Act() 35 | { 36 | _exception = TestHelpers.CatchException(() => Sut.Execute(_target, null, null)); 37 | } 38 | 39 | [Fact] 40 | public void Throws_an_exception() 41 | { 42 | Assert.NotNull(_exception); 43 | Assert.Equal("target", _exception.ParamName); 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /DotNetBuild.Core/ConfigurationBuilderExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Core 4 | { 5 | public static class ConfigurationBuilderExtension 6 | { 7 | public static IConfigurationBuilder Configure(this String name) 8 | { 9 | var configurationRegistry = GetConfigurationRegistry(); 10 | return new ConfigurationBuilder(configurationRegistry, name); 11 | } 12 | 13 | public static void Configure(this String name, IConfigurationSettings configurationSettings) 14 | { 15 | var configurationRegistry = GetConfigurationRegistry(); 16 | configurationRegistry.Add(name, configurationSettings); 17 | } 18 | 19 | private static Func _resolveConfigurationRegistry; 20 | public static void ResolveConfigurationRegistry(Func resolveConfigurationRegistry) 21 | { 22 | _resolveConfigurationRegistry = resolveConfigurationRegistry; 23 | } 24 | 25 | private static IConfigurationRegistry GetConfigurationRegistry() 26 | { 27 | if (_resolveConfigurationRegistry == null) 28 | throw new InvalidOperationException("DotNetBuild hasn't been configured yet"); 29 | 30 | var configurationRegistry = _resolveConfigurationRegistry(); 31 | if (configurationRegistry == null) 32 | throw new InvalidOperationException("DotNetBuild hasn't been configured yet"); 33 | 34 | return configurationRegistry; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /DotNetBuild.Tests/Runner/Infrastructure/Reflection/TypeActivatorTests/Activate_a_Type_with_no_default_constructor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using DotNetBuild.Runner.Exceptions; 4 | using DotNetBuild.Runner.Infrastructure.Reflection; 5 | using Xunit; 6 | 7 | namespace DotNetBuild.Tests.Runner.Infrastructure.Reflection.TypeActivatorTests 8 | { 9 | public class Activate_a_Type_with_no_default_constructor 10 | : TestSpecification 11 | { 12 | private Type _type; 13 | private UnableToActivateTypeWithNoDefaultConstructorException _exception; 14 | 15 | protected override void Arrange() 16 | { 17 | _type = typeof (DummyType); 18 | } 19 | 20 | protected override TypeActivator CreateSubjectUnderTest() 21 | { 22 | return new TypeActivator(); 23 | } 24 | 25 | protected override void Act() 26 | { 27 | _exception = TestHelpers.CatchException(() => Sut.Activate(_type)); 28 | } 29 | 30 | [Fact] 31 | public void Throws_an_exception() 32 | { 33 | Assert.NotNull(_exception); 34 | Assert.Equal(_type, _exception.Type); 35 | } 36 | 37 | private interface IType 38 | { 39 | } 40 | 41 | private class DummyType : IType 42 | { 43 | public DummyType(String name) 44 | { 45 | Debug.WriteLine(name); 46 | } 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /DotNetBuild.Core/TargetBuilderExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Core 4 | { 5 | public static class TargetBuilderExtension 6 | { 7 | public static ITargetBuilder Target(this String name) 8 | { 9 | var description = name; 10 | return name.Target(description); 11 | } 12 | 13 | public static ITargetBuilder Target(this String name, String description) 14 | { 15 | var targetRegistry = GetTargetRegistry(); 16 | return new TargetBuilder(targetRegistry, name, description); 17 | } 18 | 19 | public static void Target(this String name, ITarget target) 20 | { 21 | var targetRegistry = GetTargetRegistry(); 22 | targetRegistry.Add(name, target); 23 | } 24 | 25 | private static Func _resolveTargetRegistry; 26 | public static void ResolveTargetRegistry(Func resolveTargetRegistry) 27 | { 28 | _resolveTargetRegistry = resolveTargetRegistry; 29 | } 30 | 31 | private static ITargetRegistry GetTargetRegistry() 32 | { 33 | if (_resolveTargetRegistry == null) 34 | throw new InvalidOperationException("DotNetBuild hasn't been configured yet"); 35 | 36 | var targetRegistry = _resolveTargetRegistry(); 37 | if (targetRegistry == null) 38 | throw new InvalidOperationException("DotNetBuild hasn't been configured yet"); 39 | 40 | return targetRegistry; 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.Assembly.NonFluent/Targets/NuGet/CreateRunnerAssemblyPackage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using DotNetBuild.Core; 5 | using DotNetBuild.Core.Facilities.State; 6 | using DotNetBuild.Tasks.NuGet; 7 | 8 | namespace DotNetBuild.Build.Assembly.NonFluent.Targets.NuGet 9 | { 10 | public class CreateRunnerAssemblyPackage : ITarget 11 | { 12 | public String Description 13 | { 14 | get { return "Create Assembly Runner NuGet package"; } 15 | } 16 | 17 | public Boolean ContinueOnError 18 | { 19 | get { return false; } 20 | } 21 | 22 | public IEnumerable DependsOn 23 | { 24 | get { return null; } 25 | } 26 | 27 | public Boolean Execute(TargetExecutionContext context) 28 | { 29 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 30 | var nugetExe = context.ConfigurationSettings.Get("PathToNuGetExe"); 31 | var nugetPackTask = new Pack 32 | { 33 | NuGetExe = Path.Combine(solutionDirectory, nugetExe), 34 | NuSpecFile = Path.Combine(solutionDirectory, @"DotNetBuild.Runner.Assembly\package.nuspec"), 35 | OutputDir = Path.Combine(solutionDirectory, @"packagesForNuGet\"), 36 | Version = context.FacilityProvider.Get().Get("VersionNumber") 37 | }; 38 | 39 | return nugetPackTask.Execute(); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /DotNetBuild.Build.Assembly.NonFluent/Targets/NuGet/CreateRunnerScriptCsPackage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using DotNetBuild.Core; 5 | using DotNetBuild.Core.Facilities.State; 6 | using DotNetBuild.Tasks.NuGet; 7 | 8 | namespace DotNetBuild.Build.Assembly.NonFluent.Targets.NuGet 9 | { 10 | public class CreateRunnerScriptCsPackage : ITarget 11 | { 12 | public String Description 13 | { 14 | get { return "Create ScriptCs Runner NuGet package"; } 15 | } 16 | 17 | public Boolean ContinueOnError 18 | { 19 | get { return false; } 20 | } 21 | 22 | public IEnumerable DependsOn 23 | { 24 | get { return null; } 25 | } 26 | 27 | public Boolean Execute(TargetExecutionContext context) 28 | { 29 | var solutionDirectory = context.ConfigurationSettings.Get("SolutionDirectory"); 30 | var nugetExe = context.ConfigurationSettings.Get("PathToNuGetExe"); 31 | var nugetPackTask = new Pack 32 | { 33 | NuGetExe = Path.Combine(solutionDirectory, nugetExe), 34 | NuSpecFile = Path.Combine(solutionDirectory, @"DotNetBuild.Runner.ScriptCs\package.nuspec"), 35 | OutputDir = Path.Combine(solutionDirectory, @"packagesForNuGet\"), 36 | Version = context.FacilityProvider.Get().Get("VersionNumber") 37 | }; 38 | 39 | return nugetPackTask.Execute(); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /DotNetBuild.Runner/Infrastructure/Logging/Loggers/TeamCityLogger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DotNetBuild.Runner.Infrastructure.Logging.Loggers 4 | { 5 | // http://confluence.jetbrains.com/display/TCD7/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-CommonProperties 6 | public class TeamCityLogger 7 | : ILogger 8 | { 9 | public void Write(String message) 10 | { 11 | Console.WriteLine("##teamcity[message text='{0}']", Escape(message)); 12 | } 13 | 14 | public void WriteBlockStart(String message) 15 | { 16 | Console.WriteLine("##teamcity[progressStart '{0}']", Escape(message)); 17 | Console.WriteLine("##teamcity[blockOpened name='{0}']", Escape(message)); 18 | } 19 | 20 | public void WriteBlockEnd(String message) 21 | { 22 | Console.WriteLine("##teamcity[progressFinish '{0}']", Escape(message)); 23 | Console.WriteLine("##teamcity[blockClosed name='{0}']", Escape(message)); 24 | } 25 | 26 | public void WriteError(String message, Exception exception) 27 | { 28 | Console.WriteLine("##teamcity[message text='{0}' errorDetails='{1}' status='ERROR']", Escape(message), Escape(exception.StackTrace)); 29 | } 30 | 31 | private static String Escape(String value) 32 | { 33 | return value == null 34 | ? String.Empty 35 | : value.Replace("|", "||").Replace("'", "|'").Replace("\r", "|r").Replace("\n", "|n").Replace("]", "|]"); 36 | } 37 | } 38 | } --------------------------------------------------------------------------------