Skip to content

0.16.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@gabrielfeo gabrielfeo released this 23 May 20:50
· 236 commits to main since this release
2fcb1a5

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:

Full Changelog: 0.15.1...0.16.0