0.16.0
Pre-release
Pre-release
What's Changed
These are breaking changes, but easy to migrate. Please note the library is still pre-release, as 0.x
suggests.
API redesign
Below are examples of how to adapt to the new API. Refer to the latest README and javadoc.
Imports and API calls
-gradleEnterpriseApi.getBuilds(...)
+GradleEnterpriseApi.buildsApi.getBuilds(...)
-gradleEnterpriseApi.createOrUpdateBuildCacheNode(...)
+GradleEnterpriseApi.buildCacheApi.createOrUpdateBuildCacheNode(...)
-import com.gabrielfeo.gradle.enterprise.api.getBuildsFlow
-gradleEnterpriseApi.getBuildsFlow(...)
+import com.gabrielfeo.gradle.enterprise.api.extension.getBuildsFlow
+GradleEnterpriseApi.buildsApi.getBuildsFlow(...)
-import com.gabrielfeo.gradle.enterprise.api.model.get
-import com.gabrielfeo.gradle.enterprise.api.model.contains
+import com.gabrielfeo.gradle.enterprise.api.extension.get
+import com.gabrielfeo.gradle.enterprise.api.extension.contains
"LOCAL" in gradleAttributes.tags
gradleAttributes.propertyValues["Git commit id"]
Shutdown
-shutdown()
+GradleEnterpriseApi.shutdown()
Configuration via code
-options.cache.cacheEnabled = true
-gradleEnterpriseApi.getBuilds(...)
+val config = Config(cacheConfig = CacheConfig(cacheEnabled = true))
+val api = GradleEnterpriseApi.newInstance(config)
+api.buildsApi.getBuilds(...)
Default HTTP cache dir
The default HTTP cache dir is changed from ${java.io.tmpdir}/gradle-enterprise-api-kotlin-cache
to ${user.home}/.gradle-enterprise-api-kotlin-cache`. If you were using the default path and want to keep the old cache contents, you may simply move it to the new location.
# Print the current java.io.tmpdir path
echo 'System.out.println("\n" + System.getProperty("java.io.tmpdir"))' | jshell --feedback concise
# Move it to the new location
mv "<old-tmpdir>/gradle-enterprise-api-kotlin-cache" "$HOME/.gradle-enterprise-api-kotlin-cache"
For motivations, see the original PRs:
- Redesign API for better usage in projects by @gabrielfeo in #49
- Improve javadoc and rename withOptions by @gabrielfeo in #67
- Rename Options to Config by @gabrielfeo in #68
- Share clientBuilder between Config constructor calls by @gabrielfeo in #70
- Use a stable path for default HTTP cache dir by @gabrielfeo in #71
Full Changelog: 0.15.1...0.16.0