Skip to content
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

Add support for quarkus:dev in multimodule projects #1973

Merged
merged 2 commits into from
Apr 11, 2019

Conversation

stuartwdouglas
Copy link
Member

Marked as a draft as it still needs tests, but it would be good to get early feedback

@stuartwdouglas stuartwdouglas marked this pull request as ready for review April 10, 2019 06:59
@stuartwdouglas
Copy link
Member Author

Looks like draft PR's don't get CI, changing to a normal one

resources.append(file.getAbsolutePath());
res = file.getAbsolutePath();
}
DevModeContext.ModuleInfo moduleInfo = new DevModeContext.ModuleInfo(getSourceDir().getAbsolutePath(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getSourceDir() is not actually not "correct" atm. The QuarkusPluginExtension.sourceDir/outputDirectory() methods returns a File, but it's "misleading"/wrong. The SourceSets they extract those locations from return a FileCollection. When we send it as a String/File the actual content of it is "correct" when the FileCollection only contained one item, else it's will be: file1:file2:file3....
I think we should change the Extension methods to return a List instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be able to look into this after the initial maven support is merged? I have not really looked at Gradle at all.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, we can do that!

Copy link
Member

@aloubyansky aloubyansky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good to me so far.

@@ -150,6 +150,8 @@
<jetty.version>9.4.15.v20190215</jetty.version>
<flyway.version>5.2.4</flyway.version>
<yasson.version>1.0.3</yasson.version>
<!-- Used for integration tests, to make sure webjars work-->
<bootstrap.version>3.1.0</bootstrap.version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to note that our bootstrap which is currently in the same repo is an independent project for which we may need to add another property here. So one or the other (or both) at that point will have to be disambiguated.

break;
}
}
if (classLoc != null && Files.exists(classLoc)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor one, if it's not null we can assume it exists.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't actually, would need to change the logic in the loop above to use a different variable and only assign after the test

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right.

try {
return Files.exists(resourcePath) ? resourcePath.toUri()
return resourcePath != null && Files.exists(resourcePath) ? resourcePath.toUri()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

//TODO: there is probably a better algorithm than this to establish the partial ordering
//basically we just iterate and add anything to the list that has not dependencies in 'toplace'
//this has worst case performance of O(n^2), if there is a linear relationship between
//the modules and the original order is reversed. As N is generally fairly small we can live with this for now
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theoretically, we might not need to include all the projects from the workspace. We could take the target project, navigate its dependencies and that should be it? I could look into that afterwards if you like.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the number of maven modules is big enough that the partial ordering algorithm becomes noticeable it would be a drop in the ocean. That TODO should be removed, I would be suprised if N is ever more than 100

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's not only the ordering though. They will be checked for changes, etc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I see what you mean. I think as a first attempt it is ok to monitor the whole project and look at improving it later

@stalep
Copy link
Member

stalep commented Apr 11, 2019

it looks good and whatever improvements we need in the maven/gradle plugins we can do in later prs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants