forked from dronekit/dronekit-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
141 lines (111 loc) · 3.72 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
apply plugin: 'com.android.library'
apply plugin: 'com.getkeepsafe.dexcount'
ext {
VERSION_MAJOR = 3
VERSION_MINOR = 0
VERSION_PATCH = 2
VERSION_SUFFIX = "release"
PUBLISH_ARTIFACT_ID = 'dronekit-android'
PUBLISH_VERSION = generateVersionName("", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_SUFFIX)
PUBLISH_VERSION_CODE = computeVersionCode(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
PROJECT_DESCRIPTION = "Android DroneKit client library."
PROJECT_LABELS = ['DroneCode', '3DR', 'Tower', 'DroneAPI', 'Android', 'DroneKit', '3DR Services']
PROJECT_LICENSE = 'The Apache Software License, Version 2.0'
PROJECT_LICENSE_URL = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
PROJECT_LICENSE_DISTRIBUTION = 'repo'
}
//Log levels values
def logLevelVerbose = 2;
def logLevelDebug = 3;
def logLevelInfo = 4;
def logLevelWarn = 5;
def logLevelError = 6;
def logLevelAssert = 7;
android {
compileSdkVersion android_build_sdk_version
buildToolsVersion android_build_tools_version
dexOptions {
javaMaxHeapSize "4g"
}
defaultConfig {
minSdkVersion android_build_min_sdk_version
targetSdkVersion android_build_target_sdk_version
versionCode PUBLISH_VERSION_CODE
versionName PUBLISH_VERSION
//Build config fields
buildConfigField "boolean", "SITL_DEBUG", "false"
buildConfigField "String", "SOLO_LINK_IP", getSoloLinkIp()
buildConfigField "boolean", "WRITE_LOG_FILE", "false"
buildConfigField "int", "LOG_FILE_LEVEL", "$logLevelDebug"
}
sourceSets {
main {
aidl.srcDirs = ['src/main/java']
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
lintOptions {
abortOnError false
}
testOptions {
unitTests.returnDefaultValues = true
}
android.libraryVariants.all { variant ->
variant.outputs.each { output ->
def file = output.outputFile
if (file != null && file.name.endsWith('.aar')) {
output.outputFile = new File(file.parent, "${PUBLISH_ARTIFACT_ID}.${PUBLISH_VERSION}.aar")
}
}
}
buildTypes {
debug {
debuggable true
buildConfigField "boolean", "WRITE_LOG_FILE", "true"
}
sitl {
debuggable true
buildConfigField "String", "SOLO_LINK_IP", getLocalIp()
buildConfigField "boolean", "SITL_DEBUG", "true"
}
release {
}
}
testOptions {
unitTests.returnDefaultValues = true
}
buildToolsVersion '24.0.1'
}
dependencies {
compile 'com.jakewharton.timber:timber:3.1.0'
compile "com.google.android.gms:play-services-base:${play_services_version}"
compile "com.google.android.gms:play-services-location:${play_services_version}"
//Java semver library
compile 'com.github.zafarkhaja:java-semver:0.9.0'
compile 'com.jcraft:jsch:0.1.51'
//MP4 generation library
compile 'com.googlecode.mp4parser:isoparser:1.1.7'
compile 'org.droidplanner.android:usb-serial-android:0.1.0'
debugCompile project(':Mavlink')
// sitlCompile project(':Mavlink')
compile files('libs/Mavlink.jar')
compile files('libs/d2xx.jar')
androidTestCompile 'junit:junit:4.12'
androidTestCompile "org.robolectric:robolectric:3.0"
}
def getSoloLinkIp() {
return '\"10.1.1.10\"'
}
def getLocalIp() {
try {
return '\"' + InetAddress.getLocalHost().getCanonicalHostName() + '\"'
}catch(Exception e){
return '\"\"'
}
}
evaluationDependsOn ':Mavlink'
assemble.dependsOn ':Mavlink:jar'
apply from: "$projectDir/maven-push.gradle"