Now that Spring Cloud Contract is generating a plugin marker, it's much
easier to functionally test using Gradle TestKit by utilizing the
withPluginClasspath() and the 'java-gradle-plugin' Gradle plugin. Since
Gradle recommends new users, as well as new plugin authors, to use the
plugin markers and plugins{} syntax we should also follow that same
path. Especially given that there has been feature parity with the
buildscirpt{} block some releases ago.
Both Eclipse, via Buildship, and Intellij automatically add in init
scripts that run with the Gradle execution. In these they add in the
eclipse or idea plugins, so that those ide's get associated
configurations and tasks necessary for them.
This plugin is required when using the withPluginClasspath(..) method,
but during Gradle execution it creates a listing of the classpath that
the plugin under test would have. We can then use that explicitly to
build up the necessary classpath in the init.gradle script for loading
the necessary classes to run integration tests against the plugin
without needing to copy all of the jar files into a folder via a Gradle
task.
Replaced custom caching of the downloaded contracts with Gradle's
incremental build. After that `InitContractsTask` is not needed any
more, as its main purpose was to be a bridge between custom caching
and Gradle's one. Simplified code to download contracts is now part of
the `ContractsCopyTask`.
Also fixed `PublishStubsToScmTask` and removed incremental stuff from
there for now.
Fixes gh-1133
With current implementation of the `GradleContractsDownloader`, where
we have custom caching, `InitContractsTask` doesn't really need to be
incremental. Moreover, there is an issue in current implementation of
the `InitContractsTask`: it doesn't mark itself as out of date when
dynamic dependency is used (`+` or `SNAPSHOT` version). So for now just
disabling incremental build for that task.
Also restored old behaviour, where we used to always use `".*"` pattern
to define included contracts for `GenerateServerTests` task.
Also fixed minor logging issue.
Fixes gh-1133
In order to make it working - I had to define clear input and output
params for each gradle task.
As part of this task I've also cleaned up some services to define clear
inputs instead of generic `ContractVerifierConfigProperties`.
Fixes gh-1133