Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
  • 1.2.0
  • 1.2.1
  • 1.2.2
  • 1.2.3
  • 1.2.4
  • v1.1.0
7 results

Target

Select target project
  • oss/utilities/documentation-manager
1 result
Select Git revision
  • master
  • 1.2.0
  • 1.2.1
  • 1.2.2
  • 1.2.3
  • 1.2.4
  • v1.1.0
7 results
Show changes
Showing
with 759 additions and 4 deletions
#############################################################################################
#############################################################################################
##
## LICENSE
##
#############################################################################################
#############################################################################################
ifneq "$(wildcard $(SOURCE_PATH) )" ""
## Files wich should be checked for license headers
LICENSE_FILE_PATTERN ?= $(shell find $(SOURCE_PATH) -type f \( -iname \*.go -o -iname \*.php -o -iname \*.js -o -iname \*.mjs -o -iname \*.cjs \) )
endif
# https://spdx.github.io/spdx-spec/v2.3/SPDX-license-list/
ADDLICENSE_BIN ?= addlicense
ifeq ($(shell command -v $(ADDLICENSE_BIN) 2> /dev/null),)
$(shell $(GO) install github.com/google/addlicense@latest)
EXECUTABLES = $(EXECUTABLES:-) $(ADDLICENSE_BIN);
endif
EXECUTABLES = $(EXECUTABLES:-) $(ADDLICENSE_BIN)
#############################################################################################
#############################################################################################
##
## COMMANDS NODEJS
##
#############################################################################################
#############################################################################################
# path and binaries
NODEJS ?= node
NODE ?= node
NPM ?= pnpm
EXECUTABLES = $(EXECUTABLES:-) $(NPM);
NODE_PACKAGES := $(shell find $(PROJECT_ROOT) -type f -name 'package.json' -not -path '*/node_modules/*')
NODE_MODULES := $(shell find $(PROJECT_ROOT) -type d -name 'node_modules' -prune)
NODE_MODULES_MODIFIED := $(shell find $(PROJECT_ROOT) -type f -name 'package.json' -not -path '*/node_modules/*' -exec sh -c 'F=$$(dirname {}); echo $${F}/node_modules/.modified' \;)
$(NODE_MODULES_MODIFIED): $(NODE_PACKAGES)
$(ECHOMARKER) "Updating node modules..."
$(QUIET) for p in $(NODE_PACKAGES); do \
DIR=$$(dirname $$p); \
echo "Updating package: $${DIR}" ;\
$(NPM) install --prefix $${DIR} ;\
if [ -d $${DIR}/node_modules/ ]; then \
touch $${DIR}/node_modules/.modified ;\
fi ;\
done
## Main Develpoment Node Repos
NODE_ROOT_DIR ?= $(DEVELOPMENT_PATH)
NODE_MODULES_DIR ?= $(NODE_ROOT_DIR)node_modules/
NODE_PACKAGE_PATH ?= $(NODE_ROOT_DIR)package.json
NODE_MODULES_BIN_DIR ?= $(NODE_MODULES_DIR).bin/
ESBUILD ?= $(NODE_MODULES_BIN_DIR)esbuild
WEBPACK ?= $(NODE_MODULES_BIN_DIR)webpack
BABEL ?= $(NODE_MODULES_BIN_DIR)babel
UGLIFYJS ?= $(NODE_MODULES_BIN_DIR)uglifyjs
C8 ?= $(NODE_MODULES_BIN_DIR)c8
MOCHA ?= $(NODE_MODULES_BIN_DIR)mocha
PACKAGE_JSON ?= $(NODE_ROOT_DIR)package.json
ifneq "$(wildcard $(SOURCE_PATH) )" ""
MJS_SOURCE_FILES := $(shell find $(SOURCE_PATH) -name '*.mjs')
MJS_RELATIVE_SOURCE_FILES := $(shell find $(SOURCE_PATH) -name '*.mjs' -exec realpath --relative-to $(PROJECT_ROOT) {} \; )
JS_SOURCE_FILES := $(shell find $(SOURCE_PATH) -name '*.js')
JS_RELATIVE_SOURCE_FILES := $(shell find $(SOURCE_PATH) -name '*.js' -exec realpath --relative-to $(PROJECT_ROOT) {} \; )
endif
......@@ -6,4 +6,4 @@
#############################################################################################
#############################################################################################
COMPONENT_SLUG := $(shell echo "$(COMPONENT_NAME)" | tr '[:upper:]' '[:lower:]')
\ No newline at end of file
COMPONENT_SLUG := $(shell echo "$(COMPONENT_NAME)" | tr '[:upper:]' '[:lower:]')
#############################################################################################
#############################################################################################
##
## PROJECT-DEFINITIONS
##
#############################################################################################
#############################################################################################
GOFILES := $(shell find $(SOURCE_PATH) -name '*.go' ! -name 'catalog.go')
LOCALEFILES := $(shell find $(SOURCE_PATH)translations/locales/ -name '*.json')
CATALOGFILES := $(SOURCE_PATH)translations/locales/catalog.go
$(CATALOGFILES): $(LOCALEFILES) $(GOFILES)
$(QUIET) $(GO) generate $(SOURCE_PATH)translations/translations.go
$(QUIET) touch $(CATALOGFILES) $(LOCALEFILES)
\ No newline at end of file
#############################################################################################
#############################################################################################
##
## README
##
#############################################################################################
#############################################################################################
define README_FILE_CONTENT
# $(COMPONENT_NAME)
$(COMPONENT_NAME) is ...
## Documentation
To check out docs and examples, visit ....
## Installation
```shell
go get $(shell git config --get remote.origin.url | sed -E 's/^\s*.*:\/\///g')
```
**Note:** This library uses [Go Modules](https://github.com/golang/go/wiki/Modules) to manage dependencies.
## Usage
## Contributing
Merge requests are welcome. For major changes, please open an issue first to discuss what
you would like to change. **Please make sure to update tests as appropriate.**
Versioning is done with [SemVer](https://semver.org/).
Changelog is generated with [git-chglog](https://github.com/git-chglog/git-chglog#git-chglog)
Commit messages should follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.
Messages are started with a type, which is one of the following:
- **feat**: A new feature
- **fix**: A bug fix
- **doc**: Documentation only changes
- **refactor**: A code change that neither fixes a bug nor adds a feature
- **perf**: A code change that improves performance
- **test**: Adding missing or correcting existing tests
- **chore**: Other changes that don't modify src or test files
The footer would be used for a reference to an issue or a breaking change.
A commit that has a footer `BREAKING CHANGE:`, or appends a ! after the type/scope,
introduces a breaking API change (correlating with MAJOR in semantic versioning).
A BREAKING CHANGE can be part of commits of any type.
the following is an example of a commit message:
```text
feat: add 'extras' field
```
## Questions
For questions and commercial support, please contact [schukai GmbH](https://www.schukai.com/).
The issue list of this repo is exclusively for bug reports and feature requests.
## Issues
Please make sure to read the Issue Reporting Checklist before opening an
issue. Issues not conforming to the guidelines may be closed immediately.
## License
$(COPYRIGHT_TEXT)
$(COPYRIGHT_URL)
You can also purchase a commercial license.
endef
#############################################################################################
#############################################################################################
##
## README
##
#############################################################################################
#############################################################################################
define README_FILE_CONTENT
# $(COMPONENT_NAME)
$(COMPONENT_NAME) is ...
## Documentation
To check out docs and examples, visit ....
## Installation
```shell
go get $(shell git config --get remote.origin.url | sed -E 's/^\s*.*:\/\///g')
```
**Note:** This library uses [Go Modules](https://github.com/golang/go/wiki/Modules) to manage dependencies.
## Usage
## Contributing
Merge requests are welcome. For major changes, please open an issue first to discuss what
you would like to change. **Please make sure to update tests as appropriate.**
Versioning is done with [SemVer](https://semver.org/).
Changelog is generated with [git-chglog](https://github.com/git-chglog/git-chglog#git-chglog)
Commit messages should follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.
Messages are started with a type, which is one of the following:
- **feat**: A new feature
- **fix**: A bug fix
- **doc**: Documentation only changes
- **refactor**: A code change that neither fixes a bug nor adds a feature
- **perf**: A code change that improves performance
- **test**: Adding missing or correcting existing tests
- **chore**: Other changes that don't modify src or test files
The footer would be used for a reference to an issue or a breaking change.
A commit that has a footer `BREAKING CHANGE:`, or appends a ! after the type/scope,
introduces a breaking API change (correlating with MAJOR in semantic versioning).
A BREAKING CHANGE can be part of commits of any type.
the following is an example of a commit message:
```text
feat: add 'extras' field
```
## Questions
For questions and commercial support, please contact [schukai GmbH](https://www.schukai.com/).
The issue list of this repo is exclusively for bug reports and feature requests.
## Issues
Please make sure to read the Issue Reporting Checklist before opening an
issue. Issues not conforming to the guidelines may be closed immediately.
## License
$(COPYRIGHT_TEXT)
$(COPYRIGHT_URL)
You can also purchase a commercial license.
endef
#############################################################################################
#############################################################################################
##
## README
##
#############################################################################################
#############################################################################################
define README_FILE_CONTENT
# $(COMPONENT_NAME)
$(COMPONENT_NAME) is a part of the Alvine/Agenor project.
This app is built with ES6 modules and uses [import](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/import)
and [export](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export).
For some functions, you need additional [polyfills](#polyfill).
## Documentation
To check out docs and examples, visit [doc.alvine.io](https://doc.alvine.io).
## Installation
`pnpm install @oss/$(COMPONENT_SLUG)`
## Usage
A simple example of the use of functionality from $(COMPONENT_NAME). We create a small file `index.mjs`.
The `m` in `.mjs` stands for module. In the example we want to make substitutions in a string.
```js
// script
```
To integrate this function into a website it is recommended to use a bundler like [esbuild](https://esbuild.github.io/).
```sh
esbuild index.mjs --outfile dist.js
```
We can now integrate that into our website.
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>$(COMPONENT_NAME)</title>
<script src="dist.js"></script>
</head>
<body>
```
Voila!
### Polyfill
We do try to work around some browser bugs, but on the whole we don't use polyfills and feature detection.
However, many functions can be mapped via [polyfill.io](https://polyfill.io/) and thus the compatibility can be increased.
```js
<script id="polyfill" src="https://polyfill.io/v3/polyfill.min.js?..."
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
```
## Questions
For questions and commercial support, please contact [schukai GmbH](https://www.schukai.com/).
The issue list of this repo is exclusively for bug reports and feature requests.
## Issues
Please make sure to read the Issue Reporting Checklist before opening an
issue. Issues not conforming to the guidelines may be closed immediately.
## License
$(COPYRIGHT_TEXT)
$(COPYRIGHT_URL)
## Changelog
Detailed changes for each release are documented in the CHANGELOG.
endef
#############################################################################################
#############################################################################################
##
## README
##
#############################################################################################
#############################################################################################
define README_FILE_CONTENT
# $(COMPONENT_NAME)
$(COMPONENT_NAME) is ...
## Documentation
To check out docs and examples, visit ....
## Installation
## Usage
## Questions
For questions and commercial support, please contact [schukai GmbH](https://www.schukai.com/).
The issue list of this repo is exclusively for bug reports and feature requests.
## Issues
Please make sure to read the Issue Reporting Checklist before opening an
issue. Issues not conforming to the guidelines may be closed immediately.
## License
$(COPYRIGHT_TEXT)
$(COPYRIGHT_URL)
You can also purchase a commercial license.
endef
#############################################################################################
#############################################################################################
##
## README
##
#############################################################################################
#############################################################################################
define README_FILE_CONTENT
# $(COMPONENT_NAME)
$(COMPONENT_NAME) is a lightweight, robust and easy-to-use form library with modest ambitions.
The component easily integrates with your existing websites without taking over everything.
One design target is to reach the shiny sun with as little JavaScript as possible.
Monster was built with ES6 modules and uses [import](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/import)
and [export](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export).
For some functions, you need additional [polyfills](#polyfill).
## Documentation
To check out docs and examples, visit [monsterjs.org/en/doc/$(COMPONENT_SLUG)/](https://monsterjs.org/en/doc/$(COMPONENT_SLUG)/).
## Installation
`npm install @schukai/component-$(COMPONENT_SLUG)`, `yarn install @schukai/component-$(COMPONENT_SLUG)` or `pnpm install @schukai/component-$(COMPONENT_SLUG)`
## Usage
A simple example of the use of functionality from $(COMPONENT_NAME). We create a small file `index.mjs`.
The `m` in `.mjs` stands for module. In the example we want to make substitutions in a string.
```js
// example
```
To integrate this function into a website it is recommended to use a bundler like [esbuild](https://esbuild.github.io/).
```sh
esbuild index.mjs --outfile dist.js
```
We can now integrate that into our website.
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>$(COMPONENT_NAME)</title>
<script src="dist.js"></script>
</head>
<body>
```
Voila!
### Polyfill
We do try to work around some browser bugs, but on the whole we don't use polyfills and feature detection.
However, many functions can be mapped via [polyfill.io](https://polyfill.io/) and thus the compatibility can be increased.
```js
<script id="polyfill" src="https://polyfill.io/v3/polyfill.min.js?..."
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
```
## Questions
For questions and commercial support, please contact [schukai GmbH](https://www.schukai.com/).
The issue list of this repo is exclusively for bug reports and feature requests.
## Issues
Please make sure to read the Issue Reporting Checklist before opening an
issue. Issues not conforming to the guidelines may be closed immediately.
## License
$(COPYRIGHT_TEXT)
$(COPYRIGHT_URL)
You can also purchase a commercial license.
## Changelog
Detailed changes for each release are documented in
the [CHANGELOG](https://gitlab.schukai.com/oss/libraries/javascript/web-components/$(COMPONENT_SLUG)).
endef
#############################################################################################
#############################################################################################
##
## REQMAN
##
#############################################################################################
#############################################################################################
REQMAN_BIN ?= $(VENDOR_PATH)reqman
#############################################################################################
#############################################################################################
##
## ADD SPDX LICENSES
##
## For commercial projects, it is not necessary to add the SPDX license identifier.
## The license header in each file is only for open-source projects, for example under
## the AGPL 3.0 license.
##
#############################################################################################
#############################################################################################
ifeq ($(ADDLICENSE_BIN),)
$(error "addlicense is not installed. Please check your makefile and include the licenses.mk")
endif
.PHONY: add-licenses
## Add license headers to all go files
add-licenses:
$(ECHOMARKER) "Add license headers to all sourche files"
ifeq ($(LICENSE_FILE_PATTERN),)
$(error "LICENSE_FILE_PATTERN is not set. Please check your makefile and include the licenses.mk")
endif
ifndef SPDX_LICENSE_ID
$(error "SPDX_LICENSE_ID is not defined. Please check your makefile and include the licenses.mk")
endif
$(QUIET) $(ADDLICENSE_BIN) -c "$(COPYRIGHT_OWNER)" -s -l "$(SPDX_LICENSE_ID)" $(LICENSE_FILE_PATTERN)
\ No newline at end of file
#############################################################################################
#############################################################################################
##
## SERVER CONAN
##
#############################################################################################
#############################################################################################
ifeq ($(CONAN_BIN),)
$(error $(ERRORMARKER) Conan is not defined, check your Makefile if conan.mk is included)
endif
$(CONAN_BIN):
$(QUIET) $(MKDIR) -p $(VENDOR_PATH)
$(QUIET) $(WGET) -O $(CONAN_BIN) http://download.schukai.com/tools/conan/conan-$(shell uname -s | tr [:upper:] [:lower:])-$(shell echo `uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/`)
$(QUIET) $(CHMOD) u+x $(CONAN_BIN)
.PHONY: run-conan
## run conan webserver
run-conan: $(CONAN_BIN) $(CONAN_CONFIG)
$(QUIET) $(CONAN_BIN) server serve --config $(CONAN_CONFIG)
......@@ -17,4 +17,6 @@ deploy: compile
.PHONY: overview-to-s3
## overview-to-s3
overview-to-s3:
$(QUIET) AWS_PROFILE=$(AWS_PROFILE) $(AWS) s3 cp $(WEB_PATH)/index.html $(UPLOAD_TOOL_URL)
\ No newline at end of file
$(QUIET) AWS_PROFILE=$(AWS_PROFILE) $(AWS) s3 cp $(WEB_PATH)/index.html $(UPLOAD_TOOL_URL)
$(QUIET) AWS_PROFILE=$(AWS_PROFILE) $(AWS) s3 cp $(WEB_PATH)/index.css $(UPLOAD_TOOL_URL)
$(QUIET) AWS_PROFILE=$(AWS_PROFILE) $(AWS) s3 cp $(WEB_PATH)/index.js $(UPLOAD_TOOL_URL)
\ No newline at end of file
#############################################################################################
#############################################################################################
##
## DOCMAN-TARGETS
##
#############################################################################################
#############################################################################################
ifeq ($(DOCMAN_BIN),)
$(error "$(DOCMAN_BIN) is not installed. Please check your makefile and include the docman.mk")
endif
$(DOCMAN_BIN):
$(QUIET) $(MKDIR) -p $(VENDOR_PATH)
$(QUIET) $(WGET) -O $(DOCMAN_BIN) http://download.schukai.com/tools/docman/docman-$(shell uname -s | tr [:upper:] [:lower:])-$(shell echo `uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/`)
$(QUIET) $(CHMOD) u+x $(DOCMAN_BIN)
$(PROJECT_ROOT)deployment/build/manual.html: $(DOCMAN_BIN)
$(DOCMAN_BIN) document html --config $(PROJECT_ROOT)documentation/config.yaml
$(PROJECT_ROOT)deployment/build/manual.pdf: $(DOCMAN_BIN)
$(DOCMAN_BIN) document pdf --config $(PROJECT_ROOT)documentation/config.yaml
.PHONY: build-doc-pdf
## creating the documentation in pdf format
build-doc-pdf: $(PROJECT_ROOT)deployment/build/manual.pdf
.PHONY: build-doc-html
## creating the documentation in html format
build-doc-html: $(PROJECT_ROOT)deployment/build/manual.html
.PHONY: build-doc
## creating the documentation in pdf and html format
build-doc: build-doc-pdf build-doc-html
......@@ -6,7 +6,9 @@
#############################################################################################
#############################################################################################
EXECUTABLES = $(EXECUTABLES:-) uuidgen
ifeq ($(GIT),)
$(error $(ERRORMARKER) Git is not defined, check your Makefile if git.mk is included)
endif
## Current Branch-GIT_TAG
GIT_TAG := -
......@@ -17,7 +19,6 @@ GIT_MESSAGE := current status
.PHONY: git-branch
## create new branch (use GIT_TAG-Variable)
git-branch:
$(QUIET) export BRANCH="b$(GIT_TAG)/$(shell uuidgen --random)" ; \
$(QUIET) $(GIT) checkout -b $${BRANCH} && \
RESULT=$$($(GIT) push origin $$BRANCH 2>&1) && \
......@@ -45,3 +46,13 @@ git-push: git-branch git-push-to-server
## git create version tag
git-tag:
$(QUIET) $(GIT) tag -a "$(COMPONENT_VERSION)" -m "release $(COMPONENT_VERSION)"
.PHONY: git-prune-remote
## removes your local remote tracking branches where the branch no longer exists on the remote
git-prune-remote:
$(QUIET) $(GIT) remote prune origin
.PHONY: git-prune-local
## deletes local merged branches except the master branch
git-prune-local:
$(QUIET) $(GIT) branch --merged master | grep -v '^[ *]*master$$' | xargs git branch -d
\ No newline at end of file
......@@ -6,17 +6,23 @@
#############################################################################################
#############################################################################################
ifeq ($(GO),)
$(error $(ERRORMARKER) Go is not defined, check your Makefile if go.mk is included)
endif
GO_RELEASE_PACKAGE_NAME ?= main
.PHONY: compile
## Compiling for every OS and Platform
compile: next-patch-version
$(QUIET) $(ECHO) "Compiling for every OS and Platform"
$(QUIET) $(ECHO) "Version: $(PROJECT_VERSION)"
$(QUIET) $(ECHO) "Build: $(PROJECT_BUILD_DATE)"
$(ECHOMARKER) "Compiling for every OS and Platform"
$(ECHO) "Version: $(PROJECT_VERSION)"
$(ECHO) "Build: $(PROJECT_BUILD_DATE)"
$(QUIET) cd $(SOURCE_PATH) ; \
GO111MODULE=on GOOS=linux GOARCH=arm $(GO) build -ldflags "-X main.version=$(PROJECT_VERSION) -X main.build=$(PROJECT_BUILD_DATE)" -o $(BUILD_PATH)$(COMPONENT_SLUG)-linux-arm ; \
GOOS=linux GOARCH=amd64 $(GO) build -ldflags "-X main.version=$(PROJECT_VERSION) -X main.build=$(PROJECT_BUILD_DATE)" -o $(BUILD_PATH)$(COMPONENT_SLUG)-linux-amd64 ; \
GOOS=linux GOARCH=arm64 $(GO) build -ldflags "-X main.version=$(PROJECT_VERSION) -X main.build=$(PROJECT_BUILD_DATE)" -o $(BUILD_PATH)$(COMPONENT_SLUG)-linux-arm64 ; \
GOOS=linux GOARCH=386 $(GO) build -ldflags "-X main.version=$(PROJECT_VERSION) -X main.build=$(PROJECT_BUILD_DATE)" -o $(BUILD_PATH)$(COMPONENT_SLUG)-linux-386 ; \
GOOS=windows GOARCH=amd64 $(GO) build -ldflags "-X main.version=$(PROJECT_VERSION) -X main.build=$(PROJECT_BUILD_DATE)" -o $(BUILD_PATH)$(COMPONENT_SLUG)-windows ; \
GO111MODULE=on GOOS=linux GOARCH=arm $(GO) build -ldflags "-X $(GO_RELEASE_PACKAGE_NAME).version=$(PROJECT_VERSION) -X $(GO_RELEASE_PACKAGE_NAME).build=$(PROJECT_BUILD_DATE)" -o $(BUILD_PATH)$(COMPONENT_SLUG)-linux-arm ; \
GOOS=linux GOARCH=amd64 $(GO) build -ldflags "-X $(GO_RELEASE_PACKAGE_NAME).version=$(PROJECT_VERSION) -X $(GO_RELEASE_PACKAGE_NAME).build=$(PROJECT_BUILD_DATE)" -o $(BUILD_PATH)$(COMPONENT_SLUG)-linux-amd64 ; \
GOOS=linux GOARCH=arm64 $(GO) build -ldflags "-X $(GO_RELEASE_PACKAGE_NAME).version=$(PROJECT_VERSION) -X $(GO_RELEASE_PACKAGE_NAME).build=$(PROJECT_BUILD_DATE)" -o $(BUILD_PATH)$(COMPONENT_SLUG)-linux-arm64 ; \
GOOS=linux GOARCH=386 $(GO) build -ldflags "-X $(GO_RELEASE_PACKAGE_NAME).version=$(PROJECT_VERSION) -X $(GO_RELEASE_PACKAGE_NAME).build=$(PROJECT_BUILD_DATE)" -o $(BUILD_PATH)$(COMPONENT_SLUG)-linux-386 ; \
GOOS=windows GOARCH=amd64 $(GO) build -ldflags "-X $(GO_RELEASE_PACKAGE_NAME).version=$(PROJECT_VERSION) -X $(GO_RELEASE_PACKAGE_NAME).build=$(PROJECT_BUILD_DATE)" -o $(BUILD_PATH)$(COMPONENT_SLUG)-windows ; \
cd $(PROJECT_ROOT);
#############################################################################################
#############################################################################################
##
## GET LICENSES
##
#############################################################################################
#############################################################################################
ifeq ($(GO),)
$(error $(ERRORMARKER) Go is not defined, check your Makefile if go.mk is included)
endif
GO_MOD_FILE := $(SOURCE_PATH)go.mod
ifeq ($(shell test -e $(GO_MOD_FILE) && echo -n yes),yes)
GO_CURRENT_MODULE := $(shell cat $(GO_MOD_FILE) | head -n1 | cut -d" " -f2)
# go install github.com/google/go-licenses@latest
EXECUTABLES = $(EXECUTABLES:-) go-licenses;
endif
.PHONY: go-fetch-licenses
## Fetch licenses for all modules
go-fetch-licenses:
ifeq ($(GO_CURRENT_MODULE),)
$(QUIET) $(ECHOERRORMARKER) "no go.mod file found, skipping fetching licenses"
else
$(ECHOMARKER) "Fetch licenses"
$(QUIET) cd $(SOURCE_PATH); $(GO_LICENSES_BIN) save $(GO_CURRENT_MODULE) $(GO_LICENSES_IGNORE_PACKAGES) --force --save_path $(DOCUMENTATION_PATH)licenses/ ; cd -
endif
#############################################################################################
#############################################################################################
##
## INIT-STANDARD
##
#############################################################################################
#############################################################################################
# @see .PHONY https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets
.PHONY: init-go-lib
# The default directories are defined in the
# directories-standard.mk file, but all other
# targets can define directories as well.
$(PROJECT_DIRECTORIES):
$(foreach path,$(PROJECT_DIRECTORIES),\
$(shell $(MKDIR) -p $(path)))
## init go lib project
init-go-lib: $(PROJECT_DIRECTORIES) $(PROJECT_ROOT).gitignore $(PROJECT_ROOT)README.md $(LICENSE_PATH)LICENSE
$(ECHOMARKER) "Run init-go-lib"
$(ECHO) "Done"
#############################################################################################
#############################################################################################
##
## LICENSE
##
#############################################################################################
#############################################################################################
export LICENSE_FILE_CONTENT
$(LICENSE_PATH)LICENSE:
$(QUIET) $(ECHO) "$$LICENSE_FILE_CONTENT" >> $@
#############################################################################################
#############################################################################################
##
## README
##
#############################################################################################
#############################################################################################
export README_FILE_CONTENT
$(PROJECT_ROOT)README.md:
$(QUIET) $(ECHO) "$$README_FILE_CONTENT" >> $@
#############################################################################################
#############################################################################################
##
## INIT-STANDARD
##
#############################################################################################
#############################################################################################
# @see .PHONY https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets
.PHONY: init-go-utilities
# The default directories are defined in the
# directories-standard.mk file, but all other
# targets can define directories as well.
$(PROJECT_DIRECTORIES):
$(foreach path,$(PROJECT_DIRECTORIES),\
$(shell $(MKDIR) -p $(path)))
## init go utilities project
init-go-utilities: $(PROJECT_DIRECTORIES) $(PROJECT_ROOT).gitignore $(PROJECT_ROOT)README.md $(LICENSE_PATH)LICENSE
$(ECHOMARKER) "Run init-go-utilities"
$(ECHO) "Done"
#############################################################################################
#############################################################################################
##
## LICENSE
##
#############################################################################################
#############################################################################################
export LICENSE_FILE_CONTENT
$(LICENSE_PATH)LICENSE:
$(QUIET) $(ECHO) "$$LICENSE_FILE_CONTENT" >> $@
#############################################################################################
#############################################################################################
##
## README
##
#############################################################################################
#############################################################################################
export README_FILE_CONTENT
$(PROJECT_ROOT)README.md:
$(QUIET) $(ECHO) "$$README_FILE_CONTENT" >> $@