Skip to content

Commit

Permalink
Do no duplicate AndroidManifest.xml, yet allow supplying it and the j…
Browse files Browse the repository at this point in the history
…ava sources
  • Loading branch information
remster committed Aug 26, 2020
1 parent 1ede399 commit 816aa85
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 96 deletions.
17 changes: 10 additions & 7 deletions android.pri
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@ message("Adding Serial Java Classes")
QT += androidextras

ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android

exists($$PWD/custom/android) {
message("Merging $$PWD/custom/android/ -> $$PWD/android/")

ANDROID_PACKAGE_SOURCE_DIR = $$OUT_PWD/ANDROID_PACKAGE_SOURCE_DIR
android_source_dir_target.target = android_source_dir
PRE_TARGETDEPS += $$android_source_dir_target.target
QMAKE_EXTRA_TARGETS += android_source_dir_target

javaforce.target = custom_android
javaforce.commands = $$QMAKE_MKDIR $$ANDROID_PACKAGE_SOURCE_DIR && \
$$QMAKE_COPY_DIR $$PWD/android/* $$OUT_PWD/ANDROID_PACKAGE_SOURCE_DIR && \
$$QMAKE_COPY_DIR $$PWD/custom/android/* $$OUT_PWD/ANDROID_PACKAGE_SOURCE_DIR
javaforce.depends = FORCE
PRE_TARGETDEPS += $$javaforce.target
QMAKE_EXTRA_TARGETS += javaforce
android_source_dir_target.commands = $$QMAKE_MKDIR $$ANDROID_PACKAGE_SOURCE_DIR && \
$$QMAKE_COPY_DIR $$PWD/android/* $$OUT_PWD/ANDROID_PACKAGE_SOURCE_DIR && \
$$QMAKE_COPY_DIR $$PWD/custom/android/* $$OUT_PWD/ANDROID_PACKAGE_SOURCE_DIR && \
$$QMAKE_STREAM_EDITOR -i \"s/package="org.mavlink.qgroundcontrol"/package=\"$$QGC_ORG_DOMAIN.qgroundcontrol\"/\" $$ANDROID_PACKAGE_SOURCE_DIR/AndroidManifest.xml
android_source_dir_target.depends = FORCE
}

exists($$PWD/custom/android/AndroidManifest.xml) {
Expand Down
1 change: 1 addition & 0 deletions android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,4 @@
<!-- %%INSERT_FEATURES -->

</manifest>

84 changes: 0 additions & 84 deletions custom-example/android/AndroidManifest.xml

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions custom-example/custom.pri
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ QGC_APP_NAME = "Custom QGroundControl"
QGC_BINARY_NAME = "CustomQGroundControl"
QGC_ORG_NAME = "Custom"
QGC_ORG_DOMAIN = "org.custom"
QGC_ANDROID_PACKAGE = "org.custom.qgroundcontrol"
QGC_APP_DESCRIPTION = "Custom QGroundControl"
QGC_APP_COPYRIGHT = "Copyright (C) 2020 QGroundControl Development Team. All rights reserved."

Expand Down

0 comments on commit 816aa85

Please sign in to comment.