[buildj] make data a type rather than a tool



commit d98a990c705e257c4994ff52b80540e84619a40f
Author: Abderrahim Kitouni <a kitouni gmail com>
Date:   Mon Aug 12 17:25:33 2013 +0100

    make data a type rather than a tool

 buildj.py    |    9 +++++----
 project.yaml |    2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/buildj.py b/buildj.py
index 081d9bd..c13919d 100644
--- a/buildj.py
+++ b/buildj.py
@@ -103,7 +103,7 @@ class ProjectFile:
 
                for target in self._targets:
                        tool = target.get_tool ()
-                       if tool and tool != "data":
+                       if tool:
                                tools.append (tool)
                return tools
 
@@ -129,7 +129,9 @@ class ProjectTarget(object):
                if not isinstance (target, dict):
                        raise ValueError, "Target %s: the target argument must be a dictionary" % name
 
-               if 'tool' in target:
+               if target['type'] == 'data':
+                       cls = DataTarget
+               elif 'tool' in target:
                        cls = TOOL_CLASS_MAP[target['tool']]
                else:
                        sources = target['input']
@@ -416,8 +418,7 @@ class ProjectOption:
 #Mapping between tools and target classes
 TOOL_CLASS_MAP = {'cc':   CcTarget,
                   'c++':  CcTarget,
-                  'vala': ValaTarget,
-                  'data': DataTarget}
+                  'vala': ValaTarget}
 
 # Mapping between file extensions and tools
 EXT_TOOL_MAP = {'cc':   ('.c', '.h'),
diff --git a/project.yaml b/project.yaml
index ab9712b..df4bc18 100644
--- a/project.yaml
+++ b/project.yaml
@@ -56,7 +56,7 @@ targets:
       - vala_library.vala
   
   my_cpp_program_data:
-    tool: data
+    type: data
     input:
       - data/buildj.svg
     dir:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]