{"id":27217463,"url":"https://github.com/gradleup/compat-patrouille","last_synced_at":"2025-04-15T02:47:24.735Z","repository":{"id":286827007,"uuid":"962626109","full_name":"GradleUp/compat-patrouille","owner":"GradleUp","description":"🐾🐾 La Compat-Patrouille helps you configure your Java/Kotlin compatibility flags.🐾🐾","archived":false,"fork":false,"pushed_at":"2025-04-08T21:59:02.000Z","size":74,"stargazers_count":19,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-15T02:47:18.872Z","etag":null,"topics":["android","gradle","java","kotlin"],"latest_commit_sha":null,"homepage":"https://GradleUp.github.io/compat-patrouille/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GradleUp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-08T12:41:33.000Z","updated_at":"2025-04-14T15:54:10.000Z","dependencies_parsed_at":"2025-04-10T07:06:13.705Z","dependency_job_id":null,"html_url":"https://github.com/GradleUp/compat-patrouille","commit_stats":null,"previous_names":["gradleup/compat-patrouille"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GradleUp%2Fcompat-patrouille","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GradleUp%2Fcompat-patrouille/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GradleUp%2Fcompat-patrouille/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GradleUp%2Fcompat-patrouille/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GradleUp","download_url":"https://codeload.github.com/GradleUp/compat-patrouille/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248997086,"owners_count":21195797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","gradle","java","kotlin"],"created_at":"2025-04-10T05:28:49.028Z","updated_at":"2025-04-15T02:47:24.721Z","avatar_url":"https://github.com/GradleUp.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maven Central](https://img.shields.io/maven-central/v/com.gradleup.compat.patrouille/compat-patrouille-gradle-plugin?style=flat-square)](https://central.sonatype.com/namespace/com.gradleup.compat.patrouille)\n[![OSS Snapshots](https://img.shields.io/nexus/s/com.gradleup.compat.patrouille/compat-patrouille-gradle-plugin?server=https%3A%2F%2Foss.sonatype.org\u0026label=oss-snapshots\u0026style=flat-square)](https://oss.sonatype.org/content/repositories/snapshots/com/gradleup/compat/patrouille/)\n\n\n# 🐾 Compat-Patrouille 🐾\n\nThe Compat-Patrouille helps you configure your Java/Kotlin compatibility flags: \n\n```kotlin\ncompatPatrouille {\n  java(17)\n  kotlin(\"2.0.21\")\n}\n```\n\n### Rationale\n\nConfiguring Java/Kotlin compatibility flags is a mundane task that comes with surprising amounts of questions:\n\n* What is the difference between `sourceCompatibility` and `targetCompatibility`?\n* Should I use `release` instead?\n* What does `release` even mean on Android?\n* Why do I need to configure Java compatibility if I only do Kotlin?\n* How do I configure `release` with Kotlin?\n* Should I use `tasks.withType\u003cKotlinCompile\u003e` or `compilerOptions {}` or something else?\n* Is it \"1.8\" or \"8\" or `JavaVersion.VERSION_1_8`?\n* Is it `org.jetbrains.kotlin.gradle.dsl.KotlinVersion` or `kotlin.KotlinVersion`?\n* And more...\n\nLa Compat Patrouille handles all of that with just two simple functions!\n\n### Usage\n\n```kotlin\nplugins {\n  id(\"java\")\n  // Add your Kotlin/Android plugins here\n  // Add the CompatPatrouille plugin\n  id(\"com.gradleup.compat.patrouille\").version(\"0.0.0\")\n}\n\n/*\n * Configure all your Java/Kotlin targets with a single code block.\n * This code block works regardless of if you're using Kotlin/Android/KMP/etc...\n * You can copy/pate it\n */\ncompatPatrouille {\n  // Java takes an int for simplicity\n  java(17)\n  // Kotlin takes a string so you have more control of the patch release of the stdlib.\n  // languageVersion/apiVersion are configured with the minor version only.\n  kotlin(\"2.0.21\")\n}\n```\n\nIf you have convention plugins, you can also use the Compat-Patrouille without all the plugin ceremony:\n\n```kotlin\nimport compat.patrouille.configureJavaCompatibility\nimport compat.patrouille.configureKotlinCompatibility\n\nclass ConventionPlugin: Plugin\u003cProject\u003e {\n  override fun apply(target: Project) {\n    target.configureJavaCompatibility(17)\n    target.configureKotlinCompatibility(\"2.0.21\")\n  }\n}\n```\n\nThat's it, you can now keep on with your life.\n\n### Note\n\nCalling `CompatPatrouilleExtension.java()` or `CompatPatrouille.kotlin()` requires the java/kotlin/android to be applied (this plugin does not use `pluginManager.withId {}`). This is typically the case if you use the `plugins {}` block. But If you're applying your plugins programmatically, make sure to call `CompatPatrouilleExtension.java()` or `CompatPatrouille.kotlin()` only after all your plugins have been applied.\n\n### Requirements:\n\n* Gradle 8+\n* For Kotlin: Kotlin Gradle Plugin 1.9.0+\n* For Android: Android Gradle Plugin 8.2.0+\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgradleup%2Fcompat-patrouille","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgradleup%2Fcompat-patrouille","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgradleup%2Fcompat-patrouille/lists"}