forked from Floorp-Projects/Floorp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1234629 - Post: Add Gradle support for bouncer. r=me
- Loading branch information
Showing
4 changed files
with
89 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
buildDir "${topobjdir}/gradle/build/mobile/android/bouncer" | ||
|
||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 23 | ||
buildToolsVersion "23.0.1" | ||
|
||
defaultConfig { | ||
targetSdkVersion 23 | ||
minSdkVersion 15 | ||
applicationId mozconfig.substs.ANDROID_PACKAGE_NAME | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_7 | ||
targetCompatibility JavaVersion.VERSION_1_7 | ||
} | ||
|
||
dexOptions { | ||
javaMaxHeapSize "2g" | ||
} | ||
|
||
lintOptions { | ||
abortOnError false | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
} | ||
} | ||
|
||
sourceSets { | ||
main { | ||
manifest.srcFile "${topobjdir}/mobile/android/bouncer/AndroidManifest.xml" | ||
assets { | ||
if (mozconfig.substs.MOZ_ANDROID_DISTRIBUTION_DIRECTORY) { | ||
srcDir "${mozconfig.substs.MOZ_ANDROID_DISTRIBUTION_DIRECTORY}/assets" | ||
} | ||
} | ||
java { | ||
srcDir 'java' | ||
} | ||
res { | ||
srcDir "${topsrcdir}/${mozconfig.substs.MOZ_BRANDING_DIRECTORY}/res" // For the icon. | ||
srcDir 'res' | ||
} | ||
} | ||
} | ||
} | ||
|
||
task generateCodeAndResources(type:Exec) { | ||
workingDir "${topobjdir}" | ||
|
||
commandLine mozconfig.substs.GMAKE | ||
args '-C' | ||
args "${topobjdir}/mobile/android/bouncer" | ||
args 'gradle-targets' | ||
|
||
// Only show the output if something went wrong. | ||
ignoreExitValue = true | ||
standardOutput = new ByteArrayOutputStream() | ||
errorOutput = standardOutput | ||
doLast { | ||
if (execResult.exitValue != 0) { | ||
throw new GradleException("Process '${commandLine}' finished with non-zero exit value ${execResult.exitValue}:\n\n${standardOutput.toString()}") | ||
} | ||
} | ||
} | ||
|
||
afterEvaluate { | ||
android.applicationVariants.all { | ||
preBuild.dependsOn generateCodeAndResources | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters