Permalink
Browse files

Added a DifferenceWithFluentNHibernate to internalize most of the tas…

…ks of refresh database. Re-ILMerging the dll. Fixed refreshdatabase package so that it works. The migrator now logs the same as the console and msbuild task.
  • Loading branch information...
1 parent c37acb4 commit a6820d18d213e1f8c2009a2897fc1794163d2ba6 @ferventcoder ferventcoder committed Jun 6, 2011
View
@@ -1,24 +1,23 @@
-.svn
-build_output
-code_drop
-bin
-obj
-_ReSharper*
-
-*.suo
-*.user
-*.csproj.user
-*.resharper.user
-*.resharper
-*.ReSharper.user
-*.cache
-*~
-*.swp
-*.bak
-*.orig
-*.log
-
-TestResult.xml
-submit.xml
-SolutionVersion.cs
+.svn
+build_output
+code_drop
+bin
+obj
+_ReSharper*
+
+*.suo
+*.user
+*.csproj.user
+*.resharper.user
+*.ReSharper.user
+*.cache
+*~
+*.swp
+*.bak
+*.orig
+*.log
+
+TestResult.xml
+submit.xml
+SolutionVersion.cs
SolutionVersion.vb
View
@@ -0,0 +1,39 @@
+@echo off
+
+::Project UppercuT - http://uppercut.googlecode.com
+
+if '%2' NEQ '' goto usage
+if '%3' NEQ '' goto usage
+if '%1' == '/?' goto usage
+if '%1' == '-?' goto usage
+if '%1' == '?' goto usage
+if '%1' == '/help' goto usage
+
+SET APP_BDDDOC="..\lib\bdddoc\bdddoc.console.exe"
+SET TEST_ASSEMBLY_NAME="roundhouse.tests.dll"
+
+SET DIR=%~d0%~p0%
+
+SET build.config.settings="%DIR%Settings\UppercuT.config"
+"%DIR%lib\Nant\nant.exe" /f:.\build\compile.step -D:build.config.settings=%build.config.settings%
+
+if %ERRORLEVEL% NEQ 0 goto errors
+
+"%DIR%lib\Nant\nant.exe" /f:.\build\analyzers\test.step %1 -D:build.config.settings=%build.config.settings%
+"%DIR%lib\Nant\nant.exe" /f:.\build.custom\bdddoc.build -D:build.config.settings=%build.config.settings% -D:app.bdddoc=%APP_BDDDOC% -D:test_assembly=%TEST_ASSEMBLY_NAME%
+"%DIR%lib\Nant\nant.exe" /f:.\build.custom\bdddoc.build open_results
+
+if %ERRORLEVEL% NEQ 0 goto errors
+
+goto finish
+
+:usage
+echo.
+echo Usage: bdddoc.bat
+echo.
+goto finish
+
+:errors
+EXIT /B %ERRORLEVEL%
+
+:finish
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="BDDRunner" default="go">
+ <!-- Project UppercuT - http://projectuppercut.org -->
+ <!-- This is a sample for running BDDDoc -->
+ <property name="build.config.settings" value="__NONE__" overwrite="false" />
+ <include buildfile="${build.config.settings}" if="${file::exists(build.config.settings)}" />
+ <property name="dirs.current" value="${directory::get-parent-directory(project::get-buildfile-path())}" overwrite="false" />
+ <property name="dirs.lib" value="${dirs.current}\..\lib" overwrite="false" />
+ <property name="dirs.build" value="${dirs.current}\..\build_output" overwrite="false" />
+ <property name="dirs.build_artifacts" value="${path::get-full-path(dirs.build)}\build_artifacts" overwrite="false" />
+ <property name="dirs.test_results" value="${dirs.build_artifacts}\mbunit2" overwrite="false" />
+ <property name="file.test_results" value="mbunit-results" overwrite="false" />
+ <property name="dirs.bdddoc_results" value="${dirs.build_artifacts}\bdddoc" overwrite="false" />
+ <property name="files.bdddoc_results" value="${dirs.bdddoc_results}\bdddoc-results.html" overwrite="false" />
+ <property name="app.bdddoc" value="${path::get-full-path(dirs.lib)}\bdddoc\bdddoc.console.exe" overwrite="false" />
+ <property name="test_attribute" value="ObservationAttribute" overwrite="false" />
+ <property name="test_assembly" value="__TEST_ASSEMBLY__" overwrite="false" />
+ <property name="folder.app.drop" value="app" overwrite="false" />
+
+ <target name="go" depends="cleanup, run_bdddoc" description="Tests" />
+
+ <target name="cleanup">
+ <echo message="Removing and adding ${dirs.bdddoc_results}."/>
+ <delete dir="${dirs.bdddoc_results}" />
+ <mkdir dir="${dirs.bdddoc_results}" />
+ </target>
+
+ <target name="run_bdddoc" depends="cleanup" description="Running BDDDoc">
+ <echo message="Running BDDDoc against ${dirs.build}\${folder.app.drop}\${test_assembly} ${test_attribute} ${files.bdddoc_results} ${dirs.test_results}\${file.test_results}.xml."/>
+ <exec program="${app.bdddoc}" >
+ <arg file="${dirs.build}\${folder.app.drop}\${test_assembly}"/>
+ <arg value="${test_attribute}"/>
+ <arg file="${files.bdddoc_results}"/>
+ <arg file="${dirs.test_results}\${file.test_results}.xml"/>
+ </exec>
+ </target>
+
+ <target name="open_results">
+ <echo message="Opening results at ${path::get-full-path(files.bdddoc_results)}."/>
+ <exec
+ spawn="true"
+ program="${environment::get-folder-path('ProgramFiles')}\Internet Explorer\iexplore.exe"
+ commandline="${path::get-full-path(files.bdddoc_results)}"
+ >
+ </exec>
+ </target>
+
+</project>
@@ -52,10 +52,11 @@
<items>
<exclude name="${dirs.merge.from}\${file.merge.name}" />
<exclude name="${dirs.merge.from}\log4net.dll" />
- <include name="${dirs.merge.from}\roundhouse*.dll" />
<include name="${dirs.merge.from}\*.exe" />
+ <include name="${dirs.merge.from}\*.dll" />
+ <!--include name="${dirs.merge.from}\roundhouse*.dll" />
<include name="${dirs.merge.from}\NHibernate.JetDriver.dll" />
- <include name="${dirs.merge.from}\StructureMap.dll" />
+ <include name="${dirs.merge.from}\StructureMap.dll" /-->
</items>
</in>
<do>
@@ -87,12 +88,13 @@
<echo message="Removing unneeded assemblies before moving the merged assembly back into ${dirs.merge.from}."/>
<delete>
<fileset basedir="${dirs.merge.from}" >
- <exclude name="log4net*" />
- <include name="roundhouse*" />
+ <exclude name="log4net.dll" />
+ <include name="*.*" />
+ <!--include name="roundhouse*" />
<include name="*.exe" />
<include name="NHibernate.JetDriver.dll" />
<include name="StructureMap.dll" />
- <include name="Microsoft.Build.Framework.*" />
+ <include name="Microsoft.Build.Framework.*" /-->
</fileset>
</delete>
</target>
@@ -87,7 +87,7 @@
<echo message="Removing unneeded assemblies before moving the merged assembly back into ${dirs.merge.from}."/>
<delete>
<fileset basedir="${dirs.merge.from}" >
- <exclude name="log4net*" />
+ <exclude name="log4net.dll" />
<exclude name="Microsoft.Build.Framework.dll" />
<exclude name="roundhouse.tasks.dll" />
<exclude name="*.proj" />
@@ -15,7 +15,7 @@
<iconUrl>http://roundhouse.googlecode.com/svn/trunk/nuget/RoundhousE_Logo.NuGet.jpg</iconUrl>
<dependencies>
<dependency id="log4net" version="1.2.10" />
- <dependency id="FluentNHibernate" version="1.2.0.712" />
+ <!--dependency id="FluentNHibernate" version="1.2.0.712" /-->
</dependencies>
</metadata>
</package>
@@ -1,55 +0,0 @@
-// ==============================================================================
-//
-// Fervent Coder Copyright © 2011 - Released under the Apache 2.0 License
-//
-// Copyright 2007-2008 The Apache Software Foundation.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-// this file except in compliance with the License. You may obtain a copy of the
-// License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-// ==============================================================================
-namespace $rootnamespace$
-{
- using System.Diagnostics;
- using System.IO;
- using System.Reflection;
-
- public class CommandRunner
- {
- #region Methods
-
- public static int run(string process, string arguments, bool wait_for_exit)
- {
- var exit_code = -1;
- var psi = new ProcessStartInfo(Path.GetFullPath(process), arguments)
- {
- WorkingDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location),
- UseShellExecute = false,
- RedirectStandardOutput = false,
- CreateNoWindow = false
- };
-
- using (var p = new Process())
- {
- p.StartInfo = psi;
- p.Start();
- if (wait_for_exit)
- {
- p.WaitForExit();
- }
- exit_code = p.ExitCode;
- }
-
- return exit_code;
- }
-
- #endregion
- }
-}
@@ -1,82 +0,0 @@
-// ==============================================================================
-//
-// Fervent Coder Copyright © 2011 - Released under the Apache 2.0 License
-//
-// Copyright 2007-2008 The Apache Software Foundation.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-// this file except in compliance with the License. You may obtain a copy of the
-// License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-// ==============================================================================
-namespace $rootnamespace$
-{
- using System;
- using FluentNHibernate.Cfg;
- using FluentNHibernate.Cfg.Db;
- using log4net;
- using NHibernate;
- using NHibernate.Cfg;
-
- public class NHibernateSessionFactory
- {
- #region Constants
-
- private static readonly ILog logger = LogManager.GetLogger(typeof (NHibernateSessionFactory));
-
- #endregion
-
- #region Methods
-
- public static ISessionFactory build_session_factory<TYPE, CONVENTIONS_TYPE>(string db_server, string db_name, Action<Configuration> additional_function)
- {
- logger.Debug("Building Session Factory");
- return Fluently.Configure().Database(MsSqlConfiguration.MsSql2008.ConnectionString(c => c.Server(db_server).Database(db_name).TrustedConnection())).Mappings(m =>
- {
- //m.HbmMappings.AddFromAssemblyOf<TYPE>()
- m.FluentMappings.AddFromAssemblyOf<TYPE>().Conventions.AddFromAssemblyOf<CONVENTIONS_TYPE>();
- }).ExposeConfiguration(additional_function).BuildSessionFactory();
- }
-
- //#region new stuff
-
- //public static ISessionFactory build_session_factory(string db_server, string db_name, Assembly fluent_mapping_assembly, Assembly fluent_convention_assembly, Action<Configuration> additional_function)
- //{
- // logger.Debug("Building Session Factory");
- // return Fluently.Configure()
- // .Database(MsSqlConfiguration.MsSql2005
- // .ConnectionString(c => c.Server(db_server).Database(db_name).TrustedConnection())
- // )
- // .Mappings(m =>
- // {
- // register_maps_and_conventions(m, fluent_mapping_assembly, fluent_convention_assembly);
- // })
- // .ExposeConfiguration(additional_function)
- // .BuildSessionFactory();
-
- //}
-
- //private static FluentMappingsContainer register_maps_and_conventions(MappingConfiguration mapping_configuration, Assembly fluent_mapping_assembly, Assembly fluent_convention_assembly)
- //{
- // FluentMappingsContainer fluent_mappings = mapping_configuration.FluentMappings;
- // fluent_mappings.AddFromAssembly(fluent_mapping_assembly);
- // if (fluent_convention_assembly != null)
- // {
- // fluent_mappings.Conventions.AddAssembly(fluent_convention_assembly);
- // }
-
- // return fluent_mappings;
- //}
- //#endregion
-
- private static void no_operation(Configuration cfg) {}
-
- #endregion
- }
-}
Oops, something went wrong.

0 comments on commit a6820d1

Please sign in to comment.