How to specify COMSTR for Command Builder in 'scons'

Many built-in scons builders have $ * COMSTR variables that are used to change the default output of their associated Builder. We can use the $ * COMSTR variables to make our build processes clearer.

I would like to set the $ * COMSTR variable for the command builder.

target = 'mydb.db3' populatesql = 'populate.sql' sources = [populatesql] command = '@sqlite3 $TARGET < ' + populatesql built_database = env.Command(target, sources, command) 

I found that I can prefix my command with the "@" character to suppress output, but I was not able to figure out how to use $ * COMSTR using Command Builder. Did I miss the trick here?

Thanks.

+4
source share
1 answer

You do not associate the command line with the builder. Command lines are associated with an Action object.

If you need a command line just write something like this:

 built_database = env.Command(target, sources, Action('mySqlite3', 'Generating $TARGET with sqlite3')) 

or if you want finer tuning

 env['SQLITE3COMSTR'] = 'Generating $TARGET from $SOURCES with sqlite3' ... built_database = env.Command(target, sources, Action('mySqlite3', '$SQLITE3COMSTR')) 
+6
source

Source: https://habr.com/ru/post/1482857/


All Articles