Env var SHFBROOT causes automated build issues

Topics: User Forum
Sep 4, 2009 at 6:12 PM

I've just started to have a go with Sandcastle and the Help File Builder which has really made things very simple. My one issue / concern is that the tool requires that the SHFBROOT variable is registered in the environment properties, either manually or by installing the tool.

The problem is that we use a build server farm where very little is installed on the buildservers and almost everything each build requires is included in source control. The tool allows for the Sandcastle assemblies and help file compilers to be located elsewhere but does not do the same for itself.

I have tried to override the SHFBROOT variable but this doesn't work as the msbuild tasks generate another proj file which again tries to use the original SHFBROOT variable from the environment properties.

Would it be feasible to make this value more configurable in a future release?

Coordinator
Sep 4, 2009 at 8:30 PM

The SHFBROOT environment variable is used to import the Sandcastle Build targets file.  You'll find the one and only reference to it at the bottom of each .shfbproj file.  You can replace it with a hard coded absolute or relative path to eliminate the reference to it.  It's evaluated by MSBuild when the project file is loaded so it can't really be configured within the project itself like the other path properties.  At best you could add a property item for it to define a default path if one isn't already set which may be another solution.  Add it to the end of the main PropertyGroup element within the project file:

<SHFBROOT Condition="'$(SHFBROOT)' == ''">C:\PathTo\SHFB\TargetsFile\</SHFBROOT>

Eric

 

Sep 7, 2009 at 12:19 PM

Hi Eric,

Thanks for the response. Yes I saw the reference to the variable at the bottom of the project file and I have tried overriding it by passing in the value via msbuild (not as a property as you have suggested). This works to a point however there is another project file (GenerateRefInfo.proj) which gets generated during the build and placed within the working directory which also uses the SHFBROOT variable and I believe this is the point it is breaking. 

Coordinator
Sep 7, 2009 at 7:34 PM

That's one of the template files used during the build process.  You can find them in the .\Templates folder in the SHFB installation folder.  You can edit the .proj files found there in a similar manner.  I can probably add the property to them noted in my last reply so that they resolve it to the proper folder if not defined automatically.

Eric

 

Coordinator
Sep 7, 2009 at 7:38 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.