diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-02-08 20:34:33 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-02-08 20:34:33 +0200 |
commit | 57e74de3aea47a361cfb358bfbb78dbda5866109 (patch) | |
tree | 6894abf06424418c571d12bd7800cf000ec68aff /interpreter.py | |
parent | 46f932909a7c17d5be9b544419aa021ad67112cd (diff) | |
download | meson-57e74de3aea47a361cfb358bfbb78dbda5866109.zip meson-57e74de3aea47a361cfb358bfbb78dbda5866109.tar.gz meson-57e74de3aea47a361cfb358bfbb78dbda5866109.tar.bz2 |
Provide the vcs_tag command. Closes #33.
Diffstat (limited to 'interpreter.py')
-rw-r--r-- | interpreter.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/interpreter.py b/interpreter.py index e682387..5431585 100644 --- a/interpreter.py +++ b/interpreter.py @@ -1,4 +1,4 @@ -# Copyright 2012-2014 The Meson development team +# Copyright 2012-2015 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -726,6 +726,7 @@ class Interpreter(): 'get_option' : self.func_get_option, 'subproject' : self.func_subproject, 'pkgconfig_gen' : self.func_pkgconfig_gen, + 'vcs_tag' : self.func_vcs_tag, } def get_build_def_files(self): @@ -1105,6 +1106,16 @@ class Interpreter(): def func_jar(self, node, args, kwargs): return self.build_target(node, args, kwargs, JarHolder) + def func_vcs_tag(self, node, args, kwargs): + fallback = kwargs.get('fallback', None) + if not isinstance(fallback, str): + raise InterpreterException('Keyword argument must exist and be a string.') + del kwargs['fallback'] + scriptfile = os.path.join(os.path.split(__file__)[0], 'vcstagger.py') + kwargs['command'] = [sys.executable, scriptfile, '@INPUT@', '@OUTPUT@', fallback] + kwargs['build_always'] = True + return self.func_custom_target(node, ['vcstag'], kwargs) + def func_custom_target(self, node, args, kwargs): if len(args) != 1: raise InterpreterException('Incorrect number of arguments') |