Can we use (and change) parameters of parent projects?

Answered

Hi,

We have some projects that are sub-projects to "<root>". 

These projects have builds where we need to send parameters/values from one step to another. For example:

<root>
   project1
      buildStep1 - set parameter1="value1"
      buildStep2 - use parameter1.

   project2
      buildStep1 - set parameter1="value2"
      buildStep2 - use parameter1.


I can do this using configuration parameters. However, this requires that the parameters are defined in the build definition of both project1 and project2. Disregarding metarunners etc, can this be avoided?  

I'm thinking, to define the configuration parameters in the "<root>" project. So that both projects inherit "parameter1". However, since the two projects both SET the parameter value, and may run at the same time, will this work? Or put in another way, are any of the inherited parameters copied/shielded within the build definitions so that they do not influence each other (e.g. project2 sees parameter1 value as "value1")?

Hope you get what I'm asking :)

Thanks...

 

0
2 comments

Hi Werner,

Yes, it is safe to set a configuration parameter at the root project level, so that all projects and build configurations inherit it, and then modify it at the sub-project level (or even build configuration) for the change to only apply to that sub-project/build configuration. More information on parameter definition precedence here: https://confluence.jetbrains.com/display/TCD10/Configuring+Build+Parameters

0
Avatar
Permanently deleted user

Excellent, thanks Denis.

0

Please sign in to leave a comment.