<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<br>
<div class="moz-cite-prefix">13.08.2018 11:31, Christian Kandeler
пишет:<br>
</div>
<blockquote type="cite"
cite="mid:20180813103106.03162bbb@ckandeler-archlinux">
<pre wrap="">On Sun, 12 Aug 2018 22:56:31 +0300
Карелин Павел <a class="moz-txt-link-rfc2396E" href="mailto:hkarel@yandex.ru"><hkarel@yandex.ru></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I have a project in which, in addition to the main application,
auxiliary utilities are builded. In this regard, I have two questions:
1) How do I run an auxiliary utility right after his built, so that it
could generate necessary data?
</pre>
</blockquote>
<pre wrap="">
It works the same way as always: You trigger creation of the data by giving it some tag, and the tool's tag appears as some sort of input in the respective rule (which has the data as outputs).</pre>
</blockquote>
<span id="result_box" class="" lang="en"><span class="">That's the
problem, that I do not have clear how to do it.<br>
Not so long ago I made a rule for compiling cuda-files. </span></span><span
id="result_box" class="" lang="en"><span class=""><span
id="result_box" class="short_text" lang="en"><span class="">Here
is a shortened version</span></span>:<br>
<br>
Module {<br>
   id: cuda<br>
   Depends { name: "cpp" }<br>
<br>
   FileTagger {<br>
       patterns: "*.cu"<br>
       fileTags: ["cuda"]<br>
   }<br>
<br>
   Rule {<br>
       id: cudaCompiler<br>
       inputs: ["cuda"]<br>
       auxiliaryInputs: ["hpp"]<br>
<br>
       Artifact {<br>
           fileTags: ["obj"]<br>
           filePath: FileInfo.joinPaths(".obj",
Utilities.getHash(input.baseDir), input.fileName + ".o")<br>
       }<br>
<br>
       prepare: {<br>
           var args = [];<br>
           args.push(...);<br>
<br>
           var cmd = new Command("/usr/bin/nvcuda", args);<br>
           cmd.description = 'cuda compiling ' +
input.fileName;<br>
           cmd.highlight = "compiler";<br>
           return cmd;<br>
       }<br>
   }<br>
}<br>
<br>
Everything is clear: there are files with the extension 'cu',
the files are connected to the project. And there is a cuda
compiler: /usr/bin/nvcuda.<br>
<br>
In the current project, instead of /usr/bin/nvcuda, the
newly-built utility should be used (call it
sonnet_parsetrigrams). I do not understand how to write it down.
Also what should I write in the FileTagger section? Files do not
have an extension, these files are not connected to the project.
All that is - the name of the directory in which these files are
located. The call of the utility is as follows:
sonnet_parsetrigrams MyProjectDir/trigramsDir > trigrams.map<br>
</span></span><br>
<blockquote type="cite"
cite="mid:20180813103106.03162bbb@ckandeler-archlinux">
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">2) How to pass parameters to the auxiliary utility? The matter is that
the utility has one parameter - a directory name. It directory contains
text files without expansion, the utility has to process these files.
The output should be one file with the extension 'map'
</pre>
</blockquote>
<pre wrap="">
You rule has to take care of that when creating the Command.
Christian
_______________________________________________
Qbs mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qbs@qt-project.org">Qbs@qt-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.qt-project.org/mailman/listinfo/qbs">http://lists.qt-project.org/mailman/listinfo/qbs</a>
</pre>
</blockquote>
<br>
</body>
</html>