-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Use JavaContainerBuilder in plugins #1572
Conversation
…com:GoogleContainerTools/jib into i1373-javacontainerbuilder-plugins
…73-javacontainerbuilder-plugins
jib-core/src/main/java/com/google/cloud/tools/jib/frontend/JavaLayerConfigurations.java
Show resolved
Hide resolved
jib-core/src/main/java/com/google/cloud/tools/jib/api/JibContainerBuilder.java
Show resolved
Hide resolved
...mmon/src/main/java/com/google/cloud/tools/jib/plugins/common/JavaContainerBuilderHelper.java
Outdated
Show resolved
Hide resolved
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.
Another early set of comments. (Sorry, there may be another set later, due to the magnitude of the API/structural changes.)
jib-core/src/main/java/com/google/cloud/tools/jib/api/JavaContainerBuilder.java
Outdated
Show resolved
Hide resolved
jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java
Outdated
Show resolved
Hide resolved
jib-core/src/main/java/com/google/cloud/tools/jib/api/JavaContainerBuilder.java
Outdated
Show resolved
Hide resolved
jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java
Outdated
Show resolved
Hide resolved
jib-core/src/main/java/com/google/cloud/tools/jib/api/JavaContainerBuilder.java
Outdated
Show resolved
Hide resolved
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.
Moving the extra layer code out of ProjectProperties
looks nice. I'll go over the PR once more. Sorry for the delay.
...on/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java
Show resolved
Hide resolved
jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java
Outdated
Show resolved
Hide resolved
jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MavenProjectProperties.java
Show resolved
Hide resolved
jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java
Outdated
Show resolved
Hide resolved
jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java
Outdated
Show resolved
Hide resolved
jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java
Outdated
Show resolved
Hide resolved
jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java
Outdated
Show resolved
Hide resolved
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.
Here are some comments. I need to make another pass through this; so many helpers.
jib-core/src/main/java/com/google/cloud/tools/jib/api/JavaContainerBuilder.java
Outdated
Show resolved
Hide resolved
jib-core/src/main/java/com/google/cloud/tools/jib/api/JavaContainerBuilder.java
Outdated
Show resolved
Hide resolved
jib-core/src/main/java/com/google/cloud/tools/jib/api/JavaContainerBuilder.java
Outdated
Show resolved
Hide resolved
...mmon/src/main/java/com/google/cloud/tools/jib/plugins/common/JavaContainerBuilderHelper.java
Outdated
Show resolved
Hide resolved
jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java
Show resolved
Hide resolved
.../src/test/java/com/google/cloud/tools/jib/plugins/common/JavaContainerBuilderHelperTest.java
Outdated
Show resolved
Hide resolved
jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MavenProjectProperties.java
Outdated
Show resolved
Hide resolved
jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java
Outdated
Show resolved
Hide resolved
jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java
Outdated
Show resolved
Hide resolved
...mmon/src/main/java/com/google/cloud/tools/jib/plugins/common/JavaContainerBuilderHelper.java
Show resolved
Hide resolved
LGTM for what I can check. I'll leave @briandealwis to approve this. |
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.
Could we have a better name than getContainerBuilderWithLayers
? It's really starting the containerization process. The {Gradle,Maven}ProjectProperties
doesn't seem like the right place for this, or maybe they just need to be renamed. That can be done later.
public JibContainerBuilder getContainerBuilderWithLayers(RegistryImage baseImage) | ||
throws IOException { | ||
try { | ||
if (isWarProject()) { |
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.
Ditto my comment in GradleProjectProperties
: it feels like we should have MavenWarProjectProperties
and MavenJarProjectProperties
.
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.
Yeah, I'll file an issue for this.
public JibContainerBuilder getContainerBuilderWithLayers(RegistryImage baseImage) { | ||
try { | ||
if (isWarProject()) { | ||
logger.info("WAR project identified, creating WAR image: " + project.getDisplayName()); |
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.
So this seems… out of place. It feels like we should have subclasses a GradleWarProjectProperties
and GradleJarProjectProperties
.
Fixes #1373.
Notable changes:
JavaLayerConfigurations
in plugins withJavaContainerBuilder
(aside from a couple global constants; should these be moved?)ProjectProperties.getClassFiles()
; since project properties no longer hold layer configurations, we need another way to pass a list of class files toMainClassResolver
GradleLayerConfigurations
andMavenLayerConfigurations
were consolidated enough that I decided to just move their logic straight intoGradleProjectProperties
/MavenProjectProperties
GradleLayerConfigurationsTest
andMavenLayerConfigurationsTest
were moved into their respectiveProjectProperties
testsPluginConfigurationProcessor
instead of theProjectProperties
, to avoid passing around too many parameters/share code between the pluginscontainerize()