From 57e74de3aea47a361cfb358bfbb78dbda5866109 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sun, 8 Feb 2015 20:34:33 +0200 Subject: Provide the vcs_tag command. Closes #33. --- interpreter.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'interpreter.py') 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') -- cgit v1.1