forked from google/zooshi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
120 lines (109 loc) · 2.96 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
buildscript {
repositories {
mavenLocal()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.1'
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
sourceSets {
main {
jniLibs.srcDirs = ['libs']
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src_java']
res.srcDirs = ['res']
assets.srcDirs = ['assets', 'built_assets']
}
}
defaultConfig {
applicationId 'com.google.fpl.zooshi'
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName '1.0'
ndk {
// Because of a bug in the older Cardboard SDK Zooshi currently uses, only the
// armeabi-v7a ABI is supported. This has been resolved in newer versions,
// and this will be fixed when the SDK is updated.
abiFilters 'armeabi-v7a'
}
externalNativeBuild {
ndkBuild {
arguments = ['-j24', 'NDK_LIBS_OUT=libs']
}
}
}
buildTypes {
release {
// Proguard temporarily disabled until we have a template for
// classes referenced from JNI that shouldn't be stripped.
//minifyEnabled true
//proguardFiles getDefaultProguardFile('proguard-android.txt')
}
}
lintOptions {
abortOnError false
}
externalNativeBuild {
ndkBuild {
path "jni/Android.mk"
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(dir: 'libs/android', include: ['*.aar'])
compile 'com.android.support:support-v4:23.0+'
}
task copyFplbase(type: Copy) {
def fplbase_dir = ''
def github_dir = new File('dependencies/fplbase/src_java')
if (github_dir.exists()) {
fplbase_dir = github_dir.getPath()
} else {
def internal_dir = new File('../fplbase/src_java')
if (internal_dir.exists()) {
fplbase_dir = internal_dir.getPath()
} else {
def gerrit_dir = new File('../../libs/fplbase/src_java')
if (gerrit_dir.exists()) {
fplbase_dir = gerrit_dir.getPath();
} else {
throw new GradleException('Unable to find dependency FPL Base.')
}
}
}
from fplbase_dir
into 'src_java'
}
task copyCardboard(type: Copy) {
def cardboard_dir = ''
def dependency_dir = new File('dependencies/cardboard-java')
if (dependency_dir.exists()) {
cardboard_dir = dependency_dir.getPath()
} else {
def gerrit_dir = new File('../../../../prebuilts/cardboard-java')
if (gerrit_dir.exists()) {
cardboard_dir = gerrit_dir.getPath()
} else {
throw new GradleException('Unable to find dependency Cardboard SDK');
}
}
from cardboard_dir + '/CardboardSample/libs'
into 'libs'
}
project.afterEvaluate {
preBuild.dependsOn(copyCardboard)
preBuild.dependsOn(copyFplbase)
}