Nokia Networks Home

Nokia nmake Product Builder

Quick Links

Related Products

Tool Repository

[ tool index ]

targets.scala

Lists information about the triggered targets.

Download targets.scala

Description

targets.scala is a Scala script that lists data about each triggered target. Data about each target appears on a separate output line in a space separated format. Each line displays target name, execution exit code, start time, and end time. This is an example Scala script from the Build Log Overview.

Requirements

scala. Scala is a general purpose staticly typed programming language for the JVM that smoothly integrates features of object-oriented and functional programming and provides built-in parsing of inline standard XML syntax and library support for XPath style XML document queries. Since Scala runs on the JVM, it runs on platforms supporting the JVM including Linux, Solaris, and Windows.

Usage

scala targets.scala filename.xml

Example Command Line

scala targets.scala makelog.xml

Example Output

See the Extended Example in the Build Log Overview for details and structure of the example build used.

cmd 0 17:11:21.16 17:11:21.57
hw 0 17:11:21.22 17:11:21.53
hw.o 0 17:11:21.31 17:11:21.36
hw 0 17:11:21.38 17:11:21.43
../../../bin 0 17:11:21.45 17:11:21.46
../../../bin/hw 0 17:11:21.48 17:11:21.50

Script

The first line parses the XML document and saves the parsed build log tree as the value of bl. The second line, bl \\ "tg", is a XPath-like expression that recursively selects all the tg elements in the document. The foreach iterates over each of the selected elements, printing a line of output for each element. It accesses data from each element using non-recursive XPath-like expressions indicated by the single \ operator. For example, i\"@nm" accesses the value of the attribute named nm. See also the Build Log Overview.

import scala.xml._
val bl = XML.loadFile(args(0))
(bl \\ "tg") foreach { i => println((i\"@nm")+" "+(i\"@ec")+" "+
	(i\"@st").text.substring(11,22)+" "+(i\"@et").text.substring(11,22))
}
Last Update: Friday,12-Aug-2016 12:17:06 EDT