Skip to content

Commit

Permalink
Update tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasVautherin committed Jan 30, 2022
1 parent 60d8f40 commit a4be47c
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 135 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ local.properties
gradle.properties

.cxx
venv
1 change: 1 addition & 0 deletions mavsdk_server/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.gradle
build
prebuiltLibs

libmavsdk_server.so
libc++_shared.so
98 changes: 49 additions & 49 deletions mavsdk_server/build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.6.0'
classpath 'com.android.tools.build:gradle:7.0.4'
}
}

allprojects {
apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'

repositories {
google()
jcenter()
mavenCentral()
}

def mavsdk_server_release = "v0.48.0"
Expand All @@ -28,11 +28,11 @@ allprojects {
def archiveName = "mavsdk_server_android-" + arch + "_" + mavsdk_server_release + ".tar"
def archiveFile = new File(project.buildDir.getAbsolutePath() + "/tmp/" + archiveName)
def archiveUrl = "https://github.com/mavlink/MAVSDK/releases/download/" + mavsdk_server_release + "/mavsdk_server_android-" + arch + ".tar"
def destDir = project.projectDir.getAbsolutePath() + "/src/main/jniLibs"
def destDir = project.projectDir.getAbsolutePath() + "/src/main/prebuiltLibs"

if (!archiveFile.exists()) {
project.logger.lifecycle("Downloading " + archiveFile.getName() + " into " + archiveFile.getAbsolutePath() + "...")
new URL(archiveUrl).withInputStream{ i -> archiveFile.withOutputStream{ it << i }}
new URL(archiveUrl).withInputStream { i -> archiveFile.withOutputStream { it << i } }
} else {
project.logger.lifecycle("Archive already exists! Skipping download!")
}
Expand All @@ -41,7 +41,7 @@ allprojects {
copy {
from tarTree(archiveFile)
eachFile({ file -> if (file.getName().endsWith(".so")) file.setMode(0755) })
into (destDir)
into(destDir)
}
}

Expand All @@ -62,61 +62,61 @@ allprojects {
}

if (project.hasProperty('ossrhUsername')
&& project.hasProperty('ossrhPassword')) {
&& project.hasProperty('ossrhPassword')) {

signing {
useGpgCmd()
sign configurations.archives
}

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

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
signing {
useGpgCmd()
sign configurations.archives
}

pom.project {
name 'MAVSDK-Server'
packaging 'aar'
description 'MAVSDK server for Android.'
url 'https://github.com/mavlink/MAVSDK-Java'
publishing {
publications {
mavenJava(MavenPublication) {
pom {
name = 'MAVSDK-Server'
packaging = 'aar'
description = 'MAVSDK server for Android.'
url = 'https://github.com/mavlink/MAVSDK-Java'

scm {
connection = 'scm:git:https://github.com/mavlink/MAVSDK-Java'
developerConnection = 'scm:git:https://github.com/mavlink/MAVSDK-Java'
url = 'https://github.com/mavlink/MAVSDK-Java'
}

scm {
connection 'scm:git:https://github.com/mavlink/MAVSDK-Java'
developerConnection 'scm:git:https://github.com/mavlink/MAVSDK-Java'
url 'https://github.com/mavlink/MAVSDK-Java'
}
licenses {
license {
name = 'BSD 3-Clause "New"'
url = 'https://opensource.org/licenses/BSD-3-Clause'
}
}

licenses {
license {
name 'BSD 3-Clause "New"'
url 'https://opensource.org/licenses/BSD-3-Clause'
developers {
developer {
id = 'jonasvautherin'
name = 'Jonas Vautherin'
email = '[email protected]'
}
}
}
}
}
repositories {
maven {
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"

developers {
developer {
id 'jonasvautherin'
name 'Jonas Vautherin'
email '[email protected]'
}
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
}
}
}

android {
compileSdkVersion 29
compileSdkVersion 31

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -125,7 +125,7 @@ android {

defaultConfig {
minSdkVersion 21
targetSdkVersion 29
targetSdkVersion 31

archivesBaseName = 'mavsdk-server'
group = 'io.mavsdk'
Expand All @@ -149,5 +149,5 @@ android {
}
}

ndkVersion "22.1.7171670"
ndkVersion "23.1.7779620"
}
5 changes: 3 additions & 2 deletions mavsdk_server/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Sat Jan 29 14:03:55 CET 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
6 changes: 3 additions & 3 deletions mavsdk_server/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
cmake_minimum_required(VERSION 3.4.1)
cmake_minimum_required(VERSION 3.10.2)

add_library(mavsdk_server SHARED IMPORTED)
set_target_properties(mavsdk_server
PROPERTIES IMPORTED_LOCATION
"${CMAKE_CURRENT_SOURCE_DIR}/../jniLibs/${ANDROID_ABI}/libmavsdk_server.so")
"${CMAKE_CURRENT_SOURCE_DIR}/../prebuiltLibs/${ANDROID_ABI}/libmavsdk_server.so")

include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../jniLibs/include")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../prebuiltLibs/include")

add_library(native_lib SHARED native-lib.cpp)
target_link_libraries(native_lib mavsdk_server log)
41 changes: 0 additions & 41 deletions mavsdk_server/src/main/jniLibs/include/mavsdk_server_api.h

This file was deleted.

82 changes: 42 additions & 40 deletions sdk/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
buildscript {
repositories {
jcenter()
mavenCentral()
}

dependencies {
Expand All @@ -12,7 +13,7 @@ subprojects {
apply plugin: 'com.google.protobuf'
apply plugin: 'idea'
apply plugin: 'java-library'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'

group = 'io.mavsdk'
Expand All @@ -21,6 +22,7 @@ subprojects {

repositories {
jcenter()
mavenCentral()
}

configurations {
Expand Down Expand Up @@ -100,55 +102,55 @@ subprojects {
if (project.hasProperty('ossrhUsername')
&& project.hasProperty('ossrhPassword')) {

signing {
useGpgCmd()
sign configurations.archives
}

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

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
signing {
useGpgCmd()
sign configurations.archives
}

pom.project {
name 'MAVSDK-Java'
packaging 'jar'
description 'MAVSDK client for Java.'
url 'https://github.com/mavlink/MAVSDK-Java'
publishing {
publications {
mavenJava(MavenPublication) {
pom {
name = 'MAVSDK-Java'
packaging = 'jar'
description = 'MAVSDK client for Java.'
url = 'https://github.com/mavlink/MAVSDK-Java'

scm {
connection = 'scm:git:https://github.com/mavlink/MAVSDK-Java'
developerConnection = 'scm:git:https://github.com/mavlink/MAVSDK-Java'
url = 'https://github.com/mavlink/MAVSDK-Java'
}

scm {
connection 'scm:git:https://github.com/mavlink/MAVSDK-Java'
developerConnection 'scm:git:https://github.com/mavlink/MAVSDK-Java'
url 'https://github.com/mavlink/MAVSDK-Java'
}
licenses {
license {
name = 'BSD 3-Clause "New"'
url = 'https://opensource.org/licenses/BSD-3-Clause'
}
}

licenses {
license {
name 'BSD 3-Clause "New"'
url 'https://opensource.org/licenses/BSD-3-Clause'
developers {
developer {
id = 'jonasvautherin'
name = 'Jonas Vautherin'
email = '[email protected]'
}
}
}
}
}
repositories {
maven {
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"

developers {
developer {
id 'jonasvautherin'
name 'Jonas Vautherin'
email '[email protected]'
}
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
}
}

task checkstyle(type: Checkstyle) {
configFile = rootProject.file("config/checkstyle/checkstyle.xml")
Expand Down Expand Up @@ -189,7 +191,7 @@ subprojects {
implementation "io.grpc:grpc-okhttp:${grpcVersion}"
implementation "io.grpc:grpc-protobuf-lite:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation 'org.slf4j:slf4j-api:1.7.25'
implementation 'org.slf4j:slf4j-api:1.7.35'
api 'io.reactivex.rxjava2:rxjava:2.2.21'

compileOnly "javax.annotation:javax.annotation-api:1.3.2"
Expand Down

0 comments on commit a4be47c

Please sign in to comment.