{"id":13902387,"url":"https://github.com/usefulness/licensee-for-android","last_synced_at":"2025-07-22T17:04:04.496Z","repository":{"id":206560645,"uuid":"717173966","full_name":"usefulness/licensee-for-android","owner":"usefulness","description":"Turn raw cashapp/licensee report into assets/Kotlin code that can be easily consumed from an Android app","archived":false,"fork":false,"pushed_at":"2025-07-21T13:54:31.000Z","size":2130,"stargazers_count":9,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-21T15:42:13.369Z","etag":null,"topics":["android","apache","gradle","licensee","licenses","mit","mit-license","opensource"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"premex-ab/gross","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/usefulness.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-11-10T18:19:39.000Z","updated_at":"2025-07-21T13:54:35.000Z","dependencies_parsed_at":"2023-11-28T06:32:15.363Z","dependency_job_id":"90c2c7f0-06c4-4503-9c08-afe286031849","html_url":"https://github.com/usefulness/licensee-for-android","commit_stats":{"total_commits":120,"total_committers":5,"mean_commits":24.0,"dds":0.675,"last_synced_commit":"b3a01f3bb4075284b9869eceb29e3331aeae8914"},"previous_names":["mateuszkwiecinski/gross","usefulness/licensee-for-android"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/usefulness/licensee-for-android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usefulness%2Flicensee-for-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usefulness%2Flicensee-for-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usefulness%2Flicensee-for-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usefulness%2Flicensee-for-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/usefulness","download_url":"https://codeload.github.com/usefulness/licensee-for-android/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usefulness%2Flicensee-for-android/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266535695,"owners_count":23944275,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","apache","gradle","licensee","licenses","mit","mit-license","opensource"],"created_at":"2024-08-06T22:01:07.766Z","updated_at":"2025-07-22T17:04:04.472Z","avatar_url":"https://github.com/usefulness.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"# licensee-for-android\n\n[![Build Status](https://github.com/usefulness/licensee-for-android/workflows/Build%20Project/badge.svg)](https://github.com/usefulness/licensee-for-android/actions)\n[![Latest Version](https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/io/github/usefulness/licensee-for-android/maven-metadata.xml?label=gradle)](https://plugins.gradle.org/plugin/io.github.usefulness.licensee-for-android)\n![Maven Central](https://img.shields.io/maven-central/v/io.github.usefulness/licensee-for-android)\n\n\nTurn raw [cashapp/licensee](https://github.com/cashapp/licensee) report into assets/Kotlin code that can be easily consumed from an Android app\n\n### Features\n- Access licenses report directly by a generated Kotlin code (accessible via static `io.github.usefulness.licensee.LicenseeForAndroid` object)\n- Read _licensee_ report copied to projects assets directory in runtime (via `assetManager.open(\"licensee_artifacts.json\")`)\n\n![example](images/generated_code_dark.png#gh-dark-mode-only)\n![example](images/generated_code_light.png#gh-light-mode-only)\n\n### Installation\n\nAvailable on:\n\n- [Gradle Plugin Portal](https://plugins.gradle.org/plugin/io.github.usefulness.licensee-for-android)\n- [Maven Central](https://mvnrepository.com/artifact/io.github.usefulness/licensee-for-android)\n\n#### Apply the plugin\n\n```groovy\nplugins {\n    id(\"app.cash.licensee\") version \"x.y.z\"\n    id(\"io.github.usefulness.licensee-for-android\") version \"{{version}}\"\n}\n```\n\n#### Configuration\n\nOptions can be configured in the `licenseeForAndroid` extension:\n\n```groovy\nlicenseeForAndroid {\n    enableKotlinCodeGeneration = false\n    generatedPackageName = \"io.github.usefulness.licensee\"\n    enableResourceGeneration = false\n    resourceFileName = \"licensee_artifacts.json\"\n    singularVariantName = null\n    automaticCoreDependencyManagement = true\n}\n```\n\n- `enableKotlinCodeGeneration` - Enables generating a static list of open source assets. \n- `generatedPackageName` - Generate kotlin code under given package \n- `enableResourceGeneration` - Enables copying _licensee_ report to asset(Android)/resource(JVM) directory, making it available under 'resourceFileName' name. \n- `resourceFileName` - The name of the asset/resource file the licensee report gets copied to. \n- `singularVariantName` - The name of the build variant which all build variants will use, to show always the same licenses. (i.e. `\"paidRelease\"`)\n- `automaticCoreDependencyManagement` - Automatically add `licensee-for-android-core` core artifact as an implementation dependency for the generated code. The idea is to later use the same _core_ artifact within a consumer project, and wire generated implementation via DI mechanism\n\n### Common recipes\n\n#### Generate licensee information from any module\n\n```groovy\nplugins {\n    id(\"com.android.application\") // or `com.android.library`\n    id(\"app.cash.licensee\")\n    id(\"io.github.usefulness.licensee-for-android\")\n}\n\nlicensee {\n    allow(\"Apache-2.0\")\n}\n\nlicenseeForAndroid {\n    enableKotlinCodeGeneration = true\n    enableResourceGeneration = true\n}\n```\n#### Generate Kotlin code in Kotlin-only module using licensee output from a different module\n###### DI based approach\n\n`app/build.gradle`:\n\n```groovy\nplugins {\n    id(\"com.android.application\") \n    id(\"app.cash.licensee\")\n    id(\"io.github.usefulness.licensee-for-android\")\n}\n\nlicenseeForAndroid {\n    enableKotlinCodeGeneration = true\n}\n```\n\\+ provide `LicenseeForAndroid` object as `Licensee` interface using your DI framework\n\n`consumer/build.gradle`:\n```groovy\nplugins {\n    id(\"org.jetbrains.kotlin.jvm\") // or any other module type\n}\n\ndependencies {\n    implementation(\"io.github.usefulness:licensee-for-android-core:${{ version }\")\n}\n```\n\\+ inject `Licensee` interface\n\n###### Gradle based approach\n```groovy\nplugins {\n    id(\"org.jetbrains.kotlin.jvm\") // or any other module type\n    id(\"io.github.usefulness.licensee-for-android\") apply(false) // do not generate licensee information for _this_ module\n}\n\n// Register custom, source-generating task, use `:app`'s `productionRelease` variant\ndef licenseeTarget = layout.buildDirectory.map { it.dir(\"generated/licensee\") }\ntasks.register(\"generateLicenseeKotlinCode\", CodeGenerationTask) {\n    it.inputFile.set(\n            project(\":app\").tasks.named(\"licenseeAndroidProductionRelease\")\n                    .flatMap { it.outputDir.file(\"artifacts.json\") }\n    )\n    it.outputDirectory.set(licenseeTarget)\n    it.packageName.set(\"io.github.usefulness.licensee\")\n}\n\n// Make sources discoverable in IDE (https://youtrack.jetbrains.com/issue/KT-45161)\nsourceSets.named(\"main\") {\n    kotlin {\n        srcDir(licenseeTarget)\n    }\n}\n\n// Make them run on every compilation\ntasks.named(\"compileKotlin\") {\n    dependsOn(\"generateLicenseeKotlinCode\")\n}\n```\n\n\n### Credits\nHuge thanks to [premex-ab/gross](https://github.com/premex-ab/gross) which this plugin forked from.   \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusefulness%2Flicensee-for-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusefulness%2Flicensee-for-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusefulness%2Flicensee-for-android/lists"}