jfrog / build-info

Artifactory's open integration layer for CI build servers
https://www.buildinfo.org
Apache License 2.0
147 stars 157 forks source link

unchanged artifacts should not be published to artifactory #1

Open jochenberger opened 11 years ago

jochenberger commented 11 years ago

I have a multi-module gradle project for libraries. In most there are changes to only a subset of the projects. In that case, I only want the changed artifacts to be published. I think that the artifactoryPublish task should be up-to-date for the unchanged artifacts. It seems to me that gradle should be able to detect that the task's inputs have not changed, however when running gradle with the --debug switch, the log says:

09:10:11.028 [LIFECYCLE] [org.gradle.TaskExecutionLogger] :configuration:artifactoryPublish
09:10:11.028 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Starting to execute task ':configuration:artifactoryPublish'
09:10:11.028 [DEBUG] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Determining if task ':configuration:artifactoryPublish' is up-to-date
09:10:11.028 [INFO] [org.gradle.api.internal.changedetection.ShortCircuitTaskArtifactStateRepository] Task ':configuration:artifactoryPublish' has not declared any outputs, assuming that it is out-of-date.

If, inspired by http://stackoverflow.com/questions/15655938/gradle-how-to-have-an-upload-task-make-an-up-to-date-check, I add an artifactoryPublish.outputs.upToDateWhen { true } to my build, I get

12:38:06.030 [INFO] [org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository] Skipping task ':configuration:artifactoryPublish' as it is up-to-date.

Maybe the BuildInfoBaseTask could be changed to declare that it doesn't have any outputs?

rkrisztian commented 6 years ago

+1. I have a task at root level like this:

task notifyPublicationsInEmail {
    projects.each {
        dependsOn "${it.path}:artifactoryPublish"
    }
    (...)
}

However: