Re: [QBS] run script after building products

2015-03-03 Thread Tim Hutt
Here's my solution, for converting elf to bin. NOTE THAT YOU MUST LEAVE
application IN THE TYPE LIST. Otherwise the run configuration of the Bare
Metal projects won't work.

CppApplication {

type: [application, bin]


// ...

property string objCopyPath:
cpp.compilerPath.replace(arm-none-eabi-g++, arm-none-eabi-objcopy)
Rule {  id: bin inputs: [application]
Artifact {  fileTags: [bin]   
fileName: firmware.bin}
prepare: {  var args = [-O, binary, 
input.filePath,
output.filePath];   var cmd = new 
Command(product.objCopyPath,
args);  cmd.description = converting to bin:  +
FileInfo.fileName(output.filePath); cmd.highlight =
linker;   return cmd; }   }



On 2 March 2015 at 19:16, Stephan Gatzka stephan.gat...@gmail.com wrote:

 Hello all!

 Please forgive me my probably basic questions, but I'm a newbie to qbs.

 I've to build a bare metal project, consisting of two elf binaries and
 an FPGA image.

 Building both elf binaries worked like charm. But after building both
 elf binaries I have to combine both elf files and the pre-built FPGA
 image into a single image. This involves some fancy calls to objcopy
 and dd.

 Now I'm struggling with the task how to implement that in a qbs product.

 This is my current structure:
 Project {
   name: productName

   Application {
 name: app1
 ...
   }

   Application {
 name: app2
 ...
   }

   Product {
 name: image

 Depends {
   name:app1
   required:true
 }
 Depends {
   name:app2
   required:true
 }

   }
 }

 Inside the image product I tried to make the calls to objcopy and dd
 in the prepare script of a Rule or a Transformer. I think I haven't
 totally understood the behavior or intention of the usings and input
 directives.

 Can somebody please give me a hint how to solve this task best?

 Kind regards,

 Stephan
 ___
 QBS mailing list
 QBS@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/qbs

___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


Re: [QBS] run script after building products

2015-03-03 Thread Stephan Gatzka
Tim,

 Here's my solution, for converting elf to bin. NOTE THAT YOU MUST LEAVE
 application IN THE TYPE LIST. Otherwise the run configuration of the Bare
 Metal projects won't work.

What you described is not exactly what I want to do. Your example
converts an elf binary into a bin file for every single application
product. This can truly accomplished using an Rule inside the
application product.

But what I need to accomplish is to combine the elf output of two
different products into a single binary image file.

Regards,

Stephan
___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


Re: [QBS] run script after building products

2015-03-03 Thread Richard Weickelt
 Currently I'm struggling that only inputs[application][0] is defined
 but not inputs[application][1] (I have two products of type
 application).

I guess, You forgot to mark the rule as multiplex in order to catch all files 
at once.
___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs