Commit 7412db2a authored by Mart Lubbers's avatar Mart Lubbers
Browse files

nitrile/clean-lang.org version v1.0

parent 2229a9c5
Pipeline #61152 passed with stage
in 1 minute and 23 seconds
variables:
GIT_SUBMODULE_STRATEGY: recursive
image: isocyanoclean/clean-nc:0.2
image: cleanlang/nitrile:0.3
stages: [build, publish]
......
# Changelog
# v1.0
- Initial nitrile version
CFLAGS?=-Wall -Wextra -Wno-unused-parameter
ifeq ($(OS), Windows_NT)
SUFFIX:=obj
else
SUFFIX:=o
endif
.PHONY: clean
all: buildLib buildDemo
buildLib:
$(MAKE) -C cdeps
mkdir -p src/Clean\ System\ Files
cp cdeps/libWrapper.o src/Clean\ System\ Files/libWrapper.$(SUFFIX)
ifeq ($(OS), Windows_NT)
cp cdeps/wolfMQTT/src/libwolfmqtt_la-mqtt_client.o src/Clean\ System\ Files/libwolfmqtt_la-mqtt_client.$(SUFFIX)
cp cdeps/wolfMQTT/src/libwolfmqtt_la-mqtt_packet.o src/Clean\ System\ Files/libwolfmqtt_la-mqtt_packet.$(SUFFIX)
cp cdeps/wolfMQTT/src/libwolfmqtt_la-mqtt_socket.o src/Clean\ System\ Files/libwolfmqtt_la-mqtt_socket.$(SUFFIX)
cp cdeps/_chkstk_ms.obj src/Clean\ System\ Files/
cp src-win/* src/
else
cp cdeps/wolfMQTT/src/.libs/libwolfmqtt_la-mqtt_client.o src/Clean\ System\ Files/libwolfmqtt_la-mqtt_client.$(SUFFIX)
cp cdeps/wolfMQTT/src/.libs/libwolfmqtt_la-mqtt_packet.o src/Clean\ System\ Files/libwolfmqtt_la-mqtt_packet.$(SUFFIX)
cp cdeps/wolfMQTT/src/.libs/libwolfmqtt_la-mqtt_socket.o src/Clean\ System\ Files/libwolfmqtt_la-mqtt_socket.$(SUFFIX)
cp src-posix/* src/
endif
buildDemo: buildLib
$(MAKE) -C demo
clean:
$(RM) -r $(addsuffix /Clean\ System\ Files, src src/MQTT)
$(RM) -r $(addprefix src/_MQTT., icl dcl)
$(MAKE) -C cdeps clean
$(MAKE) -C demo clean
# MQTTClient
# Clean iTask mqtt client using [WolfMQTT](https://github.com/wolfSSL/wolfMQTT)
## Installation instructions
## Maintainer
1. Install [WolfMQTT](https://github.com/wolfSSL/wolfMQTT) (optionally with --enable-mqtt5 flag)
2. Run the `make` command
\ No newline at end of file
Mart Lubbers (mart@cs.ru.nl)
## License
`itasks-mqtt` is licensed under the BSD 2-Clause "Simplified" License (see [LICENSE](LICENSE)).
`itasks-mqtt` uses WolfMQTT (is statically linked with) which is licensed under GPLv2.
{"packages":{"linux-x64":[{"name":"abc-interpreter"
,"version":"1.0.2"}
,"version":"1.0.0"}
,{"name":"argenv"
,"version":"1.0.2"}
,"version":"1.0.1"}
,{"name":"base"
,"version":"1.1.2"}
,"version":"1.0.0"}
,{"name":"base-clm"
,"version":"1.4.2"}
,{"name":"base-code-generator"
,"version":"1.1.0"}
,"version":"1.0.0"}
,{"name":"base-compiler"
,"version":"2.0.0"}
,"version":"2.0.1"}
,{"name":"base-compiler-itasks"
,"version":"1.0.3"}
,"version":"1.0.0"}
,{"name":"base-rts"
,"version":"1.0.4"}
,"version":"1.1.0"}
,{"name":"base-stdenv"
,"version":"1.0.4"}
,"version":"1.0.0"}
,{"name":"clean-platform"
,"version":"0.3.4"}
,{"name":"gast"
,"version":"0.1.2"}
,"version":"0.2.1"}
,{"name":"graph-copy"
,"version":"1.0.1"}
,"version":"2.0.1"}
,{"name":"itasks"
,"version":"0.1.4"}
,"version":"0.2.0"}
,{"name":"lib-compiler-itasks"
,"version":"2.0.0"}
,{"name":"platform"
,"version":"0.1.13"}
,"version":"2.0.1"}
,{"name":"tcpip"
,"version":"1.0.4"}]}}
\ No newline at end of file
,"version":"2.0.1"}]
,"windows-x64":[{"name":"abc-interpreter"
,"version":"1.0.0"}
,{"name":"argenv"
,"version":"1.0.1"}
,{"name":"base"
,"version":"1.0.0"}
,{"name":"base-clm"
,"version":"1.4.2"}
,{"name":"base-code-generator"
,"version":"1.0.0"}
,{"name":"base-compiler"
,"version":"2.0.1"}
,{"name":"base-compiler-itasks"
,"version":"1.0.0"}
,{"name":"base-linker"
,"version":"1.0.2"}
,{"name":"base-rts"
,"version":"1.1.0"}
,{"name":"base-stdenv"
,"version":"1.0.0"}
,{"name":"clean-platform"
,"version":"0.3.4"}
,{"name":"gast"
,"version":"0.2.1"}
,{"name":"graph-copy"
,"version":"2.0.1"}
,{"name":"itasks"
,"version":"0.2.0"}
,{"name":"lib-compiler-itasks"
,"version":"2.0.1"}
,{"name":"tcpip"
,"version":"2.0.1"}]}}
\ No newline at end of file
name: itask-mqttclient
name: itasks-mqtt
url: https://gitlab.com/mtask/mqttclient
maintainer: Mart Lubbers
contact_email: mart@cs.ru.nl
description: Library for MQTT using WolfMQTT
description: iTasks library for MQTT using WolfMQTT
version: 1.0
license: AGPL-3.0-only
license: BSD-2-Clause
type: Library
clm_options:
bytecode: prelinked
compiler: cocl-itasks
export_local_labels: true
fusion: GenericFusion
bytecode: prelinked
generate_descriptors: true
export_local_labels: true
post_link: web-resource-collector
print_result: false
print_time: false
strip: false
# Dependencies
build_dependencies:
base: ^1.0
dependencies:
platform: ^0.1.0
itasks: ^0.1.0
base: ^1.0.0
clean-platform: ^0.3.4
itasks: ^0.2.0
package:
core_modules:
- _MQTT
- iTasks.Extensions._MQTT
extra_files:
- README.md
- LICENSE
# Tests
test_src:
- demo/
tests:
compilation:
compilation:
{}
demo:
script:
- clm:
main: MQTTClient
heap: 500m
# Sources
src:
......@@ -89,3 +81,51 @@ rules:
- libwolfmqtt_la-mqtt_packet.obj
- libwolfmqtt_la-mqtt_socket.obj
- _chkstk_ms.obj
---
name: itasks-mqtt-demo
url: https://gitlab.com/mlubbers/clean-itasks-mqtt
maintainer: Mart Lubbers
contact_email: mart@cs.ru.nl
description: Demo application for itasks-mqtt
version: 0.1
license: BSD-2-Clause
type: Application
dependencies:
base: ^1.0.0
base-compiler-itasks: ^1.0.0
clean-platform: ^0.3.4
itasks: ^0.2.0
clm_options:
bytecode: prelinked
compiler: cocl-itasks
export_local_labels: true
fusion: GenericFusion
generate_descriptors: true
heap: 500M
post_link: web-resource-collector
print_result: false
print_time: false
strip: false
src:
- examples
- src/clean-any
rules:
posix:
extra_src:
- src/clean-posix
windows:
extra_src:
- src/clean-windows
build:
demo:
script:
- nitrile build --name=itasks-mqtt
- clm:
main: MQTTClient
target: examples/MQTTClient
definition module iTasks.Extensions.MQTT.Errors
errorCodeToString :: Int -> String
errorCodeToString :: !Int -> String
......@@ -2,7 +2,7 @@ implementation module iTasks.Extensions.MQTT.Errors
import iTasks
errorCodeToString :: Int -> String
errorCodeToString :: !Int -> String
errorCodeToString 0 = "Success"
errorCodeToString -7 = "Timeout"
errorCodeToString -8 = "Network error"
......
......@@ -3,8 +3,8 @@ definition module iTasks.Extensions.MQTT.Util
import iTasks
import iTasks.Extensions.MQTT
createReceiveLens :: (SimpleSDSLens MQTTClient) -> (SimpleSDSLens [MQTTMsg])
mqttSend :: MQTTMsg (SimpleSDSLens MQTTClient) -> Task ()
mqttSubscribe :: MQTTSubscribe (SimpleSDSLens MQTTClient) -> Task ()
mqttUnsubscribe :: MQTTTopicFilter (SimpleSDSLens MQTTClient) -> Task ()
mqttDisconnect :: (SimpleSDSLens MQTTClient) -> Task ()
createReceiveLens :: !(SimpleSDSLens MQTTClient) -> (SimpleSDSLens [MQTTMsg])
mqttSend :: !MQTTMsg !(SimpleSDSLens MQTTClient) -> Task ()
mqttSubscribe :: !MQTTSubscribe !(SimpleSDSLens MQTTClient) -> Task ()
mqttUnsubscribe :: !MQTTTopicFilter !(SimpleSDSLens MQTTClient) -> Task ()
mqttDisconnect :: !(SimpleSDSLens MQTTClient) -> Task ()
......@@ -3,20 +3,19 @@ implementation module iTasks.Extensions.MQTT.Util
import iTasks
import iTasks.Extensions.MQTT
createReceiveLens :: (SimpleSDSLens MQTTClient) -> (SimpleSDSLens [MQTTMsg])
createReceiveLens :: !(SimpleSDSLens MQTTClient) -> (SimpleSDSLens [MQTTMsg])
createReceiveLens sds = mapReadWrite (read, write) ?None sds
where read r = r.received
write received c = (?Just { c & received = received })
mqttSend :: MQTTMsg (SimpleSDSLens MQTTClient) -> Task ()
mqttSend :: !MQTTMsg !(SimpleSDSLens MQTTClient) -> Task ()
mqttSend msg sds = upd (\c. { c & send = c.send ++ [msg] }) sds @! ()
mqttSubscribe :: MQTTSubscribe (SimpleSDSLens MQTTClient) -> Task ()
mqttSubscribe :: !MQTTSubscribe !(SimpleSDSLens MQTTClient) -> Task ()
mqttSubscribe sub sds = upd (\c. { c & subscribe = c.subscribe ++ [sub] }) sds @! ()
mqttUnsubscribe :: MQTTTopicFilter (SimpleSDSLens MQTTClient) -> Task ()
mqttUnsubscribe :: !MQTTTopicFilter !(SimpleSDSLens MQTTClient) -> Task ()
mqttUnsubscribe sub sds = upd (\c. { c & unsubscribe = c.unsubscribe ++ [sub] }) sds @! ()
mqttDisconnect :: (SimpleSDSLens MQTTClient) -> Task ()
mqttDisconnect :: !(SimpleSDSLens MQTTClient) -> Task ()
mqttDisconnect sds = upd (\c. { c & disconnect = True }) sds @! ()
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