Copy Output to $(OutDir)

Topics: User Forum
May 11, 2011 at 2:58 PM

We are building the Sandcastle Documentation on a build server using the latest and things are working well and the build is succeeding but nothing ends up in the drop folder. 

We are using Team Build 2010 and are just adding the SHFBPROJ file to the list of the projects to build proceeded by the 2 solutions that contain the projects that we referenced in the SHFBPROJ.  The outputs from the two solutions get built and copied to the drop folder just fine but the SHFBPROJ file output does not get copied to the drop folder.

When we look at the MSBUILD command line that Team Build generates it correctly specifies OutDir:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe /nologo /noconsolelogger "C:\TFSBuilds\195\foo\Main - Documentation\Sources\foo\SDK\fooSDK_Help.shfbproj" /m:1 /fl /flp:"logfile=C:\TFSBuilds\195\foo\Main - Documentation\Sources\foo\SDK\fooSDK_Help.log;encoding=Unicode;verbosity=normal" /p:SkipInvalidConfigurations=true /p:SHFBROOT="C:\TFSBuilds\195\foo\Main - Documentation\Sources\foo\build\SandcastleHelpFileBuilder\\" /p:SandcastlePath="C:\TFSBuilds\195\foo\Main - Documentation\Sources\foo\build\Sandcastle\\" /p:ReferencePath="C:\TFSBuilds\195\foo\Main - Documentation\Sources\foo\References\\" /p:OutDir="C:\TFSBuilds\195\foo\Main - Documentation\Binaries\\" /p:VCBuildOverride="C:\TFSBuilds\195\foo\Main - Documentation\Sources\foo\SDK\fooSDK_Help.shfbproj.vsprops"  /dl:WorkflowCentralLogger,"C:\Program Files\Microsoft Team Foundation Server 2010\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;BuildUri=vstfs:///Build/Build/247769;InformationNodeId=275480026;TargetsNotLogged=GetNativeManifest,GetCopyToOutputDirectoryItems,GetTargetPath;TFSUrl=http://tfsserver:8080/tfs/tfsCollection;"*WorkflowForwardingLogger,"C:\Program Files\Microsoft Team Foundation Server 2010\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;"

I did some digging in the code for SHFB and it looks like we only used $(OutDir) when looking for the assemblies that any projects would output.  For all of the output we $(OutputPath).  Is this expected?  It would seem that when building if $(OutDir) is specified we should use that to place the final output. 

I was just curious what others that are building on a build server have done? 

Coordinator
May 11, 2011 at 8:14 PM

SHFB uses the project's OutputPath property to determine where the output is written.  You can override it from the command line.  Another alternative is to use the Output Deployment plug-in to copy the output where you want it.  Be aware that if building website output, it will clear the target folder prior to copying the content to it.  That's one reason not to have SHFB automatically use the $(OutDir) setting.

Eric

 

May 12, 2011 at 2:51 PM

Thanks for the feedback.  I tried the Output Deployment plug-in and I just typed in $(OutDir) but that did not work well in the local build and just wrote it to a folder called $(OutDir).  I will test on the build server.  I did work around by manually editing the SHFBPROJ file with:

    <!-- SHFB properties -->
    <OutputPath Condition="'$(OutDir)' == ''">..\Target\Help\</OutputPath>
    <OutputPath Condition="'$(OutDir)' != ''">$(OutDir)</OutputPath>

That is working but will run into the problem that you mentioned with the out directory getting deleted if we move to the WebSite.

Thanks,

Zach