Skip to content

Commit

Permalink
Fix build. During the build the dex conversion was failing OOM.
Browse files Browse the repository at this point in the history
This increases the memory and provides a couple sanity checks around
the git committing
  • Loading branch information
Stanford, Jon authored and Stanford, Jon committed Dec 3, 2015
1 parent 2f55ca8 commit 093515c
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 22 deletions.
42 changes: 24 additions & 18 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.android.tools.build:gradle:2.0.0-alpha1'
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
classpath 'org.ajoberstar:gradle-git:1.1.0'
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.0'
classpath 'org.apache.commons:commons-lang3:3.4'
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.2.1'
}
}

Expand All @@ -20,7 +19,6 @@ import org.ajoberstar.grgit.Tag
import org.ajoberstar.grgit.operation.BranchListOp
import org.eclipse.jgit.util.StringUtils

apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.application'
apply plugin: 'hugo'
apply plugin: 'checkstyle'
Expand All @@ -33,8 +31,8 @@ dependencies {
compile files('libs/libGoogleAnalyticsServices.jar')
compile files('libs/annotations.jar')

compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:design:22.+'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'

compile 'com.google.code.gson:gson:2.4'
compile 'com.mcxiaoke.volley:library:1.0.18'
Expand All @@ -61,7 +59,7 @@ dependencies {
compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'

// We have too many methods including the appcompat library
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:multidex:1.0.1'

compile('com.mikepenz:materialdrawer:4.4.6@aar') {
transitive = true
Expand Down Expand Up @@ -150,18 +148,22 @@ try {
}

android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
compileSdkVersion 23
buildToolsVersion '23.0.2'
// compile Using Java 7
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
useLibrary 'org.apache.http.legacy'

defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize "4g"
}

sourceSets {
main {}
Expand All @@ -175,19 +177,14 @@ android {
proguardFile 'proguard-project.txt'
signingConfig signingConfigs.release
}
debug {
apply plugin: 'com.getkeepsafe.dexcount'
dexcount {
printAsTree = true
orderByMethodCount = true
}
}
}
lintOptions {
abortOnError false
}
packagingOptions {
exclude 'plugin.properties'
exclude 'META-INF/ECLIPSE_.RSA'
exclude 'META-INF/ECLIPSE_.SF'
}
if (versionPropsFile.canRead()) {
versionProps.load(new FileInputStream(versionPropsFile))
Expand Down Expand Up @@ -219,7 +216,7 @@ android {
versionName projectVersionName
versionCode projectVersionCode
minSdkVersion 14
targetSdkVersion 22
targetSdkVersion 23
println("versionCode: $versionCode versionName: $versionName")
}
} else {
Expand Down Expand Up @@ -298,6 +295,11 @@ task commitFiles << {
* Checkout feature branch, if branch does not exist create the branch
*/
def branchExists = false

if (grgit == null) {
grgit = Grgit.open(project.rootDir, new Credentials(gitUsername.toString(), gitPassword.toString()))
}

// get a List<Branch> of all local branches
def branches = grgit.branch.list(mode: BranchListOp.Mode.LOCAL)

Expand Down Expand Up @@ -326,7 +328,7 @@ task commitFiles << {
println 'Current Branch: ' + getCurrentBranch()
if (versionPropsFile.exists() && versionPropsFile.canRead()) {
// Stage changed files for commit
grgit.add(patterns: ['.'])
grgit.add(patterns: ['version.properties'])
println "Grgit file staging: " + grgit.status()
// Commit the updated version.properties
grgit.commit(message: "Release: update version to: ${projectVersionName}", amend: false)
Expand Down Expand Up @@ -377,6 +379,10 @@ task push << {
// push tags to remote
grgit.push(tags: true)
} finally {
if (getCurrentBranch() == branchName) {
println "Unexpected branch! {$branchName} Switching to master branch"
grgit.checkout(branch: 'master')
}
grgit.branch.remove(names: [branchName], force: true)
grgit.push()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.jbirdvegas.mgerrit.message.GerritChanged;
import com.jbirdvegas.mgerrit.tasks.GerritService;


import de.greenrobot.event.EventBus;

/*
Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.android.tools.build:gradle:2.0.0-alpha1'
}
}

Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.daemon=true
org.gradle.configureondemand=true
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Jun 20 12:55:14 EST 2015
#Thu Dec 03 02:02:16 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-all.zip
2 changes: 1 addition & 1 deletion project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-22
target=android-23

0 comments on commit 093515c

Please sign in to comment.