Skip to content

Commit 2395f12

Browse files
committed
Merge pull request #2 in G/truffle from ~DOUG.SIMON_ORACLE.COM/truffle:fix/add-missing-TruffleArchiveParticipants to master
* commit 'db8f1df152a69e393a19bd9724b79f7fd7310582': all distributions that use a Truffle DSL annotation processor must use TruffleArchiveParticipant
2 parents 1c873ef + db8f1df commit 2395f12

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

mx.truffle/mx_truffle.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,5 +151,21 @@ def __closing__(self):
151151
self.arc.zf.writestr(arcname, content + os.linesep)
152152

153153
def mx_post_parse_cmd_line(opts):
154-
dist = mx.distribution('TRUFFLE_TEST')
155-
dist.set_archiveparticipant(TruffleArchiveParticipant())
154+
155+
def _uses_truffle_dsl_processor(dist):
156+
for dep in dist.deps:
157+
if dep.name.startswith('TRUFFLE_DSL_PROCESSOR'):
158+
return True
159+
truffle_dsl_processors = set()
160+
def visit(dep, edge):
161+
if dep is not dist and dep.isJavaProject():
162+
for ap in dep.annotation_processors():
163+
if ap.name.startswith('TRUFFLE_DSL_PROCESSOR'):
164+
truffle_dsl_processors.add(ap)
165+
dist.walk_deps(visit=visit)
166+
return len(truffle_dsl_processors) != 0
167+
168+
for d in mx.dependencies():
169+
if d.isJARDistribution():
170+
if _uses_truffle_dsl_processor(d):
171+
d.set_archiveparticipant(TruffleArchiveParticipant())

0 commit comments

Comments
 (0)