It's all about the answers!

Ask a question

Command Line build - injection of build definition propertie


Ralph Schoon (63.6k33646) | asked Nov 14 '08, 8:05 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi,

I am setting up a build for C++ refering to

https://jazz.net/wiki/bin/view/Main/CppBuild
https://jazz.net/wiki/bin/view/Main/SCMCLIWithJazzBuild

I created make files etc. After struggeling for some time and failing builds
I found an issue.
I need to pass build properties / build dependant environment variables to
the make file. Apparently the normal environment variables are passed to
the make command but the properties set in the build definition are not.

Is this to be expected or an issue with my machine or RTC 1.0.1? See errors
and other data below.

Thanks,

Ralph

Here the errors:
Makefile:9: warning: undefined variable `JAZZ_TOOLKIT'
Makefile:9: warning: undefined variable `repositoryAddress'
Makefile:9: warning: undefined variable `buildResultUUID'
Makefile:9: warning: undefined variable `JAZZ_TOOLKIT'
Makefile:9: warning: undefined variable `repositoryAddress'
Makefile:9: warning: undefined variable `buildResultUUID'
Makefile:9: warning: undefined variable `JAZZ_TOOLKIT'
Makefile:9: warning: undefined variable `repositoryAddress'
Makefile:9: warning: undefined variable `buildResultUUID'

And here the content of the build properties passed to a file:

#Fri Nov 14 17:38:05 CET 2008
personalBuild=true
team.scm.acceptBeforeFetch=true
team.scm.fetchDestination=C\:/JazzDemo/build/work/fib/build.input
team.scm.componentLoadRules=
team.scm.deleteDestinationBeforeFetch=false
team.scm.workspaceUUID=_MReSsLJMEd2-TIBlZp-GWQ
buildDefinitionId=Squawk Team C++ build
requestUUID=_mh6lAbJqEd2-TIBlZp-GWQ
com.ibm.team.build.internal.template.id=com.ibm.team.build.cmdline
buildResultUUID=_mh6lArJqEd2-TIBlZp-GWQ
JAZZ_TOOLKIT=C\:/JazzDemo/build/buildsystem/buildtoolkit;C\:\\JazzDemo\\build\\jdk1.6.0_05\\lib
ANT_CLASSPATH=C\:/JazzDemo/build/ant/org.apache.ant_1.7.0/lib/ant-launcher.jar
buildLabel=20081114-1738
BUILDROOT=C\:/JazzDemo/build/work/fib
team.scm.buildOnlyIfChanges=true
repositoryAddress=https\://localhost\:9443/jazz/



Example build file:

ANT_LAUNCHER = org.apache.tools.ant.launch.Launcher
JAZZ_TASK = java $(ANT_LAUNCHER) -f jazzbuild.xml -lib $(JAZZ_TOOLKIT) -DrepositoryAddress=$(repositoryAddress)
-DbuildResultUUID=$(buildResultUUID)

all: compile

compile:
$(JAZZ_TASK) -DactivityLabel="Compiling" startActivity
make -C ../Fibonacci all
$(JAZZ_TASK) -DactivityLabel="Publishing results" startActivity
$(JAZZ_TASK) -Dlabel="Executable" -DfilePath=../Fibonacci/Fibo attachArtifact

2 answers



permanent link
Don Weinand (7851) | answered Nov 14 '08, 1:08 p.m.
JAZZ DEVELOPER
On the command line page are you passing in the properties as arguments?
From the first wiki topic you reference below...

"At the top of the makefile, add:

CLASSPATH = ant-home/lib/ant-launcher.jar
ANT_LAUNCHER = org.apache.tools.ant.launch.Launcher
JAZZ_TOOLKIT = build-server-toolkit-install/buildsystem/buildtoolkit

Note: if you use backslashes in the paths in the makefile, be sure to escape
them with \
Open the build definition. On the Command Line page, set the following in
the Arguments field:
repositoryAddress=${repositoryAddress}
buildResultUUID=${buildResultUUID}

Save the build definition and all edited files"

Don Weinand
Jazz Team Build

"Ralph Schoon" <ralph> wrote in message
news:dc83ed3b27828cb149ac652010e@news.jazz.net...

Hi,

I am setting up a build for C++ refering to

https://jazz.net/wiki/bin/view/Main/CppBuild
https://jazz.net/wiki/bin/view/Main/SCMCLIWithJazzBuild

I created make files etc. After struggeling for some time and failing
builds I found an issue.
I need to pass build properties / build dependant environment variables to
the make file. Apparently the normal environment variables are passed to
the make command but the properties set in the build definition are not.

Is this to be expected or an issue with my machine or RTC 1.0.1? See
errors and other data below.

Thanks,

Ralph

Here the errors:
Makefile:9: warning: undefined variable `JAZZ_TOOLKIT'
Makefile:9: warning: undefined variable `repositoryAddress'
Makefile:9: warning: undefined variable `buildResultUUID'
Makefile:9: warning: undefined variable `JAZZ_TOOLKIT'
Makefile:9: warning: undefined variable `repositoryAddress'
Makefile:9: warning: undefined variable `buildResultUUID'
Makefile:9: warning: undefined variable `JAZZ_TOOLKIT'
Makefile:9: warning: undefined variable `repositoryAddress'
Makefile:9: warning: undefined variable `buildResultUUID'

And here the content of the build properties passed to a file:

#Fri Nov 14 17:38:05 CET 2008
personalBuild=true
team.scm.acceptBeforeFetch=true
team.scm.fetchDestination=C\:/JazzDemo/build/work/fib/build.input
team.scm.componentLoadRules=
team.scm.deleteDestinationBeforeFetch=false
team.scm.workspaceUUID=_MReSsLJMEd2-TIBlZp-GWQ
buildDefinitionId=Squawk Team C++ build
requestUUID=_mh6lAbJqEd2-TIBlZp-GWQ
com.ibm.team.build.internal.template.id=com.ibm.team.build.cmdline
buildResultUUID=_mh6lArJqEd2-TIBlZp-GWQ
JAZZ_TOOLKIT=C\:/JazzDemo/build/buildsystem/buildtoolkit;C\:\\JazzDemo\\build\\jdk1.6.0_05\\lib
ANT_CLASSPATH=C\:/JazzDemo/build/ant/org.apache.ant_1.7.0/lib/ant-launcher.jar
buildLabel=20081114-1738
BUILDROOT=C\:/JazzDemo/build/work/fib
team.scm.buildOnlyIfChanges=true
repositoryAddress=https\://localhost\:9443/jazz/



Example build file:
ANT_LAUNCHER = org.apache.tools.ant.launch.Launcher
JAZZ_TASK = java $(ANT_LAUNCHER) -f jazzbuild.xml -lib
$(JAZZ_TOOLKIT) -DrepositoryAddress=$(repositoryAddress) -DbuildResultUUID=$(buildResultUUID)
all: compile

compile:
$(JAZZ_TASK) -DactivityLabel="Compiling" startActivity make -C
../Fibonacci all $(JAZZ_TASK) -DactivityLabel="Publishing results"
startActivity
$(JAZZ_TASK) -Dlabel="Executable" -DfilePath=../Fibonacci/Fibo
attachArtifact


permanent link
Ralph Schoon (63.6k33646) | answered Nov 16 '08, 11:07 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Don,

thanks - I assumed that the said ID's are passed to the commandline by default.
My bad!

FYI: In addition to passing the said variables in the arguments I had to
set the repository Address and the build UUID manually in the makefile.
Otherwise the parameters where not passed to the ant-task.xml

CLASSPATH = C:/JazzDemo/build/ant/org.apache.ant_1.7.0/lib/ant-launcher.jar;C:/JazzDemo/build/jdk1.6.0_05/lib/tools.jar
ANT_LAUNCHER = org.apache.tools.ant.launch.Launcher
JAZZ_TOOLKIT = C:/JazzDemo/build/buildsystem/buildtoolkit
JAZZ_TASK = java -cp $(CLASSPATH) $(ANT_LAUNCHER) -f jazzbuild.xml -lib $(JAZZ_TOOLKIT)
REPOSITORY_ADDRESS=${repositoryAddress}
BUILD_UUID=${buildResultUUID}
all: compile

compile:
$(JAZZ_TASK) -DrepositoryAddress=${REPOSITORY_ADDRESS} -DbuildResultUUID=${BUILD_UUID}
-DactivityLabel="Compiling" startActivity
make -C ../Fibonacci all
$(JAZZ_TASK) -DrepositoryAddress=${REPOSITORY_ADDRESS} -DbuildResultUUID=${BUILD_UUID}
-DactivityLabel="Publishing results" startActivity
$(JAZZ_TASK) -DrepositoryAddress=${REPOSITORY_ADDRESS} -DbuildResultUUID=${BUILD_UUID}
-Dlabel="Executable" -DfilePath=../Fibonacci/Fibo.exe attachArtifact

Thanks,

Ralph

On the command line page are you passing in the properties as
arguments? From the first wiki topic you reference below...

"At the top of the makefile, add:

CLASSPATH = ant-home/lib/ant-launcher.jar
ANT_LAUNCHER = org.apache.tools.ant.launch.Launcher
JAZZ_TOOLKIT =
build-server-toolkit-install/buildsystem/buildtoolkit
Note: if you use backslashes in the paths in the makefile, be sure to
escape
them with \
Open the build definition. On the Command Line page, set the following
in
the Arguments field:
repositoryAddress=${repositoryAddress}
buildResultUUID=${buildResultUUID}
Save the build definition and all edited files"

Don Weinand
Jazz Team Build
"Ralph Schoon" <ralph> wrote in message
news:dc83ed3b27828cb149ac652010e@news.jazz.net...

Hi,

I am setting up a build for C++ refering to

https://jazz.net/wiki/bin/view/Main/CppBuild
https://jazz.net/wiki/bin/view/Main/SCMCLIWithJazzBuild
I created make files etc. After struggeling for some time and failing
builds I found an issue.
I need to pass build properties / build dependant environment
variables to
the make file. Apparently the normal environment variables are passed
to
the make command but the properties set in the build definition are
not.
Is this to be expected or an issue with my machine or RTC 1.0.1? See
errors and other data below.

Thanks,

Ralph

Here the errors:
Makefile:9: warning: undefined variable `JAZZ_TOOLKIT'
Makefile:9: warning: undefined variable `repositoryAddress'
Makefile:9: warning: undefined variable `buildResultUUID'
Makefile:9: warning: undefined variable `JAZZ_TOOLKIT'
Makefile:9: warning: undefined variable `repositoryAddress'
Makefile:9: warning: undefined variable `buildResultUUID'
Makefile:9: warning: undefined variable `JAZZ_TOOLKIT'
Makefile:9: warning: undefined variable `repositoryAddress'
Makefile:9: warning: undefined variable `buildResultUUID'
And here the content of the build properties passed to a file:

#Fri Nov 14 17:38:05 CET 2008
personalBuild=true
team.scm.acceptBeforeFetch=true
team.scm.fetchDestination=C\:/JazzDemo/build/work/fib/build.input
team.scm.componentLoadRules=
team.scm.deleteDestinationBeforeFetch=false
team.scm.workspaceUUID=_MReSsLJMEd2-TIBlZp-GWQ
buildDefinitionId=Squawk Team C++ build
requestUUID=_mh6lAbJqEd2-TIBlZp-GWQ
com.ibm.team.build.internal.template.id=com.ibm.team.build.cmdline
buildResultUUID=_mh6lArJqEd2-TIBlZp-GWQ
JAZZ_TOOLKIT=C\:/JazzDemo/build/buildsystem/buildtoolkit;C\:\\JazzDem
o\\build\\jdk1.6.0_05\\lib
ANT_CLASSPATH=C\:/JazzDemo/build/ant/org.apache.ant_1.7.0/lib/ant-lau
ncher.jar
buildLabel=20081114-1738
BUILDROOT=C\:/JazzDemo/build/work/fib
team.scm.buildOnlyIfChanges=true
repositoryAddress=https\://localhost\:9443/jazz/
Example build file:
ANT_LAUNCHER = org.apache.tools.ant.launch.Launcher
JAZZ_TASK = java $(ANT_LAUNCHER) -f jazzbuild.xml -lib
$(JAZZ_TOOLKIT) -DrepositoryAddress=$(repositoryAddress)
-DbuildResultUUID=$(buildResultUUID)
all: compile
compile:
$(JAZZ_TASK) -DactivityLabel="Compiling" startActivity make -C
../Fibonacci all $(JAZZ_TASK) -DactivityLabel="Publishing results"
startActivity
$(JAZZ_TASK) -Dlabel="Executable" -DfilePath=../Fibonacci/Fibo
attachArtifact

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.