<?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 Jordan Gout on Medium]]></title>
        <description><![CDATA[Stories by Jordan Gout on Medium]]></description>
        <link>https://medium.com/@jordan.gout?source=rss-11a59629fdf1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*xohDSfa_-hF_Lc-5qPAJ5A.jpeg</url>
            <title>Stories by Jordan Gout on Medium</title>
            <link>https://medium.com/@jordan.gout?source=rss-11a59629fdf1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 04:26:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jordan.gout/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[Simplify Dependency Management for Android Projects with Gradle Version Catalog and Dependabot]]></title>
            <link>https://proandroiddev.com/simplify-dependency-management-for-android-projects-with-gradle-version-catalog-and-dependabot-38e776b6e18d?source=rss-11a59629fdf1------2</link>
            <guid isPermaLink="false">https://medium.com/p/38e776b6e18d</guid>
            <category><![CDATA[dependabot]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[gradle]]></category>
            <category><![CDATA[version-catalog]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Jordan Gout]]></dc:creator>
            <pubDate>Wed, 26 Jul 2023 15:34:24 GMT</pubDate>
            <atom:updated>2024-09-06T07:53:27.426Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GVY0hu7P2GaI_Si7" /><figcaption>Photo by <a href="https://unsplash.com/@synkevych?utm_source=medium&amp;utm_medium=referral">Roman Synkevych</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As Android engineers, one of the key challenges we face is keeping our project’s dependencies up-to-date. Doing it is time-consuming and as long as we wait, as long as it will be complicated to migrate dependencies to the latest version.</p><p>Fortunately, there are powerful tools available to simplify this process and ensure app is using the latest and most secure libraries.</p><p>Today I want to share how Gradle Version Catalog and Github’s Dependabot saved me a lot of work in my Android projects.</p><h3>Version Catalog</h3><p><a href="https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog">Gradle Version Catalog</a> is a feature that provides a centralized and consistent way to manage dependency versions. It has been released as an experimental feature in version Gradle 7.0 and promoted to stable in version 7.4.</p><h4>Create a Version Catalog</h4><p>To get started we need to create a libs.versions.toml file in root project’s gradle folder.</p><blockquote>libs is the default name but we can have multiple version catalogs and/or use another name but it will require more config and won’t be covered in this article.</blockquote><p>Version Catalog file has 4 sections:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dbc5ad17738430c2a22fab10edcbc5dd/href">https://medium.com/media/dbc5ad17738430c2a22fab10edcbc5dd/href</a></iframe><ul><li>In the versions section, define variables that hold the versions of dependencies and plugins. Variables can be shared between multiple dependencies.</li><li>In the libraries, define dependencies</li><li>In the bundles, define group of dependencies</li><li>In the plugins, define plugin</li></ul><p>In this article, we will focus on versions and libraries. Check <a href="https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml">documentation</a> for more info.</p><h4>Declare dependencies</h4><p>Now we need to declare dependencies:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b861be1c874358eb06b9e6d296d18597/href">https://medium.com/media/b861be1c874358eb06b9e6d296d18597/href</a></iframe><blockquote>The recommended naming is kebab case. Such as kotlin-coroutines-core and not camel case kotlinCoroutinesCore. Type-safe accessors `kotlin-coroutines-core` will be converted to `kotlin.coroutines.core`</blockquote><h4>Use Version Catalog</h4><p>Before using Version Catalog, we will need to sync project to make Gradle generate type-safe accessors.</p><p>Open app or module build.gradle(.kts) and update the dependencies block:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5d15cff58934c534cc45b57689ca1cfe/href">https://medium.com/media/5d15cff58934c534cc45b57689ca1cfe/href</a></iframe><p>That’s it!</p><h3>Dependabot</h3><blockquote>Disclaimer: the repository needs to be hosted on Github</blockquote><p><a href="https://docs.github.com/en/code-security/dependabot">GitHub Dependabot</a> is an automated dependency management tool provided by GitHub. It monitors a project’s dependencies and notifies about outdated versions. <br>It generates pull requests with information on the updates available.</p><p>Dependabot helps to ensure projects are using the latest dependencies.</p><p>Since march-23 Dependabot has an <a href="https://github.blog/changelog/2023-03-13-dependabot-version-updates-keeps-gradle-version-catalogs-up-to-date/">official support</a> of Gradle Version Catalog.</p><h4>How to configure it</h4><p>To enable version updates, we need to create a dependabot.yml file inside a root project’s .github directory.</p><p>This config file tells Dependabot which dependencies management tools we are using and how often it should check for updates.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/98e6f24b606691df89f567bcfd5de03d/href">https://medium.com/media/98e6f24b606691df89f567bcfd5de03d/href</a></iframe><p>Check <a href="https://docs.github.com/en/code-security/dependabot/dependabot-version-updates">documentation</a> for all settings.</p><h4>What’s pull request looks like</h4><p>Once Dependabot detects new dependencies version it creates a pull request that looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h7ZMdyz1B4A63MWpYcivbw.png" /><figcaption>Coroutines pull request from Dependabot</figcaption></figure><p>Pull request description contents release note, change log, and commit to help us identify -breaking- changes.</p><p>Dependabot groups all dependencies that use the same version on our Version Catalog.</p><blockquote>By default, Dependabot will open up to 5 pull requests with news updates per week but we can change this with the `open-pull-requests-limit` setting.</blockquote><h4>Dependabot action comments</h4><p>To be able to easily manage Dependabot’s pull requests, we can use pull requests comment to ask Dependabot to run some actions:</p><ul><li>@dependabot rebase will rebase this PR</li><li>@dependabot recreate will recreate this PR, overwriting any edits that have been made to it</li><li>@dependabot merge will merge this PR after CI passes on it</li><li>@dependabot squash and merge will squash and merge this PR after CI passes on it</li><li>@dependabot cancel merge will cancel a previously requested merge and block auto merging</li><li>@dependabot reopen will reopen this PR if it is closed</li><li>@dependabot close will close this PR and stop Dependabot from recreating it (Same result by closing it manually)</li><li>@dependabot ignore this major version will close this PR and stop Dependabot from creating any more for this major version (unless we reopen the PR or upgrade to it ourself)</li><li>@dependabot ignore this minor version will close this PR and stop Dependabot from creating any more for this minor version. (unless we reopen the PR or upgrade to it ourself)</li><li>@dependabot ignore this dependency will close this PR and stop Dependabot from creating any more for this dependency (unless we reopen the PR or upgrade to it ourself)</li></ul><h4>Conclusion</h4><p>By combining the power of Gradle Version Catalog and GitHub’s Dependabot, we can significantly streamline the process of managing dependencies for our Android projects. Centralizing version management with Gradle Version Catalog ensures consistency and ease of updates, while Dependabot automates the detection and application of the latest library releases.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38e776b6e18d" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/simplify-dependency-management-for-android-projects-with-gradle-version-catalog-and-dependabot-38e776b6e18d">Simplify Dependency Management for Android Projects with Gradle Version Catalog and Dependabot</a> was originally published in <a href="https://proandroiddev.com/">ProAndroidDev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Improve your Kotlin code with Detekt]]></title>
            <link>https://medium.com/frichtitech/improve-your-kotlin-code-with-detekt-65795656b1ed?source=rss-11a59629fdf1------2</link>
            <guid isPermaLink="false">https://medium.com/p/65795656b1ed</guid>
            <category><![CDATA[detekt]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[linter]]></category>
            <category><![CDATA[gradle]]></category>
            <dc:creator><![CDATA[Jordan Gout]]></dc:creator>
            <pubDate>Mon, 11 Oct 2021 12:52:39 GMT</pubDate>
            <atom:updated>2021-10-11T13:27:30.564Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*HEvspHNNfS3Mw-JYg64vqw.png" /></figure><p>As a developer you have your own coding style and keeping a codebase both consistent and maintainable in a project with multiple developers can be challenging.</p><p>During a code review, you want to focus on business logic, algorithmic, coding patterns and not on code styling, on variable naming, this is why you should use linters.</p><p>This article will focus on <a href="https://github.com/detekt/detekt">Detekt</a>, a static code analysis tool for Kotlin.</p><p>Detekt comes with multiple rules sets like <a href="https://detekt.github.io/detekt/style.html"><em>style</em></a>, <a href="https://detekt.github.io/detekt/complexity.html"><em>complexity</em></a>, <a href="https://detekt.github.io/detekt/naming.html"><em>naming</em></a>, and <a href="https://detekt.github.io/detekt"><em>others</em></a> and allowed to easily create you own rules.</p><p><strong>Add Detekt to your project</strong></p><blockquote><em>Note : On this article, code sample will used Gradle Kotlin DSL on a multi modules android project</em></blockquote><p>You need to add Detekt dependency to you buildSrc gradle file :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dda099714d0d5664c30b84909c5d1700/href">https://medium.com/media/dda099714d0d5664c30b84909c5d1700/href</a></iframe><p>You can use Detekt’s default task like <strong>./gradlew detekt</strong> but on this exemple I want to run Detekt only once on multiple modules. I need to create a plugin to define custom tasks and settings:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4969b2d91f83ad9c6b751165c72e0797/href">https://medium.com/media/4969b2d91f83ad9c6b751165c72e0797/href</a></iframe><p>In the code snippet above, we are setting the source directory of the project (projectDir), then we are defining two glob filters to run Detekt on all .kt and .kts files and finally we are ignoring the resources and the build folders</p><p>Finally, you need to enable the Detekt plugin on the gradle’s file at the root of your project:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K1mzngC-Iy9GnImhGg0e4w.png" /><figcaption>Apply custom your Detekt plugin to project</figcaption></figure><p><strong>Configure Detekt’s rules</strong></p><p>Now you need to select rules you want to apply to your project. You can either use <strong>buildUponDefaultConfig</strong> property or create your own config file.</p><p>Check <a href="https://detekt.github.io/detekt/configurations.html">Detekt docs</a> to create your own config file.</p><p><strong>Let’s run Detekt</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IS-1Zp5ONbl9wk3UGeqwIw.png" /></figure><p>Now Detekt is ready, but you may have some issues as above. In that case you can choose to fix them all but what if you can’t right now or what if your project is already in production and you have a couple hundred issues?</p><p>You can use <strong>@Supress</strong> annotation to ignore a single issue. You should use this option in the worst case only. To ignore existing issues you should use baseline.</p><p><strong>Create baseline file to ignore legacy issues</strong></p><p>We need to modify our Detekt plugin:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a47d113cbc047c3f8a7526c7270e73f4/href">https://medium.com/media/a47d113cbc047c3f8a7526c7270e73f4/href</a></iframe><p>Now we need to run <strong>./gradlew detektAllBaseline</strong> to ask Detekt to create our baseline file.</p><p>Let’s retry to run ./<strong>gradlew detektAll</strong> task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wsm-fWhZbH8fnUijGSpNYA.png" /></figure><p>All existing issues are now ignored so you can focus on new development and takes time to remove thoses previous issues.</p><p><strong>Going further</strong></p><ul><li>Install <a href="https://github.com/detekt/detekt-intellij-plugin">Detekt’s IntellJ plugin</a> to be warned during development phase</li><li>Run Detekt on your CI</li><li>Create your <a href="https://detekt.github.io/detekt/extensions.html#custom-rulesets">own rules</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65795656b1ed" width="1" height="1" alt=""><hr><p><a href="https://medium.com/frichtitech/improve-your-kotlin-code-with-detekt-65795656b1ed">Improve your Kotlin code with Detekt</a> was originally published in <a href="https://medium.com/frichtitech">FrichtiTech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>