Closed rgleason closed 1 year ago
REM Remove the current opencpn-libs submodule linkage.
git submodule deinit -f opencpn-libs
git rm --cached opencpn-libs
rmdir /S .\.git\modules\opencpn-libs <--- try taking this out (LATER: Leave in, required)
rmdir /S .\opencpn-libs
git config -f .gitmodules --remove-section submodule.opencpn-libs
git add .gitmodules
git commit -m "Remove opencpn-libs submodule."
REM opencpn-libs linkage and files removed and commit made
REM Add the new linkage
git submodule add https://github.com/OpenCPN/opencpn-libs.git
git commit -m "Adding revised opencpn-libs submodule main"
REM Added new linkage to module opencpn-libs main and made commit.
OK, I think I've got this now, watchdog has been done too.
I checked testplugin_pi, reading the logs. I see that you got my email about late change for PluginCOnfigure. Good. Thanks. All builds look good. On the home stretch.
Let us carry on.
Had to reload submodule "data" in Climatology_pi https://github.com/jongough/testplugin_pi/issues/345
Convert to opencpn-libs submodule
Create a new branch called "sublibs" (locally)
In root directory of plugin, do:
1.1. This adds the "devel" branch of leamas' opencpn-libs repo to the plugin project as a submodule. 1.2. It also immediately downloads opencpn-libs, and places it in the plugin project root directory. 1.3 This needs only to be done ONCE. 1.4. Also, DO NOT add the raw contents of opencpn-libs to the plugin project git tree. 1.5. Submodules use only a reference to the github resident version of the submodule.
Edit CMakeLists.txt in plugin project to change all instances of "libs/x" to "opencpn-libs/x"
Use the syntax shown in watchdog_pi for adding directories from the opencpn-libs submodule.
You may test build locally from the plugin project root as normal. When satisfies with local builds, got to #3.
Review the CMakeLists.txt changes made in Watchdog Weatherfax, Weather_routing, Testplugin for submodule changes including:
Review weatherfax, weather_routing, testplugin changes too.
Reference Commit https://github.com/rgleason/watchdog_pi/commit/d0ce572cb661853908b082708c222d37b74f8fe0
Build Locally
For your local builds, after doing:
This is exactly what the CI process does. It will bring in a fresh copy of opencpn-libs from github. It does not change the git repo contents at all, since you already have the git reference to opencpn-libs.
You generally need to only do this once (for each plugin), unless opencpn-libs is changed by me or Alec. We will let you know if that happens.
Remember: treat opencpn-libs as a read-only library. Do not edit. Do not commit contents.
Dave
More rules about submodules
If you follow these rules locally, then you will be following exactly the same process as CCI does in its scripts. Remember, CCI is the "golden build", from which production plugins are released.
I'm sure you know all this, so just reminders.
Regarding Watchdog opencpn-libs Issue
from Dave More research, working on the flatpak builds. You need to do this for each plugin:
In ci directory, add this line to build scripts after each submodule update.
git submodule update --init opencpn-libs git submodule update --remote --merge opencpn-libs <-- ADD THIS.
Then commit and push the results. This will fix all builds except flatpak.
To fix failing flatpak builds, for each plugin that you have IN PROCESS that fails flatpak on CCI, from source root, do this:
$ cd opencpn-libs $ git checkout devel $ git pull origin devel $ cd .. $ git add opencpn-libs $ git commit -m "Updating the submodule 'opencpn-libs' to the latest version" $ git push origin sublibs
For plugin that you have not started yet, you only need to do this, as described in the adaptation guide.:
Lets confirm this on watchdog, and then move on.
Changes to opencpn-libs (notice from Dave or Alec)
When the change lands in opencpn-libs main branch, you will need to (for these two plugins only): $ git submodule update --remote --merge opencpn-libs $ git add opencpn-libs $ git commit -m "Update opencpn-libs submodule" $ git push origin master (or other branch as you decide)