As per the documentation on extension-points, there is a note
that this is designed to be used with imported build files.
I tried to create the example given (see attached files) where
build.xml imports targets and an extension-point and then
adds a dependency via the extensionOf.

This results in an error that the extension-point does not exist,
which it doesn't because the import is done after the
build is parsed.  I believe that I have the intent correct but
that there is a bug in TargetHelper in ProjectHelper2.  I can
see that the extensionOf needs to find the other target so that
it can add a dependency but that that target doesn't
exist since the import stack hasn't been fully popped.

I believe that the fix is to change ProjectHelper2 (I will try to
create my own in the short term) to add the extension to
a stack which then is processed after the import stack is done.
That is, all extensions should be done after the imports
are done.

Do I have the intent right?

I can add the extensionOfs to another file that is then imported
last and that works but its not what I want.
---
Brian Repko
LearnThinkCode, Inc.
email: brian.re...@learnthinkcode.com
phone: +1 612 229 6779

<?xml version="1.0" encoding="UTF-8"?>
<project name="modular-ant" default="compile">

  <import file="ant-example.xml" />

  <target name="generate-sources" extensionOf="ready-to-compile">
  </target>
  
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project name="ant-example">

  <target name="create-directory-layout">
  </target>
  
  <extension-point name="ready-to-compile" depends="create-directory-layout" />

  <target name="compile" depends="ready-to-compile">
  </target>

</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org

Reply via email to