Giter Site home page Giter Site logo

Comments (19)

athkalia avatar athkalia commented on June 16, 2024 1

cool pal, it works!! thanks a lot.

Btw it should be apkSize instead of dexcount

from gradle-android-apk-size-plugin.

vanniktech avatar vanniktech commented on June 16, 2024

That seems like a really good idea. 👍

from gradle-android-apk-size-plugin.

vanniktech avatar vanniktech commented on June 16, 2024

If so it should be splitted though usually debug apk is much bigger than release.

from gradle-android-apk-size-plugin.

athkalia avatar athkalia commented on June 16, 2024

@vanniktech I am trying to set a limit only for my release build, is this possible?

from gradle-android-apk-size-plugin.

vanniktech avatar vanniktech commented on June 16, 2024

I don't think so. The release hasn't been made. You can try the snapshot though.

from gradle-android-apk-size-plugin.

athkalia avatar athkalia commented on June 16, 2024

Sorry for the confusion. I mean in the snapshot version 0.4-SNAPSHOT, is there a way to only fail my build (assembleRelease) if the size of the release apk is too large, but not have any rules around sizes for my debug APK?

from gradle-android-apk-size-plugin.

vanniktech avatar vanniktech commented on June 16, 2024

Oh no. There's only one size unfortunately.

from gradle-android-apk-size-plugin.

athkalia avatar athkalia commented on June 16, 2024

would be cool if you could add that in. as, as you said, the release apk is usually smaller cause of proguard

from gradle-android-apk-size-plugin.

vanniktech avatar vanniktech commented on June 16, 2024

Yeah. If you want you can create a PR for it. I don't have much time to work on this project at the moment.

from gradle-android-apk-size-plugin.

athkalia avatar athkalia commented on June 16, 2024

I may attempt it, but I've never touched a gradle plugin. Got any suggestions for how to solve this?

from gradle-android-apk-size-plugin.

vanniktech avatar vanniktech commented on June 16, 2024

You can look at the PR that did the initial implementation.

from gradle-android-apk-size-plugin.

jaredsburrows avatar jaredsburrows commented on June 16, 2024

@athkalia Use gradle:

gradle.taskGraph.afterTask { task ->
    if (gradle.taskGraph.hasTask("assembleRelease")) {
        dexcount {
            maxApkSize = 5800000
        }
    }
}

from gradle-android-apk-size-plugin.

athkalia avatar athkalia commented on June 16, 2024

the task graph is always going to have an assembleRelease task right? regardless of which task is currently executing, assembleDebug or assembleRelease

from gradle-android-apk-size-plugin.

jaredsburrows avatar jaredsburrows commented on June 16, 2024

@athkalia No and I didn't mean to use afterTask.

Something like this:

gradle.taskGraph.whenReady { taskGraph ->
    if (taskGraph.hasTask(":app:assembleRelease")) {
        dexcount {
            maxApkSize = 5800000
        }
    }
}

To set dexcount.maxApkSize = 5800000, simply run:

gradlew :app:assembleRelease

Docs: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#configure-by-dag

from gradle-android-apk-size-plugin.

athkalia avatar athkalia commented on June 16, 2024

thanks pal, I'll give it a go

from gradle-android-apk-size-plugin.

jaredsburrows avatar jaredsburrows commented on June 16, 2024

@vanniktech It looks like we need to fix the README.md: https://github.com/vanniktech/gradle-android-apk-size-plugin#configuration.

from gradle-android-apk-size-plugin.

athkalia avatar athkalia commented on June 16, 2024

I also noticed that in the console this appears btw

The current APK is 2853469 Kb, the current max is: 1 Kb.
It should have been bytes not Kb

from gradle-android-apk-size-plugin.

jaredsburrows avatar jaredsburrows commented on June 16, 2024

@athkalia @vanniktech Should we create an issue for this?

from gradle-android-apk-size-plugin.

vanniktech avatar vanniktech commented on June 16, 2024

Sure.

from gradle-android-apk-size-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.