aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2019-03-02 12:29:54 +0100
committerDaniel Mensinger <daniel@mensinger-ka.de>2019-03-04 13:00:06 +0100
commit1290330894f5c2ad77684b1b3985a7ba17114ccb (patch)
tree9e8af491d6351b5131dd6999ff84f26ec065904f
parentc98987c19efabac06296c0e65692b7822db95a72 (diff)
downloadmeson-1290330894f5c2ad77684b1b3985a7ba17114ccb.zip
meson-1290330894f5c2ad77684b1b3985a7ba17114ccb.tar.gz
meson-1290330894f5c2ad77684b1b3985a7ba17114ccb.tar.bz2
rewriter: Renamed tgt_{add,rm} --> target_{add,rm}
-rw-r--r--docs/markdown/Rewriter.md2
-rw-r--r--mesonbuild/rewriter.py12
-rw-r--r--test cases/rewrite/1 basic/addTgt.json2
-rw-r--r--test cases/rewrite/1 basic/rmTgt.json4
-rw-r--r--test cases/rewrite/2 subdirs/addTgt.json2
-rw-r--r--test cases/rewrite/2 subdirs/rmTgt.json2
6 files changed, 12 insertions, 12 deletions
diff --git a/docs/markdown/Rewriter.md b/docs/markdown/Rewriter.md
index 46b117e..332c9f7 100644
--- a/docs/markdown/Rewriter.md
+++ b/docs/markdown/Rewriter.md
@@ -175,7 +175,7 @@ The format for the type `target` is defined as follows:
{
"type": "target",
"target": "target ID/name/assignment variable",
- "operation": "one of ['src_add', 'src_rm', 'tgt_rm', 'tgt_add', 'info']",
+ "operation": "one of ['src_add', 'src_rm', 'target_rm', 'target_add', 'info']",
"sources": ["list", "of", "source", "files", "to", "add, remove"],
"subdir": "subdir where the new target should be added (only has an effect for operation 'tgt_add')",
"target_type": "function name of the new target -- same as in the CLI (only has an effect for operation 'tgt_add')"
diff --git a/mesonbuild/rewriter.py b/mesonbuild/rewriter.py
index b344ce6..196fc3b 100644
--- a/mesonbuild/rewriter.py
+++ b/mesonbuild/rewriter.py
@@ -306,7 +306,7 @@ rewriter_keys = {
},
'target': {
'target': (str, None, None),
- 'operation': (str, None, ['src_add', 'src_rm', 'tgt_rm', 'tgt_add', 'info']),
+ 'operation': (str, None, ['src_add', 'src_rm', 'target_rm', 'target_add', 'info']),
'sources': (list, [], None),
'subdir': (str, '', None),
'target_type': (str, 'executable', ['both_libraries', 'executable', 'jar', 'library', 'shared_library', 'shared_module', 'static_library']),
@@ -571,7 +571,7 @@ class Rewriter:
def process_target(self, cmd):
mlog.log('Processing target', mlog.bold(cmd['target']), 'operation', mlog.cyan(cmd['operation']))
target = self.find_target(cmd['target'])
- if target is None and cmd['operation'] != 'tgt_add':
+ if target is None and cmd['operation'] != 'target_add':
mlog.error('Unknown target "{}" --> skipping'.format(cmd['target']))
return
@@ -678,7 +678,7 @@ class Rewriter:
if root not in self.modefied_nodes:
self.modefied_nodes += [root]
- elif cmd['operation'] == 'tgt_add':
+ elif cmd['operation'] == 'target_add':
if target is not None:
mlog.error('Can not add target', mlog.bold(cmd['target']), 'because it already exists')
return
@@ -705,7 +705,7 @@ class Rewriter:
tgt_ass_node.accept(AstIndentationGenerator())
self.to_add_nodes += [src_ass_node, tgt_ass_node]
- elif cmd['operation'] == 'tgt_rm':
+ elif cmd['operation'] == 'target_rm':
to_remove = self.find_assignment_node(target['node'])
if to_remove is None:
to_remove = target['node']
@@ -841,8 +841,8 @@ class Rewriter:
target_operation_map = {
'add': 'src_add',
'rm': 'src_rm',
- 'add_target': 'tgt_add',
- 'rm_target': 'tgt_rm',
+ 'add_target': 'target_add',
+ 'rm_target': 'target_rm',
'info': 'info',
}
diff --git a/test cases/rewrite/1 basic/addTgt.json b/test cases/rewrite/1 basic/addTgt.json
index 432e299..2f4e7e2 100644
--- a/test cases/rewrite/1 basic/addTgt.json
+++ b/test cases/rewrite/1 basic/addTgt.json
@@ -2,7 +2,7 @@
{
"type": "target",
"target": "trivialprog10",
- "operation": "tgt_add",
+ "operation": "target_add",
"sources": ["new1.cpp", "new2.cpp"],
"target_type": "shared_library"
}
diff --git a/test cases/rewrite/1 basic/rmTgt.json b/test cases/rewrite/1 basic/rmTgt.json
index 5774157..9861f05 100644
--- a/test cases/rewrite/1 basic/rmTgt.json
+++ b/test cases/rewrite/1 basic/rmTgt.json
@@ -7,11 +7,11 @@
{
"type": "target",
"target": "trivialprog1",
- "operation": "tgt_rm"
+ "operation": "target_rm"
},
{
"type": "target",
"target": "trivialprog9",
- "operation": "tgt_rm"
+ "operation": "target_rm"
}
]
diff --git a/test cases/rewrite/2 subdirs/addTgt.json b/test cases/rewrite/2 subdirs/addTgt.json
index 01e9a6e..2e1e8bc 100644
--- a/test cases/rewrite/2 subdirs/addTgt.json
+++ b/test cases/rewrite/2 subdirs/addTgt.json
@@ -2,7 +2,7 @@
{
"type": "target",
"target": "newLib",
- "operation": "tgt_add",
+ "operation": "target_add",
"sources": ["new1.cpp", "new2.cpp"],
"target_type": "shared_library",
"subdir": "sub2"
diff --git a/test cases/rewrite/2 subdirs/rmTgt.json b/test cases/rewrite/2 subdirs/rmTgt.json
index 73a7b1d..9b112f9 100644
--- a/test cases/rewrite/2 subdirs/rmTgt.json
+++ b/test cases/rewrite/2 subdirs/rmTgt.json
@@ -2,6 +2,6 @@
{
"type": "target",
"target": "something",
- "operation": "tgt_rm"
+ "operation": "target_rm"
}
]