Permalink
Browse files

Renaming branch

git-svn-id: https://rhino-tools.svn.sourceforge.net/svnroot/rhino-tools/trunk@1093 079b0acf-d9fa-0310-9935-e5ade295c882
  • Loading branch information...
1 parent 9abbb29 commit cda873a48f89fb5b2a979c33e2a5ed4016f91ff9 ayenderahien committed Jan 15, 2008
Showing with 8,079 additions and 0 deletions.
  1. +67 −0 Default.build
  2. +84 −0 Rhino.Etl.Cmd/Rhino.Etl.Cmd.csproj
  3. +5 −0 Rhino.Etl.Cmd/Rhino.Etl.Cmd.csproj.user
  4. +16 −0 Rhino.Etl.Cmd/RhinoEtlCommandLineOptions.cs
  5. +41 −0 Rhino.Etl.Cmd/RhinoEtlRunner.cs
  6. +108 −0 Rhino.Etl.Cmd/RhinoEtlSetup.cs
  7. +25 −0 Rhino.Etl.Cmd/standard.log4net.config
  8. +28 −0 Rhino.Etl.Cmd/verbose.log4net.config
  9. +50 −0 Rhino.Etl.Core/ConventionOperations/ConventionInputCommandOperation.cs
  10. +57 −0 Rhino.Etl.Core/ConventionOperations/ConventionOutputCommandOperation.cs
  11. +42 −0 Rhino.Etl.Core/ConventionOperations/ConventionSqlBatchOpeartion.cs
  12. +41 −0 Rhino.Etl.Core/DataReaders/Descriptor.cs
  13. +30 −0 Rhino.Etl.Core/DataReaders/DictionaryDescriptorAdapter.cs
  14. +55 −0 Rhino.Etl.Core/DataReaders/DictionaryEnumeratorDataReader.cs
  15. +447 −0 Rhino.Etl.Core/DataReaders/EnumerableDataReader.cs
  16. +132 −0 Rhino.Etl.Core/Enumerables/CachingEnumerable.cs
  17. +125 −0 Rhino.Etl.Core/Enumerables/EventRaisingEnumerator.cs
  18. +128 −0 Rhino.Etl.Core/Enumerables/ThreadSafeEnumerator.cs
  19. +154 −0 Rhino.Etl.Core/EtlProcess.cs
  20. +68 −0 Rhino.Etl.Core/EtlProcessBase.cs
  21. +41 −0 Rhino.Etl.Core/Exceptions/MissingKeyException.cs
  22. +48 −0 Rhino.Etl.Core/Exceptions/ParameterCountException.cs
  23. +35 −0 Rhino.Etl.Core/Exceptions/RhinoEtlException.cs
  24. +81 −0 Rhino.Etl.Core/Files/FileEngine.cs
  25. +118 −0 Rhino.Etl.Core/Files/FluentFile.cs
  26. +42 −0 Rhino.Etl.Core/IPipelineExecuter.cs
  27. +60 −0 Rhino.Etl.Core/ObjectArrayKeys.cs
  28. +58 −0 Rhino.Etl.Core/Operations/AbstractAggregationOperation.cs
  29. +37 −0 Rhino.Etl.Core/Operations/AbstractCommandOperation.cs
  30. +111 −0 Rhino.Etl.Core/Operations/AbstractDatabaseOperation.cs
  31. +108 −0 Rhino.Etl.Core/Operations/AbstractOperation.cs
  32. +65 −0 Rhino.Etl.Core/Operations/BranchingOperation.cs
  33. +66 −0 Rhino.Etl.Core/Operations/IOperation.cs
  34. +60 −0 Rhino.Etl.Core/Operations/InputCommandOperation.cs
  35. +276 −0 Rhino.Etl.Core/Operations/JoinOperation.cs
  36. +28 −0 Rhino.Etl.Core/Operations/JoinType.cs
  37. +249 −0 Rhino.Etl.Core/Operations/NestedLoopsJoinOperation.cs
  38. +83 −0 Rhino.Etl.Core/Operations/OperationStatistics.cs
  39. +64 −0 Rhino.Etl.Core/Operations/OutputCommandOperation.cs
  40. +137 −0 Rhino.Etl.Core/Operations/PartialProcessOperation.cs
  41. +101 −0 Rhino.Etl.Core/Operations/SqlBatchOperation.cs
  42. +118 −0 Rhino.Etl.Core/Operations/SqlBulkInsertOperation.cs
  43. +129 −0 Rhino.Etl.Core/Pipelines/AbstractPipelineExecuter.cs
  44. +23 −0 Rhino.Etl.Core/Pipelines/SingleThreadedPipelineExecuter.cs
  45. +44 −0 Rhino.Etl.Core/Pipelines/ThreadPoolPipelineExecuter.cs
  46. +416 −0 Rhino.Etl.Core/QuackingDictionary.cs
  47. +112 −0 Rhino.Etl.Core/Rhino.Etl.Core.csproj
  48. +5 −0 Rhino.Etl.Core/Rhino.Etl.Core.csproj.user
  49. +197 −0 Rhino.Etl.Core/Row.cs
  50. +111 −0 Rhino.Etl.Core/WithLoggingMixin.cs
  51. +54 −0 Rhino.Etl.Dsl/CompilerSteps/CorrelateTypesToModuleName.cs
  52. +31 −0 Rhino.Etl.Dsl/CompilerSteps/UseModuleNameAsNamespaceIfMissing.cs
  53. +82 −0 Rhino.Etl.Dsl/EtlDslEngine.cs
  54. +89 −0 Rhino.Etl.Dsl/Macros/AbstractChildMacro.cs
  55. +260 −0 Rhino.Etl.Dsl/Macros/AbstractClassGeneratorMacro.cs
  56. +39 −0 Rhino.Etl.Dsl/Macros/AccumulateMacro.cs
  57. +17 −0 Rhino.Etl.Dsl/Macros/AggregateMacro.cs
  58. +68 −0 Rhino.Etl.Dsl/Macros/GroupByMacro.cs
  59. +20 −0 Rhino.Etl.Dsl/Macros/InputMacro.cs
  60. +32 −0 Rhino.Etl.Dsl/Macros/JoinMacro.cs
  61. +53 −0 Rhino.Etl.Dsl/Macros/JoinSectionMacro.cs
  62. +15 −0 Rhino.Etl.Dsl/Macros/LeftMacro.cs
  63. +70 −0 Rhino.Etl.Dsl/Macros/OnMacro.cs
  64. +18 −0 Rhino.Etl.Dsl/Macros/OperationMacro.cs
  65. +20 −0 Rhino.Etl.Dsl/Macros/OutputMacro.cs
  66. +42 −0 Rhino.Etl.Dsl/Macros/ProcessMacro.cs
  67. +16 −0 Rhino.Etl.Dsl/Macros/RightMacro.cs
  68. +38 −0 Rhino.Etl.Dsl/Macros/TerminateMacro.cs
  69. +95 −0 Rhino.Etl.Dsl/Rhino.Etl.Dsl.csproj
  70. +40 −0 Rhino.Etl.Tests/Aggregation/AggregationFixture.cs
  71. +34 −0 Rhino.Etl.Tests/Aggregation/BaseAggregationFixture.cs
  72. +15 −0 Rhino.Etl.Tests/Aggregation/BaseDslTest.cs
  73. +26 −0 Rhino.Etl.Tests/Aggregation/CostPerProductAggregation.cs
  74. +22 −0 Rhino.Etl.Tests/Aggregation/RowCount.cs
  75. +8 −0 Rhino.Etl.Tests/App.config
  76. +45 −0 Rhino.Etl.Tests/BaseFibonacciTest.cs
  77. +69 −0 Rhino.Etl.Tests/BaseUserToPeopleTest.cs
  78. +29 −0 Rhino.Etl.Tests/Branches/BranchesFixture.cs
  79. +26 −0 Rhino.Etl.Tests/Branches/BranchingProcess.cs
  80. +18 −0 Rhino.Etl.Tests/Branches/MultiplyByThreeOperation.cs
  81. +18 −0 Rhino.Etl.Tests/Dsl/Aggregate.boo
  82. +36 −0 Rhino.Etl.Tests/Dsl/AggregationFixture.cs
  83. +41 −0 Rhino.Etl.Tests/Dsl/DatabaseToDatabaseWithTransformFixture.cs
  84. +42 −0 Rhino.Etl.Tests/Dsl/InnerJoin.boo
  85. +44 −0 Rhino.Etl.Tests/Dsl/JoinFixture.cs
  86. +22 −0 Rhino.Etl.Tests/Dsl/ResultsToList.cs
  87. +16 −0 Rhino.Etl.Tests/Dsl/UsersToPeople.boo
  88. +8 −0 Rhino.Etl.Tests/Dsl/UsersToPeople.boo.config
  89. +39 −0 Rhino.Etl.Tests/Errors/ErrorsFixture.cs
  90. +12 −0 Rhino.Etl.Tests/Errors/ErrorsProcess.cs
  91. +21 −0 Rhino.Etl.Tests/Errors/ThrowingOperation.cs
  92. +29 −0 Rhino.Etl.Tests/Fibonacci/Batch/BatchFibonacci.cs
  93. +24 −0 Rhino.Etl.Tests/Fibonacci/Batch/BatchFibonacciToDatabase.cs
  94. +29 −0 Rhino.Etl.Tests/Fibonacci/Bulk/BulkInsertFibonacciToDatabase.cs
  95. +19 −0 Rhino.Etl.Tests/Fibonacci/Bulk/FibonacciBulkInsert.cs
  96. +36 −0 Rhino.Etl.Tests/Fibonacci/FibonacciOperation.cs
  97. +17 −0 Rhino.Etl.Tests/Fibonacci/InMemoryFibonacci.cs
  98. +13 −0 Rhino.Etl.Tests/Fibonacci/Output/FibonacciOutput.cs
  99. +28 −0 Rhino.Etl.Tests/Fibonacci/Output/OutputFibonacciToDatabase.cs
  100. +8 −0 Rhino.Etl.Tests/Fibonacci/Output/Should.cs
  101. +30 −0 Rhino.Etl.Tests/InformationFixture.cs
  102. +38 −0 Rhino.Etl.Tests/Integration/DatabaseToDatabaseWithTransformations.cs
  103. +23 −0 Rhino.Etl.Tests/Integration/ReadUsers.cs
  104. +20 −0 Rhino.Etl.Tests/Integration/SplitName.cs
  105. +14 −0 Rhino.Etl.Tests/Integration/UsersToPeople.cs
  106. +23 −0 Rhino.Etl.Tests/Integration/WritePeople.cs
  107. +25 −0 Rhino.Etl.Tests/Joins/AddToResults.cs
  108. +23 −0 Rhino.Etl.Tests/Joins/AllStringsToUpperCase.cs
  109. +42 −0 Rhino.Etl.Tests/Joins/BaseJoinFixture.cs
  110. +17 −0 Rhino.Etl.Tests/Joins/BaseJoinUsersToPeople.cs
  111. +33 −0 Rhino.Etl.Tests/Joins/ComplexUsersToPeopleJoinProcess.cs
  112. +13 −0 Rhino.Etl.Tests/Joins/FullJoinUsersToPeopleByEmail.cs
  113. +21 −0 Rhino.Etl.Tests/Joins/GenericEnumerableOperation.cs
  114. +12 −0 Rhino.Etl.Tests/Joins/InnerJoinUsersToPeopleByEmail.cs
  115. +87 −0 Rhino.Etl.Tests/Joins/JoinFixture.cs
  116. +31 −0 Rhino.Etl.Tests/Joins/JoinInProcessFixture.cs
  117. +13 −0 Rhino.Etl.Tests/Joins/LeftJoinUsersToPeopleByEmail.cs
  118. +14 −0 Rhino.Etl.Tests/Joins/RightJoinUsersToPeopleByEmail.cs
  119. +29 −0 Rhino.Etl.Tests/Joins/TrivialUsersToPeopleJoinProcess.cs
  120. +20 −0 Rhino.Etl.Tests/LoadTest/AccumulateResults.cs
  121. +26 −0 Rhino.Etl.Tests/LoadTest/BatchUpdateUserNames.cs
  122. +22 −0 Rhino.Etl.Tests/LoadTest/BulkInsertUsers.cs
  123. +27 −0 Rhino.Etl.Tests/LoadTest/GenerateRandomIds.cs
  124. +33 −0 Rhino.Etl.Tests/LoadTest/GenerateUsers.cs
  125. +22 −0 Rhino.Etl.Tests/LoadTest/JoinUsersAndIds.cs
  126. +21 −0 Rhino.Etl.Tests/LoadTest/Join_250_000_UsersWithMostlyFallingOut.cs
  127. +79 −0 Rhino.Etl.Tests/LoadTest/LoadTestFixture.cs
  128. +26 −0 Rhino.Etl.Tests/LoadTest/LoadTestJoinsFixture.cs
  129. +23 −0 Rhino.Etl.Tests/LoadTest/PushDataToDatabase.cs
  130. +12 −0 Rhino.Etl.Tests/LoadTest/ReadUsers.cs
  131. +16 −0 Rhino.Etl.Tests/LoadTest/UpdateUserNames.cs
  132. +31 −0 Rhino.Etl.Tests/LoadTest/UpperCaseColumn.cs
  133. +17 −0 Rhino.Etl.Tests/LoadTest/UpperCaseUserNames.cs
  134. +29 −0 Rhino.Etl.Tests/OutputCommandFixture.cs
  135. +178 −0 Rhino.Etl.Tests/Rhino.Etl.Tests.csproj
  136. +30 −0 Rhino.Etl.Tests/SqlBatchOperationFixture.cs
  137. +31 −0 Rhino.Etl.Tests/SqlBulkInsertOperationFixture.cs
  138. +18 −0 Rhino.Etl.Tests/UsingDAL/ExportUsersToFile.cs
  139. +17 −0 Rhino.Etl.Tests/UsingDAL/GetAllUsers.cs
  140. +13 −0 Rhino.Etl.Tests/UsingDAL/ImportUsersFromFile.cs
  141. +23 −0 Rhino.Etl.Tests/UsingDAL/MySimpleDal.cs
  142. +21 −0 Rhino.Etl.Tests/UsingDAL/ReadUsersFromFile.cs
  143. +18 −0 Rhino.Etl.Tests/UsingDAL/SaveToDal.cs
  144. +39 −0 Rhino.Etl.Tests/UsingDAL/User.cs
  145. +12 −0 Rhino.Etl.Tests/UsingDAL/UserRecord.cs
  146. +40 −0 Rhino.Etl.Tests/UsingDAL/UsingDALFixture.cs
  147. +37 −0 Rhino.Etl.Tests/UsingDAL/WriteUsersToFile.cs
  148. +33 −0 Rhino.Etl.Tests/Util/DictionaryEnumeratorDataReaderFixture.cs
  149. +38 −0 Rhino.Etl.sln
  150. 0 ilmerge.exclude
View
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<Project
+ xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <PropertyGroup>
+ <ProjectName>Rhino.ETL</ProjectName>
+ <ShortName>rhino-etl</ShortName>
+ <SolutionFile>Rhino.Etl.sln</SolutionFile>
+ <FlattenZipFile>True</FlattenZipFile>
+ <SectionId>-1</SectionId>
+ <Version>2.0</Version>
+ <ClsCompliant>false</ClsCompliant>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <AssemblyInfo Include="Item">
+ <File>$(MSBuildProjectDirectory)\Rhino.ETL.Core\Properties\AssemblyInfo.cs</File>
+ </AssemblyInfo>
+ <AssemblyInfo Include="Item">
+ <File>$(MSBuildProjectDirectory)\Rhino.ETL.Dsl\Properties\AssemblyInfo.cs</File>
+ </AssemblyInfo>
+ <AssemblyInfo Include="Item">
+ <File>$(MSBuildProjectDirectory)\Rhino.ETL.Tests\Properties\AssemblyInfo.cs</File>
+ </AssemblyInfo>
+ <AssemblyInfo Include="Item">
+ <File>$(MSBuildProjectDirectory)\Rhino.ETL.Cmd\Properties\AssemblyInfo.cs</File>
+ </AssemblyInfo>
+ </ItemGroup>
+
+ <ItemGroup>
+ <TestAssembly Include="$(OutDir)\Rhino.ETL.Tests.dll"/>
+ </ItemGroup>
+
+ <ItemGroup>
+ <ZipFiles Include="$(OutDir)\Rhino.ETL.*.exe"/>
+ <ZipFiles Include="$(OutDir)\Rhino.ETL.*.dll"/>
+ <ZipFiles Include="$(OutDir)\Boo.Lang.dll"/>
+ <ZipFiles Include="$(OutDir)\Boo.Lang.Parser.dll"/>
+ <ZipFiles Include="$(OutDir)\Boo.Lang.Compiler.dll"/>
+ <ZipFiles Include="$(OutDir)\log4net.dll"/>
+ <ZipFiles Include="$(OutDir)\FileHelpers.dll"/>
+ </ItemGroup>
+
+ <Import Project="$(MSBuildProjectDirectory)\..\Common.build.xml"/>
+
+
+ <Target Name="BeforeZip">
+ <ILMerge
+ ToolPath="$(SharedLibsDir)\Tools\"
+ InputAssemblies="$(OutDir)\Rhino.Etl.Cmd.exe;
+ $(OutDir)\Rhino.Etl.Core.dll;
+ $(OutDir)\Rhino.Etl.Dsl.dll;
+ $(OutDir)\log4net.dll;
+ $(OutDir)\FileHelpers.dll;
+ $(OutDir)\Boo.Lang.Parser.dll;
+ $(OutDir)\Boo.Lang.Compiler.dll;
+ $(OutDir)\Boo.Lang.dll;"
+ ExcludeFile="$(MSBuildProjectDirectory)\ilmerge.exclude"
+ OutputFile="$(OutDir)\Rhino.Etl.exe"
+ LogFile="$(logFile)"
+ DebugInfo="true"
+ XmlDocumentation="true"
+ KeyFile="$(SharedLibsDir)\..\ayende-open-source.snk"
+ />
+ </Target>
+
+</Project>
@@ -0,0 +1,84 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{AAD5286D-943E-472A-A861-8C6F155C8712}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Rhino.Etl.Cmd</RootNamespace>
+ <AssemblyName>Rhino.Etl.Cmd</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Boo.Lang, Version=2.0.0.0, Culture=neutral, PublicKeyToken=32c39770e9a21a67, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\SharedLibs\Boo\Boo.Lang.dll</HintPath>
+ </Reference>
+ <Reference Include="Boo.Lang.Useful, Version=2.0.0.0, Culture=neutral, PublicKeyToken=32c39770e9a21a67, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\SharedLibs\Boo\Boo.Lang.Useful.dll</HintPath>
+ </Reference>
+ <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\Build\Rhino.Commons\log4net.dll</HintPath>
+ </Reference>
+ <Reference Include="Rhino.DSL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\Build\Rhino.Commons\Rhino.DSL.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="RhinoEtlRunner.cs" />
+ <Compile Include="RhinoEtlSetup.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="RhinoEtlCommandLineOptions.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Rhino.Etl.Core\Rhino.Etl.Core.csproj">
+ <Project>{DC42946E-5972-411C-A061-F2932E49C31F}</Project>
+ <Name>Rhino.Etl.Core</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Rhino.Etl.Dsl\Rhino.Etl.Dsl.csproj">
+ <Project>{D087E051-C099-468D-A3E7-4567DBBDFE69}</Project>
+ <Name>Rhino.Etl.Dsl</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="verbose.log4net.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="standard.log4net.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
@@ -0,0 +1,5 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <StartArguments>-f:d:\OSS\rhino-tools\rhino-etl2\Rhino.Etl\Rhino.Etl.Tests\Dsl\UsersToPeople.boo</StartArguments>
+ </PropertyGroup>
+</Project>
@@ -0,0 +1,16 @@
+namespace Rhino.Etl.Cmd
+{
+ using System;
+ using Boo.Lang.Useful.CommandLine;
+
+ [Serializable]
+ public class RhinoEtlCommandLineOptions : AbstractCommandLine
+ {
+ [Option("File name", ShortForm = "f", MinOccurs = 1, MaxOccurs = 1)]
+ public string File;
+ [Option("Process name", ShortForm = "p", MinOccurs = 0, MaxOccurs = 1)]
+ public string Process;
+ [Option("Verbse logging", ShortForm = "v", MaxOccurs = 1)]
+ public bool Verbose = false;
+ }
+}
@@ -0,0 +1,41 @@
+namespace Rhino.Etl.Cmd
+{
+ using System;
+ using System.IO;
+ using Core;
+ using log4net;
+ using log4net.Config;
+
+ public class RhinoEtlRunner : MarshalByRefObject
+ {
+ private readonly ILog log = LogManager.GetLogger(typeof (RhinoEtlRunner));
+
+ public static void SetupLogging(bool verbose)
+ {
+ string configurationName = "Rhino.Etl.Cmd.standard.log4net.config";
+ if (verbose)
+ configurationName = "Rhino.Etl.Cmd.verbose.log4net.config";
+ using (Stream stream = typeof(RhinoEtlSetup).Assembly.GetManifestResourceStream(configurationName))
+ XmlConfigurator.Configure(stream);
+ }
+
+ public void Start(Type type, bool verboseLogging)
+ {
+ try
+ {
+ SetupLogging(verboseLogging);
+ EtlProcess process = (EtlProcess)Activator.CreateInstance(type);
+ process.Execute();
+ foreach (Exception error in process.GetAllErrors())
+ {
+ log.Debug(error);
+ log.Error(error.Message);
+ }
+ }
+ catch (Exception e)
+ {
+ log.Error(e);
+ }
+ }
+ }
+}
@@ -0,0 +1,108 @@
+namespace Rhino.Etl.Cmd
+{
+ using System;
+ using System.IO;
+ using System.Reflection;
+ using Boo.Lang.Useful.CommandLine;
+ using Core;
+ using Dsl;
+ using log4net;
+ using log4net.Config;
+
+ public class RhinoEtlSetup
+ {
+ private readonly ILog log = LogManager.GetLogger(typeof(RhinoEtlSetup));
+
+
+ private static void Main(string[] args)
+ {
+ try
+ {
+ RhinoEtlCommandLineOptions options = new RhinoEtlCommandLineOptions();
+ try
+ {
+ options.Parse(args);
+ }
+ catch (CommandLineException e)
+ {
+ Console.WriteLine(e.Message);
+ options.PrintOptions();
+ return;
+ }
+ new RhinoEtlSetup().Execute(options);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(e);
+ }
+ }
+
+ private void Execute(RhinoEtlCommandLineOptions options)
+ {
+ RhinoEtlRunner.SetupLogging(options.Verbose);
+
+ log.DebugFormat("Starting with {0}", options.File);
+ try
+ {
+ string ext = Path.GetExtension(options.File).ToLower();
+ Type processType;
+ if(ext==".exe" || ext==".dll")
+ {
+ processType = GetFromAssembly(options);
+ }
+ else
+ {
+ processType = GetFromDslFile(options.File);
+ }
+
+ ExecuteProcessInSeparateAppDomain(processType, options);
+ }
+ catch (Exception e)
+ {
+ log.Debug(e);
+ log.Error(e.Message);
+ }
+ }
+
+ private static Type GetFromAssembly(RhinoEtlCommandLineOptions options)
+ {
+ Assembly asm = Assembly.ReflectionOnlyLoadFrom(options.File);
+ foreach (Type type in asm.GetTypes())
+ {
+ if(typeof(EtlProcess).IsAssignableFrom(type) && type.Name.Equals(options.Process, StringComparison.InvariantCultureIgnoreCase))
+ return type;
+ }
+ throw new InvalidOperationException("Could not find type nameed '" + options.Process + "' on: " +
+ options.File);
+ }
+
+ private static Type GetFromDslFile(string filename)
+ {
+ Type processType;
+ EtlProcess process = EtlDslEngine.Facotry.Create<EtlProcess>(filename);
+ processType = process.GetType();
+ return processType;
+ }
+
+ private void ExecuteProcessInSeparateAppDomain(Type processType, RhinoEtlCommandLineOptions options)
+ {
+ try
+ {
+ //we have to run the code in another appdomain, because we want to
+ //setup our own app.config for it
+ AppDomainSetup appDomainSetup = new AppDomainSetup();
+ appDomainSetup.ConfigurationFile = options.File + ".config";
+ AppDomain appDomain = AppDomain.CreateDomain("etl.domain", null, appDomainSetup);
+ appDomain.Load(processType.Assembly.GetName());
+ RhinoEtlRunner runner = (RhinoEtlRunner)appDomain.CreateInstanceAndUnwrap(typeof (RhinoEtlRunner).Assembly.GetName().FullName,
+ typeof (RhinoEtlRunner).FullName);
+ runner.Start(processType, options.Verbose);
+ }
+ catch (Exception e)
+ {
+ log.Debug(e);
+ log.Error(e.Message);
+ }
+ }
+ }
+}
@@ -0,0 +1,25 @@
+<log4net>
+
+ <appender name="ColoredConsoleAppender" type="log4net.Appender.ColoredConsoleAppender">
+ <mapping>
+ <level value="ERROR" />
+ <foreColor value="Red, HighIntensity" />
+ </mapping>
+ <mapping>
+ <level value="WARN" />
+ <foreColor value="Red" />
+ </mapping>
+ <mapping>
+ <level value="INFO" />
+ <foreColor value="Green" />
+ </mapping>
+ <layout type="log4net.Layout.PatternLayout">
+ <conversionPattern value="%date{HH:mm:ss.fff} %logger: %message%newline" />
+ </layout>
+ </appender>
+
+ <root>
+ <level value="INFO"/>
+ <appender-ref ref="ColoredConsoleAppender" />
+ </root>
+</log4net>
@@ -0,0 +1,28 @@
+<log4net>
+
+ <appender name="ColoredConsoleAppender" type="log4net.Appender.ColoredConsoleAppender">
+ <mapping>
+ <level value="ERROR" />
+ <foreColor value="Red, HighIntensity" />
+ </mapping>
+ <mapping>
+ <level value="WARN" />
+ <foreColor value="Red" />
+ </mapping>
+ <mapping>
+ <level value="INFO" />
+ <foreColor value="Green" />
+ </mapping>
+ <mapping>
+ <level value="DEBUG" />
+ <foreColor value="White" />
+ </mapping>
+ <layout type="log4net.Layout.PatternLayout">
+ <conversionPattern value="%date{HH:mm:ss.fff} %logger: %message %exception%newline" />
+ </layout>
+ </appender>
+
+ <root>
+ <appender-ref ref="ColoredConsoleAppender" />
+ </root>
+</log4net>
Oops, something went wrong.

0 comments on commit cda873a

Please sign in to comment.