Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Run Build and create Snapshot using Java API?

Hi all,

I am wondering if the following is possible in RTC via Java API?

    Load a given workspace
    Run a build definition against this workspace(Ant)
    Create Snapshot after build is successful (this is automatic process)
    Set the owner of the snapshot as Stream


Regards,
Karthik

0 votes



5 answers

Permanent link
Hi Kartik,

please see https://jazz.net/library/article/634 which triggers a build. I assume all you request is doable through the Plain Java Client Library and the same api provided in Eclipse. You just have to find your way through the API.

Some hints:

https://jazz.net/wiki/bin/view/Main/RTCSDK20_SourceControl

Visual Studio, but maybe other ideas: https://jazz.net/wiki/bin/view/Main/APIUsage

To set up for development with Plain Java Client library set up the SDK first (workshop) then create a plugin project and provide it with the Plain Java Client Library this allows to browse the SDK while developing. There is also a new API document for download with 3.0.1.1.

0 votes


Permanent link
Hi Kartik,

please see https://jazz.net/library/article/634 which triggers a build. I assume all you request is doable through the Plain Java Client Library and the same api provided in Eclipse. You just have to find your way through the API.

Some hints:

https://jazz.net/wiki/bin/view/Main/RTCSDK20_SourceControl

Visual Studio, but maybe other ideas: https://jazz.net/wiki/bin/view/Main/APIUsage

To set up for development with Plain Java Client library set up the SDK first (workshop) then create a plugin project and provide it with the Plain Java Client Library this allows to browse the SDK while developing. There is also a new API document for download with 3.0.1.1.


Thanks Ralph. Will give a try

0 votes


Permanent link
Good luck! Would be great if you could feed back the result.

BTW, when developing with Plain Java Client Library in said plugin project, the only disadvantage is you need to add the dependencies to the used plugins. Otherwise the PDE is confused.

0 votes


Permanent link
The main class you have to use is IWorkspaceConnection (you can obtain it from IWorkspace or IWorkspaceHandle using IWorkspaceManager.getWorkspaceConnection).

From this class you can use createBaselineSet and addBaselineSet methods to create and promote a snapshot (which is named BaselineSet)

Michele.

0 votes


Permanent link
Hi Karthik,

The workflow in your original post is a little non-standard. It would be more straightforward to configure the build definition to do the SCM phase, which does:
- accept latest changes from stream (it's actually a replace, bringing the build workspace into sync with what's in the stream)
- creates a snapshot (associated with the build workspace)
- loads the workspace

The rest of the build the runs (Ant / Maven / command line ...)

In 3.0.1, we added a Post-build deliver option which you can use to deliver changes to a target stream (again, it's actually doing a replace).

In 4.0, we've added an option in Post-build deliver to also promote the snapshot to be associated with this stream too. Until 4.0 is available, the alternative would be to use the SCM CLI to do the promotion, invoked from the build script.

Assuming all the above is done as part of the build definition configuration and/or script, all you need to do then is request a build for the given build definition, and (optionally) wait for it to complete. This can be done with the requestTeamBuild and waitForTeamBuild Ant tasks. See the Ant task reference's section on controlling the build lifecycle for details.

For tips on using the SCM CLI in builds, see this article.

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Nov 28 '11, 5:19 a.m.

Question was seen: 11,991 times

Last updated: Nov 28 '11, 5:19 a.m.

Confirmation Cancel Confirm