Skip to content
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

Installable plugin generation #35

Merged
merged 18 commits into from
Sep 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
version: 2
jobs:
build-debian:
docker:
- image: circleci/buildpack-deps:xenial-scm
environment:
- OCPN_TARGET: xenial
steps:
- checkout
- run: >
echo "deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main"
| sudo tee -a /etc/apt/sources.list
- run: >
echo "deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main"
| sudo tee -a /etc/apt/sources.list
- run: cat /etc/apt/sources.list
- run: ci/circleci-build-debian.sh
- run: ci/circleci-upload.sh
build-flatpak:
machine:
image: circleci/classic:201808-01
environment:
- OCPN_TARGET: flatpak
steps:
- checkout
- run: ci/circleci-build-flatpak.sh
- run: ci/circleci-upload.sh
build-fedora:
docker:
- image: fedora:29
environment:
- OCPN_TARGET: fedora
steps:
- run: su -c "dnf install -q -y git openssh-clients openssh-server"
- checkout
- run: ci/circleci-build-fedora.sh
- run: ci/circleci-upload.sh
build-mingw:
docker:
- image: fedora:29
environment:
- OCPN_TARGET: mingw
steps:
- run: su -c "dnf install -q -y git openssh-clients openssh-server"
- checkout
- run: ci/circleci-build-mingw.sh
- run: ci/circleci-upload.sh
build-macos:
macos:
xcode: "10.0.0"
environment:
- OCPN_TARGET: macos
steps:
- checkout
- run: ci/circleci-build-macos.sh
- run: ci/circleci-upload.sh

workflows:
version: 2
build_all:
jobs:
- build-debian:
filters:
branches:
only: master
- build-flatpak:
filters:
branches:
only: master
- build-fedora:
filters:
branches:
only: master
- build-macos:
filters:
branches:
only: master
- build-mingw:
filters:
branches:
only: master
44 changes: 44 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
language: cpp
matrix:
include:
- env:
- OCPN_TARGET=xenial
dist: xenial
compiler: gcc
script:
- "./ci/travis-build-debian.sh"
- env:
- OCPN_TARGET=flatpak
services:
- docker
script:
- "./ci/travis-build-flatpak.sh"
- env:
- OCPN_TARGET=fedora
services:
- docker
script:
- "./ci/travis-build-fedora.sh"
- env:
- OCPN_TARGET=osx
os: osx
compiler: clang
script:
- "./ci/travis-build-osx.sh"
notifications:
email: false
git:
depth: 10
user: leamas
skip_cleanup: true
on:
all_branches: true
key: $BINTRAY_API_KEY
deploy:
provider: script
skip_cleanup: true
script: ci/travis-upload.sh
on:
branch: master
tags: false

49 changes: 49 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,53 @@ SET(VERSION_PATCH "4")
SET(VERSION_DATE "19/05/2019")
SET(OCPN_MIN_VERSION "ov50")

SET(PACKAGE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
SET(PKG_RELEASE "1")
SET(PKG_API_VERSION "1.16")
SET(PKG_AUTHOR "Mauro Calvi")
SET(PKG_NVR ${PACKAGE_NAME}-${PACKAGE_VERSION}-${PKG_RELEASE})
SET(PKG_BASE_URL
"https://dl.cloudsmith.io/public/alec-leamas/opencpn-plugins-unstable/raw/files")


INCLUDE("cmake/PluginSetup.cmake")
set(PLUGIN_NAME squiddio-plugin-${PKG_TARGET}-${PKG_TARGET_VERSION})

if (OCPN_FLATPAK)
find_program(TAR NAMES gtar tar)
if (NOT TAR)
message(FATAL_ERROR "tar not found, required for OCPN_FLATPAK")
endif ()
configure_file(
${CMAKE_SOURCE_DIR}/squiddio-plugin.xml.in
${CMAKE_CURRENT_BINARY_DIR}/${PLUGIN_NAME}.xml
)
add_custom_target(flatpak-build ALL
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/flatpak
COMMAND /usr/bin/flatpak-builder --force-clean
${CMAKE_CURRENT_BINARY_DIR}/app
org.opencpn.OpenCPN.Plugin.squiddio.yaml
)
add_custom_target("flatpak-pkg")
add_custom_command(
TARGET flatpak-pkg
COMMAND ${TAR}
-czf ${PKG_NVR}_${PKG_TARGET_NVR}.tar.gz
--transform 's|.*/files/|squiddio-flatpak-${PACKAGE_VERSION}/|'
${CMAKE_CURRENT_BINARY_DIR}/app/files
)
return ()
endif()



#SET(CMAKE_BUILD_TYPE Debug)

# Prefer libGL.so to libOpenGL.so, see CMP0072
set(OpenGL_GL_PREFERENCE "LEGACY")

INCLUDE("cmake/PluginConfigure.cmake")
set(CMAKE_CXX_STANDARD 11)

SET(SRC_SQUIDDIO
src/squiddio_pi.h
Expand Down Expand Up @@ -140,6 +184,7 @@ SET(SRC_NMEA0183
)
INCLUDE_DIRECTORIES(nmea0183)
INCLUDE_DIRECTORIES(src/wxJSON)
INCLUDE_DIRECTORIES(api-16)

ADD_DEFINITIONS(-DTIXML_USE_STL)
IF(UNIX)
Expand All @@ -165,3 +210,7 @@ INCLUDE("cmake/PluginInstall.cmake")
INCLUDE("cmake/PluginLocalization.cmake")
INCLUDE("cmake/PluginPackage.cmake")

configure_file(
${CMAKE_SOURCE_DIR}/squiddio-plugin.xml.in
${CMAKE_CURRENT_BINARY_DIR}/${PLUGIN_NAME}.xml
)
Binary file added api-16/libopencpn.dll.a
Binary file not shown.
File renamed without changes.
Binary file added api-16/opencpn.lib
Binary file not shown.
67 changes: 40 additions & 27 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
clone_folder: c:\project\squiddio_pi
shallow_clone: true
clone_folder: c:\project\opencpn\squiddio_pi
shallow_clone: false
clone_depth: 10

image:
- Visual Studio 2017

platform:
# - x64
- Win32

configuration: Release
configuration: RelWithDebInfo
test: OFF

install:
# VS2015 and earlier version - '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86'
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"

# sent environment variables for wxWidgets
# set environment variables for wxWidgets
- set WXWIN=C:\wxWidgets-3.1.2
- set wxWidgets_ROOT_DIR=%WXWIN%
- set wxWidgets_LIB_DIR=%WXWIN%\lib\vc_dll
Expand All @@ -22,39 +25,49 @@ install:
# install dependencies:
- choco install poedit

- ps: Start-FileDownload http://opencpn.navnux.org/build_deps/nsis-3.04-setup.exe
- cmd: nsis-3.04-setup.exe /S

# Download and unzip wxwidgets
- ps: Start-FileDownload http://opencpn.navnux.org/build_deps/wxWidgets-3.1.2.7z
- cmd: 7z x wxWidgets-3.1.2.7z -o%WXWIN% > null

- set
# some debugging information
# - cmake --help
# - set Displays sensitive password!

# build wxWidgets - Disabled as we provide prebuilt WX to save time
#- cmd: cd %WXWIN%\build\msw\
#- cmd: nmake -f makefile.vc BUILD=release SHARED=1 CFLAGS=/D_USING_V120_SDK71_ CXXFLAGS=/D_USING_V120_SDK71_
#- cmd: nmake -f makefile.vc BUILD=debug SHARED=1 CFLAGS=/D_USING_V120_SDK71_ CXXFLAGS=/D_USING_V120_SDK71_

before_build:
- cd c:\project\squiddio_pi
- cd c:\project\opencpn\squiddio_pi
- mkdir build
- cd build
- ps: Start-FileDownload https://downloads.sourceforge.net/project/opencpnplugins/opencpn_lib/4.99.1405-vc141_xp/opencpn.lib
- ps: Start-FileDownload http://opencpn.navnux.org/build_deps/OpenCPN_buildwin-4.99a.7z
- cmd: 7z x -y OpenCPN_buildwin-4.99a.7z -oc:\project\squiddio_pi\buildwin
- cmake -T v141_xp ..
# - ps: Start-FileDownload http://opencpn.navnux.org/build_deps/OpenCPN_buildwin-4.99a.7z
# - cmd: 7z x -y OpenCPN_buildwin-4.99a.7z -oc:\project\opencpn\buildwin
- cmake -T v141_xp -DOCPN_CI_BUILD=ON ..

build_script:
- cmake --build . --target package --config release
# --target package doesn't work because of nsis not correctly installed
- cmake -G "Visual Studio 15 2017" ..
- cmake --build . --target install --config RelWithDebInfo
- cmake --build . --target package --config RelWithDebInfo
- choco install git
- python -m ensurepip
- python -m pip install -q setuptools
- python -m pip install -q cloudsmith-cli
- bash ../ci/appveyor-upload.sh

artifacts:
- path: 'build\*.exe'
name: installer
- path: 'build\*gz'
name: plugin_archive
- path: '**\*msvc*xml'
name: plugin_xml

deploy:
description: 'release created by AppVeyor CI'
provider: GitHub
auth_token: '%GitHub_auth_token%'
artifact: installer,portable
draft: true
prerelease: true
on:
appveyor_repo_tag: true # deploy on tag push only
configuration: Release # Debug contains non-redist MS DLLs
- provider: BinTray
username: leamas
repo: OpenCPN
package: plugins
version: 1.15-0.beta2
publish: true
override: true
explode: false
28 changes: 28 additions & 0 deletions ci/appveyor-upload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

#
# Upload the .tar.gz and .xml artifacts to cloudsmith
#

set -xe

REPO='alec-leamas/opencpn-plugins-unstable'

if [ -z "$CLOUDSMITH_API_KEY" ]; then
echo 'Cannot deploy to cloudsmith, missing $CLOUDSMITH_API_KEY'
exit 0
fi

python -m ensurepip
python -m pip install -q setuptools
python -m pip install -q cloudsmith-cli

commit=$(git rev-parse --short=7 HEAD) || commit="unknown"
now=$(date --rfc-3339=seconds) || now=$(date)

tarball=$(ls *.tar.gz)
xml=$(ls *.xml)
echo '<!--'" Date: $now Commit: $commit Build nr: $BUILD_ID -->" >> $xml

cloudsmith push raw --republish --no-wait-for-sync $REPO $tarball
cloudsmith push raw --republish --no-wait-for-sync $REPO $xml
58 changes: 58 additions & 0 deletions ci/bintray.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"package": {
"name": "plugins",
"repo": "OpenCPN",
"subject": "leamas",
"desc": "squiddio plugin automatic push",
"website_url": "www.jfrog.com",
"issue_tracker_url": "https://github.com/leamas/squiddio_pi/issues",
"vcs_url": "https://github.com/leamas/squiddio_pi.git",
"github_use_tag_release_notes": false,
"licenses": ["GPL2"],
"labels": [],
"public_download_numbers": false,
"public_stats": false,
"attributes": [{
"name": "att5",
"values" : ["2014-12-28T19:43:37+0100"],
"type": "date"
}]
},

"version": {
"name": "1.15-0.beta2",
"desc": "Pre-release based on 5.0.0 beta2",
"released": "2019-03-14",
"vcs_tag": "1.15",
"attributes": [
{"name": "VerAtt1", "values" : ["VerVal1"], "type": "string"},
{"name": "VerAtt2", "values" : [1, 3.3, 5], "type": "number"},
{
"name": "VerAtt3",
"values" : ["2015-01-01T19:43:37+0100"],
"type": "date"
}
],
"gpgSign": false
},

"files":
[
{
"includePattern": "build/(squiddio.*\\.tar.gz)",
"uploadPattern": "$1",
"matrixParams": {"override": 1}
},
{
"includePattern": "build/(squiddio-plugin\\.xml)",
"uploadPattern": "$1",
"matrixParams": {"override": 1}
},
{
"includePattern": "build/(squiddio-plugin-.*\\.xml)",
"uploadPattern": "$1",
"matrixParams": {"override": 1}
}
],
"publish": true
}
Loading