<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Łukasz Bogusz on Medium]]></title>
        <description><![CDATA[Stories by Łukasz Bogusz on Medium]]></description>
        <link>https://medium.com/@lukefotit?source=rss-e846c3a6dc47------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-feT5t1X0it1FM74172CBg.png</url>
            <title>Stories by Łukasz Bogusz on Medium</title>
            <link>https://medium.com/@lukefotit?source=rss-e846c3a6dc47------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 19:03:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lukefotit/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Bill of Materials (BOM) with version catalog for Compose in Android]]></title>
            <link>https://medium.com/@lukefotit/bill-of-materials-bom-with-version-catalog-for-compose-in-android-c17bdb260613?source=rss-e846c3a6dc47------2</link>
            <guid isPermaLink="false">https://medium.com/p/c17bdb260613</guid>
            <category><![CDATA[version-catalog]]></category>
            <category><![CDATA[compose]]></category>
            <category><![CDATA[bill-of-materials]]></category>
            <dc:creator><![CDATA[Łukasz Bogusz]]></dc:creator>
            <pubDate>Sun, 30 Oct 2022 20:14:59 GMT</pubDate>
            <atom:updated>2022-10-30T20:14:59.687Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1QsNJtIIgAGG78OMF-nAHw.jpeg" /></figure><p><a href="https://developer.android.com/jetpack/compose/setup#using-the-bom">BOM</a> declares a set of dependency with their versions taking their compatibility off your shoulders. <a href="https://youtu.be/Awi4J5-tbW4?t=1097">Soon there might be more independence between them</a>, so one <em>core </em>to rule them all might not be possible.</p><p>BOM works with Gradle version catalog. You just need to specify your BOM in the .toml file as a regular dependency, then remove versions from all androidx.compose libraries. Compose integration artifacts such as navigation-compose can still be mixed with BOM covered dependencies (they are not part of Compose BOM). The catalog could look like below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c48cc68514bf8cafe8ec2b245b8a37f6/href">https://medium.com/media/c48cc68514bf8cafe8ec2b245b8a37f6/href</a></iframe><p>There is no need for a core compose version to manage multiple dependencies as they will divert eventually anyway. Depending on your project setup, you might want to separate integration libraries from BOM or use them altogether:</p><pre>// Include Compose BOM<br>implementation platform(libs.compose.bom)</pre><pre>// Compose BOM bundle and integration dependencies<br>implementation libs.bundles.compose</pre><pre>// Compose BOM bundle<br>implementation libs.bundles.compose.bom</pre><pre>// Single Compose dependency<br>implementation libs.compose.ui</pre><p>You can also create a custom catalog for compose to access it with:</p><pre>// Catalog name: compose.versions.toml<br>implementation platform(compose.bom)<br>implementation compose.bundles.core<br>implementation compose.ui</pre><p>Learn more about it here:</p><p><a href="https://sourcediving.com/manage-your-gradle-dependencies-with-version-catalog-not-only-in-android-114117647cdb">Manage your Gradle dependencies with Version Catalog (not only) in Android</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c17bdb260613" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Manage your Gradle dependencies with Version Catalog (not only) in Android]]></title>
            <link>https://sourcediving.com/manage-your-gradle-dependencies-with-version-catalog-not-only-in-android-114117647cdb?source=rss-e846c3a6dc47------2</link>
            <guid isPermaLink="false">https://medium.com/p/114117647cdb</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[dependency-management]]></category>
            <category><![CDATA[gradle]]></category>
            <dc:creator><![CDATA[Łukasz Bogusz]]></dc:creator>
            <pubDate>Fri, 15 Oct 2021 15:34:41 GMT</pubDate>
            <atom:updated>2021-10-15T15:34:41.035Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lmnESkzNgJ2Uo9tyx5gHYg.jpeg" /></figure><p>If you ever built a single module Android app, you probably managed your dependencies manually. We all started there. Then as you move to a multi-module setup, you realize it doesn’t work anymore and shiny highlights and convenient shortcuts from your IDE don’t really make your life easier, if you have to go through all the modules in your project to update dependencies. So you find yourself a better solution using ext blocks or even a buildSrc. You might want to take a quick recap and read <a href="https://handstandsam.com/2018/02/11/kotlin-buildsrc-for-better-gradle-dependency-management/">this</a> great summary. However with Gradle 7.0 there is a new player in town that can be another alternative.</p><h4>Where do I start?</h4><p>First and foremost, you have to opt into VERSION_CATALOG feature preview in your settings.gradle:</p><pre>enableFeaturePreview(&quot;VERSION_CATALOGS&quot;)</pre><p>That’s pretty much everything you need to start defining dependencies in your catalog. You can carry on in that file with the dependency definition specifying its version, alias or bundle:</p><pre>dependencyResolutionManagement {<br>  versionCatalogs {<br>    libs { <br>      version(&#39;ver&#39;, &#39;1.0.0&#39;)<br>      alias(&#39;my-alias&#39;).to(&#39;group&#39;, &#39;artifact&#39;).versionRef(&#39;ver&#39;)<br>      alias(&#39;another&#39;).to(&#39;group&#39;, &#39;artifact&#39;).versionRef(&#39;ver&#39;)<br>      bundle(&#39;my-bundle&#39;, [&#39;my-alias&#39;, &#39;another&#39;]) <br>   }<br>  }<br>}</pre><p>This enables you to use your alias or bundle across the project as libs.my.alias or bundle.my.bundle in the .gradle files. Alias represents a single dependency while bundle can incorporate as many dependencies as you want. Version catalogs support autocompletion in the IDE through their type-safe accessors generated by Gradle.</p><p>You probably noted that — character is replaced by . for the catalog. Separators such as -, _, . create subsections and subsection can not be a name on its own. This means that you can’t have alias(&#39;dagger&#39;) and alias(&#39;dagger-android&#39;) so you will likely go with alias(&#39;dagger-core&#39;) instead. You can read more about type safe accessors in the official <a href="https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog-declaration">documentation</a>.</p><h4>Structured catalog with TOML files</h4><p>Although you might define versions, aliases, bundles and plugins in one place settings.gradle, the beauty of version catalog comes from the ability to split your dependencies in a more structured manner. They can be declared in .toml files and by default Gradle will use gradle/libs.versions.toml as the input for libs catalog. All you need is to create this file in your repository declaring [versions], [libraries], [bundles] , [plugins] and following structure:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/234d21f36acc206eacd6639c091cb79b/href">https://medium.com/media/234d21f36acc206eacd6639c091cb79b/href</a></iframe><p>The access for each section is the same as you would define it within a .gradle file. You can use each section item alone and here are some examples of how you might want it:</p><pre>// Access versions in your top build.gradle<br>buildscript {    <br> ...<br> dependencies {        <br>   classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:${libs.versions.kotlin.get()}&quot;<br> }<br>}</pre><pre>// Access versions in the android block <br>composeOptions {        <br> kotlinCompilerExtensionVersion androidx.versions.compose.core.get()        <br> kotlinCompilerVersion libs.versions.kotlin.get()    <br>}</pre><pre>// Implement a single dependency <br>implementation libs.google.material</pre><pre>// Implement the whole bundle <br>implementation libs.bundles.accompanist</pre><pre>// Use with annotationProcessor or kapt<br>annotationProcessor libs.room.compiler</pre><h4>I want more catalogs</h4><p>Default libs catalog is quite convenient but when your start defining your dependencies you might want to give more meaning to the libs subsection. You can override its name through <a href="https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml">defaultLibrariesExtensionName</a>, but more importantly you can import another catalog to the project.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4ddcdb7b86d030a94f540f870f077dd9/href">https://medium.com/media/4ddcdb7b86d030a94f540f870f077dd9/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c957d401aa31f8a8375079ea02ed40e7/href">https://medium.com/media/c957d401aa31f8a8375079ea02ed40e7/href</a></iframe><p>Newly created catalog can be accessed similarly to the default one:</p><pre>// Implement a single dependency <br>implementation androidx.lifecycle</pre><pre>// Implement the whole bundle <br>implementation androidx.bundles.base<br>implementation androidx.bundles.compose</pre><h4>Version updates (bonus)</h4><p>Unfortunately, there is no support for versions update at the moment. If a new version of a dependency arrives, the IDE will not highlight outdated versions, but neither do you have this with ext blocks. However, that doesn’t mean there is no tool to support that. You can grab the Gradle version plugin from Ben Manes and adjust it to your needs:</p><p><a href="https://github.com/ben-manes/gradle-versions-plugin">GitHub - ben-manes/gradle-versions-plugin: Gradle plugin to discover dependency updates</a></p><p>Take a look at the official documentation to learn more!</p><p><a href="https://docs.gradle.org/current/userguide/platforms.html">Platforms</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=114117647cdb" width="1" height="1" alt=""><hr><p><a href="https://sourcediving.com/manage-your-gradle-dependencies-with-version-catalog-not-only-in-android-114117647cdb">Manage your Gradle dependencies with Version Catalog (not only) in Android</a> was originally published in <a href="https://sourcediving.com/">Source Diving</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>