Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have a program I'm working on that my company uses internally, but is also sent to vendors. The vendor version will be identical, except that it will be missing some features, and use an installer. I only have to remove 2 lines from an XML file, and it's good for external use.

Is there some "typical" method to create a project like this without having to maintain separate codebases for each project?

If it makes any difference, program is written in C#, developed using Visual Studio 2010, compiled as a dll, runs on Windows 7.

share|improve this question
    
What is your build environment? –  MichaelT Dec 28 '12 at 15:26
    
@MichaelT Not sure exactly what you mean. I have the computer environment in the question. I'm one of 2 developers in an Engineering company. The dll is an addin for Autodesk Inventor. –  Brandon Dec 28 '12 at 15:27
    
Depending on how one builds, the build process/environment itself may make for building the different distributions from one source. –  MichaelT Dec 28 '12 at 15:36
add comment

3 Answers 3

up vote 5 down vote accepted

Is there some "typical" method to create a project like this without having to maintain separate codebases for each project?

More complex approaches (configuration, plugins etc.) have been described. Yet for your relatively simple case you may be better off using a straight forward approach, that is automate what you do manually:

  1. Maintain one code base
  2. Add a "config" folder that has /vendor and /internal subdirectories, each one containing the specific XML file to be included in each version.
  3. Create a build script that accepts -internal or -vendor as a parameter

The build script will then create the shippable software (i.e. the binary plus configuration file) by simply copying the respective XML to the right location.

share|improve this answer
    
Build parameters are exactly what i was looking for, but I didn't know what to call them. Thank you –  Brandon Dec 28 '12 at 18:25
add comment

This sounds like a weak approach to including / excluding functionality. All it takes is one customer to backward-engineer your program and figure out which XML elements to add and they have access to the functionality you want to hide.

A better approach is to have a plug-in system, where the software looks for an assembly that includes your extra functionality, but fails gracefully if that assembly isn't there.

This way you don't need a separate codebase. You simply install the same software everywhere and your plugin locally.

share|improve this answer
    
Yes and no. It's a very weak solution, but it isn't a very important problem. All the xml does is provide a link to an Excel file that has definitions. A better solution would be for me to remove the Excel file and the XML lines. –  Brandon Dec 28 '12 at 15:29
    
@Brandon: If that's the way you want to go then, still, reverse your thinking. Install it without the Excel file and XML lines, then add them with a separate installation step. –  pdr Dec 28 '12 at 15:36
add comment

I would have licensing system where based on the Licence you have different modules get loaded\activated.

But the entire code base is always the same.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.