{"id":13726037,"url":"https://github.com/pocmo/recompose","last_synced_at":"2025-04-13T05:04:44.250Z","repository":{"id":41971380,"uuid":"295527648","full_name":"pocmo/recompose","owner":"pocmo","description":"recompose is a tool for converting Android layouts in XML to Kotlin code using Jetpack Compose.","archived":false,"fork":false,"pushed_at":"2023-03-03T20:56:21.000Z","size":1298,"stargazers_count":805,"open_issues_count":23,"forks_count":49,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-13T05:04:23.326Z","etag":null,"topics":["android","android-studio-plugin","compose","hacktoberfest","intellij","jetpack-compose","kotlin"],"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/pocmo.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2020-09-14T20:12:03.000Z","updated_at":"2025-04-08T16:59:56.000Z","dependencies_parsed_at":"2024-01-06T02:02:18.470Z","dependency_job_id":"ffbdc615-7257-470d-89fa-4979c7b3cb14","html_url":"https://github.com/pocmo/recompose","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocmo%2Frecompose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocmo%2Frecompose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocmo%2Frecompose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocmo%2Frecompose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pocmo","download_url":"https://codeload.github.com/pocmo/recompose/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665748,"owners_count":21142123,"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","android-studio-plugin","compose","hacktoberfest","intellij","jetpack-compose","kotlin"],"created_at":"2024-08-03T01:02:49.705Z","updated_at":"2025-04-13T05:04:44.187Z","avatar_url":"https://github.com/pocmo.png","language":"Kotlin","readme":"# recompose\n\nrecompose is a tool for converting [Android layouts in XML](https://developer.android.com/guide/topics/ui/declaring-layout)\nto Kotlin code using [Jetpack Compose](https://developer.android.com/jetpack/compose). It can be used on the command line,\nas IntelliJ / Android Studio plugin or as a library in custom code.\n\n![](demo.gif)\n\n## Running\n\n### IntelliJ / Android Studio plugin\n\nThe plugin does not get published yet. If you want to try them then you'll have to build them from code. Use the Gradle task `runIde` to run a test IDE with the plugin installed or create an installable plugin with the `buildPlugin` task. The plugin zip will be placed in `recompose-idea/build/distributions/`. To learn how to install it, read the [Install plugin from disk](https://www.jetbrains.com/help/idea/managing-plugins.html#install_plugin_from_disk) section in the IntelliJ docs.\n\n### Command-line interface (CLI)\n\nLike the plugin, the command-line interface does not get published yet. You can run it directly from Gradle via\n`./gradlew recompose-cli:run --args=\"list file paths..\"`. Alternatively you can run the `assembleDist` which will place\na zip/tar containing a binary into `recompose-cli/build/distributions/`.\n\n```\nUsage: recompose [OPTIONS] INPUT...\n\nOptions:\n  -o, --output PATH  Output directory for Kotlin code\n  -h, --help         Show this message and exit\n\nArguments:\n  INPUT  Layout XML files to convert to Kotlin\n```\n\n## Building\n\nEither import the project into [IntelliJ IDEA](https://www.jetbrains.com/idea/) or use [Gradle](https://gradle.org/) on\nthe command line (via the provided `gradlew` wrapper).\n\n### Modules\n\n* **recompose-ast**: Contains the data classes for the Abstract Syntax Tree (AST) representing a parsed XML layout.\n* **recompose-cli**: A command-line interface (CLI) for running recompose in a shell.\n* **recompose-composer**: Responsible for taking an AST and transforming it into the equivalent `Composable` Kotlin code.\n* **recompose-idea**: An IntelliJ IDEA / Android Studio plugin that allows copying XML layouts and pasting as\n`Composable` Kotlin code.\n* **recompose-test**: Contains test data and helpers for unit tests. \n\n### Important gradle tasks\n\n* **clean**: Deletes the build directories.\n* **test**: Runs all unit tests in all modules.\n* **runIde**: Runs IntelliJ IDEA with the plugin installed. \n* **buildPlugin**: Builds the IntelliJ / Android Studio plugin and makes it available in `recompose-idea/build/distributions`.\n\n### How does this work?\n\nThe [Parser](https://github.com/pocmo/recompose/blob/main/recompose-parser/src/main/kotlin/recompose/parser/Parser.kt) (`recompose-parser`) takes the input XML and transforms it into an\nAbstract Syntax Tree (`recompose-ast`). The [Composer](https://github.com/pocmo/recompose/blob/main/recompose-composer/src/main/kotlin/recompose/composer/Composer.kt) (`recompose-composer`)\ntakes the AST and translates it into Kotlin code calling [Composables](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable).\n\nThe IntelliJ / Android Studio plugin (`recompose-idea`) uses that to perform the translation when pasting copied XML code. And the CLI (`recompose-cli`) uses it to translate files.\n\n### Can I contribute?\n\nYes, absolutely. There are a ton of `View`s and attributes to support. The list of issues labeled with [good first issue](https://github.com/pocmo/recompose/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) are a good place to start. An issue from the list labeled with [help wanted](https://github.com/pocmo/recompose/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) may be a good follow-up. Just comment on any issue that interests you.\n\n## License\n\n```\nCopyright 2020 Sebastian Kaspari\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\nhttp://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```","funding_links":[],"categories":["Tools","Kotlin"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocmo%2Frecompose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpocmo%2Frecompose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocmo%2Frecompose/lists"}