-
Notifications
You must be signed in to change notification settings - Fork 0
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
Improve how the plugin is passed configuration information (iteration 2) #14
Comments
This commit starts working to try and make the Umple plugin behave similarly to the Scala and Antlr plugins. I've realized that having the configuration in the `sourceSets` is not worth-while, however, we can use them to add extra configuration (mostly dependency checks). The current state has a global configuration closure (`umple`) that specifies the information on how to generate things _per project_. The idea would be to allow for the specification of an array of generators and we always place them into a subdirectory that is `build/generated-src/$lang`. Additionally, I've added some testing that does not require the `integrationTests` style testing, that should simplify some testing -- we still need the integration ones, though. [skip ci]
Referencing @vahdat-ab so that he knows what we're currently working on. I'm going to try and work on this issue in tandem with the umple compiler jar stuff we're discussing in #10 |
Great, thanks. |
@vahdat-ab @Nava2 To be clear, what I was talking about was adding the Gradle Eclipse Plugin to our Gradle plugin's |
@AdamBJ Check this out: http://stackoverflow.com/a/43047325/1748595 (the comments particularly) |
I've had a look at the comments. Seems like a good idea, though there's a lot of stuff that's new to me. Hard to wrap my head around. Here's a couple things I'm trying to figure out: In your commit, you add the configuration defaults like this:
According to what the SO guy said, we should also be using a DslObject to somehow add a bunch of properties and methods to our SourceSets. Like this:
Does that mean we're supposed to be adding the defaults via the DslObject now? Or should we keep both steps? And how do we access the If we get rid of the I'm going to have another look at everything tomorrow. On the plus side, I've got to the point where I can run the |
Made a bit more progress today, though the going is still slow. There's a lot of stuff I still don't fully understand, like how the FYI this is the error I've been battling when I try to run the
The second one is being caused because the default value for |
That is a good resource. Is the code pushed in the branch? I'm finishing up writing my final exam for my course tonight, but I should have some time to look. |
Just checked, no code is up on github, could you push what you've been working on? I can take a look later. |
I've pushed my changes. They're still fairly rough (spacing etc will need to be fixed). The main changes I made are:
I've pointed out 1) and 2) with comments on the commit page. |
I think one problem is that we're changing how we're using To configure the
We used to be setting the convention like this:
But we're using a |
After a lot of poking and prodding we've finally got a plan for how we can fix the issues with the ss-config-2 branch. The problem right now is that we can't seem to specify custom configuration values. For example:
Leads to a "Unknown Property Error" for I'm going to try to apply these changes to the plugin tomorrow. Everyone keep their fingers crossed! |
I had a quick look at things before bed. Here are the remaining issues as far as I can tell: We're currently only using the default values from
Inside
|
I think what we do for the generate task is just change it two one of two ways:
I think the Java plugin prefers 1, so I'm inclined that way. :) |
Ok, I'll look into adding the check within |
@Nava2, the problem is that the configuration of the |
Think I got it! When we run Need to test this more fully, and see how it'll all work with the default In
and in
The second bit will need some if/else logic so that a field only gets overwritten if we the user has specified a value for it. |
Not quite out of the woods yet as it turns out. Still have that Update: this is driving me crazy! I've never had to specify a |
Can you push what you've got? Just tag the commit with skip ci (in square brackets, mobile keyboard doesn't have them...), and Travis won't run it. This all looks good, I'm happy to look at it today, finally got some time to myself. |
Tried to address some of the concerns from #14, but still needs integration testing. @AdamBJ solved most of the leg work, I fought with it a bit more and figured out how to actually get the information back from the sourceSet closures. By adding the properties to the `UmpleSourceSet` (via the `UmpleOptions` interface), we can now set the properties that we want for running Umple. This is because when the `Closure` is applied, the `delegate` used for figuring out what fields are what is set to be the `SourceSet` that it is called against (in this case, `UmpleSourceSet`). See [1] for more information on how to apply `Closure`s. The TODO from all of this: 1. Create a better testing suite -- the "properties-as-strings" approach is nasty, we need to do better 2. Add more integration testing 3. Verify what I did makes sense.. I think I may have excessively created the "config-style" as I'm not sure how many tasks are made per project [1] http://groovy-lang.org/closures.html#closure-this
Check out the changes I made in ef3750d. I noticed this message after running
I think it leads from the bolded point below.. TODO:
|
Random note: Gradle uses slf4j, so to properly log while running gradle you need to do: private static final logger = Logging.getLogger(MyClass) and just use it... No idea why I didn't think about this earlier. |
Also... https://docs.gradle.org/3.3/userguide/test_kit.html#sub:test-kit-debug asdfajshdfkajshdfasdflkjhasdfasd. There, I got out my frustration about not finding this until now. |
Do you mean we missed some functions that make working with a |
Debugging the actual plugin itself. I was trying to do it all via "println()" when there is support for debugging the plugin itself. I just missed it in the docs. |
Ah, yeah I see it at the bottom. That would have been handy! I'm going to see if I can get the debugger working in Eclipse. |
Ugh, nothing with Gradle is ever easy. Have you gotten the debugger working in IntelliJ? I think I'm close with Eclipse, but I'm getting a error that says the |
I've got it working in IntelliJ, not Eclipse: This is how I was launching the debugger. Important line. |
Kevin has made some changes to how the plugin reads configuration information from the projects it is applied to. He's also added new tests. See d249ce1
There are a number of issues to resolve before we can merge these changes into
master
. Roughly:build.gradle
file. Do whatever initialization is necessary to get it working.umple
configuration closure is independent of theSourceSet
s in the project (it can be used to configure the source sets, but it is not a part of the source sets)We're also going to need to settle on a final configuration syntax. This is still up in the air, and will depend on the answer to a question Kevin has asked about source set configuration on the Gradle forum
The text was updated successfully, but these errors were encountered: