It's all about the answers!

Ask a question

how to specify the build script directory


antoine robic (111) | asked Mar 16 '17, 6:37 a.m.
retagged Mar 31 '17, 1:22 p.m. by Ken Tessier (84117)

Hi,
I'm using RTC 5.0.2 with command-line - jazz build engine and the build system toolkit on a windows machine.
My project is loaded to the build machine on the "build" directory and my build script is in a subfolder named "script".
How do i specify the path to my build script ?
When I specify the command line "${scriptDir}\build.bat" it find the script but I need to "cd" in this "scriptdir" subfolder before running the script.
I try setting the working directory to the "$scriptDir" directory and changing my command line to "build.bat" but the build fail with "java.io.IOException: Cannot run program "build.bat" (in directory "build\script"): CreateProcess error=2, Le fichier spécifié est introuvable."
I don't understand because the script file is in that "build\script" directory.


Comments
Ralph Schoon commented Mar 16 '17, 9:40 a.m. | edited Mar 16 '17, 9:41 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

From your explanation I can not tell what you are doing. I can guess a lot, but that does not make sense. Please explain what you have set up and how e.g. build definition etc. 



antoine robic commented Mar 16 '17, 11:54 a.m. | edited Mar 16 '17, 11:15 p.m.

Ok, I'll try to be more explcit.
I'm Trying to set up continous integration for my project and I'm trying to use rational team concert build to do it.
I created a sample hello world C project with a build.bat script to compile the code.
Sources files are in "src" subfolder and the script file is in"script" subfolder.
I push the code to a repository workspace on the jazz source control then deliver changes to a dedicated stream.
I read the rational team conert build documentation at https://www.ibm.com/support/knowledgecenter/en/SSYMRC_5.0.2/com.ibm.team.build.doc/topics/t_build_overview.html and follow the instructions.
I installed the build system toolkit, create a dedicated build workspace, a jazz build engine, and a "command line - jazz build engine" build definition.
I started the build engine.
In the build definition, I created properties like that :

  • loadDir = build
  • scriptDir = ${loadDir}\script

I configured the build definition with the jazz source control, specify the dedicated build workspace, and the load directory with ${loadDir} .
Then in the command line tab, when I set the command field to "${scriptDir}\build.bat", It's working, the build script is called.
But I want to call the script from the ${scriptDir} and not from the build engine root directory.

So the question is : "how to call the build script from his own directory : {$scriptDir}" ?

I tried many things like setting the working directory to {$scriptDir} and command line to build.bat  was the right way to do it. But in that case, I get the following error :

2017-03-16 10:59:07 [Jazz Build Engine] Les variables de propriété de génération suivantes ont été substituées :
2017-03-16 10:59:07 [Jazz Build Engine]     scriptDir = ${loadDir}/script   -->   scriptDir = build/script
2017-03-16 10:59:07 [Jazz Build Engine] team.scm.fetchDestination = ${loadDir} --> team.scm.fetchDestination = build
2017-03-16 10:59:07 [Jazz Build Engine]
2017-03-16 10:59:07 [Jazz Build Engine] Les variables de propriété d'élément de configuration suivantes ont été substituées :
2017-03-16 10:59:07 [Jazz Build Engine] com.ibm.team.build.cmdline : com.ibm.team.build.cmdline.workingDir = ${scriptDir} --> com.ibm.team.build.cmdline.workingDir = build/script
2017-03-16 10:59:07 [Jazz Build Engine]
2017-03-16 10:59:07 [Jazz Build Engine] exécution sur l'hôte : CTSS-WES7
2017-03-16 10:59:07 [Jazz Build Engine] La génération doit-elle être effectuée ?
2017-03-16 10:59:07 [Jazz Build Engine] Oui : toujours générer une demande émise par un utilisateur.
2017-03-16 10:59:08 [Jazz Build Engine] Appel du participant à la pré-génération "com.ibm.team.build.jazzscm"
2017-03-16 10:59:08 [Jazz Build Engine] Suppression de la destination d'extraction "C:\RC\build_toolkit\jazz\buildsystem\buildengine\eclipse\build" avant l'extraction...
2017-03-16 10:59:08 [Jazz Build Engine] Extraction des fichiers dans la destination d'extraction "C:\RC\build_toolkit\jazz\buildsystem\buildengine\eclipse\build"...
2017-03-16 10:59:10 [Jazz Build Engine] Appel du participant à la génération "com.ibm.team.build.cmdline"
java.io.IOException: Cannot run program "build.bat" (in directory "build\script"): CreateProcess error=2, Le fichier spécifié est introuvable.
...
It can not find the file although it is there !
I also tried to use absolute path instead of relative path but it's not working either.

I'm using rational team concert 5.0.2 with the eclipse client on a windows 7 machine.

Hope that is clear enought

2 answers



permanent link
Donald Nong (14.5k414) | answered Mar 16 '17, 11:23 p.m.

How about changing the working directory in your build.bat?
http://stackoverflow.com/questions/5138507/how-to-change-current-working-directory-using-a-batch-file

If you want to know what is the current working directory in the batch file, see below post.
http://stackoverflow.com/questions/4419868/what-is-the-current-directory-in-a-batch-file


permanent link
antoine robic (111) | answered Mar 30 '17, 7:45 a.m.

Finaly, I find a solution to my problem.
When trying to call the batch script, you can use the following command.

cmd /c yourScript.bat

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.