Skip to content

Commit 4c31ca3

Browse files
authored
Merge pull request #436 from dronekit/version_3.0.1
Version 3.0.1
2 parents aa9ce0e + 095ce9e commit 4c31ca3

File tree

443 files changed

+3423
-10965
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

443 files changed

+3423
-10965
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ android:
2929
before_script:
3030
- export GRADLE_OPTS="-XX:MaxPermSize=2048m -Xmx1536m"
3131

32-
script: ./gradlew cleanJar clean testDevDebug assembleDevDebug -PdisablePreDex
32+
script: ./gradlew cleanJar clean testDebug assembleDebug -PdisablePreDex
3333

3434
after_success:
3535
- chmod a+x .utility/push-docs-to-gh-pages.sh
File renamed without changes.
File renamed without changes.

ClientLib/build.gradle

+80-7
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,50 @@
11
apply plugin: 'com.android.library'
2+
apply plugin: 'com.getkeepsafe.dexcount'
23

34
ext {
4-
VERSION_MAJOR = 2
5-
VERSION_MINOR = 9
5+
VERSION_MAJOR = 3
6+
VERSION_MINOR = 0
67
VERSION_PATCH = 1
78
VERSION_SUFFIX = "release"
89

910
PUBLISH_ARTIFACT_ID = 'dronekit-android'
1011
PUBLISH_VERSION = generateVersionName("", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_SUFFIX)
1112
PUBLISH_VERSION_CODE = computeVersionCode(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
1213
PROJECT_DESCRIPTION = "Android DroneKit client library."
13-
PROJECT_LABELS = ['3DR', '3DR Services', 'DroneAPI', 'Android', 'DroneKit']
14-
PROJECT_LICENSES = ['Apache-2.0']
14+
PROJECT_LABELS = ['DroneCode', '3DR', 'Tower', 'DroneAPI', 'Android', 'DroneKit', '3DR Services']
15+
PROJECT_LICENSE = 'The Apache Software License, Version 2.0'
16+
PROJECT_LICENSE_URL = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
17+
PROJECT_LICENSE_DISTRIBUTION = 'repo'
1518
}
1619

20+
//Log levels values
21+
def logLevelVerbose = 2;
22+
def logLevelDebug = 3;
23+
def logLevelInfo = 4;
24+
def logLevelWarn = 5;
25+
def logLevelError = 6;
26+
def logLevelAssert = 7;
27+
1728
android {
1829
compileSdkVersion android_build_sdk_version
1930
buildToolsVersion android_build_tools_version
2031

32+
dexOptions {
33+
javaMaxHeapSize "4g"
34+
}
35+
2136
defaultConfig {
2237
minSdkVersion android_build_min_sdk_version
2338
targetSdkVersion android_build_target_sdk_version
39+
2440
versionCode PUBLISH_VERSION_CODE
2541
versionName PUBLISH_VERSION
42+
43+
//Build config fields
44+
buildConfigField "boolean", "SITL_DEBUG", "false"
45+
buildConfigField "String", "SOLO_LINK_IP", getSoloLinkIp()
46+
buildConfigField "boolean", "WRITE_LOG_FILE", "false"
47+
buildConfigField "int", "LOG_FILE_LEVEL", "$logLevelDebug"
2648
}
2749

2850
sourceSets {
@@ -52,16 +74,67 @@ android {
5274
}
5375
}
5476
}
77+
78+
buildTypes {
79+
debug {
80+
debuggable true
81+
buildConfigField "boolean", "WRITE_LOG_FILE", "true"
82+
}
83+
84+
sitl {
85+
debuggable true
86+
buildConfigField "String", "SOLO_LINK_IP", getLocalIp()
87+
buildConfigField "boolean", "SITL_DEBUG", "true"
88+
}
89+
90+
release {
91+
}
92+
}
93+
94+
testOptions {
95+
unitTests.returnDefaultValues = true
96+
}
5597
}
5698

5799
dependencies {
58-
compile "com.android.support:support-v4:${support_lib_version}"
100+
compile 'com.jakewharton.timber:timber:3.1.0'
101+
59102
compile "com.google.android.gms:play-services-base:${play_services_version}"
103+
compile "com.google.android.gms:play-services-location:${play_services_version}"
104+
105+
//Java semver library
106+
compile 'com.github.zafarkhaja:java-semver:0.9.0'
107+
108+
compile 'com.jcraft:jsch:0.1.51'
109+
110+
//MP4 generation library
111+
compile 'com.googlecode.mp4parser:isoparser:1.1.7'
112+
113+
compile 'org.droidplanner.android:usb-serial-android:0.1.0'
60114

61115
debugCompile project(':Mavlink')
62-
releaseCompile files('libs/Mavlink.jar')
116+
// sitlCompile project(':Mavlink')
117+
118+
compile files('libs/Mavlink.jar')
119+
compile files('libs/d2xx.jar')
120+
121+
androidTestCompile 'junit:junit:4.12'
122+
androidTestCompile "org.robolectric:robolectric:3.0"
123+
}
124+
125+
def getSoloLinkIp() {
126+
return '\"10.1.1.10\"'
127+
}
128+
129+
def getLocalIp() {
130+
try {
131+
return '\"' + InetAddress.getLocalHost().getCanonicalHostName() + '\"'
132+
}catch(Exception e){
133+
return '\"\"'
134+
}
63135
}
64136

137+
evaluationDependsOn ':Mavlink'
65138
assemble.dependsOn ':Mavlink:jar'
66139

67-
apply from: "../release_android_library.gradle"
140+
apply from: "$projectDir/maven-push.gradle"
File renamed without changes.

ClientLib/maven-push.gradle

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
apply plugin: 'maven'
2+
apply plugin: 'signing'
3+
4+
def projectGroupId = 'com.o3dr.android'
5+
def projectArtifactId = project.PUBLISH_ARTIFACT_ID
6+
def projectVersion = project.PUBLISH_VERSION
7+
def projectDescription = project.PROJECT_DESCRIPTION
8+
def projectLabels = project.PROJECT_LABELS
9+
def projectLicense = project.PROJECT_LICENSE
10+
def projectLicenseUrl = project.PROJECT_LICENSE_URL
11+
def projectLicenseDistribution = project.PROJECT_LICENSE_DISTRIBUTION
12+
13+
def getMavenOrg(){
14+
return hasProperty('COM_O3DR_MAVEN_ORG') ? COM_O3DR_MAVEN_ORG : ''
15+
}
16+
17+
def getMavenPublishUrl(String artifactId){
18+
def prefix = hasProperty('COM_O3DR_MAVEN_PUBLISH_URL_PREFIX') ? COM_O3DR_MAVEN_PUBLISH_URL_PREFIX : null
19+
if(prefix == null)
20+
return null
21+
22+
return "$prefix/$artifactId/;publish=0;override=1"
23+
}
24+
25+
def getMavenPomPackaging(){
26+
return hasProperty('COM_O3DR_MAVEN_POM_PACKAGING') ? COM_O3DR_MAVEN_POM_PACKAGING : 'aar'
27+
}
28+
29+
def getDeveloperId(){
30+
return hasProperty('DEVELOPER_ID') ? DEVELOPER_ID : ''
31+
}
32+
33+
def getDeveloperName(){
34+
return hasProperty('DEVELOPER_NAME') ? DEVELOPER_NAME : ''
35+
}
36+
37+
afterEvaluate { project ->
38+
uploadArchives {
39+
repositories {
40+
mavenDeployer {
41+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
42+
43+
pom.groupId = projectGroupId
44+
pom.artifactId = projectArtifactId
45+
pom.version = projectVersion
46+
47+
repository(url: getMavenPublishUrl(projectArtifactId)) {
48+
authentication(userName: getMavenUsername(), password: getMavenApiKey())
49+
}
50+
51+
pom.project {
52+
name projectArtifactId
53+
packaging getMavenPomPackaging()
54+
description projectDescription
55+
56+
url 'https://github.com/dronekit/dronekit-android'
57+
scm {
58+
url 'https://github.com/dronekit/dronekit-android'
59+
connection 'scm:git:[email protected]:dronekit/dronekit-android.git'
60+
developerConnection 'scm:git:[email protected]:dronekit/dronekit-android.git'
61+
}
62+
63+
licenses {
64+
license {
65+
name projectLicense
66+
url projectLicenseUrl
67+
distribution projectLicenseDistribution
68+
}
69+
}
70+
71+
developers {
72+
developer {
73+
id getDeveloperId()
74+
name getDeveloperName()
75+
}
76+
}
77+
}
78+
}
79+
}
80+
}
81+
82+
signing {
83+
required { gradle.taskGraph.hasTask("uploadArchives") }
84+
sign configurations.archives
85+
}
86+
87+
task androidJavadocs(type: Javadoc) {
88+
failOnError false
89+
90+
//Add the project java source directory.
91+
def files = [android.sourceSets.main.java.srcDirs]
92+
93+
//Add the java source directories for the project's dependencies
94+
configurations.compile.dependencies.each {
95+
if (it instanceof ProjectDependency) {
96+
def dependency = it as ProjectDependency
97+
def depProj = dependency.getDependencyProject()
98+
def projName = depProj.getName()
99+
if(projName != "Mavlink") {
100+
files += depProj.android.sourceSets.main.java.srcDirs
101+
}
102+
}
103+
}
104+
105+
source = files
106+
title = projectDescription
107+
exclude '**/*.aidl', 'org/droidplanner/services/android/impl/**'
108+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
109+
options.links("http://docs.oracle.com/javase/7/docs/api/")
110+
options.links("https://developer.android.com/reference/packages.html")
111+
}
112+
113+
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs){
114+
classifier = 'javadoc'
115+
from androidJavadocs.destinationDir
116+
}
117+
118+
task androidSourcesJar(type: Jar){
119+
classifier = 'sources'
120+
from android.sourceSets.main.java.srcDirs
121+
exclude 'org/droidplanner/services/android/impl/**'
122+
}
123+
124+
artifacts {
125+
archives androidSourcesJar
126+
archives androidJavadocsJar
127+
}
128+
}

ServiceApp/test/java/com/o3dr/android/client/apis/ControlApiTest.java ClientLib/src/androidTest/java/com/o3dr/android/client/apis/ControlApiTest.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
import com.o3dr.services.android.lib.model.AbstractCommandListener;
88
import com.o3dr.services.android.lib.model.action.Action;
99

10-
import org.droidplanner.services.android.mock.MockDrone;
11-
import org.junit.Assert;
10+
import junit.framework.Assert;
11+
12+
import org.droidplanner.services.android.impl.mock.MockDrone;
1213
import org.junit.Test;
1314
import org.junit.runner.RunWith;
1415
import org.robolectric.RobolectricGradleTestRunner;
@@ -24,7 +25,7 @@
2425
* Created by Fredia Huya-Kouadio on 10/23/15.
2526
*/
2627
@RunWith(RobolectricGradleTestRunner.class)
27-
@Config(constants = org.droidplanner.services.android.BuildConfig.class, sdk = 18)
28+
@Config(constants = com.o3dr.android.client.BuildConfig.class, sdk = 18)
2829
public class ControlApiTest {
2930

3031
private static final SparseArray<float[][]> expectedVelocitiesPerAttitude = new SparseArray<>();

ServiceApp/test/java/org/droidplanner/services/android/BasicTest.java ClientLib/src/androidTest/java/org/droidplanner/services/android/impl/BasicTest.java

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.droidplanner.services.android;
1+
package org.droidplanner.services.android.impl;
22

33
import android.content.Context;
44
import android.os.Bundle;
@@ -8,25 +8,28 @@
88
import com.MAVLink.Messages.MAVLinkMessage;
99
import com.MAVLink.common.msg_command_long;
1010
import com.MAVLink.enums.MAV_CMD;
11+
import com.o3dr.android.client.BuildConfig;
1112
import com.o3dr.services.android.lib.drone.connection.ConnectionParameter;
1213
import com.o3dr.services.android.lib.gcs.link.LinkConnectionStatus;
1314

14-
import org.droidplanner.services.android.communication.model.DataLink;
15-
import org.droidplanner.services.android.core.MAVLink.MavLinkCommands;
16-
import org.droidplanner.services.android.core.drone.LogMessageListener;
17-
import org.droidplanner.services.android.core.drone.autopilot.MavLinkDrone;
18-
import org.droidplanner.services.android.core.drone.autopilot.apm.ArduCopter;
19-
import org.droidplanner.services.android.core.firmware.FirmwareType;
20-
import org.droidplanner.services.android.mock.MockMAVLinkClient;
21-
import org.droidplanner.services.android.utils.AndroidApWarningParser;
2215
import org.junit.Assert;
2316
import org.junit.Before;
17+
18+
import org.droidplanner.services.android.impl.communication.model.DataLink;
19+
import org.droidplanner.services.android.impl.core.MAVLink.MavLinkCommands;
20+
import org.droidplanner.services.android.impl.core.drone.LogMessageListener;
21+
import org.droidplanner.services.android.impl.core.drone.autopilot.MavLinkDrone;
22+
import org.droidplanner.services.android.impl.core.drone.autopilot.apm.ArduCopter;
23+
import org.droidplanner.services.android.impl.core.firmware.FirmwareType;
24+
import org.droidplanner.services.android.impl.mock.MockMAVLinkClient;
25+
import org.droidplanner.services.android.impl.utils.AndroidApWarningParser;
2426
import org.junit.Test;
2527
import org.junit.runner.RunWith;
2628
import org.robolectric.RobolectricGradleTestRunner;
2729
import org.robolectric.RuntimeEnvironment;
2830
import org.robolectric.annotation.Config;
2931

32+
3033
/**
3134
* Created by djmedina on 3/5/15.
3235
* This is a simple test case.

ServiceApp/test/java/org/droidplanner/services/android/core/drone/autopilot/apm/ArduPilotTest.java ClientLib/src/androidTest/java/org/droidplanner/services/android/impl/core/drone/autopilot/apm/ArduPilotTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.droidplanner.services.android.core.drone.autopilot.apm;
1+
package org.droidplanner.services.android.impl.core.drone.autopilot.apm;
22

33
import com.github.zafarkhaja.semver.Version;
44

ServiceApp/test/java/org/droidplanner/services/android/core/helpers/coordinates/Coord2DTest.java ClientLib/src/androidTest/java/org/droidplanner/services/android/impl/core/helpers/coordinates/Coord2DTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.droidplanner.services.android.core.helpers.coordinates;
1+
package org.droidplanner.services.android.impl.core.helpers.coordinates;
22

33
import com.o3dr.services.android.lib.coordinate.LatLong;
44

ServiceApp/test/java/org/droidplanner/services/android/core/helpers/coordinates/Coord3DTest.java ClientLib/src/androidTest/java/org/droidplanner/services/android/impl/core/helpers/coordinates/Coord3DTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.droidplanner.services.android.core.helpers.coordinates;
1+
package org.droidplanner.services.android.impl.core.helpers.coordinates;
22

33
import com.o3dr.services.android.lib.coordinate.LatLong;
44
import com.o3dr.services.android.lib.coordinate.LatLongAlt;

ServiceApp/test/java/org/droidplanner/services/android/core/helpers/coordinates/CoordBoundsTest.java ClientLib/src/androidTest/java/org/droidplanner/services/android/impl/core/helpers/coordinates/CoordBoundsTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.droidplanner.services.android.core.helpers.coordinates;
1+
package org.droidplanner.services.android.impl.core.helpers.coordinates;
22

33
import com.o3dr.services.android.lib.coordinate.LatLong;
44

ServiceApp/test/java/org/droidplanner/services/android/core/helpers/geoTools/GeoToolsTest.java ClientLib/src/androidTest/java/org/droidplanner/services/android/impl/core/helpers/geoTools/GeoToolsTest.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
package org.droidplanner.services.android.core.helpers.geoTools;
1+
package org.droidplanner.services.android.impl.core.helpers.geoTools;
22

33
import com.o3dr.services.android.lib.coordinate.LatLong;
44
import com.o3dr.services.android.lib.coordinate.LatLongAlt;
55

66
import junit.framework.TestCase;
77

8-
import org.droidplanner.services.android.core.polygon.Polygon;
8+
import org.droidplanner.services.android.impl.core.polygon.Polygon;
9+
910

1011
public class GeoToolsTest extends TestCase {
1112

ServiceApp/test/java/org/droidplanner/services/android/core/helpers/units/AreaTest.java ClientLib/src/androidTest/java/org/droidplanner/services/android/impl/core/helpers/units/AreaTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.droidplanner.services.android.core.helpers.units;
1+
package org.droidplanner.services.android.impl.core.helpers.units;
22

33
import junit.framework.TestCase;
44

0 commit comments

Comments
 (0)