Skip to content

Commit

Permalink
Allow custom shell commands to specify weak dependencies (bug 5997 pa…
Browse files Browse the repository at this point in the history
…rt 7, r=ds).
  • Loading branch information
David Anderson committed Dec 28, 2013
1 parent 9120dc8 commit e6d789f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
12 changes: 10 additions & 2 deletions ambuild2/frontend/amb2/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,14 @@ def addSymlink(self, context, source, output_path):
def addFolder(self, context, folder):
return self.generateFolder(context.localFolder, folder)

def addShellCommand(self, context, inputs, argv, outputs, folder=-1, dep_type=None):
def addShellCommand(self,
context,
inputs,
argv,
outputs,
folder=-1,
dep_type=None,
weak_inputs=[]):
if folder is -1:
folder = context.localFolder

Expand All @@ -620,7 +627,8 @@ def addShellCommand(self, context, inputs, argv, outputs, folder=-1, dep_type=No
folder = folder,
data = data,
inputs = inputs,
outputs = outputs
outputs = outputs,
weak_inputs = weak_inputs
)

def addConfigureFile(self, context, path):
Expand Down
13 changes: 10 additions & 3 deletions ambuild2/frontend/base_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,15 @@ def AddFolder(self, folder):
def AddCopy(self, source, output_path):
return self.generator.addCopy(self, source, output_path)

def AddCommand(self, inputs, argv, outputs, dep_type=None):
return self.generator.addShellCommand(self, inputs, argv, outputs, dep_type=dep_type)
def AddCommand(self, inputs, argv, outputs, dep_type=None, weak_inputs=[]):
return self.generator.addShellCommand(
self,
inputs,
argv,
outputs,
dep_type = dep_type,
weak_inputs = weak_inputs
)

def AddConfigureFile(self, path):
return self.generator.addConfigureFile(self, path)
Expand Down Expand Up @@ -236,7 +243,7 @@ def addFolder(self, context, folder):
def addCopy(self, context, source, output_path):
raise Exception('Must be implemented!')

def addShellCommand(self, context, inputs, argv, outputs, dep_type=None):
def addShellCommand(self, context, inputs, argv, outputs, dep_type=None, weak_inputs=[]):
raise Exception('Must be implemented!')

def addConfigureFile(self, context, path):
Expand Down

0 comments on commit e6d789f

Please sign in to comment.