Permalink
Browse files

stop using cmd /c with git versioner

  • Loading branch information...
ferventcoder committed Dec 14, 2013
1 parent ed8e5d8 commit ca38bd638ac876e9e9248c73471bcb254530c084
@@ -34,9 +34,10 @@
<property name="msbuild.outputpath" value="${dirs.build}${path.separator}${folder.app.drop}" overwrite="false" />
<property name="msbuild.outputpath.windows.mono" value="${string::replace(msbuild.outputpath,'\','/')}" />
<property name="solution.path" value="${dirs.current}${path.separator}${path_to_solution}${path.separator}${project.name}.sln" />
<property name="solution.path" value="${path::get-full-path(solution.path)}" />
<property name="solution.path.windows.mono" value="${string::replace(dirs.current,'\','/')}/${string::replace(path_to_solution,'\','/')}/${project.name}.sln" />
<property name="solution.path" value="${dirs.current}${path.separator}${path_to_solution}${path.separator}${project.name}.vbp" if="${microsoft.framework =='vb6'}" />
<property name="nant.settings.currentframework" value="mono-2.0" if="${platform::is-unix()}" />
<property name="nant.settings.currentframework" value="mono-4.0" if="${platform::is-unix()}" />
<property name="nant.settings.currentframework" value="net-3.5" if="${microsoft.framework !='vb6' and platform::is-windows()}" />
<property name="app.xbuild" value="C:\Program Files (x86)\Mono-2.8\bin\xbuild.bat" overwrite="false" if="${platform::is-windows() and file::exists('C:\Program Files (x86)\Mono-2.8\bin\xbuild.bat')}" />
<property name="app.xbuild" value="C:\Program Files\Mono-2.8\bin\xbuild.bat" overwrite="false" if="${platform::is-windows() and file::exists('C:\Program Files\Mono-2.8\bin\xbuild.bat')}" />
@@ -47,6 +48,8 @@
<property name="fail.build.on.error" value="true" />
<property name="app.ruby" value="C:\Ruby\bin\ruby.exe" overwrite="false" />
<property name="app.powershell" value="%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe" overwrite="false" />
<property name="app.nuget" value="..${path.separator}..${path.separator}${folder.references}${path.separator}NuGet${path.separator}NuGet.exe" overwrite="false" />
<property name="app.nuget" value="${path::get-full-path(app.nuget)}" />
<target name="go" depends="load_uppercut_assemblies, run_tasks" />
@@ -77,7 +80,7 @@
</target>
<target name="run_normal_tasks"
depends="error_check, set_vars, build_code, copy_documentation, copy_db"
depends="error_check, set_vars, restore_packages, build_code, copy_documentation, copy_db"
description="Compiling project." />
<target name="error_check">
@@ -103,6 +106,16 @@
<setenv name="EnableNuGetPackageRestore" value="true"/>
</target>
<target name="restore_packages" if="${file::exists(app.nuget)}">
<echo level="Warning" message="Finding and restoring all packages (${app.nuget} restore '${solution.path}')" />
<exec program="${app.nuget}"
workingdir="${dirs.build}"
commandline='restore "${solution.path}"' if="${platform::is-windows()}" />
<exec program="mono"
workingdir="${dirs.build}"
commandline="'${app.nuget}' restore '${solution.path}'" if="${platform::is-unix()}" />
</target>
<target name="build_code" depends="" description="Building Library">
<echo level="Warning" message="Compiling ${solution.path}."/>
<call target="build_dotNET_code" if="${microsoft.framework !='vb6'}" />
@@ -130,28 +143,28 @@
<mkdir dir="${msbuild.outputpath}" />
<if test="${platform::is-unix()}">
<!-- Do clean and build in two steps since xbuild has a bug with using OutputPath and Rebuild together Bug #628525 at Novell -->
<echo level="Warning" message="Cleaning build..." />
<echo level="Warning" message="Cleaning build..." if="${microsoft.framework.specific != 'mono-4.0'}" />
<exec program="${app.xbuild}"
basedir="/usr/bin"
workingdir="${dirs.build}"
commandline="${solution.path} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" />
commandline="${solution.path} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" if="${microsoft.framework.specific != 'mono-4.0'}" />
<echo level="Warning" message="Building..." />
<exec program="${app.xbuild}"
basedir="/usr/bin"
workingdir="${dirs.build}"
commandline="${solution.path} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger" />
commandline="${solution.path} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:minimal /toolsversion:${framework::get-version(microsoft.framework.specific)} /property:Platform='${msbuild.platform}' /property:TargetFrameworkVersion=v${framework::get-version(microsoft.framework.specific)} /l:${msbuild.logger};'${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml'" />
</if>
<if test="${platform::is-windows()}">
<!-- nant is retarded - I had to have four of these instead of throwing an if on the outputpath and targets -->
<if test="${msbuild.override_output_path}">
<if test="${framework.multitargeting}">
<if test="${framework::get-family(microsoft.framework.specific) == 'mono'}" >
<!-- Do clean and build in two steps since xbuild has a bug with using OutputPath and Rebuild together Bug #628525 at Novell -->
<echo level="Warning" message="Cleaning build..." />
<echo level="Warning" message="Cleaning build..." if="${microsoft.framework.specific != 'mono-4.0'}" />
<exec program="${app.xbuild}"
basedir="${dirs.build.windows.mono}"
workingdir="${dirs.build.windows.mono}"
commandline="${solution.path.windows.mono} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" />
commandline="${solution.path.windows.mono} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" if="${microsoft.framework.specific != 'mono-4.0'}" />
<echo level="Warning" message='Building...by running this command ${app.xbuild} ${solution.path.windows.mono} /nologo /property:OutputPath="${msbuild.outputpath.windows.mono}" /property:Configuration=${msbuild.configuration} /verbosity:minimal' />
<exec program="${app.xbuild}"
basedir="${dirs.build.windows.mono}"
@@ -180,11 +193,11 @@
<if test="${not framework.multitargeting}">
<if test="${framework::get-family(microsoft.framework.specific) == 'mono'}" >
<!-- Do clean and build in two steps since xbuild has a bug with using OutputPath and Rebuild together Bug #628525 at Novell -->
<echo level="Warning" message="Cleaning build..." />
<echo level="Warning" message="Cleaning build..." if="${microsoft.framework.specific != 'mono-4.0'}" />
<exec program="${app.xbuild}"
basedir="${dirs.build.windows.mono}"
workingdir="${dirs.build.windows.mono}"
commandline="${solution.path.windows.mono} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" />
commandline="${solution.path.windows.mono} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" if="${microsoft.framework.specific != 'mono-4.0'}" />
<echo level="Warning" message='Building without multitargeting by running this command ${app.xbuild} ${solution.path.windows.mono} /nologo /property:OutputPath="${msbuild.outputpath.windows.mono}" /property:Configuration=${msbuild.configuration} /verbosity:minimal' />
<exec program="${app.xbuild}"
basedir="${dirs.build.windows.mono}"
@@ -213,11 +226,11 @@
<if test="${framework.multitargeting}">
<if test="${framework::get-family(microsoft.framework.specific) == 'mono'}" >
<!-- Do clean and build in two steps since xbuild has a bug with using OutputPath and Rebuild together Bug #628525 at Novell -->
<echo level="Warning" message="Cleaning build..." />
<echo level="Warning" message="Cleaning build..." if="${microsoft.framework.specific != 'mono-4.0'}" />
<exec program="${app.xbuild}"
basedir="${dirs.build}"
workingdir="${dirs.build}"
commandline="${solution.path} /nologo /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" />
commandline="${solution.path} /nologo /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" if="${microsoft.framework.specific != 'mono-4.0'}" />
<echo level="Warning" message="Building..." />
<exec program="${app.xbuild}"
basedir="${dirs.build}"
@@ -244,11 +257,11 @@
<if test="${not framework.multitargeting}">
<if test="${framework::get-family(microsoft.framework.specific) == 'mono'}" >
<!-- Do clean and build in two steps since xbuild has a bug with using OutputPath and Rebuild together Bug #628525 at Novell -->
<echo level="Warning" message="Cleaning build..." />
<echo level="Warning" message="Cleaning build..." if="${microsoft.framework.specific != 'mono-4.0'}" />
<exec program="${app.xbuild}"
basedir="${dirs.build.windows.mono}"
workingdir="${dirs.build.windows.mono}"
commandline="${solution.path.windows.mono} /nologo /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" />
commandline="${solution.path.windows.mono} /nologo /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" if="${microsoft.framework.specific != 'mono-4.0'}" />
<echo level="Warning" message="Building...by running this command ${app.xbuild} ${solution.path.windows.mono} /nologo /property:Configuration=${msbuild.configuration} /verbosity:minimal" />
<exec program="${app.xbuild}"
basedir="${dirs.build.windows.mono}"
@@ -100,7 +100,7 @@
<nant buildfile="${dirs.current.file}${path.separator}policyChecks.step" inheritall="true" />
<nant buildfile="${dirs.current.file}${path.separator}versionBuilder.step" inheritall="true" />
<nant buildfile="${dirs.current.file}${path.separator}generateBuildInfo.step" inheritall="true" />
<nant buildfile="${dirs.current.file}${path.separator}manifestBuilder.step" inheritall="true" />
<!--FIX PATHING TO WORK ON *NIX FIRST nant buildfile="${dirs.current.file}${path.separator}manifestBuilder.step" inheritall="true" /-->
<nant buildfile="${dirs.current.file}${path.separator}compile.step" inheritall="true" />
<nant buildfile="${dirs.current.file}${path.separator}environmentBuilder.step" inheritall="true" />
<nant buildfile="${dirs.current.file}${path.separator}analyze.step" inheritall="true" />
@@ -99,7 +99,10 @@
<echo level="Warning" message="Running this: ${app.ilmerge} ${args.ilmerge}"/>
<exec program="${app.ilmerge}"
workingdir="${dirs.merge.from}"
commandline="${args.ilmerge}" />
commandline="${args.ilmerge}" if="${platform::is-windows()}" />
<exec program="mono"
workingdir="${dirs.merge.from}"
commandline="'${app.ilmerge}' ${args.ilmerge}" if="${platform::is-unix()}"/>
</target>
<target name="copy_configs">
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
@@ -93,21 +93,21 @@ public string get_version_from_describe()
infrastructure.logging.Log.bound_to(this).log_a_warning_event_containing(Project.BaseDirectory);
//run_external_application("cmd", git_path + " " + git_version_arguments + " > " + output_file, repo_directory, true);
infrastructure.logging.Log.bound_to(this).log_a_warning_event_containing("Running cmd /c {0} {1} on {2}", git_path, git_version_arguments, repo_path);
version_output = run_external_application("cmd", "/c " + git_path + " " + git_version_arguments, repo_directory, true);
infrastructure.logging.Log.bound_to(this).log_a_warning_event_containing("Running {0} {1} on {2}", git_path, git_version_arguments, repo_path);
version_output = run_external_application(git_path, git_version_arguments, repo_directory, true);
git_describe_output = version_output.ReadToEnd();
if (git_describe_output.to_lower().Contains("fatal") || string.IsNullOrEmpty(git_describe_output))
{
infrastructure.logging.Log.bound_to(this).log_a_warning_event_containing("Running cmd /c {0} {1} on {2}", git_path, git_create_tag_arguments, repo_path);
infrastructure.logging.Log.bound_to(this).log_a_warning_event_containing("Running {0} {1} on {2}", git_path, git_create_tag_arguments, repo_path);
had_to_create_tags = true;
run_external_application("cmd", "/c " + git_path + " " + git_create_tag_arguments, repo_directory, true);
run_external_application(git_path, git_create_tag_arguments, repo_directory, true);
}
if (had_to_create_tags)
{
infrastructure.logging.Log.bound_to(this).log_a_warning_event_containing("Running cmd /c {0} {1} on {2}", git_path, git_version_arguments, repo_path);
version_output = run_external_application("cmd", "/c " + git_path + " " + git_version_arguments, repo_directory, true);
infrastructure.logging.Log.bound_to(this).log_a_warning_event_containing("Running {0} {1} on {2}", git_path, git_version_arguments, repo_path);
version_output = run_external_application(git_path, git_version_arguments, repo_directory, true);
git_describe_output = version_output.ReadToEnd();
}
@@ -121,8 +121,8 @@ public string get_sha1_hash()
infrastructure.logging.Log.bound_to(this).log_a_warning_event_containing(Project.BaseDirectory);
//run_external_application("cmd", git_path + " " + git_version_arguments + " > " + output_file, repo_directory, true);
infrastructure.logging.Log.bound_to(this).log_a_warning_event_containing("Running cmd /c {0} {1} on {2}", git_path, git_sha1_hash_arguments, repo_path);
hash_output = run_external_application("cmd", "/c " + git_path + " " + git_sha1_hash_arguments, repo_directory, true);
infrastructure.logging.Log.bound_to(this).log_a_warning_event_containing("Running {0} {1} on {2}", git_path, git_sha1_hash_arguments, repo_path);
hash_output = run_external_application(git_path, git_sha1_hash_arguments, repo_directory, true);
git_sha1_hash_output = hash_output.ReadToEnd();
try

0 comments on commit ca38bd6

Please sign in to comment.