All Projects → vanniktech → Gradle Android Apk Size Plugin

vanniktech / Gradle Android Apk Size Plugin

Licence: apache-2.0
Gradle plugin that generates CSV files with apk size per output and variant of an apk

Programming Languages

groovy
2714 projects

Projects that are alternatives of or similar to Gradle Android Apk Size Plugin

RocketXPlugin
🔥🔥 android 端编译加速插件🚀 自动识别未改动 module 并在编译流程中替换为 aar ,只编译改动模块,加速 Android apk 的编译速度。
Stars: ✭ 408 (+416.46%)
Mutual labels:  apk, gradle-plugin
Androidanimationexercise
Android 动画各种实现,包括帧动画、补间动画和属性动画的总结分享
Stars: ✭ 1,254 (+1487.34%)
Mutual labels:  gradle-plugin, apk
Onesignal Gradle Plugin
Use with OneSignal-Android-SDK to help integrate it into your Android Studio or Gradle project. https://onesignal.com
Stars: ✭ 49 (-37.97%)
Mutual labels:  gradle-plugin
Kivy Apk
Vbox+Ubuntu16.04打包生成kivy apk
Stars: ✭ 74 (-6.33%)
Mutual labels:  apk
Mlmanager
A modern, easy and customizable app manager for Android with Material Design
Stars: ✭ 1,118 (+1315.19%)
Mutual labels:  apk
Licensechecker
Gradle plugin to check that all Open Source Libraries in a project have been attributed
Stars: ✭ 52 (-34.18%)
Mutual labels:  gradle-plugin
Website 2 Apk Builder
Convert your Website to a working Android App. Supports html, php, htm, js, css. Build app from any website or from local directory.
Stars: ✭ 67 (-15.19%)
Mutual labels:  apk
Apkupdater
APKUpdater is an open source tool that simplifies the process of finding updates for your installed apps.
Stars: ✭ 1,028 (+1201.27%)
Mutual labels:  apk
Apkscale
A Gradle plugin to measure the app size impact of Android libraries
Stars: ✭ 76 (-3.8%)
Mutual labels:  gradle-plugin
Gradle Archetype Plugin
Gradle plugin that creates projects from your own cookiecutter
Stars: ✭ 61 (-22.78%)
Mutual labels:  gradle-plugin
Gradle Android Javadoc Plugin
Gradle plugin that generates Java Documentation from an Android Gradle project.
Stars: ✭ 73 (-7.59%)
Mutual labels:  gradle-plugin
Node Google Play Cli
command line tools using the node-google-play library
Stars: ✭ 58 (-26.58%)
Mutual labels:  apk
Gradle S3 Build Cache
An AWS S3 Gradle build cache implementation
Stars: ✭ 54 (-31.65%)
Mutual labels:  gradle-plugin
Gradle Clover Plugin
Gradle plugin for generating a code coverage report using Clover
Stars: ✭ 67 (-15.19%)
Mutual labels:  gradle-plugin
Auto Manifest
Generates AndroidManifest.xml in simple libraries so that you don't have to
Stars: ✭ 51 (-35.44%)
Mutual labels:  gradle-plugin
Mobile Security Framework Mobsf
Mobile Security Framework (MobSF) is an automated, all-in-one mobile application (Android/iOS/Windows) pen-testing, malware analysis and security assessment framework capable of performing static and dynamic analysis.
Stars: ✭ 10,212 (+12826.58%)
Mutual labels:  apk
Hellomello
Experiments with writing Android apps in Nim
Stars: ✭ 47 (-40.51%)
Mutual labels:  apk
Module Service Manager
Android模块化/组件化通信框架
Stars: ✭ 58 (-26.58%)
Mutual labels:  gradle-plugin
Gradle Gae Plugin
Gradle plugin that provides tasks for uploading, running and managing Google App Engine projects
Stars: ✭ 62 (-21.52%)
Mutual labels:  gradle-plugin
Vab
V Android Bootstrapper
Stars: ✭ 77 (-2.53%)
Mutual labels:  apk

gradle-android-apk-size-plugin

Gradle plugin that generates CSV files with apk size per output and variant of apk. The files can be found here <projectbuildDir>/outputs/apksize/. In addition while building it'll also print out the size of the apk.

Starting 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.

This 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.

Works with the latest stable Gradle Android Tools version 3.0.1.

Set up

app/build.gradle

buildscript {
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath "com.vanniktech:gradle-android-apk-size-plugin:0.4.0"
  }
}

apply plugin: "com.vanniktech.android.apk.size"

Information: This plugin is also available on Gradle plugins

Snapshot

buildscript {
  repositories {
    maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
  }
  dependencies {
    classpath "com.vanniktech:gradle-android-apk-size-plugin:0.5.0-SNAPSHOT"
  }
}

apply plugin: "com.vanniktech.android.apk.size"

Sample output

> ./gradlew assembleDebug

...buildspam...
:app:packageDebug
:app:zipalignDebug
:app:assembleDebug
Total APK Size in my-app-debug in bytes: 3231060

BUILD SUCCESSFUL

Total time: 33.017 secs

Detailed output

<projectbuildDir>/outputs/apksize/debug.csv
<projectbuildDir>/outputs/apksize/release.csv

Those CSV files can for instance be used to configure the Jenkins Plot Plugin, to see the apk size for each build in a graph.

Configuration

Apksize is configurable via a Gradle extension (shown with default values) in app/build.gradle:

apkSize {
  maxApkSize = 5800000
  teamcity = true
}

Configurable flags:

  • maxApkSize: Set the max APK size in Kb. Greater than specified size will fail the build. Default is -1.
  • teamcity : Enable teamcity statistics ready log output. Default is true if run on teamcity otherwise default is false.

Teamcity

This will print logs in the form of

##teamcity[buildStatisticValue key='ApkSize_${apk.name}_B' value='{size in bytes}']
##teamcity[buildStatisticValue key='ApkSize_${apk.name}_MB' value='{size in megabytes}']

see https://confluence.jetbrains.com/display/TCD10/Build+Script+Interaction+with+TeamCity for an in depth explanation how it works

License

Copyright (C) 2015 Vanniktech - Niklas Baudy

Licensed under the Apache License, Version 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].