Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert to sdk-style projects #285

Merged
merged 17 commits into from
Oct 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ App_Data
*.sln.docstates
*.results.xml
*.bak
.vs
.idea

TestResult.xml
submit.xml
Expand Down
6 changes: 0 additions & 6 deletions .nuget/NuGet.Config

This file was deleted.

Binary file removed .nuget/NuGet.exe
Binary file not shown.
52 changes: 0 additions & 52 deletions .nuget/NuGet.targets

This file was deleted.

70 changes: 70 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/usr/bin/env powershell

$MSBUILD=msbuild

$root = $PSScriptRoot;

$CODEDROP="$($root)\code_drop";
$LOGDIR="$($CODEDROP)\log";

$TESTOUTDIR="$($root)\product\roundhouse.tests\bin"

$onAppVeyor = $("$($env:APPVEYOR)" -eq "True");

pushd $root


"`n * Generating version number"
$gitVersion = (GitVersion | ConvertFrom-Json)

If ($onAppVeyor) {
$newVersion="$($gitVersion.FullSemVer).$env:APPVEYOR_BUILD_NUMBER"
Write-host " - Updating appveyor build version to: $newVersion"
$env:APPVEYOR_BUILD_VERSION="$newVersion"
appveyor UpdateBuild -Version "$newVersion"
}

"`n * Restoring nuget packages"
nuget restore -NonInteractive -Verbosity quiet

# Create output and log dirs if they don't exist (don't know why this is necessary - works on my box...)
If (!(Test-Path $CODEDROP)) {
$null = mkdir $CODEDROP;
}
If (!(Test-Path $LOGDIR)) {
$null = mkdir $LOGDIR;
}


"`n * Building and packaging"
msbuild /t:"Build;Pack" /p:DropFolder=$CODEDROP /p:Version="$($gitVersion.FullSemVer)" /p:NoPackageAnalysis=true /nologo /v:m /fl /flp:"LogFile=$LOGDIR\msbuild.log;Verbosity=n" /p:Configuration=Build /p:Platform="Any CPU"

# Workaround until test filter is updated - remove then.
If ($onAppVeyor) {
dir -r product/roundhouse.tests.integration -i roundhouse.tests.integration.dll | % {
rm -fo $_;
}
}

# AppVeyor runs the test automagically, no need to run explicitly with nunit-console.exe.
# But we want to run the tests on localhost too.
If (! $onAppVeyor) {

# Find nunit3-console dynamically
"`n * Looking for nunit3-console.exe"

$nugetRoot = $env:NUGET_PACKAGES;
If ("$($nugetRoot)" -eq "") {
$nugetRoot = "~/.nuget"
}

$nunit = $(dir -r "$($nugetRoot)/packages/nunit*" -i nunit3-console.exe | Select-Object -last 1)

" - Found at $($nunit)"

"`n * Running unit tests`n"
$tests = $(dir -r "$($TESTOUTDIR)" -i *.tests.dll);
& $nunit --noheader --noresult --output "$($LOGDIR)/nunit.log" --err="$($LOGDIR)/nunit.errlog" $tests
}

popd
70 changes: 16 additions & 54 deletions build/compile.step
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<property name="dirs.build_results" value="${dirs.build_artifacts}${path.separator}compile" overwrite="false" />
<property name="msbuild.logger" value="ThoughtWorks.CruiseControl.MSBuild.XmlLogger,&quot;${dirs.lib}${path.separator}NAnt${path.separator}ThoughtWorks.CruiseControl.MSBuild.dll&quot;" />
<property name="path_to_solution" value="." overwrite="false" />
<property name="microsoft.framework" value="net-3.5" overwrite="false" />
<property name="microsoft.framework" value="net-4.0" overwrite="false" />
<property name="msbuild.configuration" value="Release" overwrite="false" />
<property name="msbuild.platform" value="Any CPU" overwrite="false" />
<property name="msbuild.override_output_path" value="true" overwrite="false" />
Expand All @@ -37,10 +37,11 @@
<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="net-3.5" if="${microsoft.framework !='vb6' and platform::is-windows()}" />
<property name="nant.settings.currentframework" value="net-4.0" 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')}" />
<property name="app.xbuild" value="xbuild" overwrite="false" if="${platform::is-unix()}" />
<property name="app.msbuild" value="msbuild" overwrite="false" />
<property name="framework.multitargeting" value="false" />
<property name="framework.multitargeting.delimiter" value="," />
<property name="is.replaced" value="false" />
Expand Down Expand Up @@ -159,21 +160,10 @@
commandline='${solution.path.windows.mono} /nologo /property:OutputPath="${msbuild.outputpath.windows.mono}" /property:Configuration=${msbuild.configuration} /verbosity:minimal' />
</if>
<if test="${framework::get-family(microsoft.framework.specific) != 'mono'}" >
<msbuild project="${solution.path}" verbosity="minimal" if="${microsoft.framework.specific != 'net-1.0' and microsoft.framework.specific != 'net-1.1'}">
<property name="Configuration" value="${msbuild.configuration}" />
<property name="OutputPath" value="${msbuild.outputpath}" />
<property name="Platform" value="${msbuild.platform}" />
<property name="TargetFrameworkVersion" value="v${framework::get-version(microsoft.framework.specific)}" />
<property name="ToolsVersion" value="${framework::get-version(microsoft.framework.specific)}" />
<!--property name="Logger" value="${msbuild.logger};&quot;${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml&quot;" /-->
<arg line="/l:${msbuild.logger};&quot;${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml&quot;" />
</msbuild>
<solution
configuration="${msbuild.configuration}"
solutionfile="${solution.path}"
outputdir="${msbuild.outputpath}"
platform="${msbuild.platform}"
if="${microsoft.framework.specific == 'net-1.0' or microsoft.framework.specific == 'net-1.1'}"
<exec program="${app.msbuild}"
basedir="${dirs.build}"
workingdir="${dirs.build}"
commandline='${solution.path} /nologo /property:OutputPath="${msbuild.outputpath}" /property:Configuration=${msbuild.configuration} /verbosity:minimal /property:Platform=${msbuild.platform} /l:${msbuild.logger};&quot;${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml&quot;'
/>
</if>
</if>
Expand All @@ -192,19 +182,9 @@
commandline='${solution.path.windows.mono} /nologo /property:OutputPath="${msbuild.outputpath.windows.mono}" /property:Configuration=${msbuild.configuration} /verbosity:minimal' />
</if>
<if test="${framework::get-family(microsoft.framework.specific) != 'mono'}" >
<msbuild project="${solution.path}" verbosity="minimal" if="${microsoft.framework.specific != 'net-1.0' and microsoft.framework.specific != 'net-1.1'}">
<property name="Configuration" value="${msbuild.configuration}" />
<property name="OutputPath" value="${msbuild.outputpath}" />
<property name="Platform" value="${msbuild.platform}" />
<!--property name="Logger" value="${msbuild.logger};&quot;${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml&quot;" /-->
<arg line="/l:${msbuild.logger};&quot;${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml&quot;" />
</msbuild>
<solution
configuration="${msbuild.configuration}"
solutionfile="${solution.path}"
outputdir="${msbuild.outputpath}"
platform="${msbuild.platform}"
if="${microsoft.framework.specific == 'net-1.0' or microsoft.framework.specific == 'net-1.1'}"
<exec program="${app.msbuild}"
workingdir="${dirs.build}"
commandline='${solution.path} /nologo /property:OutputPath="${msbuild.outputpath}" /property:Configuration="${msbuild.configuration}" /verbosity:minimal /property:Platform="${msbuild.platform}" /l:${msbuild.logger};&quot;${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml&quot;'
/>
</if>
</if>
Expand All @@ -225,19 +205,9 @@
commandline="${solution.path} /nologo /property:Configuration=${msbuild.configuration} /verbosity:minimal" />
</if>
<if test="${framework::get-family(microsoft.framework.specific) != 'mono'}" >
<msbuild project="${solution.path}" verbosity="minimal" if="${microsoft.framework.specific != 'net-1.0' and microsoft.framework.specific != 'net-1.1'}">
<property name="Configuration" value="${msbuild.configuration}" />
<property name="Platform" value="${msbuild.platform}" />
<property name="TargetFrameworkVersion" value="v${framework::get-version(microsoft.framework.specific)}" />
<property name="ToolsVersion" value="${framework::get-version(microsoft.framework.specific)}" />
<!--property name="Logger" value="${msbuild.logger};&quot;${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml&quot;" /-->
<arg line="/l:${msbuild.logger};&quot;${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml&quot;" />
</msbuild>
<solution
configuration="${msbuild.configuration}"
solutionfile="${solution.path}"
platform="${msbuild.platform}"
if="${microsoft.framework.specific == 'net-1.0' or microsoft.framework.specific == 'net-1.1'}"
<exec program="${app.msbuild}"
workingdir="${dirs.build}"
commandline='${solution.path} /nologo /property:OutputPath="${msbuild.outputpath}" /property:Configuration="${msbuild.configuration}" /verbosity:minimal /property:Platform="${msbuild.platform}" /l:${msbuild.logger};&quot;${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml&quot;'
/>
</if>
</if>
Expand All @@ -256,17 +226,9 @@
commandline="${solution.path.windows.mono} /nologo /property:Configuration=${msbuild.configuration} /verbosity:minimal" />
</if>
<if test="${framework::get-family(microsoft.framework.specific) != 'mono'}" >
<msbuild project="${solution.path}" verbosity="minimal" if="${microsoft.framework.specific != 'net-1.0' and microsoft.framework.specific != 'net-1.1'}">
<property name="Configuration" value="${msbuild.configuration}" />
<property name="Platform" value="${msbuild.platform}" />
<!--property name="Logger" value="${msbuild.logger};&quot;${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml&quot;" /-->
<arg line="/l:${msbuild.logger};&quot;${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml&quot;" />
</msbuild>
<solution
configuration="${msbuild.configuration}"
solutionfile="${solution.path}"
platform="${msbuild.platform}"
if="${microsoft.framework.specific == 'net-1.0' or microsoft.framework.specific == 'net-1.1'}"
<exec program="${app.msbuild}"
workingdir="${dirs.build}"
commandline='${solution.path} /nologo /property:OutputPath="${msbuild.outputpath}" /property:Configuration="${msbuild.configuration}" /verbosity:minimal /property:Platform="${msbuild.platform}" /l:${msbuild.logger};&quot;${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml&quot;'
/>
</if>
</if>
Expand Down
1 change: 1 addition & 0 deletions build/default.build
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
<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" />
<nant buildfile="${dirs.current.file}${path.separator}nugetRestore.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" />
Expand Down
20 changes: 20 additions & 0 deletions build/nugetRestore.step
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<project name="Compiler" default="go">
<property name="solution.path" value="${dirs.current}${path.separator}${path_to_solution}${path.separator}${project.name}.sln" />
<property name="app.nuget" value="nuget" />

<target name="go" depends="run_tasks" />

<target name="run_tasks">
<call target="restore" if="${target::exists('restore')}" />
</target>


<target name="restore">
<echo level="Warning" message="Nuget restore ${project::get-name()}" />
<exec program="${app.nuget}"
workingdir="${dirs.build}"
commandline="restore ${solution.path}" />
</target>

</project>
Loading