Skip to content

Commit

Permalink
Merge pull request #436 from dronekit/version_3.0.1
Browse files Browse the repository at this point in the history
Version 3.0.1
  • Loading branch information
m4gr3d committed Sep 6, 2016
2 parents aa9ce0e + 095ce9e commit 4c31ca3
Show file tree
Hide file tree
Showing 443 changed files with 3,423 additions and 10,965 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ android:
before_script:
- export GRADLE_OPTS="-XX:MaxPermSize=2048m -Xmx1536m"

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

after_success:
- chmod a+x .utility/push-docs-to-gh-pages.sh
Expand Down
File renamed without changes
File renamed without changes
87 changes: 80 additions & 7 deletions ClientLib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,28 +1,50 @@
apply plugin: 'com.android.library'
apply plugin: 'com.getkeepsafe.dexcount'

ext {
VERSION_MAJOR = 2
VERSION_MINOR = 9
VERSION_MAJOR = 3
VERSION_MINOR = 0
VERSION_PATCH = 1
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 = ['3DR', '3DR Services', 'DroneAPI', 'Android', 'DroneKit']
PROJECT_LICENSES = ['Apache-2.0']
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 {
Expand Down Expand Up @@ -52,16 +74,67 @@ android {
}
}
}

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
}
}

dependencies {
compile "com.android.support:support-v4:${support_lib_version}"
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')
releaseCompile files('libs/Mavlink.jar')
// 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: "../release_android_library.gradle"
apply from: "$projectDir/maven-push.gradle"
File renamed without changes.
128 changes: 128 additions & 0 deletions ClientLib/maven-push.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
apply plugin: 'maven'
apply plugin: 'signing'

def projectGroupId = 'com.o3dr.android'
def projectArtifactId = project.PUBLISH_ARTIFACT_ID
def projectVersion = project.PUBLISH_VERSION
def projectDescription = project.PROJECT_DESCRIPTION
def projectLabels = project.PROJECT_LABELS
def projectLicense = project.PROJECT_LICENSE
def projectLicenseUrl = project.PROJECT_LICENSE_URL
def projectLicenseDistribution = project.PROJECT_LICENSE_DISTRIBUTION

def getMavenOrg(){
return hasProperty('COM_O3DR_MAVEN_ORG') ? COM_O3DR_MAVEN_ORG : ''
}

def getMavenPublishUrl(String artifactId){
def prefix = hasProperty('COM_O3DR_MAVEN_PUBLISH_URL_PREFIX') ? COM_O3DR_MAVEN_PUBLISH_URL_PREFIX : null
if(prefix == null)
return null

return "$prefix/$artifactId/;publish=0;override=1"
}

def getMavenPomPackaging(){
return hasProperty('COM_O3DR_MAVEN_POM_PACKAGING') ? COM_O3DR_MAVEN_POM_PACKAGING : 'aar'
}

def getDeveloperId(){
return hasProperty('DEVELOPER_ID') ? DEVELOPER_ID : ''
}

def getDeveloperName(){
return hasProperty('DEVELOPER_NAME') ? DEVELOPER_NAME : ''
}

afterEvaluate { project ->
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

pom.groupId = projectGroupId
pom.artifactId = projectArtifactId
pom.version = projectVersion

repository(url: getMavenPublishUrl(projectArtifactId)) {
authentication(userName: getMavenUsername(), password: getMavenApiKey())
}

pom.project {
name projectArtifactId
packaging getMavenPomPackaging()
description projectDescription

url 'https://github.com/dronekit/dronekit-android'
scm {
url 'https://github.com/dronekit/dronekit-android'
connection 'scm:git:[email protected]:dronekit/dronekit-android.git'
developerConnection 'scm:git:[email protected]:dronekit/dronekit-android.git'
}

licenses {
license {
name projectLicense
url projectLicenseUrl
distribution projectLicenseDistribution
}
}

developers {
developer {
id getDeveloperId()
name getDeveloperName()
}
}
}
}
}
}

signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}

task androidJavadocs(type: Javadoc) {
failOnError false

//Add the project java source directory.
def files = [android.sourceSets.main.java.srcDirs]

//Add the java source directories for the project's dependencies
configurations.compile.dependencies.each {
if (it instanceof ProjectDependency) {
def dependency = it as ProjectDependency
def depProj = dependency.getDependencyProject()
def projName = depProj.getName()
if(projName != "Mavlink") {
files += depProj.android.sourceSets.main.java.srcDirs
}
}
}

source = files
title = projectDescription
exclude '**/*.aidl', 'org/droidplanner/services/android/impl/**'
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
options.links("http://docs.oracle.com/javase/7/docs/api/")
options.links("https://developer.android.com/reference/packages.html")
}

task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs){
classifier = 'javadoc'
from androidJavadocs.destinationDir
}

task androidSourcesJar(type: Jar){
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
exclude 'org/droidplanner/services/android/impl/**'
}

artifacts {
archives androidSourcesJar
archives androidJavadocsJar
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
import com.o3dr.services.android.lib.model.AbstractCommandListener;
import com.o3dr.services.android.lib.model.action.Action;

import org.droidplanner.services.android.mock.MockDrone;
import org.junit.Assert;
import junit.framework.Assert;

import org.droidplanner.services.android.impl.mock.MockDrone;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricGradleTestRunner;
Expand All @@ -24,7 +25,7 @@
* Created by Fredia Huya-Kouadio on 10/23/15.
*/
@RunWith(RobolectricGradleTestRunner.class)
@Config(constants = org.droidplanner.services.android.BuildConfig.class, sdk = 18)
@Config(constants = com.o3dr.android.client.BuildConfig.class, sdk = 18)
public class ControlApiTest {

private static final SparseArray<float[][]> expectedVelocitiesPerAttitude = new SparseArray<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.droidplanner.services.android;
package org.droidplanner.services.android.impl;

import android.content.Context;
import android.os.Bundle;
Expand All @@ -8,25 +8,28 @@
import com.MAVLink.Messages.MAVLinkMessage;
import com.MAVLink.common.msg_command_long;
import com.MAVLink.enums.MAV_CMD;
import com.o3dr.android.client.BuildConfig;
import com.o3dr.services.android.lib.drone.connection.ConnectionParameter;
import com.o3dr.services.android.lib.gcs.link.LinkConnectionStatus;

import org.droidplanner.services.android.communication.model.DataLink;
import org.droidplanner.services.android.core.MAVLink.MavLinkCommands;
import org.droidplanner.services.android.core.drone.LogMessageListener;
import org.droidplanner.services.android.core.drone.autopilot.MavLinkDrone;
import org.droidplanner.services.android.core.drone.autopilot.apm.ArduCopter;
import org.droidplanner.services.android.core.firmware.FirmwareType;
import org.droidplanner.services.android.mock.MockMAVLinkClient;
import org.droidplanner.services.android.utils.AndroidApWarningParser;
import org.junit.Assert;
import org.junit.Before;

import org.droidplanner.services.android.impl.communication.model.DataLink;
import org.droidplanner.services.android.impl.core.MAVLink.MavLinkCommands;
import org.droidplanner.services.android.impl.core.drone.LogMessageListener;
import org.droidplanner.services.android.impl.core.drone.autopilot.MavLinkDrone;
import org.droidplanner.services.android.impl.core.drone.autopilot.apm.ArduCopter;
import org.droidplanner.services.android.impl.core.firmware.FirmwareType;
import org.droidplanner.services.android.impl.mock.MockMAVLinkClient;
import org.droidplanner.services.android.impl.utils.AndroidApWarningParser;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;


/**
* Created by djmedina on 3/5/15.
* This is a simple test case.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.droidplanner.services.android.core.drone.autopilot.apm;
package org.droidplanner.services.android.impl.core.drone.autopilot.apm;

import com.github.zafarkhaja.semver.Version;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.droidplanner.services.android.core.helpers.coordinates;
package org.droidplanner.services.android.impl.core.helpers.coordinates;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.droidplanner.services.android.core.helpers.coordinates;
package org.droidplanner.services.android.impl.core.helpers.coordinates;

import com.o3dr.services.android.lib.coordinate.LatLong;
import com.o3dr.services.android.lib.coordinate.LatLongAlt;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.droidplanner.services.android.core.helpers.coordinates;
package org.droidplanner.services.android.impl.core.helpers.coordinates;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package org.droidplanner.services.android.core.helpers.geoTools;
package org.droidplanner.services.android.impl.core.helpers.geoTools;

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

import junit.framework.TestCase;

import org.droidplanner.services.android.core.polygon.Polygon;
import org.droidplanner.services.android.impl.core.polygon.Polygon;


public class GeoToolsTest extends TestCase {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.droidplanner.services.android.core.helpers.units;
package org.droidplanner.services.android.impl.core.helpers.units;

import junit.framework.TestCase;

Expand Down
Loading

0 comments on commit 4c31ca3

Please sign in to comment.