Creating BuildInfo File automatically - SC 18.0 and above


This article is a follow on from our previous Knowledge Base article relating to the creation of the BuildInfo file prior to SC 17.0:

Due to the changes in the location of the BuildInfo file, the steps and arguments now differ from this previous article so I will detail the changes below. The code needed now will be different from the previous article. If you need a copy of this, please log a support incident and this will be supplied along with the needed jar file. 

The BuildInfo.xml files are now stored in the ProgramData folder in the following path for each instance: C:\ProgramData\SilkCentral\<instance_name>\BuildInfos.

To use the jar file:

1. Open up a command window, and run the following command:
java –cp <location of jar file> buildinfo.XMLWriter “<Product>” "<Version>" "<Build>" <Path to BuildInfo>

java -cp "C:\working\BuildXML3.jar" buildinfo.XMLWriter "Demo Product" "AutoVersion" "AutoBuild" "C:\ProgramData\SilkCentral\instance_1_silk\BuildInfos\BuildInfo.xml"

- This will then create your BuildInfo.xml file and also test that the command works correctly.


2. Modify the Silk Central Project Settings so that the file the Project is looking for is BuildInfo.xml.


3. Create a test in Silk Central, which will allow this test to be run before the executions.
On a Test Container right-click and create a new Test using the Type ‘ProcessExecutor Test’, which will allow you to configure the properties to run the jar file through the command line:

- Make sure to enter the full argument from /c onwards within quotations - shown above in my argument list.

*For Windows 10, I had issues with the location of the java.exe file. 
- I had to specify the full location of my java install location as shown above
- You may not need to do this as Java might work without this being specified

4. You must now specify the parameter values from the argument above. This is done within the Test Parameters on the Properties tab.
Enter each of the parameters at the Test level. You can leave these blank here and specify them within the Execution Plan. The Plan will detect these automatically and allow you to enter values from the Plan Properties. 


5. Now that it is configured, this test can be added to an execution plan. You can make this a Master Execution Plan so that when run, this script will execute first. 
This Execution Plan will then create the new BuildInfo.xml file, add the new parameter values specified and then run the dependent execution plan using the new Buildinfo.xml that has been created.

If you have any questions or issues when configuring this, or would like a copy of the .JAR file then log a Support Incident and the JAR file and additional support can be provided.

SI: 3141677

Comment List
Related Discussions