-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TP Template Development Manual #199
Comments
Not quite sure what you are trying to do or ask. Build environments are Circleci and Appveyor. All the information that is needed by frontend2 has already been setup. The only changes needed to frontend2 are for the specific plugin requirements. There are only two required labels within CMakeLists.txt, SRCS and HDRS as these are used both for building the C++ code and for building the language dependent files. In Testplugin, OD and Windvane I use extsrc and extinclude for opensource code I have incorporated into the plugins and which is not maintained or modified by the plugin. ocpnsrc and ocpninclude are used to contain code I have to use in the plugin to make them work which is not maintained or modified by the plugn but which is obtained from the OpenCPN source code tree. These enable me to understand what and where code comes from, so if issues occur in them I can more easily find the solution. .editconfig is just a new file that is optional and is used to help clang format the code correctly, i.e. number of spaces for a tab. It has no effect on the runtime environment. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Remember, this process builds in virtual environments in the cloud. So everything is specified to ensure that all installations are done for all environments every time. As things change with supported environments the requirements change, but all circleci builds should work both in the cloud and locally. Appveyor 'can' be run locally, but has some fairly heavy requirements. Also, standard local builds can be done from the IDE of your choice, but getting this to work in OCPN Plugin Manager 'may' be interesting due to the locations Plugin Manger uses. There are methods I use for debugging, but Plugin Manager has made this more compicated. All the requirements are in the config.yml files and the build scripts, i.e ci/*sh, and the appveyor.yml. |
Basically, if you take the whole of Testplugin, rename it and use it as the basis of a new plugin it will all work, including all the interactions needed with OCPN. Then the whole functionality of the plugin can be changed as well as the name. This gives a good working base to use. It should be fairly simple to understand and modify. The only bit that I use that seems overkill for some is that forms are generated in their own directory, 'Forms' with associated fbp files used by FormBuilder and my naming convension for classes, Def. for the code maintained by form builder and Impl. for code maintained in the plugin. This makes modifying the forms much easier. The Forms directory is in github but is not used to build the pluin as I copy the files to SRCS and HDRS and then include the names in the relevant part of the CMakeLists.txt file. I use JSON Validation in my plugins, but it is not required. I would suggest that it is used but.... So unless the developer wants to invest the effort in validation (testplugin has all the code needed) this should not be included. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
It also builds for 3 arm environments. Testplugin doesn't have 'extras' apart from those needed to communicate with OD through JSON and the ODAPI (this is what the plugin was originally built to test). If there is no need to communicate with OD then remove references to JSON (tpJSON.cpp & tpJSON.h) and ODAPI (ODAPI.h) and the associated usage within testplugin. Testplugin has three purposes now,:
For Frontend2 it is highly likely that a plugin will have other resources needed to make it functional apart from that provided in Frontend2. Hpowever, the changes should be confined to CMakeLists.txt and the addition of extra libs to be built. If the changes are restricted to CMakeLists.txt then the builds should work for all platforms, assuming the source code can handle this with Android builds requiring, potentiall, considerable customisation of the GUI components. Updates to support new and changed environments will normally be constrained to the other cmake files, yml files and script files. These should be able to be copied over the ones currently in use. There are readme files in the various directories to help the developer and CMakeLists.txt is commented to help identify those area that need customisation for a particular plugin. If there is a need to modify the other supplied files then it would be better to create a pull request against testplugin_pi for incorporation in the base as this will allow easier future upgrades. Unless the developer is starting from scratch using testplugin as a base the "Other directories" is a suitable place for 1-4. Just the names "SRCS" & "HDRS" must be used if internationalisation is required (it normally is). This then avoids having to change some of the "supplied" cmake files. |
This comment was marked as outdated.
This comment was marked as outdated.
Here is the new Developer Manual Testplugin Templates so far |
Building locally for |
Summary
The TestPugin Frontend2 is a build template to improve the process of building for multiple Operating System environments. Customization is applied in CMakeLists.txt and certain directories such as circleci, ci, and cmake, Flatpak library dependencies must be applied within its own flatpak sandbox. Also see Plugin Manager Structure
Plugin Development Manual for the TP (FE2) Template as stands now (needs updates). NOTE: These pages can be edited using the "Edit this page" button in the upper right.
If you do not have a development environment, to Compile, set one up.
Testplugin_pi (TP) purposes:
List of OS built by the Frontend2 (FE2) Template
This list will change over time depending on needs.
For each tarball there is a metadata file used by PIM
Refer to TP (FE2) Template Table
Including Windows, MacOS, Flatpak, Debian, Ubuntu, RPI, Android
Build Locally and with Cloud Services
Start Conversion to FE2 Template
GET STARTED by copying the testplugin template into your desktop git folder and rename.
FE2 Updates
Folders and files must be duplicated or copied to the subject plugin.
CMakeLists.txt Editing
CMakeLists.txt requires comparison using WinMerge or your Text Editor and careful line by line editing because it has critical plugin parameters, as you complete the upper part of CMakeLists.txt
Submodule shared library "opencpn-libs"
Your Plugin Code
CircleCI/config.yml
circleci/config.yml is used to control the builds. Individual builds can be turned on or off in at the start section of that file and deployment controlled.
Cmake folder
Generally these are all required. Sometimes there are additional cmake files specific to the plugin.
CI folder
Script files to build different OS metadata xml files and tarballs.
Libs folder
Subordinate builds that are not available in "opencpn-libs" submodule that are needed to provide functionality for the plugin. Each plugin has specific requirements the original programmer will know about.
ODAPI Notes
ODAPI is currently used by three plugins, Weather_routing, Watchdog and squiddio to talk to OD and ask questions about OD objects, i.e. boundaries, text points, etc. If a plugin wants to talk to OD then this should be used. It is possible to talk using JSON only, but then the ODJSON schema should be used to construct the message correctly.
We also have a page in the PI Developer Manual about ODAPI.
JSON Notes
If a plugin uses JSON then it should really use a JSON schema (OD does for its JSON API). If the plugin does not use JSON, or only uses the OCPN JSON messages then as there is no OCPN JSON schema then validation will not work.
For OCPN and its use of a JSON validator, it sets the OS/ABI to a value that will not work with OCPN. This is a compiler constraint so the code in CMakeLists.txt line 244 to 263 handles this and changes the OS/ABI value to something that will work with OCPN. You will need to look in OD CMakeLists.txt file to see it in use and in ODJSON.cpp to see the associated code for validation.
Notes for not using JSON validation
.editorconfig
An optional file used to help clang format the code correctly, i.e. number of spaces for a tab. It has no effect on the runtime environment.
Windows Debugging Process
Jon Gough's workflow when testing under windows is:
Now you are running OCPN and OD in the debugging environment of VS2022. Apart from the first install of a package to put all the correct bits into place there is no need to build the package and install it.
For VS2022 Windows debugging that uses TransmitterDan's process, please see this post and the two previous.
Development Manual
The Dev Manual under Plugin Development has two sections
Shipdriver is quite current and has been edited extensively.
Testplugin is needs some work.
Deployment overview
These use the asciidoc/antora system which is outlined here under the Plugin Manual Authoring section
There is an "Edit this page" which might help
The text was updated successfully, but these errors were encountered: