Skip to content

Commit

Permalink
Add derived_from to scrooge_gen scrooge generated targets
Browse files Browse the repository at this point in the history
  • Loading branch information
tejal29 authored and Tejal Desai committed Aug 20, 2014
1 parent 541f13c commit e5162aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/python/pants/backend/codegen/tasks/scrooge_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ def create_target(files, deps, target_type):
sources=files,
provides=gentarget.provides,
dependencies=deps,
excludes=gentarget.excludes)
excludes=gentarget.excludes,
derived_from=gentarget)

def create_geninfo(key):
compiler = self.compiler_for_name[self.defaults.get_compiler(gentarget)]
Expand Down
6 changes: 4 additions & 2 deletions tests/python/pants_test/tasks/test_scrooge_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ def test_smoke(self):
)
'''))

target = self.target('test_smoke:a')
task = prepare_task(ScroogeGen,
build_graph=self.build_graph,
targets=[self.target('test_smoke:a')],
targets=[target],
build_file_parser=self.build_file_parser)

with patch('pants.backend.codegen.tasks.scrooge_gen.calculate_services'):
Expand All @@ -116,6 +117,7 @@ def test_smoke(self):
sources=sources,
excludes=OrderedSet(),
dependencies=OrderedSet(),
provides=None)
provides=None,
derived_from=target)
finally:
Context.add_new_target = saved_add_new_target

0 comments on commit e5162aa

Please sign in to comment.