lib/build/analyzers/ncover.step in uppercutbuild-1.3.0.0 vs lib/build/analyzers/ncover.step in uppercutbuild-1.4.0.0
- old
+ new
@@ -36,65 +36,40 @@
<property name="tests.excluded_categories.comma_separated" value="Database,Integration,Slow,NotWorking" overwrite="false" />
<property name="test.args" value="" />
<property name="test.args" value="/rt:Text /rnf:mbUnit /rf:"${dirs.ncover_results}" /ec:${tests.excluded_categories.comma_separated}" if="${test.framework=='mbunit2'}" />
<property name="test.args" value="/xml:"${dirs.ncover_results}${path.separator}nunit-results.xml" /nologo /framework=${microsoft.framework} /exclude:${tests.excluded_categories.comma_separated}" if="${test.framework=='nunit'}" />
<!--property name="test.args" value="/xml:"${dirs.ncover_results}\nunit-results.xml" /nologo /framework=${microsoft.framework} /exclude:${tests.excluded_categories.comma_separated}" if="${test.framework=='nunit'}" /-->
- <property name="file.custom.step.before" value="${dirs.build_scripts_custom}${path.separator}${file.current.no_extension}.pre.step" />
- <property name="file.custom.step.after" value="${dirs.build_scripts_custom}${path.separator}${file.current.no_extension}.post.step" />
- <property name="file.custom.step.replace" value="${dirs.build_scripts_custom}${path.separator}${file.current.no_extension}.replace.step" />
<property name="is.replaced" value="false" />
<property name="fail.build.on.error" value="false" />
<target name="go" depends="run_tasks" if="${file::exists(app.ncover) and test.framework !='none'}" />
- <target name="run_tasks">
- <echo message="Running ${project::get-name()} tasks." />
+ <target name="run_tasks" if="${file::exists(app.ncover) and test.framework !='none'}">
+ <echo level="Warning" message="" />
+ <echo level="Warning" message="====================" />
+ <echo level="Warning" message="${project::get-name()}" />
+ <echo level="Warning" message="====================" />
<call target="prepare" if="${target::exists('prepare')}" />
- <call target="custom_tasks_before" if="${target::exists('custom_tasks_before')}" />
- <call target="custom_tasks_replace" if="${target::exists('custom_tasks_replace')}" />
+ <customExtension extends="${project::get-buildfile-path()}" type="pre" failonerror="${fail.build.on.error}" />
+ <customExtension extends="${project::get-buildfile-path()}" type="replace" failonerror="${fail.build.on.error}" />
<call target="run_normal_tasks" if="${not is.replaced}" />
- <call target="custom_tasks_after" if="${target::exists('custom_tasks_after')}" />
+ <customExtension extends="${project::get-buildfile-path()}" type="post" failonerror="${fail.build.on.error}" />
</target>
<target name="run_normal_tasks"
depends="get_test_dlls, ncover, ncover_explorer"
description="Using NCover to Analyze project for test quality indicators."
if="${file::exists(app.ncover) and test.framework !='none'}" />
- <target name="custom_tasks_before">
- <echo message="Running custom tasks if ${file.custom.step.before} exists." />
- <nant buildfile="${file.custom.step.before}" inheritall="true" if="${file::exists(file.custom.step.before)}" failonerror="${fail.build.on.error}" />
- <exec program="powershell.exe" if="${file::exists(file.custom.step.before + '.ps1')}" failonerror="${fail.build.on.error}">
- <arg value="${path::get-full-path(file.custom.step.before + '.ps1')}" />
- </exec>
- <exec program="ruby.exe" if="${file::exists(file.custom.step.before + '.rb')}" failonerror="${fail.build.on.error}">
- <arg value="${path::get-full-path(file.custom.step.before + '.rb')}" />
- </exec>
- </target>
-
- <target name="custom_tasks_replace">
- <echo message="Running custom tasks instead of normal tasks if ${file.custom.step.replace} exists." />
- <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace)}" />
- <nant buildfile="${file.custom.step.replace}" inheritall="true" if="${file::exists(file.custom.step.replace)}" failonerror="${fail.build.on.error}" />
- <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace + '.ps1')}" />
- <exec program="powershell.exe" if="${file::exists(file.custom.step.replace + '.ps1')}" failonerror="${fail.build.on.error}" >
- <arg value="${path::get-full-path(file.custom.step.replace + '.ps1')}" />
- </exec>
- <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace + '.rb')}" />
- <exec program="ruby.exe" if="${file::exists(file.custom.step.replace + '.rb')}" failonerror="${fail.build.on.error}" >
- <arg value="${path::get-full-path(file.custom.step.replace + '.rb')}" />
- </exec>
- </target>
-
<target name="prepare">
- <echo message="Removing and adding ${dirs.ncover_results}."/>
+ <echo level="Warning" message="Removing and adding ${dirs.ncover_results}."/>
<delete dir="${dirs.ncover_results}" failonerror="false" />
<mkdir dir="${dirs.ncover_results}" />
</target>
<target name="get_test_dlls">
- <echo message="Getting test dlls based on name in directory ${path::get-full-path(dirs.build.code)}." />
+ <echo level="Warning" message="Getting test dlls based on name in directory ${path::get-full-path(dirs.build.code)}." />
<property name="dll.names" value="" />
<foreach item="File" property="dll.filename">
<in>
<items>
<exclude name="${dirs.build.code}${path.separator}lib${path.separator}**" />
@@ -109,17 +84,17 @@
<property name="dll.names" value="${dll.names + ' ' + string::replace(string::replace(dll.filename,path::get-full-path(dirs.build.code) + '\',''),'\',path.separator) + ''}" />
</do>
</foreach>
<property name="dlls.test" value="${dll.names}" />
- <echo message="Running NCover against these test dlls - ${dlls.test}." />
+ <echo level="Warning" message="Running NCover against these test dlls - ${dlls.test}." />
<property name="args.test_runner" value="${dlls.test} ${test.args}" />
</target>
<target name="ncover" if="${file::exists(app.ncover) and file::exists(app.ncover.tester)}" >
- <echo message="Attempting to run NCover. Creating file at ${file.ncover_results} and logging at ${file.ncover_log}." />
+ <echo level="Warning" message="Attempting to run NCover. Creating file at ${file.ncover_results} and logging at ${file.ncover_log}." />
<ncover program="${app.ncover}"
commandLineExe="${app.ncover.tester}"
commandLineArgs="${args.test_runner}"
workingDirectory="${dirs.build.code}"
coverageFile="${file.ncover_results}"
@@ -137,11 +112,11 @@
</assemblies>
</ncover>
</target>
<target name="ncover_explorer" depends="ncover" if="${file::exists(app.ncover.explorer)}" >
- <echo message="Attempting to run NCoverExplorer. Creating HTML results file at ${file.html.code_coverage_results} and XML results file at ${file.xml.code_coverage_results}." />
+ <echo level="Warning" message="Attempting to run NCoverExplorer. Creating HTML results file at ${file.html.code_coverage_results} and XML results file at ${file.xml.code_coverage_results}." />
<ncoverexplorer
program="${app.ncover.explorer}"
projectName="${project.name}"
reportType="4"
outputDir="${dirs.ncover_results}"
@@ -166,21 +141,10 @@
</exclusions>
</ncoverexplorer>
</target>
<target name="open_results">
- <echo message="Opening results - ${path::get-full-path(dirs.ncover_results) + path.separator + file.html.code_coverage_results}" />
+ <echo level="Warning" message="Opening results - ${path::get-full-path(dirs.ncover_results) + path.separator + file.html.code_coverage_results}" />
<results display="${path::get-full-path(dirs.ncover_results) + path.separator + file.html.code_coverage_results}" />
- </target>
-
- <target name="custom_tasks_after">
- <echo message="Running custom tasks if ${file.custom.step.after} exists." />
- <nant buildfile="${file.custom.step.after}" inheritall="true" if="${file::exists(file.custom.step.after)}" failonerror="${fail.build.on.error}" />
- <exec program="powershell.exe" if="${file::exists(file.custom.step.after + '.ps1')}" failonerror="${fail.build.on.error}" >
- <arg value="${path::get-full-path(file.custom.step.after + '.ps1')}" />
- </exec>
- <exec program="ruby.exe" if="${file::exists(file.custom.step.after + '.rb')}" failonerror="${fail.build.on.error}" >
- <arg value="${path::get-full-path(file.custom.step.after + '.rb')}" />
- </exec>
</target>
</project>
\ No newline at end of file