Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6876743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:30:57+00:00 2026-05-27T04:30:57+00:00

I build packages from a batch file using commands like: msbuild ..\lib\Package.dproj /target:Build /p:config=%1

  • 0

I build packages from a batch file using commands like:

msbuild ..\lib\Package.dproj /target:Build /p:config=%1

The packages’ settings are dependent on an option set:

<Import Project="..\optionsets\COND_Defined.optset" Condition="'$(Base)'!='' And Exists('..\optionsets\COND_Defined.optset')"/>

This option set defines a conditional symbol many of my packages depend on. The file looks like this:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <DCC_Define>CONDITION;$(DCC_Define)</DCC_Define>
    </PropertyGroup>
    <ProjectExtensions>
        <Borland.Personality>Delphi.Personality.12</Borland.Personality>
        <Borland.ProjectType>OptionSet</Borland.ProjectType>
        <BorlandProject>
            <Delphi.Personality/>
        </BorlandProject>
        <ProjectFileVersion>12</ProjectFileVersion>
    </ProjectExtensions>
</Project>

Now I need two builds: one with the condition defined and one without. My attack vector would be the option set file. I have some ideas on what to do:

  • write a program which modifies the option set file, run this before batch build
  • fiddle with the project files and modify the option set path to contain an environment variable, then have different option sets in different locations

But before starting to reinvent the wheel I’d like to ask how you would tackle this task? Maybe there are already means meant to support such a case (like certain command line switches, things I could configure in Delphi or batch file magic).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:30:57+00:00Added an answer on May 27, 2026 at 4:30 am

    The way I approach this is to define multiple build configurations and then select the appropriate one at build time with /p:config=XXX. The works nicely in the IDE too because you can just double click the build config in the project manager to activate it.

    I personally use inheritance of build configurations when I do this so that I don’t have to repeat myself. For example I have a build configuration named Debug DCUs that inherits from the Debug configuration and simply changes the Debug DCUs option to True.

    To help explain what I mean, here is what the build configuration tree looks like in my project:

    enter image description here

    The Debug DCUs configuration is effected by means of this option set:

    <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
        <PropertyGroup>
            <DCC_DebugDCUs>true</DCC_DebugDCUs>
        </PropertyGroup>
        <ProjectExtensions>
            <Borland.Personality>Delphi.Personality.12</Borland.Personality>
            <Borland.ProjectType>OptionSet</Borland.ProjectType>
            <BorlandProject>
                <Delphi.Personality/>
            </BorlandProject>
            <ProjectFileVersion>12</ProjectFileVersion>
        </ProjectExtensions>
    </Project>
    

    Now, I am sure that you could do this by using /p:DCC_Define=XXX but I think it is cleaner to use the build configurations so that you can be sure that what you get it the IDE is the same as what you get from the command line builds.

    I would not recommend either approach in your bullet point list. Those approaches look exceedingly brittle to me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're currently using Visual Studio to build our ClickOnce deployment packages, but we'd like
I have a very simple python package that I build into debian packages using
I am trying to build a package from source and ./configure tells me I
Is it possible to exclude specific files or folders from Build Deployment Package function
i'm using vs installer to build a setup package for my vb6 app. and
In Eclipse's Package Explorer, let's say I have a list of packages like this:
I am using Python and NLTK to build a language model as follows: from
I build my tags file from the src directory of my android project. I
I'm using PartCover 4.0 (from the sourceforge page , latest dev build) with NUnit
I'm trying to use a batch file to help setup a build project. As

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.