-
Notifications
You must be signed in to change notification settings - Fork 3k
Extracting common devtools from Quarkus core repo #4615
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
Conversation
7d2442d
to
2ade2b0
Compare
2ade2b0
to
dcaf27f
Compare
f24f76e
to
c4842eb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
return this; | ||
} | ||
|
||
public QuarkusPlatformDescriptor resolve() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you could split that big method in a few sub private ones?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would if those method would be re-usable in other places. Otherwise, it's not that long and I'm pretty sure it's be changing pretty soon anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I am allergic to long methods 😂 I prefer shorter unit testable ones
@Override | ||
public void execute() throws MojoExecutionException { | ||
|
||
validateParameters(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aloubyansky this one is too long too bug I think it's copied code right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, I actually type it in :)
public static void setupQuarkusJsonPlatformDescriptor( | ||
RepositorySystem repoSystem, RepositorySystemSession repoSession, List<RemoteRepository> repos, | ||
String platformGroupId, String platformArtifactId, String defaultPlatformVersion, | ||
final Log log) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why log is final but not the rest 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't have to be now. Originally, it was referenced from an anonymous class, so it had to be final.
|
||
@Override | ||
public QuarkusJsonPlatformDescriptor load(QuarkusJsonPlatformDescriptorLoaderContext context) { | ||
context.getMessageWriter().debug("Loading Platform Descriptor from JSON %s", context.getJsonDescriptorFile()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
too long too :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not too long :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's too long :)
private final MessageWriter log; | ||
|
||
public QuarkusLegacyPlatformDescriptor(ClassLoader cl, MessageWriter log) { | ||
this.cl = cl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
too much logic for a constructor, this might need a factory?
This is going to need a rebase for the CI fix. Thanks |
c4842eb
to
b31a864
Compare
independent-projects/tools/pom.xml
Outdated
<parent> | ||
<groupId>org.jboss</groupId> | ||
<artifactId>jboss-parent</artifactId> | ||
<version>31</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<version>31</version> | |
<version>36</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
b31a864
to
97eb496
Compare
just so I don't have to remember in future, context from https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/quarkus-dev/snbwLidlOq8/pbusfmiOAAAJ "The main purpose of that PR is to detach the project generating and manipulating functionality from the manually maintained extensions.json file stored in the same JAR as the common devtools classes and also make the first step in the direction of making the tooling API not specific to a Quarkus release. Most of the code from devtools/common has been moved to independent-projects/tools for now. The reason this was done now is for Quarkus 1.0 release we want to also release a so called Quarkus Platform that will include extensions that are in the Quarkus repo plus Camel Quarkus extension which has been developed and maintained in a different repo. The platform will have its own BOM and it's equivalent of the extensions.json file. The PR introduces basic abstractions to do that, point to a specific release of the platform or look for the latest version of the desired "platform". The extension.json file is now going to be generated (the previous manually maintained version is not removed, the tools can still be configured to use it as a legacy descriptor) from a BOM. There is a new Maven goal https://github.com/quarkusio/quarkus-platform will be releasing its own BOM and the JSON descriptor. It's not all perfectly crafted at this point, of course, it's just the first step. |
platform = mapper.readValue(is, QuarkusJsonPlatformDescriptor.class); | ||
} | ||
} catch (IOException e) { | ||
e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be removed.
|
||
public static String getPluginArtifactId() { | ||
return get("plugin-artifactId"); | ||
return "quarkus-maven-plugin"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this really right? same question on the next 2 getters....why isn't this resolving the properties rather than being hardcoded ?
public static String getBomVersionForTemplate() { | ||
final String v = getBomVersion(); | ||
if(v.equals(getQuarkusVersion())) { | ||
// this might not always work but at this point we're assuming the bom is coming from Quarkus itself |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would (almost) always be wrong when using a platform wouldn't it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in which case we'll use specific version instead of ${quarkus.version}
. I left it this way until we adjust the templates and the tests for the platform use-case.
All the native tests are red AFAICS. |
97eb496
to
2381b27
Compare
2381b27
to
e180646
Compare
Unfortunately, there's a conflict. I'm rebasing and running the tests. Will push soon. |
e180646
to
c92f285
Compare
Rebased, force pushed and added a commit to exclude the sisu inject dependency from |
ok, thanks @gsmet |
Fixes #4315