-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbuild.gradle
92 lines (82 loc) · 2.33 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// pull in dependency versions
apply from: "dependencies.gradle"
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:0.6+"
}
}
allprojects {
// repos for sub-projects
repositories {
// local checked in maven repo has chromium 3rd party jars copied from chromium source tree
// there is a bug in android-gradle which prevents serving these as file or flatDir deps
maven { url "${rootProject.projectDir}/chromium/.m2" }
mavenCentral()
// sonatype central
maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
}
}
// common boilerplate configuration shared among library and apk
def configureAndroidProject(project) {
configure(project) {
dependencies {
compile deps.androidSupport
}
// configure android gradle plugin
android {
compileSdkVersion androidVersions.compileSdkVersion
buildToolsVersion androidVersions.buildToolsVersion
defaultConfig {
minSdkVersion androidVersions.minSdkVersion
targetSdkVersion androidVersions.targetSdkVersion
}
}
}
}
// configure android library projects
configure(subprojects.findAll { project ->
['base',
'cacheinvalidation',
'chrome',
'components',
'content',
'eyesfree',
'media',
'net',
'protobuf',
'sync',
'ui'].contains(project.name)
}) {
apply plugin: 'android-library'
// the rest is boilerplate
configureAndroidProject it
}
// configure android apk projects
configure(subprojects.findAll { project ->
['content-shell',
'android-webview',
'testshell'].contains(project.name) }) {
apply plugin: 'android'
// the rest is boilerplate
configureAndroidProject it
/*
android-gradle plugin still lacks NDK support, so this is a workaround
@see https://groups.google.com/forum/?fromgroups#!searchin/adt-dev/so/adt-dev/nQobKd2Gl_8/Z5yWAvCh4h4J
*/
task copyNativeLibsToJar(type: Zip, description: 'create a jar that includes native shared objects') {
destinationDir file("${buildDir}/native/")
baseName 'chromium'
extension 'jar'
from fileTree(dir: 'libs', include: '**/*.so')
into 'lib/'
}
/**
* Clean up native libs jars
*/
task cleanNativeLibs(type: Delete, description: 'delete native lib jars') {
delete "${buildDir}/native/"
}
}