Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-823

Ability to allow mojos to communicate with each others - other than project's source root and project's attachment

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-beta-1
    • 2.0-beta-3
    • POM
    • None
    • xp, linux

    Description

      For native case, I need ability to allow my resource compiler mojo to tell my linker mojo additional resource output file (.res) to link at link time.
      This is for windows environment only.

      Brett suggests M2 to provide a share context between mojos

      Here is the the conversation on IRC
      <dantran> brett, I have a special case in native plugin where I need to tell linker to use additional files at packing phase, but the file is not on dependency list
      <dantran> like the ouput of microsoft resource compiler ouput
      <dantran> does it make sense?
      <brett> yes
      <dantran> resource compiling is a extra step at compile phase for windows env
      <brett> I think we should allow plugins to share a context
      <brett> so you can pass the results of that mojo onto another mojo within your plugin
      <dantran> yup
      <brett> but you probably don't even need that
      <brett> you can use the same condition used to trigger the resource compiler to trigger the addition of the files, right?
      <dantran> thinking..
      <dantran> resource compliler is triggered by user...
      <dantran> just like generate-source type mojo.. but only at compile phase
      <brett> oh, really?
      <dantran> the linking api.. is very dummy ....
      <brett> I thought it would be registered for any native build, and only do something if the target platform was win32
      <dantran> user has a rc file ... adn compile it to .res file ..then pass to linker
      <brett> yes, I vaguely remember how it works
      <brett> ok, you are probably right, its not always configured
      <brett> for now, can the linker just use it if it exists?
      <dantran> yeah .. add target/native/myres.res to linker option
      <dantran> ugly thou
      <dantran> yes, the linker use it if it is on its list of external libs
      <dantran> plus its .o/.obj it knows about
      <dantran> so I have to specify the fullpath of the .res file .. ${basedir}/target/native/myres.res in linkermojo configuration
      <dantran> perhaps i can get the resourcecompilmojo to place the path of res file on what you called plugin context .. have the linker mojo to look for that and pass to linker commandline
      <brett> we don't have a plugin context though
      <dantran> what about a context you mentioned?
      <brett> it doesn't exist
      <brett> yet
      <dantran> should i create a jira so you can track it? or you already have one... a enhancement request
      <brett> create one
      <dantran> will do

      Attachments

        1. pom.xml
          3 kB
          Dan Tran

        Issue Links

          Activity

            People

              jdcasey John Dennis Casey
              dantran Dan Tran
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 2h
                  2h
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h
                  2h