It's all about the answers!

Ask a question

Inserting a baseline label into source file


Chris Fagyal (462109) | asked Oct 21 '10, 9:48 a.m.
Is there a way in RTC to insert the baseline label on a version to be automatically inserted into a comment of a source file, similar to the $Name: $ tag that can be used with CVS?

Thanks,
Chris Fagyal
Aeroflex, Inc.

3 answers



permanent link
Adil Chahid (45524118) | answered Oct 21 '10, 10:17 a.m.
Hi Chris,
the following potential solution is conditional to the following aspects:
1) Use RTC Build Engine to orchestrate the Build
2) hope that the Build Engine only creates the implicit Snapshots to the involved SCM Components (Loaded in the workspace defined in the build definition) after completing the build (Someone form IBM has to confirm this)

if I'm not mistaken, the RTC Build Engine will create a Snapshot to the components that were included in the Build Definition's workspace using the ${buildResultUUID} parameter.
This UID will refer to the build result as well as to the created snapshot for each SCM component invloved into the build.
It is not the most elegant solution, but at first sight you could alter the Source code to inject that variable during the build process, that way, you'll have the automatically created Baseline Idin nthe source code.
I'm sure that this is not the most elegant solution out there.

Please advise!

Is there a way in RTC to insert the baseline label on a version to be automatically inserted into a comment of a source file, similar to the $Name: $ tag that can be used with CVS?

Thanks,
Chris Fagyal
Aeroflex, Inc.

permanent link
Chris Fagyal (462109) | answered Oct 21 '10, 12:51 p.m.
Well I sort of mis-stated the question I think, reading through what I wrote. It doesn't necessarily have to be automated (i.e. through the build engine). Just a way where one could use some sort of macro or tag to insert a label/baseline name into a comment of a file... i.e. i've applied a baseline RELEASE_1 onto a set of files, that I could then insert a ${label} or some such into the source files such that when packaging up that release each of the source files has a comment which contains the release number.

Hi Chris,
the following potential solution is conditional to the following aspects:
1) Use RTC Build Engine to orchestrate the Build
2) hope that the Build Engine only creates the implicit Snapshots to the involved SCM Components (Loaded in the workspace defined in the build definition) after completing the build (Someone form IBM has to confirm this)

if I'm not mistaken, the RTC Build Engine will create a Snapshot to the components that were included in the Build Definition's workspace using the ${buildResultUUID} parameter.
This UID will refer to the build result as well as to the created snapshot for each SCM component invloved into the build.
It is not the most elegant solution, but at first sight you could alter the Source code to inject that variable during the build process, that way, you'll have the automatically created Baseline Idin nthe source code.
I'm sure that this is not the most elegant solution out there.

Please advise!

Is there a way in RTC to insert the baseline label on a version to be automatically inserted into a comment of a source file, similar to the $Name: $ tag that can be used with CVS?

Thanks,
Chris Fagyal
Aeroflex, Inc.

permanent link
Adil Chahid (45524118) | answered Oct 21 '10, 5:23 p.m.
Hello Chris,

I did actually understand initially your point.

The only possible problem here is that once a Baseline actually is created, all the new changes will actually be included in the next Baseline that you'll create.

I do not feel comfortable with the notion of labeling source code (with a comment or so) with a label pointing on a Baseline that was already done.
So in a good scenario, you would label the source code and then create the baseline.

I do not recall a graceful way of doing that, that's why I tried previously to provide a solution with some sort of automation.

I know that you can proactively create release version at the project level.
I don't know if code completition would actually retrieve the value of a Release version.
Even so, you'll still have to create manually the baselines for each component targeted by a change after-worth.

On our end, we're used to tag the Java Archives MANIFEST files during the build by inserting as a comment the build UID such as 20101010-1456.
With that information, we are able to browse the Snapshots from the repository and automatically retrieve the source code that was included in that build.

So we do not actually need to tag the source code itself for tracability, but the produced packages.

So in the MANIFEST file for EARS, WARS and JARS we specify the version of the archive (by using the POM version since we're using Maven as a dependency manager) plus we specify as a comment the build UID that corresponds to the snapshot that was automatically created in the workspace that was assigned to the build definition.

I hope that it can give you some ideas.
Take care!

Well I sort of mis-stated the question I think, reading through what I wrote. It doesn't necessarily have to be automated (i.e. through the build engine). Just a way where one could use some sort of macro or tag to insert a label/baseline name into a comment of a file... i.e. i've applied a baseline RELEASE_1 onto a set of files, that I could then insert a ${label} or some such into the source files such that when packaging up that release each of the source files has a comment which contains the release number.

Hi Chris,
the following potential solution is conditional to the following aspects:
1) Use RTC Build Engine to orchestrate the Build
2) hope that the Build Engine only creates the implicit Snapshots to the involved SCM Components (Loaded in the workspace defined in the build definition) after completing the build (Someone form IBM has to confirm this)

if I'm not mistaken, the RTC Build Engine will create a Snapshot to the components that were included in the Build Definition's workspace using the ${buildResultUUID} parameter.
This UID will refer to the build result as well as to the created snapshot for each SCM component invloved into the build.
It is not the most elegant solution, but at first sight you could alter the Source code to inject that variable during the build process, that way, you'll have the automatically created Baseline Idin nthe source code.
I'm sure that this is not the most elegant solution out there.

Please advise!

Is there a way in RTC to insert the baseline label on a version to be automatically inserted into a comment of a source file, similar to the $Name: $ tag that can be used with CVS?

Thanks,
Chris Fagyal
Aeroflex, Inc.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.