{"id":26054814,"url":"https://github.com/kanyun-inc/Kace","last_synced_at":"2025-03-08T10:00:07.802Z","repository":{"id":63229422,"uuid":"553411218","full_name":"kanyun-inc/Kace","owner":"kanyun-inc","description":"Kace: Kotlin Android Compatible Extensions, a framework for assisting in the seamless migration from kotlin-android-extensions","archived":false,"fork":false,"pushed_at":"2025-01-11T14:11:42.000Z","size":262,"stargazers_count":276,"open_issues_count":0,"forks_count":14,"subscribers_count":6,"default_branch":"kotlin-2.0.0","last_synced_at":"2025-03-05T21:09:34.832Z","etag":null,"topics":["android","kotlin","kotlin-android","kotlin-android-extensions","kotlin-compiler-plugin"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kanyun-inc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2022-10-18T07:10:15.000Z","updated_at":"2025-03-04T06:04:18.000Z","dependencies_parsed_at":"2024-06-20T14:33:42.570Z","dependency_job_id":"418b2626-eeb9-4b28-817b-8409a2dd59fb","html_url":"https://github.com/kanyun-inc/Kace","commit_stats":null,"previous_names":["beijing-kug/kace"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanyun-inc%2FKace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanyun-inc%2FKace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanyun-inc%2FKace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanyun-inc%2FKace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kanyun-inc","download_url":"https://codeload.github.com/kanyun-inc/Kace/tar.gz/refs/heads/kotlin-2.0.0","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242532349,"owners_count":20144726,"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","kotlin","kotlin-android","kotlin-android-extensions","kotlin-compiler-plugin"],"created_at":"2025-03-08T10:00:06.889Z","updated_at":"2025-03-08T10:00:07.774Z","avatar_url":"https://github.com/kanyun-inc.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"English | **[简体中文](README_zh.md)**\n\n# Kace\n[![Hex.pm](https://img.shields.io/hexpm/l/plug.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n[![Language](https://img.shields.io/badge/Language-Kotlin-green)](https://kotlinlang.org/)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.kanyun.kace/kace-gradle-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.kanyun.kace/kace-gradle-plugin)\n\n\u003e The Kace means kotlin-android-compatible-extensions, a framework for assisting in the seamless migration from kotlin-android-extensions\n\nThe kotlin-android-extensions framework has been deprecated for a long time and will be officially removed in Kotlin 1.8\n\nFor new code, we can use ViewBinding instead, but the migration of a large amount of old code is not an easy job for developers\n\nThe Kace implements the seamless migration of kotlin-android-extensions by parsing layout to generate source code, helping developers to easily upgrade to Kotlin 1.8\n\n## Quick Start\n### 1. Add the plugin to classpath\n```kotlin\n// Option 1\n// The classic way, add the following code to build.gradle.kts in the root directory\nbuildscript {\n    repositories {\n        mavenCentral()\n    }\n    dependencies {\n        classpath(\"com.kanyun.kace:kace-gradle-plugin:$latest_version\")\n    }\n}\n\n// Option 2\n// The new way, add the following code to settings.gradle.kts\npluginManagement {\n    repositories {\n        mavenCentral()\n    }\n    plugins {\n        id(\"com.kanyun.kace\") version \"$latest_version\" apply false\n    }\n}\n````\n\n### 2. Apply the plugin\nRemove the `kotlin-android-extensions` plugin and add the following code\n\n```kotlin\nplugins {\n    id(\"com.kanyun.kace\")\n    id(\"kotlin-parcelize\") // optional, need to be added when the `@Parcelize` annotation is used\n}\n````\n\n### 3. Configure the plugin (optional)\nBy default,The Kace will parse each layout in the module and generate code. Users can also customize the layout that needs to be parsed\n\n```kotlin\nkace {\n    whiteList = listOf() // When the whiteList is not empty, only the layout in the whiteList will be parsed\n    blackList = listOf(\"activity_main.xml\") // When the blackList is not empty, the layout in the blackList will not be parsed\n}\n````\n\n## Supported types\n- android.app.Activity\n- androidx.fragment.app.Fragment\n- androidx.fragment.app.DialogFragment\n- android.view.View (The View types currently do not support viewId caching )\n\nThe Kace currently supports the above four most commonly used types. Other types supported by kotlin-android-extensions such as android.app.Fragment, android.app.Dialog, kotlinx.android.extensions.LayoutContainer are deprecated or rarely used, currently not supported by the Kace\n\n## Version compatible\n| Kace         | Kotlin       | AGP   | Gradle |\n|--------------|--------------|-------|--------|\n| 1.7.0-1.0.4  | 1.7.0        | 4.2.0 | 6.7.1  |\n| 1.8.0-1.0.4  | 1.8.0~1.8.10 | 4.2.0 | 6.8.3  |\n| 1.8.20-1.1.0 | 1.8.20       | 4.2.0 | 6.8.3  |\n| 1.9.0-1.2.0  | 1.9.0~1.9.20 | 4.2.2 | 6.8.3  |\n| 1.9.20-1.2.0 | 1.9.20       | 4.2.2 | 6.8.3  |\n| 2.0.0-1.2.0  | 2.0.0        | 7.1.3 | 7.2    |\n\nSince the goal of the Kace is to help developers easily upgrade to Kotlin 1.8, the minimum supported version of Kotlin is relatively high\n\n## Benchmark\n### Compilation speed\nBy default, The Kace will parse each layout in the module and generate code, which may have a certain impact on the compilation speed\n\nThe Kace accelerates code generation by parallel tasks. After testing, the Kace plugin is applied into a module including 500 layouts, and the total time costed to parse layout and generate code during full compilation is about 1.5 seconds.\n\nThe Kace also supports incremental compilation. When modifying or adding a layout, the total time to parse layout and generate code is about 8 milliseconds\n\n### Package size\nThe code generated by The Kace is all inline extension properties, and the unused code will be automatically removed after Code shrinking. After testing, the package size has almost no change before and after applying the Kace plugin.\n\n## License\n````\nCopyright (C) 2022 KanYun\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanyun-inc%2FKace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkanyun-inc%2FKace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanyun-inc%2FKace/lists"}