-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bring CompilerBuildContext to this library as part of the default build context #13
Comments
Java does not have notion of source 'include'. There are type imports, but they are quite different from source includes. We tried to model source imports as kind of input-to-input association when we looked at antlr support in the past, but API was clumsy and we didn't really need anltr support, so we didn't implement source includes. I suggest you introduce new AbstractBuildContext subclass with the behaviour that you need, then we can see if we can make a general API in incrementalbuild library. |
Ok, I'll give it a shot then. I'm not super familiar with how maven magically creates the BuildContext objects, looks like.. just need a MojoExecutionScoped annotation? Though, it looks like maybe I can define a custom one if I can change the provider somehow... probably another magic annotation? |
You need |
Ok, so I'm at a point where I know what information I need to store so I can do this, but I'll have to get to it tomorrow. I think the right API for what I'm looking for is something like:
And the idea would be that internally, there's yet another list of inputs. So if a change happens to This seems pretty intuitive to me from an API perspective, is there something I missed that you guys ran into when you were playing with ANTLR? It seems like it would be easier to just change this library directly, and push my fork to you. This would require adding methods to the interface for ResourceMetadata, I'm not sure if that's a change you're willing to make. |
We used to have There were few problems with that. First, So I still think you should start with a custom build context implementation. Introduce |
To resolve the problem of For "input is used to generate another output which is used as an input", well, you already have a check in there to make sure that isn't allowed. ;) For your multiple inputs aggregated into single output -- isn't there a separate context that takes care of that sort of thing? I haven't looked too carefully at it yet, though it's strange that it's not part of the default build context. I'll play with it some more today and see if I can come up with something that doesn't involve a lot of copy/paste, but I don't think that will be easy to do and a fork will be easier. But we will see. |
Maybe we should reconsider use of the same
|
Alright, you were right -- that was pretty easy once I found everything I needed, and it seems to work in the limited testing I've done. Here's a gist of my object -- pretty short: https://gist.github.com/virtuald/77d14ad1f01ff61cd20e This is a really useful library, thanks so much for the work! I'll be exploring the other lifecycle pieces too, but it seems pretty solid so far. |
The use case I'm thinking of is for generating java sources from the AVRO IDL (and I'm sure other IDL source generators have this same issue). The IDL specifies an 'import' statement that allows building a set of files using multiple inputs -- so it would be good to have a built-in way of saying:
It seems like you already have to do this sort of thing for a compiler, so extracting the CompilerBuildContext from the takari-lifecycle project and making it more generic and bringing it into the default build context would be useful.
The text was updated successfully, but these errors were encountered: