Skip to content

Instantly share code, notes, and snippets.

View Bresiu's full-sized avatar
🥷

Michał Brewczak Bresiu

🥷
View GitHub Profile
@Bresiu
Bresiu / mininal-maven-pom.xml
Created June 28, 2016 18:16 — forked from torgeir/minimal-maven-pom.xml
A minimal maven pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>gd.wa</groupId>
<artifactId>minimal-pom</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
@Bresiu
Bresiu / patchMainDexClasses.gradle
Created May 12, 2016 13:12
Gradle script to trim android main-dex classes when 65k limit is reached using standard multi-dex components.
// A blacklist of absolute package path directories that will be excluded from the main dex list. ex: 'com/company/package/path'
// the package name can be partial, since class names encountered that start with any of the given package names will be discarded.
ext.packagesToDiscardFromMainDexFile = []
def shouldDiscardClass(String className) {
packagesToDiscardFromMainDexFile.any { className.startsWith(it) }
}
def patchMainDexKeepList(Project proj, String variantName) {
Task collectTask = proj.tasks.findByName("collect${variantName.capitalize()}MultiDexComponents")