Skip to content

Commit

Permalink
all distributions that use a Truffle DSL annotation processor must us…
Browse files Browse the repository at this point in the history
…e TruffleArchiveParticipant
  • Loading branch information
dougxc committed Apr 1, 2016
1 parent 1c873ef commit db8f1df
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions mx.truffle/mx_truffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,21 @@ def __closing__(self):
self.arc.zf.writestr(arcname, content + os.linesep)

def mx_post_parse_cmd_line(opts):
dist = mx.distribution('TRUFFLE_TEST')
dist.set_archiveparticipant(TruffleArchiveParticipant())

def _uses_truffle_dsl_processor(dist):
for dep in dist.deps:
if dep.name.startswith('TRUFFLE_DSL_PROCESSOR'):
return True
truffle_dsl_processors = set()
def visit(dep, edge):
if dep is not dist and dep.isJavaProject():
for ap in dep.annotation_processors():
if ap.name.startswith('TRUFFLE_DSL_PROCESSOR'):
truffle_dsl_processors.add(ap)
dist.walk_deps(visit=visit)
return len(truffle_dsl_processors) != 0

for d in mx.dependencies():
if d.isJARDistribution():
if _uses_truffle_dsl_processor(d):
d.set_archiveparticipant(TruffleArchiveParticipant())

0 comments on commit db8f1df

Please sign in to comment.