{"id":13733813,"url":"https://github.com/vanniktech/gradle-android-apk-size-plugin","last_synced_at":"2025-05-08T10:30:25.999Z","repository":{"id":57729390,"uuid":"46174773","full_name":"vanniktech/gradle-android-apk-size-plugin","owner":"vanniktech","description":"Gradle plugin that generates CSV files with apk size per output and variant of an apk","archived":true,"fork":false,"pushed_at":"2018-11-25T08:43:54.000Z","size":1944,"stargazers_count":83,"open_issues_count":1,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-04T03:03:00.579Z","etag":null,"topics":["android","apk","apk-size","gradle-plugin"],"latest_commit_sha":null,"homepage":"http://vanniktech.com","language":"Groovy","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/vanniktech.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}},"created_at":"2015-11-14T13:02:21.000Z","updated_at":"2024-03-18T07:53:26.000Z","dependencies_parsed_at":"2022-09-10T23:40:54.114Z","dependency_job_id":null,"html_url":"https://github.com/vanniktech/gradle-android-apk-size-plugin","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanniktech%2Fgradle-android-apk-size-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanniktech%2Fgradle-android-apk-size-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanniktech%2Fgradle-android-apk-size-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanniktech%2Fgradle-android-apk-size-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vanniktech","download_url":"https://codeload.github.com/vanniktech/gradle-android-apk-size-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224720748,"owners_count":17358476,"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","apk","apk-size","gradle-plugin"],"created_at":"2024-08-03T03:00:49.394Z","updated_at":"2024-11-15T02:31:48.761Z","avatar_url":"https://github.com/vanniktech.png","language":"Groovy","funding_links":[],"categories":["Plugins"],"sub_categories":["Android application development"],"readme":"# gradle-android-apk-size-plugin\n\nGradle plugin that generates CSV files with apk size per output and variant of apk. The files can be found here `\u003cprojectbuildDir\u003e/outputs/apksize/`. In addition while building it'll also print out the size of the apk.\n\nStarting from version 0.3.0 the plugin can also be applied to Android library projects and hence it'll print out the aar size instead of the apk size.\n\nThis plugin creates a task per output file, per variant, and configures each task to run after the variant's assemble task. This means that if the assemble task does not run, no apk size will be reported.\n\nWorks with the latest stable Gradle Android Tools version 3.0.1.\n\n# Set up\n\n**app/build.gradle**\n\n```gradle\nbuildscript {\n  repositories {\n    mavenCentral()\n  }\n  dependencies {\n    classpath \"com.vanniktech:gradle-android-apk-size-plugin:0.4.0\"\n  }\n}\n\napply plugin: \"com.vanniktech.android.apk.size\"\n```\n\nInformation: [This plugin is also available on Gradle plugins](https://plugins.gradle.org/plugin/com.vanniktech.android.apk.size)\n\n### Snapshot\n\n```gradle\nbuildscript {\n  repositories {\n    maven { url \"https://oss.sonatype.org/content/repositories/snapshots\" }\n  }\n  dependencies {\n    classpath \"com.vanniktech:gradle-android-apk-size-plugin:0.5.0-SNAPSHOT\"\n  }\n}\n\napply plugin: \"com.vanniktech.android.apk.size\"\n```\n\n## Sample output\n\n```\n\u003e ./gradlew assembleDebug\n\n...buildspam...\n:app:packageDebug\n:app:zipalignDebug\n:app:assembleDebug\nTotal APK Size in my-app-debug in bytes: 3231060\n\nBUILD SUCCESSFUL\n\nTotal time: 33.017 secs\n```\n\n## Detailed output\n\n```\n\u003cprojectbuildDir\u003e/outputs/apksize/debug.csv\n\u003cprojectbuildDir\u003e/outputs/apksize/release.csv\n```\n\nThose CSV files can for instance be used to configure the [Jenkins Plot Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Plot+Plugin), to see the apk size for each build in a graph.\n\n## Configuration\n\nApksize is configurable via a Gradle extension (shown with default values) in `app/build.gradle`:\n\n```groovy\napkSize {\n  maxApkSize = 5800000\n  teamcity = true\n}\n```\n\nConfigurable flags:\n- `maxApkSize`: Set the max APK size in Kb. Greater than specified size will fail the build. Default is -1.\n- `teamcity` : Enable teamcity statistics ready log output. Default is true if run on teamcity otherwise default is false.\n\n## Teamcity\n\nThis will print logs in the form of\n```\n##teamcity[buildStatisticValue key='ApkSize_${apk.name}_B' value='{size in bytes}']\n##teamcity[buildStatisticValue key='ApkSize_${apk.name}_MB' value='{size in megabytes}']\n```\n\nsee https://confluence.jetbrains.com/display/TCD10/Build+Script+Interaction+with+TeamCity for\nan in depth explanation how it works\n\n\n# License\n\nCopyright (C) 2015 Vanniktech - Niklas Baudy\n\nLicensed under the Apache License, Version 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanniktech%2Fgradle-android-apk-size-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvanniktech%2Fgradle-android-apk-size-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanniktech%2Fgradle-android-apk-size-plugin/lists"}