Comments (19)
cool pal, it works!! thanks a lot.
Btw it should be apkSize
instead of dexcount
from gradle-android-apk-size-plugin.
That seems like a really good idea. 👍
from gradle-android-apk-size-plugin.
If so it should be splitted though usually debug apk is much bigger than release.
from gradle-android-apk-size-plugin.
@vanniktech I am trying to set a limit only for my release build, is this possible?
from gradle-android-apk-size-plugin.
I don't think so. The release hasn't been made. You can try the snapshot though.
from gradle-android-apk-size-plugin.
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.
Oh no. There's only one size unfortunately.
from gradle-android-apk-size-plugin.
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.
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.
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.
You can look at the PR that did the initial implementation.
from gradle-android-apk-size-plugin.
@athkalia Use gradle:
gradle.taskGraph.afterTask { task ->
if (gradle.taskGraph.hasTask("assembleRelease")) {
dexcount {
maxApkSize = 5800000
}
}
}
from gradle-android-apk-size-plugin.
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.
@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.
thanks pal, I'll give it a go
from gradle-android-apk-size-plugin.
@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.
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.
@athkalia @vanniktech Should we create an issue for this?
from gradle-android-apk-size-plugin.
Sure.
from gradle-android-apk-size-plugin.
Related Issues (20)
- JDK 7 support for CI builds HOT 3
- Add some tests HOT 1
- Add AAR library support HOT 1
- Update README regarding Java 8 / 7
- Auto deploy SNAPSHOT version
- How can you use it from the plugins repo? HOT 4
- Does not find APK files if I rewrite the variable outputs outputFile HOT 6
- java.lang.NoClassDefFoundError: org/gradle/logging/StyledTextOutput$Style HOT 3
- Print without using a commandline task HOT 1
- Use Spock for Testing HOT 3
- Show Megabytes next to bytes for command line print out HOT 1
- Use Coveralls instead of CodeCov HOT 4
- gradle sizeDebugApk - Android Gradle Plugin 1.5.0 HOT 8
- Gradle 4.0-milestone1 + Android Gradle tools 3.0.0-alpha3 Breaks With Error HOT 4
- [README] - Fix misleading README
- Move Gradle plugin to Kotlin? HOT 7
- [Feature Request] - Do not run the count on each build HOT 6
- Obsolete API warning HOT 4
- Incompatibility issue with Gradle configuration cache HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle-android-apk-size-plugin.