{"id":23390647,"url":"https://github.com/hazer/morphine","last_synced_at":"2025-04-08T14:35:09.778Z","repository":{"id":43791343,"uuid":"202617050","full_name":"Hazer/Morphine","owner":"Hazer","description":"Kodein companion for a Dagger-like experience","archived":false,"fork":false,"pushed_at":"2022-02-18T14:23:36.000Z","size":219,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-14T10:55:54.900Z","etag":null,"topics":["kodein","kodein-di","kotlin","kotlin-android"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hazer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-15T22:01:25.000Z","updated_at":"2019-10-21T04:27:40.000Z","dependencies_parsed_at":"2022-07-21T05:32:34.228Z","dependency_job_id":null,"html_url":"https://github.com/Hazer/Morphine","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/Hazer%2FMorphine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hazer%2FMorphine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hazer%2FMorphine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hazer%2FMorphine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hazer","download_url":"https://codeload.github.com/Hazer/Morphine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247861634,"owners_count":21008534,"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":["kodein","kodein-di","kotlin","kotlin-android"],"created_at":"2024-12-22T03:42:15.598Z","updated_at":"2025-04-08T14:35:09.760Z","avatar_url":"https://github.com/Hazer.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Morphine\r\nKotlin Kodein Module's generator\r\n\r\n## Why?\r\nWe where Dagger users, for a couple of reasons, we decided to migrate to [Kodein](https://github.com/Kodein-Framework/Kodein-DI) as our DI, but manually migrating and creating all injection binds for a big project was a total no-go. To make our lifes easier we created Morphine, it does code generation of classes and constructors annotated with `javax.inject` annotations, its a Kodein companion for a Dagger-like experience.\r\n\r\n## Configuring Morphine in Gradle for each Gradle Module do:\r\n\r\n```gradle\r\ndependencies {\r\n    implementation(\"io.vithor.libs:morphine-api:$morphineVersion\")\r\n    // There are 2 version of the codegen, one for each Kodein counterpart\r\n    kapt(\"io.vithor.libs:morphine-generic-codegen:$morphineVersion\")\r\n    // or\r\n    kapt(\"io.vithor.libs:morphine-erased-codegen:$morphineVersion\")\r\n}\r\n\r\nkapt {\r\n    arguments {\r\n        arg(\"MAIN_PACKAGE\", \"your.module.package.sample\")\r\n    }\r\n}\r\n```\r\n\r\n## Acessing generated modules in code:\r\n```kotlin\r\nimport your.module.package.sample.allModules  // Your sample module package defined earlier \r\n                                              // in each module's \"MAIN_PACKAGE\"\r\nimport org.kodein.di.Kodein\r\n\r\nval sampleModule = Kodein.Module(\"My Sample Module\") {\r\n    import(allModules)\r\n}\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazer%2Fmorphine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhazer%2Fmorphine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazer%2Fmorphine/lists"}