Browse Source

feat: Adding initial skeleton

Matthias Ladkau 3 years ago
commit
7ae4036818
8 changed files with 138 additions and 0 deletions
  1. 10 0
      .gitignore
  2. 7 0
      LICENSE
  3. 76 0
      Makefile
  4. 2 0
      NOTICE
  5. 19 0
      README.md
  6. 17 0
      cli/ecal.go
  7. 5 0
      go.mod
  8. 2 0
      go.sum

+ 10 - 0
.gitignore

@@ -0,0 +1,10 @@
+ecal
+/.cache
+/.cover
+/.ecal_console_history
+/coverage.txt
+/coverage.out
+/coverage.html
+/dist
+/build
+/stdlib/stdlib_gen.go

+ 7 - 0
LICENSE

@@ -0,0 +1,7 @@
+Copyright 2019 Matthias Ladkau
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 76 - 0
Makefile

@@ -0,0 +1,76 @@
+export NAME=ecal
+export TAG=`git describe --abbrev=0 --tags`
+export CGO_ENABLED=0
+export GOOS=linux
+
+all: build
+clean:
+	rm -f ecal
+
+mod:
+	go mod init || true
+	go mod tidy
+test:
+	go test -p 1 ./...
+cover:
+	go test -p 1 --coverprofile=coverage.out ./...
+	go tool cover --html=coverage.out -o coverage.html
+	sh -c "open coverage.html || xdg-open coverage.html" 2>/dev/null
+fmt:
+	gofmt -l -w -s .
+
+vet:
+	go vet ./...
+
+generate:
+	go generate devt.de/krotik/ecal/stdlib/generate
+
+build: clean mod generate fmt vet
+	go build -ldflags "-s -w" -o $(NAME) cli/ecal.go
+
+build-mac: clean mod generate fmt vet
+	GOOS=darwin GOARCH=amd64 go build -o $(NAME).mac cli/ecal.go
+
+build-win: clean mod generate fmt vet
+	GOOS=windows GOARCH=amd64 go build -o $(NAME).exe cli/ecal.go
+
+build-arm7: clean mod generate fmt vet
+	GOOS=linux GOARCH=arm GOARM=7 go build -o $(NAME).arm7 cli/ecal.go
+
+build-arm8: clean mod generate fmt vet
+	GOOS=linux GOARCH=arm64 go build -o $(NAME).arm8 cli/ecal.go
+
+dist: build build-win build-mac build-arm7 build-arm8
+	rm -fR dist
+
+	mkdir -p dist/$(NAME)_linux_amd64
+	mv $(NAME) dist/$(NAME)_linux_amd64
+	cp LICENSE dist/$(NAME)_linux_amd64
+	cp NOTICE dist/$(NAME)_linux_amd64
+	tar --directory=dist -cz $(NAME)_linux_amd64 > dist/$(NAME)_$(TAG)_linux_amd64.tar.gz
+
+	mkdir -p dist/$(NAME)_darwin_amd64
+	mv $(NAME).mac dist/$(NAME)_darwin_amd64/$(NAME)
+	cp LICENSE dist/$(NAME)_darwin_amd64
+	cp NOTICE dist/$(NAME)_darwin_amd64
+	tar --directory=dist -cz $(NAME)_darwin_amd64 > dist/$(NAME)_$(TAG)_darwin_amd64.tar.gz
+
+	mkdir -p dist/$(NAME)_windows_amd64
+	mv $(NAME).exe dist/$(NAME)_windows_amd64
+	cp LICENSE dist/$(NAME)_windows_amd64
+	cp NOTICE dist/$(NAME)_windows_amd64
+	tar --directory=dist -cz $(NAME)_windows_amd64 > dist/$(NAME)_$(TAG)_windows_amd64.tar.gz
+
+	mkdir -p dist/$(NAME)_arm7
+	mv $(NAME).arm7 dist/$(NAME)_arm7
+	cp LICENSE dist/$(NAME)_arm7
+	cp NOTICE dist/$(NAME)_arm7
+	tar --directory=dist -cz $(NAME)_arm7 > dist/$(NAME)_$(TAG)_arm7.tar.gz
+
+	mkdir -p dist/$(NAME)_arm8
+	mv $(NAME).arm8 dist/$(NAME)_arm8
+	cp LICENSE dist/$(NAME)_arm8
+	cp NOTICE dist/$(NAME)_arm8
+	tar --directory=dist -cz $(NAME)_arm8 > dist/$(NAME)_$(TAG)_arm8.tar.gz
+
+	sh -c 'cd dist; sha256sum *.tar.gz' > dist/checksums.txt

+ 2 - 0
NOTICE

@@ -0,0 +1,2 @@
+ECAL - Event Condition Action Language
+Copyright (c) 2020 Matthias Ladkau

+ 19 - 0
README.md

@@ -0,0 +1,19 @@
+ECAL
+====
+ECAL is an ECA (Event Condition Action) language for concurrent event processing. ECAL can define event-based systems using rules which are triggered by events.
+
+Features
+--------
+- Simple but powerful concurrent event-based processing.
+- Priorities for control flow.
+- Event cascades can be traced with monitors.
+- Rules which can match on event state.
+- Rules can suppress each other.
+
+### Further Reading:
+
+- [ECA Language](ecal.md)
+
+License
+-------
+ECAL source code is available under the [MIT License](/LICENSE).

+ 17 - 0
cli/ecal.go

@@ -0,0 +1,17 @@
+/*
+ * ECAL
+ *
+ * Copyright 2020 Matthias Ladkau. All rights reserved.
+ *
+ * This Source Code Form is subject to the terms of the MIT
+ * License, If a copy of the MIT License was not distributed with this
+ * file, You can obtain one at https://opensource.org/licenses/MIT.
+ */
+
+package main
+
+import "fmt"
+
+func main() {
+	fmt.Println("ECAL")
+}

+ 5 - 0
go.mod

@@ -0,0 +1,5 @@
+module devt.de/krotik/ecal
+
+go 1.12
+
+require devt.de/krotik/common v1.3.6

+ 2 - 0
go.sum

@@ -0,0 +1,2 @@
+devt.de/krotik/common v1.3.6 h1:qj8F65QDUCLGcD+gJgitoFIkXbVwVOghQ9NuqOfFJPI=
+devt.de/krotik/common v1.3.6/go.mod h1:X4nsS85DAxyHkwSg/Tc6+XC2zfmGeaVz+37F61+eSaI=