Commit 8678ad11 authored by Mart Lubbers's avatar Mart Lubbers
Browse files

restructure for nitrile

parent fa308984
Pipeline #60476 passed with stage
in 1 minute and 28 seconds
......@@ -14,8 +14,8 @@ Clean System Files
*.o
*.obj
# System specific files
src/_MQTT.*
# Other
.clang-format
*.tar.gz
nitrile-packages
variables:
GIT_SUBMODULE_STRATEGY: recursive
stages:
- compile
- package
compile:
stage: compile
image: "camilstaps/clean:nightly"
before_script:
- install_clean_nightly.sh bundle-complete
- apt-get update -qq
- apt-get install -yqq build-essential autoconf libtool
- ( cd cdeps/wolfMQTT; ./autogen.sh; ./configure --enable-mqtt5 --disable-tls; make; )
script:
- make
package-linux:
stage: package
image: debian
before_script:
- apt-get update -qq
- apt-get install -yqq build-essential autoconf libtool
script:
- ( cd cdeps/wolfMQTT; ./autogen.sh; ./configure --enable-mqtt5 --disable-tls; make; )
- make buildLib
- tar czf MQTTClient-linux-x64.tar.gz src --transform s/src/MQTTClient/
artifacts:
paths:
- ./*.tar.gz
package-windows:
stage: package
image: debian
before_script:
- apt-get update -qq
- apt-get install -yqq build-essential autoconf libtool mingw-w64
script:
- cp cdeps/vs_settings.h cdeps/wolfMQTT/wolfmqtt
- ( cd cdeps/wolfMQTT; ./autogen.sh; ./configure --enable-mqtt5 --disable-tls --host=x86_64-pc-mingw32 --disable-examples --enable-static CFLAGS=-Wno-error=attributes LIBS=-lws2_32 CC=x86_64-w64-mingw32-gcc; make; )
- OS=Windows_NT CC=x86_64-w64-mingw32-gcc make buildLib
- tar czf MQTTClient-windows-x64.tar.gz src --transform s/src/MQTTClient/
artifacts:
paths:
- ./*.tar.gz
image: isocyanoclean/clean-nc:0.2
stages: [build, publish]
build-linux-x64:
stage: build
before_script:
- apt-get update -qq
- apt-get install -yqq build-essential autoconf libtool
- nitrile update
- nitrile fetch
script:
- nitrile build
- nitrile test
- nitrile package
artifacts:
paths:
- itasks-mqtt*.tar.gz
build-windows-x64:
stage: build
before_script:
- apt-get update -qq
- apt-get install -yqq build-essential mingw-w64 autoconf libtool
- nitrile update
- nitrile --platform=windows fetch
script:
- nitrile --platform=windows build
- nitrile --platform=windows package
artifacts:
paths:
- itasks-mqtt*.tar.gz
publish:
stage: publish
rules:
- if: $CI_COMMIT_TAG
script:
- nitrile publish --targets=linux-x64,windows-x64
artifacts:
paths:
- itasks-mqtt*.tar.gz
[submodule "cdeps/wolfMQTT"]
path = cdeps/wolfMQTT
[submodule "src/c-any/wolfMQTT"]
path = src/c-any/wolfMQTT
url = https://github.com/wolfSSL/wolfMQTT
Copyright (c) 2022 Mart Lubbers.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
module MQTTClient
import MQTT
import MQTT.Client
import MQTT.Util
import iTasks.Extensions.MQTT
import iTasks.Extensions.MQTT.Client
import iTasks.Extensions.MQTT.Util
import iTasks
import TCPDef
import StdDebug
......@@ -52,4 +52,4 @@ received :: (SimpleSDSLens MQTTClient) -> Task [MQTTMsg]
received sds
# lens = createReceiveLens sds
= viewSharedInformation [ViewAs \res.map format res] lens
where format (MQTTMsg t p opts) = "Topic: " +++ t +++ " Payload: " +++ p +++ " Qos: " +++ (toString opts.qos) +++ " Retained: " +++ (toString opts.retain)
\ No newline at end of file
where format (MQTTMsg t p opts) = "Topic: " +++ t +++ " Payload: " +++ p +++ " Qos: " +++ (toString opts.qos) +++ " Retained: " +++ (toString opts.retain)
CLEAN_HOME?=/opt/clean
.SECONDARY: MQTTClient.prj
.PHONY: clean
all: MQTTClient
%.prj: %.icl
cpm project $* create $(CLEAN_HOME)/etc/iTasks.prt
cpm project $@ root ..
cpm project $@ path add ../src
%: %.prj
cpm project $^ build
clean:
rm -rf Clean\ System\ Files
rm -rf MQTTClient-www
rm -f MQTTClient *.bc *.pbc *.prj
{"packages":{"linux-x64":[{"name":"abc-interpreter"
,"version":"1.0.2"}
,{"name":"argenv"
,"version":"1.0.2"}
,{"name":"base"
,"version":"1.1.2"}
,{"name":"base-clm"
,"version":"1.4.2"}
,{"name":"base-code-generator"
,"version":"1.1.0"}
,{"name":"base-compiler"
,"version":"2.0.0"}
,{"name":"base-compiler-itasks"
,"version":"1.0.3"}
,{"name":"base-rts"
,"version":"1.0.4"}
,{"name":"base-stdenv"
,"version":"1.0.4"}
,{"name":"gast"
,"version":"0.1.2"}
,{"name":"graph-copy"
,"version":"1.0.1"}
,{"name":"itasks"
,"version":"0.1.4"}
,{"name":"lib-compiler-itasks"
,"version":"2.0.0"}
,{"name":"platform"
,"version":"0.1.13"}
,{"name":"tcpip"
,"version":"1.0.4"}]}}
\ No newline at end of file
name: mqttclient
url: https://gitlab.com/mtask/mqttclient
maintainer: Mart Lubbers
contact_email: mart@cs.ru.nl
description: Library for MQTT using WolfMQTT
version: 1.0
license: AGPL-3.0-only
type: Library
clm_options:
compiler: cocl-itasks
fusion: GenericFusion
bytecode: prelinked
generate_descriptors: true
export_local_labels: true
strip: false
# Dependencies
build_dependencies:
base: ^1.0
dependencies:
platform: ^0.1.0
itasks: ^0.1.0
package:
core_modules:
- _MQTT
extra_files:
- README.md
- LICENSE
# Tests
test_src:
- demo/
tests:
compilation:
compilation:
{}
demo:
script:
- clm:
main: MQTTClient
heap: 500m
# Sources
src:
- src/clean-any
rules:
posix:
extra_src:
- src/clean-posix
extra_build:
cdeps:
script:
- ( cd src/c-any/wolfMQTT; ./autogen.sh; ./configure --enable-mqtt5 --disable-tls; make; )
- make -C src/c-any
- mkdir -p src/clean-posix/Clean\ System\ Files
- cp src/c-any/libWrapper.o src/clean-posix/Clean\ System\ Files/libWrapper.o
- cp src/c-any/wolfMQTT/src/.libs/libwolfmqtt_la-mqtt_client.o src/clean-posix/Clean\ System\ Files/libwolfmqtt_la-mqtt_client.o
- cp src/c-any/wolfMQTT/src/.libs/libwolfmqtt_la-mqtt_packet.o src/clean-posix/Clean\ System\ Files/libwolfmqtt_la-mqtt_packet.o
- cp src/c-any/wolfMQTT/src/.libs/libwolfmqtt_la-mqtt_socket.o src/clean-posix/Clean\ System\ Files/libwolfmqtt_la-mqtt_socket.o
extra_package:
include:
- libWrapper.o
- libwolfmqtt_la-mqtt_client.o
- libwolfmqtt_la-mqtt_packet.o
- libwolfmqtt_la-mqtt_socket.o
windows:
extra_src:
- src/clean-windows
extra_build:
cdeps:
script:
- cp src/c-any/vs_settings.h src/c-any/wolfMQTT/wolfmqtt
- ( cd src/c-any/wolfMQTT; ./autogen.sh; ./configure --enable-mqtt5 --disable-tls --host=x86_64-pc-mingw32 --disable-examples --enable-static CFLAGS=-Wno-error=attributes LIBS=-lws2_32 CC=x86_64-w64-mingw32-gcc; make; )
- make CC=x86_64-w64-mingw32-gcc -C src/c-any
- mkdir -p src/clean-windows/Clean\ System\ Files
- cp src/c-any/libWrapper.o src/clean-windows/Clean\ System\ Files/libWrapper.obj
- cp src/c-any/wolfMQTT/src/libwolfmqtt_la-mqtt_client.o src/clean-windows/Clean\ System\ Files/libwolfmqtt_la-mqtt_client.obj
- cp src/c-any/wolfMQTT/src/libwolfmqtt_la-mqtt_packet.o src/clean-windows/Clean\ System\ Files/libwolfmqtt_la-mqtt_packet.obj
- cp src/c-any/wolfMQTT/src/libwolfmqtt_la-mqtt_socket.o src/clean-windows/Clean\ System\ Files/libwolfmqtt_la-mqtt_socket.obj
- cp src/c-any/_chkstk_ms.obj src/clean-windows/Clean\ System\ Files/_chkstk_ms.obj
extra_package:
include:
- libWrapper.obj
- libwolfmqtt_la-mqtt_client.obj
- libwolfmqtt_la-mqtt_packet.obj
- libwolfmqtt_la-mqtt_socket.obj
- _chkstk_ms.obj
definition module _MQTT
implementation module _MQTT
definition module _MQTT
definition module MQTT.Errors
errorCodeToString :: Int -> String
\ No newline at end of file
definition module MQTT
definition module iTasks.Extensions.MQTT
import iTasks
import iTasks.WF.Definition
......@@ -43,4 +43,4 @@ import TCPDef
, context :: Int // Pointer to the WolfMQTT MqttClient
}
derive class iTask MQTTMsg, MQTTMsgOpts, MQTTConnectionSettings, MQTTAuth, MQTTClient
\ No newline at end of file
derive class iTask MQTTMsg, MQTTMsgOpts, MQTTConnectionSettings, MQTTAuth, MQTTClient
implementation module MQTT
implementation module iTasks.Extensions.MQTT
import iTasks
import iTasks.WF.Definition
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment