diff options
-rw-r--r-- | .circleci/config.yml | 47 | ||||
-rw-r--r-- | .fdroid.yml | 53 | ||||
-rw-r--r-- | .gitchangelog.tpl | 2 | ||||
-rw-r--r-- | AUTHORS | 7 | ||||
-rw-r--r-- | CHANGELOG.md | 119 | ||||
-rwxr-xr-x | CMakeLists.txt | 14 | ||||
-rw-r--r-- | build.gradle | 113 | ||||
-rwxr-xr-x | contrib/sailfish/navit-sailfish.spec | 2 | ||||
-rw-r--r-- | docs/development/macos_development.rst | 4 | ||||
-rw-r--r-- | fastlane/Fastfile | 2 | ||||
-rw-r--r-- | navit/android/build.gradle | 107 | ||||
-rw-r--r-- | navit/item.h | 23 | ||||
-rw-r--r-- | navit/map.c | 16 | ||||
-rw-r--r-- | navit/map.h | 55 | ||||
-rw-r--r-- | navit/map/csv/csv.h | 22 | ||||
-rw-r--r-- | navit/mapset.c | 5 | ||||
-rw-r--r-- | navit/mapset.h | 8 | ||||
-rw-r--r-- | navit/route.c | 11 | ||||
-rw-r--r-- | navit/route_protected.h | 6 | ||||
-rw-r--r-- | navit/vehicle/gpsd/vehicle_gpsd.c | 1 | ||||
-rwxr-xr-x | scripts/build_android.sh | 28 | ||||
-rw-r--r-- | settings.gradle | 1 |
22 files changed, 443 insertions, 203 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml index 9e4c7f88a..43ebaf025 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ defaults: &defaults jobs: sanity_check: docker: - - image: navit/sanity_check:latest + - image: circleci/android:api-29-ndk steps: - checkout - run: @@ -107,19 +107,19 @@ jobs: command: ./gradlew generateDebugJavadoc - store_artifacts: name: Store APK - path: navit/android/build/outputs/apk + path: build/outputs/apk destination: apk - store_artifacts: name: Store logs - path: navit/android/build/outputs/logs + path: build/outputs/logs destination: logs - store_artifacts: name: Store Javadoc - path: navit/android/build/outputs/docs/javadoc + path: build/outputs/docs/javadoc destination: doc - store_artifacts: name: Store Lint reports - path: navit/android/build/reports + path: build/reports destination: reports - store_test_results: path: test-results @@ -127,6 +127,40 @@ jobs: name: Update Navit-Download-Center command: | bash scripts/update_download_center.sh + build_fdroid: + docker: + - image: registry.gitlab.com/fdroid/ci-images-client:latest + steps: + - checkout + - run: + name: Build with F-Droid + command: | + test -d build || mkdir build + test -d fdroidserver || mkdir fdroidserver + git ls-remote https://gitlab.com/fdroid/fdroidserver.git master + curl --silent https://gitlab.com/fdroid/fdroidserver/repository/master/archive.tar.gz | tar -xz --directory=fdroidserver --strip-components=1 + export PATH="`pwd`/fdroidserver:$PATH" + export PYTHONPATH="$CI_PROJECT_DIR/fdroidserver:$CI_PROJECT_DIR/fdroidserver/examples" + export PYTHONUNBUFFERED=true + bash fdroidserver/buildserver/setup-env-vars $ANDROID_HOME + adduser --disabled-password --gecos "" vagrant + ln -s $CI_PROJECT_DIR/fdroidserver /home/vagrant/fdroidserver + mkdir -p /vagrant/cache + wget -q https://services.gradle.org/distributions/gradle-5.6.2-bin.zip --output-document=/vagrant/cache/gradle-5.6.2-bin.zip + bash fdroidserver/buildserver/provision-gradle + bash fdroidserver/buildserver/provision-apt-get-install http://deb.debian.org/debian + source /etc/profile.d/bsenv.sh + apt-get dist-upgrade + apt-get install -t stretch-backports fdroidserver python3-asn1crypto python3-ruamel.yaml yamllint + apt-get purge fdroidserver + export GRADLE_USER_HOME=$PWD/.gradle + set -x + apt-get install sudo + fdroid build --verbose --on-server --no-tarball + - store_artifacts: + name: Store APK + path: unsigned + destination: apk build_win32: docker: - image: ubuntu:14.04 @@ -266,6 +300,9 @@ workflows: - build_android: requires: - sanity_check + - build_fdroid: + requires: + - sanity_check - build_sailfish: requires: - sanity_check diff --git a/.fdroid.yml b/.fdroid.yml new file mode 100644 index 000000000..1e314c64b --- /dev/null +++ b/.fdroid.yml @@ -0,0 +1,53 @@ +Categories: + - Navigation +License: GPL-2.0-only +WebSite: https://www.navit-project.org/ +SourceCode: https://github.com/navit-gps/navit +IssueTracker: http://trac.navit-project.org +Translation: https://translations.launchpad.net/navit/trunk/+pots/navit +Changelog: https://github.com/navit-gps/navit/blob/HEAD/CHANGELOG.md#changelog + +AutoName: Navit +Description: |- + Its modular design is capable of using vector maps of various formats for + routing and rendering of the displayed map. It’s even possible to use multiple + maps at a time. While Navit supports all major platforms, there is a fork + specializing on an easy-to-use, Android-only solution: + https://f-droid.org/packages/com.zoffcc.applications.zanavi. + + The routing engine not only calculates an optimal route to your destination, but + also generates directions and even speaks to you. + + Navit currently speaks 27 languages. You can help translating via the web-based + <a href="http://translations.launchpad.net/navit/trunk/+pots/navit">translation page</a>. + +RepoType: git +Repo: https://github.com/navit-gps/navit + +Builds: + - versionName: generated_at_build_time + versionCode: 42 + # since we generate version codes on the fly, we never know them at commit time + # therefore we use dummy values and skip the version check + novcheck: yes + commit: HEAD + gradle: + - yes + output: build/outputs/apk/release/navit-release.apk + rm: + - navit/support/espeak/espeak-data/* + prebuild: + # ndk is needed because of CI limitations and can be removed once the CI image comes with NDK 20 + - $$SDK$$/tools/bin/sdkmanager "cmake;3.6.4111459" "ndk;20.0.5594570" > /dev/null + - sed -i -e '/gradlew/d' scripts/build_android.sh + build: scripts/build_android.sh + # disable for now because of CI limitations + #ndk: r20b + +MaintainerNotes: |- + Found JAR file at navit/android/libs/TTS_library_stub.jar, removed as of v0.5.3-442-g96d9c41. + NDK r12b is the minimum required as of v0.5.3, later versions may work but are untested. + +AutoUpdateMode: Version %v +UpdateCheckMode: HTTP +UpdateCheckData: https://download.navit-project.org/api/version.json|"version_code":.*"(.*)"|.|"version_name":.*\"(.*)\", diff --git a/.gitchangelog.tpl b/.gitchangelog.tpl index 59bc8a299..b89a83815 100644 --- a/.gitchangelog.tpl +++ b/.gitchangelog.tpl @@ -29,7 +29,7 @@ Navit follows the semantic versioning: <% title = "## [%s] - %s" % (version["tag"], version["date"]) if version["tag"] else "## %s" % opts["unreleased_version_label"] %>${title} % for section in version["sections"]: -<% lbl = "## %s" % section["label"] %>${lbl} +<% lbl = "### %s" % section["label"] %>${lbl} % for commit in section["commits"]: <% @@ -1,10 +1,11 @@ # Active contributors: +barbeque-squared Benjamin Davies Bignaux Ronan -Charles Curley David Heidelberg emaiannone gefin +James Hilliard jandegr jkoan Johan Fitié @@ -16,8 +17,8 @@ mvglasow OLFDB Patrick Höhn Pierre Grandin -Robert Pohlink Stefan Wildemann +Tim Gates # Retired contributors: afaber @@ -29,6 +30,7 @@ bodenseepingu bustersnyvel carcinoma Cedric Paille +Charles Curley christeck eiten gauthier60 @@ -56,6 +58,7 @@ OmegA_MRS pavel plum_ Rikky +Robert Pohlink Robotaxi rphlx sanderd17 diff --git a/CHANGELOG.md b/CHANGELOG.md index ef152205c..f73c456ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,16 +23,94 @@ Navit follows the semantic versioning: usually tends to occur along with larger changes which would warrant a new major version anyway - -## [Unreleased] +## [Unreleased](https://github.com/navit-gps/navit/compare/v0.5.6...HEAD) To get the list of all the unreleased commits, see: -[Full Changelog](https://github.com/navit-gps/navit/compare/v0.5.5...HEAD) +[Full Changelog](https://github.com/navit-gps/navit/compare/v0.5.6...HEAD) + +## [v0.5.6](https://github.com/navit-gps/navit/compare/v0.5.5...v0.5.6) - 2021-03-06 +### Added -## [0.5.5] - 2020-08-08 +* Add:traffic:Log class/type of unrecognized events during XML parsing. [mvglasow] +* Add:traffic:Log ID for messages discarded as invalid. [mvglasow] +* Add:graphics:svg\_debug:Add svg\_debugging plugin (#1061) [jkoan] +* Add:vehicle:Add first Prototype of the geoclue Plugin. [jkoan] +* Add:port/android:Adaptive app icon. [mvglasow] +* Added license information to fix #1048 (#1060) [Patrick Höhn] +* Add:traffic/traff\_android:Process heartbeat requests. [mvglasow] +* Add:traffic/traff\_android:Log subscription operations in detail. [mvglasow] +* Add:port/android:Adaptive app icon. [mvglasow] +* Add:traffic:Complete TraFF 0.8 subscription suport. [mvglasow] +* Add:traffic:Add basic TraFF 0.8 support. [mvglasow] + +### Changed -## Added +* Update macos\_development.rst. [Patrick Höhn] +* Change:android:Remove map download size limit on modern Android versions (#1029) [Johan Fitié] + +### Fixed + +* Build:Use NDK libraries when building for Android. [mvglasow] +* Build:Keep generated Android resource files in build dir. [mvglasow] +* Build:Reduce source tree pollution by Android build CMake output now moved to android-builddir Generated XML, PNG and translations still get written to source tree. [mvglasow] +* Vehicle:gpsd:Fix #1090, plugin\_init not found. [jkoan] +* Fixed:android:build:Fixed the apk outputname and the corresponding locations within the scripts. [jkoan] +* Build:do not request CXX if explicitly disabled. [mvglasow] +* Build/android:do not double-define getcwd on recent NDK versions. [mvglasow] +* Build:android: Fix VersionCode after 31.12.2020 (#1082) [jkoan] +* Fix Link to full Changelog. [jkoan] +* Build:Remove install of git as the baseimage already has it. [jkoan] +* Builds:Revert baseimage back and oly set merge\_trunk\_in\_master to cimg/base. [jkoan] +* Core:Prevent crash if destination is set before acquiring a location. [mvglasow] +* Vehicle\_geoclue:Fix speed and direction and do some cleanup. [jkoan] +* Vehicle:Fix codestyle. [jkoan] +* Android:Add possibility to use background position usage. [jkoan] +* Build:Prevent try\_compile() from choking on CXX. [mvglasow] +* Plugin/j1850: Replace graphic\_fg\_white with graphic\_fg. [James Hilliard] +* Build:core:Fix two issues where the wrong enum type is used, but both have the same value of 0. [jkoan] +* Core:osd:Altitude in metric with imperial defined. [Patrick Höhn] +* Build:android:Add extra security check for gradle. [jkoan] +* Android:Add possibility to use background position usage. [jkoan] +* Vehicle:gpsd:minor comment fix. [jkoan] +* Fix:graphics:win32:Fix build with newer libpng versions. Thx @bignaux fixes #984. [jkoan] +* Build:Fix usage of inkscape 1.0 commandline usage. [jkoan] +* Build:Fix Codesigning with newer ndk image versions. [jkoan] +* Maptool:Add missing external, fixes #1045. [barbeque-squared] +* Graphics/qt5:Add missing include. [barbeque-squared] +* Vehicle:gpsd:Add Support for Gpsd 3.21. [jkoan] +* Core:Optimize log message for required vehicle attributes. [jkoan] +* Traffic/traff\_android:Get subscription ID from request where applicable. [mvglasow] +* Traffic/traff\_android:Fix log messages when subscription ID is missing. [mvglasow] +* Traffic/traff\_android:Fix log messages when content URI is missing. [mvglasow] +* Traffic/traff\_android:Fix subscription lookup. [mvglasow] +* Core:Prevent crash if destination is set before acquiring a location. [mvglasow] +* Core:Fix invalid pointer which would cause unpredictable crashes. [mvglasow] +* Core:set destination before firing callbacks. [mvglasow] +* Build:Prevent try\_compile() from choking on CXX. [mvglasow] + +### Other + +* Refactor:fdroid:Remove build.xml generation. [mvglasow] +* Refactor:core:Documentation update (#1095) [mvglasow] +* Refactor:build:merge into one single build.gradle. [mvglasow] +* Refactor:traffic/traff\_android:remove TODO comment. [mvglasow] +* Refactor:traffic:Make sanity check happy. [mvglasow] +* Docs: fix simple typo, useage -\> usage. [Tim Gates] +* Refactor:core:Fix documentation for route\_graph\_build() [mvglasow] +* Refactor:core:make sanity\_check happy (sort of, see #1041) [mvglasow] +* Refactor:core:Fix documentation for route\_graph\_build() [mvglasow] +* Refactor:traffic/traff\_android:Fix checkstyle issues. [mvglasow] +* Refactor:traffic/traff\_android:Fix Javadoc formatting. [mvglasow] +* Refactor:traffic/traff\_android:More sanity check fixes. [mvglasow] +* Refactor:traffic:Make sanity check happy. [mvglasow] +* Refactor:core:Add documentation. [mvglasow] +* Refactor:core:Add documentation. [mvglasow] + + +## [v0.5.5](https://github.com/navit-gps/navit/compare/v0.5.4...v0.5.5) - 2020-08-08 + +### Added * Add poly\_swimming\_pool. [Stefan Wildemann] * Add:maptool:enhance leisure=track handling and add poi\_archeaological\_site (#1005) [Stefan Wildemann] @@ -44,7 +122,7 @@ To get the list of all the unreleased commits, see: * Add:build:Android build and signing. Also add fastlane for metadata. Set execute on scripts/\*.sh. [jkoan] * Add:cmake: add compilation flags to harden the security of navit (#969) [Joseph Herlant] -## Changed +### Changed * Change:core:Remove unused argument from attr\_search. [jkoan] * Change\_layout:Make sure park, meadow, scrub, and wood render in correct order (#1017) [Johan Fitié] @@ -54,7 +132,7 @@ To get the list of all the unreleased commits, see: * Change:android:build:Fix empty Variable handling. [jkoan] * Change:metadata:Rename Title to "Navit" only because everybody knows that its for Android when found within F-Droid or Google Play store. [jkoan] -## Fixed +### Fixed * Android:Remove old, confusing AndroidManifest.xml. [jkoan] * Android:Readd android:sharedUserId to allow for Updates. [jkoan] @@ -79,7 +157,7 @@ To get the list of all the unreleased commits, see: * Plugins: too few arguments to functions navit\_attr\_iter\_new and config\_attr\_iter\_new (#966) [Joseph Herlant] * Port/android:Use new icon for notification (#963) [mvglasow] -## Other +### Other * Android: Activate downloaded maps automatically (#1027) [Johan Fitié] * Improvement:layout:car-dark Improve Car-Dark layout colors (#1028) [Johan Fitié] @@ -94,7 +172,7 @@ To get the list of all the unreleased commits, see: * Improve layout (#1002) [Johan Fitié] * Use debian:latest in the CI to get more up-to-date tools (#971) [Joseph Herlant] -## [0.5.4] - 2020-01-18 +## [v0.5.4](https://github.com/navit-gps/navit/compare/v0.5.3...v0.5.4) - 2020-01-18 ### Added @@ -191,7 +269,7 @@ To get the list of all the unreleased commits, see: - Refactoring:mingw:simplify toolchain [\#659](https://github.com/navit-gps/navit/pull/659) ([bignaux](https://github.com/bignaux)) - Refactoring:cmake:from 2.6 to 3.2 [\#651](https://github.com/navit-gps/navit/pull/651) ([bignaux](https://github.com/bignaux)) -## [v0.5.3] - 2018-08-31 +## [v0.5.3](https://github.com/navit-gps/navit/compare/v0.5.2...v0.5.3) - 2018-08-31 Release 0.5.2 had issues with the version not properly updated in the `CMakeLists.txt`. This release fixes that issue. @@ -200,7 +278,7 @@ Release 0.5.2 had issues with the version not properly updated in the `CMakeList * Update Sailfish spec for release 0.5.3. [Joseph Herlant] * Update Patch version for release 0.5.3. [Joseph Herlant] -## [v0.5.2] - 2018-08-30 +## [v0.5.2](https://github.com/navit-gps/navit/compare/v0.5.1...v0.5.2) - 2018-08-30 ### Added @@ -300,7 +378,7 @@ Release 0.5.2 had issues with the version not properly updated in the `CMakeList * Android:Fix:remove unused dependency libpng (#592) [jandegr] -## [v0.5.1] - 2018-04-19 +## [v0.5.1](https://github.com/navit-gps/navit/compare/v0.5.0...v0.5.1) - 2018-04-19 ### Added @@ -751,7 +829,7 @@ Release 0.5.2 had issues with the version not properly updated in the `CMakeList * We always want the failed code from bash not from tee. [jkoan] * Little quick change to make it working fast. [jkoan] * Auto pitch and orientation (#306) [Johan Fitié] -* #1352 workaround. [mdankov] +* \#1352 workaround. [mdankov] * Smaller Android screenshot for README.md. [Johan Fitié] * Pitch correction (#303) [Johan Fitié] * [POI] Resize SVG icons to 22x22 (#304) [Johan Fitié] @@ -899,29 +977,20 @@ Release 0.5.2 had issues with the version not properly updated in the `CMakeList * Trac-1064 render OSM shop=mall as poi\_mall. [Pierre GRANDIN] * Bumping the trunk to 0.5.1. [Pierre GRANDIN] -## [v0.5.0] - 2015-12-31 +## [v0.5.0](https://github.com/navit-gps/navit/compare/v0.5.0-rc.2...v0.5.0) - 2015-12-31 This release was done before the adoption of this changelog format. Use [this v0.5.0-rc.2 to v0.5.0 comparison link](https://github.com/navit-gps/navit/compare/v0.5.0-rc.2...v0.5.0) to view the corresponding changes. -## [v0.5.0-rc2] - 2015-09-02 +## [v0.5.0-rc2](https://github.com/navit-gps/navit/compare/v0.5.0-rc.1...v0.5.0-rc.2) - 2015-09-02 This release was done before the adoption of this changelog format. Use [this v0.5.0-rc.1 to v0.5.0-rc.2 comparison link](https://github.com/navit-gps/navit/compare/v0.5.0-rc.1...v0.5.0-rc.2) to view the corresponding changes. -## [v0.5.0-rc1] - 2015-08-08 +## [v0.5.0-rc1](https://github.com/navit-gps/navit/compare/v0.5.0-beta.1...v0.5.0-rc.1) - 2015-08-08 This release was done before the adoption of this changelog format. Use [this v0.5.0-beta.1 to v0.5.0-rc.1 comparison link](https://github.com/navit-gps/navit/compare/v0.5.0-beta.1...v0.5.0-rc.1) to view the corresponding changes. - -[Unreleased]: https://github.com/navit-gps/navit/compare/v0.5.4...HEAD -[v0.5.4]: https://github.com/navit-gps/navit/compare/v0.5.3...v0.5.4 -[v0.5.3]: https://github.com/navit-gps/navit/compare/v0.5.2...v0.5.3 -[v0.5.2]: https://github.com/navit-gps/navit/compare/v0.5.1...v0.5.2 -[v0.5.1]: https://github.com/navit-gps/navit/compare/v0.5.0...v0.5.1 -[v0.5.0]: https://github.com/navit-gps/navit/compare/v0.5.0-rc.2...v0.5.0 -[v0.5.0-rc.2]: https://github.com/navit-gps/navit/compare/v0.5.0-rc.1...v0.5.0-rc.2 -[v0.5.0-rc.1]: https://github.com/navit-gps/navit/compare/v0.5.0-beta.1...v0.5.0-rc.1 diff --git a/CMakeLists.txt b/CMakeLists.txt index 305229c30..086c3d32b 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,11 @@ cmake_minimum_required(VERSION 3.2) set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.navitproject.navit") set(MACOSX_BUNDLE_BUNDLE_NAME "Navit") message(STATUS "Building with CMake V${CMAKE_VERSION}") -project(navit C CXX) +if (DISABLE_CXX) + project(navit C) +else(DISABLE_CXX) + project(navit C CXX) +endif(DISABLE_CXX) # Workaround for CMake issue 8345 / 9220, see http://trac.navit-project.org/ticket/1041 if(DEFINED CMAKE_CXX_COMPILER AND CMAKE_CXX_COMPILER MATCHES "^$") @@ -15,7 +19,7 @@ endif(NOT DISABLE_CXX) set(NAVIT_VERSION_MAJOR "0") set(NAVIT_VERSION_MINOR "5") -set(NAVIT_VERSION_PATCH "5") +set(NAVIT_VERSION_PATCH "6") if(ANDROID) set(PACKAGE_VERSION "${NAVIT_VERSION_MAJOR}.${NAVIT_VERSION_MINOR}.${NAVIT_VERSION_PATCH}.${ANDROID_ABI}") else(ANDROID) @@ -155,6 +159,12 @@ INCLUDE (CheckLibraryExists) INCLUDE (CheckFunctionExists) INCLUDE (CheckSymbolExists) +if(ANDROID) + set(ENV{PKG_CONFIG_DIR} "") + set(ENV{PKG_CONFIG_LIBDIR} "${CMAKE_SYSROOT}/usr/lib/pkgconfig:${CMAKE_SYSROOT}/usr/share/pkgconfig") + set(ENV{PKG_CONFIG_SYSROOT_DIR} ${CMAKE_SYSROOT}) +endif(ANDROID) + ################################ # pkg-config based detection # ################################ diff --git a/build.gradle b/build.gradle index b9db6a857..d284d54a0 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,6 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. +apply plugin: 'com.android.application' +apply from: "$project.rootDir/gradle/scripts/git-scm-version.gradle" +apply plugin: 'checkstyle' buildscript { repositories { @@ -28,6 +30,115 @@ allprojects { } } +/* task clean(type: Delete) { delete rootProject.buildDir } +*/ +android { + compileSdkVersion 29 + buildToolsVersion "29.0.2" + signingConfigs { + release { + // We can leave these in environment variables + storeFile file(System.getenv("KEYSTORE") ?: "/store") + keyAlias System.getenv("KEY_ALIAS") + storePassword System.getenv("STORE_PASS") + keyPassword System.getenv("STORE_PASS") + } + } + defaultConfig { + applicationId "org.navitproject.navit" + minSdkVersion 10 + targetSdkVersion 29 + versionCode gitVersionCode + versionName gitVersionName + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + ndk { + abiFilters 'x86', 'x86_64', 'arm64-v8a', 'armeabi-v7a' + } + externalNativeBuild { + cmake { + arguments '-DDISABLE_CXX=y', '-DUSE_PLUGINS=n', '-DBUILD_MAPTOOL=n', '-DXSL_PROCESSING=n', '-DSAMPLE_MAP=n', '-DCMAKE_SYSROOT='+android.ndkDirectory+'/sysroot' + } + } + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + if(file(System.getenv("KEYSTORE") ?: "/store").exists()){ + signingConfig signingConfigs.release + } + } + } + lintOptions { + disable 'UnusedResources' + abortOnError true + } + sourceSets { + main { + manifest.srcFile "navit/android/AndroidManifest.xml" + java.srcDirs = ["navit/android/src"] + resources.srcDirs = ["navit/android/src"] + renderscript.srcDirs = ["navit/android/src"] + res.srcDirs = ["navit/android/res", "android-builddir/android/res"] + assets.srcDirs = ["navit/android/assets", "android-builddir/android/assets"] + } + } + externalNativeBuild { + cmake { + buildStagingDirectory "./android-builddir" + path 'CMakeLists.txt' + } + } + + task checkstyleMain(type: Checkstyle){ + source 'navit/android/src' + include '**/*.java' + configFile = rootProject.file('checkstyle.xml') + ignoreFailures = false + showViolations = true + // empty classpath + classpath = files() + reports { + include ('**/*.java') + xml.enabled = true + html.enabled = true + xml { + destination file("checkstyle/checkstyleMain.xml") + } + html { + destination file("checkstyle/checkstyleMain.html") + } + } + + checkstyle { + toolVersion = '8.26' + } + } + applicationVariants.all { variant -> + variant.outputs.all { + outputFileName = "navit-${variant.buildType.name}.apk" + } + // create tasks to generate Javadocs + task("generate${variant.name.capitalize()}Javadoc", type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + destinationDir = file("navit/android/build/outputs/docs/javadoc/") + title = rootProject.name + options.memberLevel = JavadocMemberLevel.PACKAGE + verbose = true + failOnError false + } + } + +} +dependencies { + implementation fileTree(include: ['*.jar'], dir: 'navit/android/libs') + androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { + exclude group: 'com.android.support', module: 'support-annotations' + }) + testImplementation 'junit:junit:4.12' + implementation 'ch.acra:acra:4.9.2' +// implementation 'com.android.support:support-v4:28.0.0' +} diff --git a/contrib/sailfish/navit-sailfish.spec b/contrib/sailfish/navit-sailfish.spec index e2b49aea2..bbc0c75d4 100755 --- a/contrib/sailfish/navit-sailfish.spec +++ b/contrib/sailfish/navit-sailfish.spec @@ -9,7 +9,7 @@ Name: harbour-navit Summary: Open Source car navigation system #Version: %{navit_version}_%{git_version} -Version: 0.5.5 +Version: 0.5.6 Release: 1 License: GPL Group: Applications/Productivity diff --git a/docs/development/macos_development.rst b/docs/development/macos_development.rst index b1559c0a5..bfc2b2b43 100644 --- a/docs/development/macos_development.rst +++ b/docs/development/macos_development.rst @@ -4,6 +4,10 @@ MacOS Development Here are some notes about running navit under Apple Mac OSX. +================================================================================================================================ +WARNING: These instructions are currently unmaintained. Please feel free to submit a PR if you manage to build navit on Mac OSX. +================================================================================================================================ + What you will need ================== diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 5d8e2d734..edb4fd4f7 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -40,7 +40,7 @@ platform :android do if isOnMasterBranch upload_to_play_store( track: 'beta', json_key: 'key.json', - apk: 'navit/android/build/outputs/apk/release/android-release.apk', + apk: 'build/outputs/apk/release/navit-release.apk', package_name: 'org.navitproject.navit' ) else diff --git a/navit/android/build.gradle b/navit/android/build.gradle deleted file mode 100644 index 0d5ef7a70..000000000 --- a/navit/android/build.gradle +++ /dev/null @@ -1,107 +0,0 @@ -apply plugin: 'com.android.application' -apply from: "$project.rootDir/gradle/scripts/git-scm-version.gradle" -apply plugin: 'checkstyle' - -android { - compileSdkVersion 29 - buildToolsVersion "29.0.2" - signingConfigs { - release { - // We can leave these in environment variables - storeFile file(System.getenv("KEYSTORE") ?: "/store") - keyAlias System.getenv("KEY_ALIAS") - storePassword System.getenv("STORE_PASS") - keyPassword System.getenv("STORE_PASS") - } - } - defaultConfig { - applicationId "org.navitproject.navit" - minSdkVersion 10 - targetSdkVersion 29 - versionCode gitVersionCode - versionName gitVersionName - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - ndk { - abiFilters 'x86', 'x86_64', 'arm64-v8a', 'armeabi-v7a' - } - externalNativeBuild { - cmake { - arguments '-DDISABLE_CXX=y', '-DUSE_PLUGINS=n', '-DBUILD_MAPTOOL=n', '-DXSL_PROCESSING=n', '-DSAMPLE_MAP=n' - } - } - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - if(file(System.getenv("KEYSTORE") ?: "/store").exists()){ - signingConfig signingConfigs.release - } - } - } - lintOptions { - disable 'UnusedResources' - abortOnError true - } - sourceSets { - main { - manifest.srcFile "AndroidManifest.xml" - java.srcDirs = ["src"] - resources.srcDirs = ["src"] - renderscript.srcDirs = ["src"] - res.srcDirs = ["res"] - assets.srcDirs = ["assets"] - } - } - externalNativeBuild { - cmake { - path '../../CMakeLists.txt' - } - } - - task checkstyleMain(type: Checkstyle){ - source 'src' - include '**/*.java' - configFile = rootProject.file('checkstyle.xml') - ignoreFailures = false - showViolations = true - // empty classpath - classpath = files() - reports { - include ('**/*.java') - xml.enabled = true - html.enabled = true - xml { - destination file("checkstyle/checkstyleMain.xml") - } - html { - destination file("checkstyle/checkstyleMain.html") - } - } - - checkstyle { - toolVersion = '8.26' - } - } - applicationVariants.all { variant -> - // create tasks to generate Javadocs - task("generate${variant.name.capitalize()}Javadoc", type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - destinationDir = file("build/outputs/docs/javadoc/") - title = rootProject.name - options.memberLevel = JavadocMemberLevel.PACKAGE - verbose = true - failOnError false - } - } - -} -dependencies { - implementation fileTree(include: ['*.jar'], dir: 'libs') - androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { - exclude group: 'com.android.support', module: 'support-annotations' - }) - testImplementation 'junit:junit:4.12' - implementation 'ch.acra:acra:4.9.2' -// implementation 'com.android.support:support-v4:28.0.0' -} diff --git a/navit/item.h b/navit/item.h index 26c83cd72..d3e222196 100644 --- a/navit/item.h +++ b/navit/item.h @@ -95,7 +95,22 @@ struct item_id { #define ITEM_ID_ARGS(x) (x).id_hi,(x).id_lo /** - * Represents an object on a map, such as a POI, a building, a way or a boundary. + * @brief Represents an object on a map. + * + * An item holds the data for an individual item on a map, including its coordinates and various attributes. The item + * type specifies what the map item refers to, such as a POI, a building, a way or a boundary. There are also special + * item types used internally, such as the various kinds of turn instructions. Item types are internally represented as + * numbers. + * + * Outside map implementations, items are generally retrieved from map rectangles, and their methods are implemented by + * the respective map driver. Items retrieved from a map rectangle are generally short-lived: a previously retrieved + * item should be considered invalid when a new item is retrieved from the same map rectangle, or after its map + * rectangle has been destroyed. After that, functions may segfault or return invalid data, and even the item itself + * may have been deallocated. + * + * Actual behavior may differ between map implementations, but do not rely on any behavior not covered by the above + * interface contract. Exceptions apply, of course, for code that is limited to working with items from one particular + * map (typically inside a map implementation). */ struct item { enum item_type type; /**< Type of the item.*/ @@ -110,6 +125,12 @@ extern struct item_range { enum item_type min,max; } item_range_all; +/** + * @brief An item indicating that the map driver is busy fetching more items. + * + * This is a “magic” item which may be returned by one of the query methods of a map driver. Receiving this item means + * that the map driver is currently busy fetching more items, and they can be retrieved at a later point in time. + */ extern struct item busy_item; /* prototypes */ diff --git a/navit/map.c b/navit/map.c index c8cddbcc2..e3034d429 100644 --- a/navit/map.c +++ b/navit/map.c @@ -52,11 +52,6 @@ #include "country.h" #include "xmlconfig.h" -/** - * @brief Holds information about a map - * - * This structure holds information about a map. - */ struct map { NAVIT_OBJECT struct map_methods meth; /**< Structure with pointers to the map plugin's functions */ @@ -64,11 +59,6 @@ struct map { struct callback_list *attr_cbl; /**< List of callbacks that are called when attributes change */ }; -/** - * @brief Describes a rectangular extract of a map - * - * This structure describes a rectangular extract of a map. - */ struct map_rect { struct map *m; /**< The map this extract is from */ struct map_rect_priv *priv; /**< Private data of this map rect, only known to the map plugin */ @@ -375,12 +365,6 @@ void map_rect_destroy(struct map_rect *mr) { } } -/** - * @brief Holds information about a search on a map - * - * This structure holds information about a search performed on a map. This can be - * used as "handle" to retrieve items from a search. - */ struct map_search { struct map *m; struct attr search_attr; diff --git a/navit/map.h b/navit/map.h index 78521bccf..63fa889e3 100644 --- a/navit/map.h +++ b/navit/map.h @@ -47,12 +47,13 @@ struct attr; /** * @brief Used to select data from a map * - * This struct is used to select data from a map. This one the one hand builds a - * rectangle on the map and on the other hand selects an order for items of each - * layer. Note that passing NULL instead of a pointer to such a struct often means - * "get me everything". + * A map selection is a map query, used to select data from a map. It builds a coordinate rectangle on the map and + * selects a range of item types to query the map for. * - * It's possible to link multiple selections in a linked list, see below. + * Multiple rectangular areas and/or non-contiguous ranges of item types can be specified by concatenating multiple map + * selections in a linked list. + * + * Note that passing NULL instead of a pointer to such a struct often means "get me everything". */ struct map_selection { struct map_selection *next; /**< Linked-List pointer */ @@ -236,10 +237,54 @@ struct attr; struct attr_iter; struct callback; struct item; + +/** + * @brief Holds information about a map + * + * A map holds data used for screen display, search and routing. Maps can come in different forms, such as stored in + * files or created on the fly in memory. Flat-file maps typically hold the data commonly found in a road map, such as + * roads, land uses, buildings and POIs. In-memory maps are used internally for data which changes at runtime, such as + * information on the currently active route or traffic reports. + * + * To read data from a map (or add data if the map driver supports it), you need to obtain a map rectangle by calling + * the map’s `map_rect_new` method. By passing a map selection it is possible to restrict the items retrieved from the + * map to a certain region or to certain item types. + */ struct map; + +/** + * @brief Implementation-specific map data. + * + * This struct is defined individually by each map driver and not ment to be accessed outside the map driver. + */ struct map_priv; + +/** + * @brief Describes an extract of a map + * + * A map rectangle is the result of a map query. It can be obtained from the map by calling `map_rect_new` and passing + * a map selection. The resulting map rectangle can be queried for items. Contrary to its name, a map rectangle does + * not necessarily correspond to a rectangle: depending on the map selection it was created from, it can hold data from + * multiple rectangular areas (which may or may not overlap) or from the entire map. + * + * Map rectangles are not guaranteed to be thread-safe, i.e. a map rectangle should never be accessed by more than one + * thread without proper external synchronization. It is recommended that each thread obtain a separate map rectangle. + * + * Map implementations must ensure, however, that accesses to different map rectangles of the same map by different + * threads are properly synchronized. Most importantly, they must ensure that threads reading from one map rectangle + * receive consistent data while another thread is writing to another (which may also happen when reloading data from a + * stored map). + */ struct map_rect; + +/** + * @brief Holds information about a search on a map + * + * This structure holds information about a search performed on a map. This can be + * used as "handle" to retrieve items from a search. + */ struct map_search; + struct map_selection; struct pcoord; struct map *map_new(struct attr *parent, struct attr **attrs); diff --git a/navit/map/csv/csv.h b/navit/map/csv/csv.h index c32be1eff..c48458c82 100644 --- a/navit/map/csv/csv.h +++ b/navit/map/csv/csv.h @@ -27,19 +27,17 @@ struct map_priv { int id; - struct quadtree_node* tree_root; + struct quadtree_node* tree_root; /**< Root of the quadtree from which items can be retrieved by their coordinates */ int flags; - GHashTable*qitem_hash; - char* filename; - /*need to write map file on exit*/ - int dirty; - int attr_cnt; - enum attr_type *attr_types; - int next_item_idx; - enum item_type item_type; - /*list of quadtree items that have no coord set yet ()*/ - GList* new_items; - char *charset; + GHashTable*qitem_hash; /**< Hash table to retrieve items by their ID */ + char* filename; /**< Name of the file in which the map is stored */ + int dirty; /**< Need to write map file on exit */ + int attr_cnt; /**< Number of elements in `attr_types` */ + enum attr_type *attr_types; /**< Array of attribute types supported by this map */ + int next_item_idx; /**< Zero-based index (`id_lo`) for the next item to be added */ + enum item_type item_type; /**< Item type stored in this map */ + GList* new_items; /**< List of quadtree items that have no coord set yet */ + char *charset; /**< Identifier for the character set of this map */ }; struct map_rect_priv { diff --git a/navit/mapset.c b/navit/mapset.c index 94f1f42be..409437e51 100644 --- a/navit/mapset.c +++ b/navit/mapset.c @@ -36,11 +36,6 @@ #include "map.h" #include "xmlconfig.h" -/** - * @brief A mapset - * - * This structure holds a complete mapset - */ struct mapset { NAVIT_OBJECT GList *maps; /**< Linked list of all the maps in the mapset */ diff --git a/navit/mapset.h b/navit/mapset.h index df6c0d0a7..6aca2afdc 100644 --- a/navit/mapset.h +++ b/navit/mapset.h @@ -30,7 +30,15 @@ struct attr; struct attr_iter; struct item; struct map; + +/** + * @brief A mapset. + * + * A mapset is a collection of (one or more) maps. This allows you to combine data from multiple maps, e.g. one map + * with the road network and another with special POIs. + */ struct mapset; + struct mapset_handle; struct mapset_search; struct mapset *mapset_new(struct attr *parent, struct attr **attrs); diff --git a/navit/route.c b/navit/route.c index 4c85e3fe9..b9fa9667f 100644 --- a/navit/route.c +++ b/navit/route.c @@ -2300,10 +2300,13 @@ static void route_graph_set_traffic_distortion(struct route_graph *this, struct /** * @brief Adds a traffic distortion item to the route graph * + * If `update` is true, the end points of the traffic distortion will have their cost recalculated. Set this to true + * for a partial recalculation of an existing route, false when initially building the route graph. + * * @param this The route graph to add to * @param profile The vehicle profile to use for cost calculations * @param item The item to add, must be of {@code type_traffic_distortion} - * @param update Whether to update the point (true for LPA*, false for Dijkstra) + * @param update Whether to update the end points */ static void route_graph_add_traffic_distortion(struct route_graph *this, struct vehicleprofile *profile, struct item *item, int update) { @@ -2700,10 +2703,8 @@ static int route_graph_is_path_computed(struct route_graph *this_) { * After recalculation, the route path is updated. * * The function uses a modified LPA* algorithm for recalculations. Most modifications were made for compatibility with - * the algorithm used for the initial routing: - * \li The `value` of a node represents the cost to reach the destination and thus decreases along the route - * (eliminating the need for recalculations as the vehicle moves within the route graph) - * \li The heuristic is always assumed to be zero (which would turn A* into Dijkstra, the basis of the main routing + * the old routing algorithm: + * \li The heuristic is always assumed to be zero (which would turn A* into Dijkstra, formerly the basis of the routing * algorithm, and makes our keys one-dimensional) * \li Currently, each pass evaluates all locally inconsistent points, leaving an empty heap at the end (though this * may change in the future). diff --git a/navit/route_protected.h b/navit/route_protected.h index 3ce6c4663..32d61e9bd 100644 --- a/navit/route_protected.h +++ b/navit/route_protected.h @@ -140,7 +140,9 @@ struct route_graph_segment { * each segment. */ struct route_graph { - int busy; /**< The graph is being built */ + int busy; /**< Route calculation is in progress: the graph is being built, + * flooded or the path is being built (a more detailed status can be + * obtained from the route’s status attribute) */ struct map_selection *sel; /**< The rectangle selection for the graph */ struct mapset_handle *h; /**< Handle to the mapset */ struct map *m; /**< Pointer to the currently active map */ @@ -150,7 +152,7 @@ struct route_graph { struct callback *done_cb; /**< Callback when graph is done */ struct event_idle *idle_ev; /**< The pointer to the idle event */ struct route_graph_segment *route_segments; /**< Pointer to the first route_graph_segment in the linked list of all segments */ - struct route_graph_segment *avoid_seg; + struct route_graph_segment *avoid_seg; /**< Segment to which a turnaround penalty (if active) applies */ struct fibheap *heap; /**< Priority queue for points to be expanded */ #define HASH_SIZE 8192 struct route_graph_point *hash[HASH_SIZE]; /**< A hashtable containing all route_graph_points in this graph */ diff --git a/navit/vehicle/gpsd/vehicle_gpsd.c b/navit/vehicle/gpsd/vehicle_gpsd.c index 01810bf5c..da17a6699 100644 --- a/navit/vehicle/gpsd/vehicle_gpsd.c +++ b/navit/vehicle/gpsd/vehicle_gpsd.c @@ -17,6 +17,7 @@ * Boston, MA 02110-1301, USA. */ +#include <config.h> #include <gps.h> #include <string.h> #include <glib.h> diff --git a/scripts/build_android.sh b/scripts/build_android.sh index 836ead59b..57bf42c50 100755 --- a/scripts/build_android.sh +++ b/scripts/build_android.sh @@ -22,21 +22,26 @@ export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin export JVM_OPTS="-Xmx3200m" export GRADLE_OPTS='-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"' +BUILD_PATH="android-builddir" + +[ -d $BUILD_PATH ] || mkdir -p $BUILD_PATH +pushd $BUILD_PATH + # processing xml is messed up a bit after the original introduction of gradle # so require a useless install of ant here even if using gradle/ninja echo Run CMake test -z "$PKG_CONFIG_LIBDIR" && export PKG_CONFIG_LIBDIR="" # Force cmake below to run ignore build host libraries when using pkgconfig. # Note: If you want to compile against specific target libraries that are searched using pkgconfig, please run this script with variable PKG_CONFIG_LIBDIR set to the appropriate path -cmake ./ -Dvehicle/gpsd_dbus:BOOL=FALSE -Dsvg2png_scaling:STRING=-1,24,32,48,64,96,128,192,256 -Dsvg2png_scaling_nav:STRING=-1,24,32,48,64,96,128,192,256 -Dsvg2png_scaling_flag:STRING=-1,24,32,64,96 -DXSL_PROCESSING=y -DXSLTS=android -DANDROID=y -DDISABLE_CXX=y || exit 1 +cmake ../ -Dvehicle/gpsd_dbus:BOOL=FALSE -Dsvg2png_scaling:STRING=-1,24,32,48,64,96,128,192,256 -Dsvg2png_scaling_nav:STRING=-1,24,32,48,64,96,128,192,256 -Dsvg2png_scaling_flag:STRING=-1,24,32,64,96 -DXSL_PROCESSING=y -DXSLTS=android -DANDROID=y -DDISABLE_CXX=y || exit 1 echo Process icons pushd navit/icons make || exit 32 -rm -rf ../android/res/drawable-nodpi -mkdir ../android/res/drawable-nodpi -cp ./*.png ../android/res/drawable-nodpi -pushd ../android/res/drawable-nodpi +rm -rf ../../android/res/drawable-nodpi +mkdir -p ../../android/res/drawable-nodpi +cp ./*.png ../../android/res/drawable-nodpi +pushd ../../android/res/drawable-nodpi rename -f 'y/A-Z/a-z/' ./*.png popd popd @@ -44,10 +49,10 @@ popd echo Process translations pushd po make || exit 64 -rm -rf ../navit/android/res/raw -mkdir ../navit/android/res/raw -cp ./*.mo ../navit/android/res/raw -pushd ../navit/android/res/raw +rm -rf ../android/res/raw +mkdir -p ../android/res/raw +cp ./*.mo ../android/res/raw +pushd ../android/res/raw rename -f 'y/A-Z/a-z/' ./*.mo popd popd @@ -56,10 +61,11 @@ popd echo Process xml config files make navit_config_xml || exit 96 -pushd navit rm -rf ./android/assets mkdir -p ./android/assets -cp -R config ./android/assets/ +cp -R ./navit/config ./android/assets/ + +#run gradle from root dir, not $BUILD_PATH popd echo Chmod permissions diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 5cac9edd2..000000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include 'navit:android' |