-
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
Auto build gradle lib-project dependencies #821
Conversation
91ab7cd
to
59293dd
Compare
Search through all configurations for dependencies of the style 'configurationName project(":path")' and have jib depend on the 'assemble' task of that project. This ensure jar dependencies are built before jib starts to package the project.
59293dd
to
55939ef
Compare
dockerContextTask.dependsOn(classesTask); | ||
buildDockerTask.dependsOn(classesTask); | ||
buildTarTask.dependsOn(classesTask); | ||
buildImageTask.dependsOn(taskDependencies.toArray()); |
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.
Can use setDependsOn
to avoid toArray
.
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.
That overwrites any previously dependencies.
For instance in a build.gradle like
apply plugin: 'jib'
task myCustomTask {
doLast {
// blah balh
}
}
jib.dependOn("myCustomTask")
the build using setDependsOn
will not honor the myCustomTask
dependency.
* @param project this project we are containerizing | ||
* @return a list of "assemble" tasks associated with projects that this project depends on. | ||
*/ | ||
static List<Task> getProjectDependencyAssembleTasks(Project project) { |
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.
nit: Order above non-static and annotate with @VisibleForTesting
.
@@ -40,6 +40,42 @@ | |||
@VisibleForTesting static final String BUILD_DOCKER_TASK_NAME = "jibDockerBuild"; | |||
@VisibleForTesting static final String DOCKER_CONTEXT_TASK_NAME = "jibExportDockerContext"; | |||
|
|||
private static void checkGradleVersion() { |
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.
nit: private static below package-private static
Search through all configurations for dependencies of the style
'configurationName project(":path")' and have jib depend on the
'assemble' task of that project. This ensure jar dependencies
are built before jib starts to package the project.
Fixes #815