Commit e1e402a2 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Merge branch 'master' into feature_airiop

parents ab249954 b6b2a32a
......@@ -3,3 +3,5 @@ obj/
src/*.swp
*.swp
src/taste-parser_version.ads
doc/templates/*.old
doc/templates/*.html
# image: $CI_REGISTRY_IMAGE/taste:latest
image: taste:latest
image: taste-buster:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
......@@ -12,7 +12,7 @@ build:
stage: build
script:
# As soon as TASTE moves from .bashrc.taste to .profile.taste this can be simplified
- echo -e "(source ~/.bashrc ; export TASTE_IN_DOCKER=1 ; /etc/init.d/postgresql start ; make install ; make test )" > docker_workaround.sh
- echo -e "(source ~/.bashrc ; sudo apt install --no-install-recommends -y --force-yes unzip ; export TASTE_IN_DOCKER=1 ; /etc/init.d/postgresql start ; make install ; make dependencies ; make test )" > docker_workaround.sh
- chmod +x docker_workaround.sh
- ./docker_workaround.sh
artifacts:
......
......@@ -6,6 +6,11 @@ exec = kazoo
all: build
dependencies:
# install a version of asn1scc that is compatible with kazoo
mkdir -p ~/.local/bin
cd ~/.local ; wget -q -O - https://github.com/ttsiodras/asn1scc/releases/download/4.2.4.3f/asn1scc-bin-4.2.4.3f.tar.bz2 | tar jxpvf - ; cd bin ; ln -s ../asn1scc/* .
templatesParser:
cp templates-parser/config/tp_xmlada_dummy.gpr templates-parser/tp_xmlada.gpr
@#$(MAKE) -C templates-parser -j
......@@ -39,11 +44,15 @@ endif
@#[ $(ARCH) == 64 ] && EXTRAFLAG="--target=x86_64-linux" ;
OCARINA_PATH=`ocarina-config --prefix` \
$(gnatpath)gprbuild -j0 -x -g $(exec) -p -P kazoo.gpr -XBUILD="debug" $$EXTRAFLAG
@rm -f templates-parser/config/setup/auto.cgpr
install:
$(MAKE)
mkdir -p `ocarina-config --prefix`/share/kazoo
rm -rf `ocarina-config --prefix`/share/kazoo/templates
cp -a templates kazoo `ocarina-config --prefix`/share/kazoo
mkdir -p `ocarina-config --prefix`/share/kazoo/doc
cp -au doc/templates/* `ocarina-config --prefix`/share/kazoo/doc
edit:
OCARINA_PATH=`ocarina-config --prefix` gps
......
[![pipeline status](https://gitrepos.estec.esa.int/taste/kazoo/badges/master/pipeline.svg)](https://gitrepos.estec.esa.int/taste/kazoo/-/commits/master)
Kazoo is the TASTE tool in chage of generating code skeletons, glue code and build scripts
Kazoo is the TASTE tool in charge of generating code skeletons, glue code and build scripts
License: LGPL (see LICENSE file)
......@@ -8,4 +8,4 @@ Copyright (c) 2019-2020 Maxime Perrotin / European Space Agency
Check the full documentation of Kazoo here:
https://taste.tuxfamily.org/wiki/index.php?title=Kazoo
\ No newline at end of file
https://taste.tuxfamily.org/wiki/index.php?title=Kazoo
......@@ -5,11 +5,12 @@ all:
cd ../test/test-cv && kazoo --doc -o ../../doc/tmp --gw -g --glue && mv ../../doc/tmp/Dump/Doc/* ../../doc/new-templates
mkdir -p preprocess
cp templates/templates_from_wiki preprocess # copy the previous one
rm templates/* # delete the old templates
mv templates/templates_from_wiki templates/templates_from_wiki.old # delete the old templates
$(MAKE) -C preprocess
cp preprocess/output/order.txt .
./kazoo-merge-doc.py
rm -rf tmp new-templates preprocess/output
./to_html.sh
clean:
rm -rf preprocess/output/*
......
......@@ -7,8 +7,8 @@
It is part of kazoo - TASTE Project
Copyright (c) 2019 Maxime Perrotin
(c) 2019 European Space Agency
Copyright (c) 2019-2020 Maxime Perrotin
(c) 2019-2020 European Space Agency
Contact : maxime.perrotin@esa.int
"""
......@@ -184,6 +184,10 @@ def run(options):
for each in orderlist:
filename=each.strip()
name=filename.replace("/", "_").replace("-", "_").split(".tmplt")[0]
# Also generate individual files for pandoc text rendering
split_output = open (result_folder + f"/{name}.split", "w")
middle_file = f"{result_folder}/{name}"
pre_file = f"{middle_file}.pre"
post_file = f"{middle_file}.post"
......@@ -196,11 +200,14 @@ def run(options):
pass
else:
wiki_output.write(f"\n=== {filename} ===\n")
split_output.write(f"\n=== {filename} ===\n")
pre_content = open(pre_file, "r").readlines()
middle_content = open(middle_file, "r").readlines()
post_content = open(post_file, "r").readlines()
for lines in chain(pre_content, middle_content, post_content):
wiki_output.write(lines)
split_output.write(lines)
split_output.close()
# Once the wiki file is generated, delete intermediate files
os.remove(pre_file)
......
......@@ -10,13 +10,13 @@ This template is evaluated only once. The output is saved to the Makefile within
|Combined table: list of fuction names...
|-
|Language
|... and corresponding implementation language
|↳ and corresponding implementation language
|-
|Is_Type
|... and flag if it is a function type
|↳ and flag if it is a function type
|-
|Has_Context_Param
|... and flag to indicate if function has context parameters
|↳ and flag to indicate if function has context parameters
|-
|CP_Files
|List of all context parameters ASN.1 files
......@@ -94,19 +94,19 @@ This template is evaluated for every function which has context parameters. The
|Set of types used for this Context Parameter file
|-
|Module_Set
|... corresponding module (needed for ASN.1 "IMPORTS")
|↳ corresponding module (needed for ASN.1 "IMPORTS")
|-
|CP_Name
|Table of context parameter names
|-
|CP_Sort
|... corresponding ASN.1 type
|↳ corresponding ASN.1 type
|-
|CP_ASN1_Module
|... in ASN.1 module
|↳ in ASN.1 module
|-
|CP_Value
|... with default value
|↳ with default value
|-
|Is_Type
|DOCUMENTATION MISSING
......@@ -162,14 +162,14 @@ This template is identical for Skeleton and Glue subfolders.
|Debug_Flag
|DOCUMENTATION MISSING
|-
|ASync_PI_Param_Name
|DOCUMENTATION MISSING
|-
|Timer_Resolution
|DOCUMENTATION MISSING
|-
|Property_Names
|DOCUMENTATION MISSING
|Vector tag: AADL Property name
|-
|Property_Values
| ↳ corresponding AADL property value
|-
|Skeletons
|DOCUMENTATION MISSING
......@@ -177,18 +177,12 @@ This template is identical for Skeleton and Glue subfolders.
|Interface_View
|Interface view filename
|-
|ASync_PI_Param_Type
|DOCUMENTATION MISSING
|-
|ASync_RI_Param_Name
|DOCUMENTATION MISSING
|-
|CP_Asn1Modules
|DOCUMENTATION MISSING
|-
|Property_Values
|DOCUMENTATION MISSING
|-
|Binary_Path
|DOCUMENTATION MISSING
|-
......@@ -202,6 +196,18 @@ This template is identical for Skeleton and Glue subfolders.
|DOCUMENTATION MISSING
|-
|List_Of_ASync_PIs
|Vector tag: list of async Provided interfaces
|-
|ASync_PI_Kind
| ↳ CYCLIC_OPERATION or SPORADIC_OPERATION
|-
|ASync_PI_Is_Connected
| ↳ Flag set to true if PI is connected
|-
|ASync_PI_Param_Name
|DOCUMENTATION MISSING
|-
|ASync_PI_Param_Type
|DOCUMENTATION MISSING
|-
|Glue
......@@ -269,6 +275,9 @@ This file is optional, if exists the result of parsing of this file is a name of
|-
|Name
|The name of the function
|-
|Language
|DOCUMENTATION MISSING
|}
=== templates/skeletons/sub/function-filename.tmplt ===
This file is optional, if exists the result of parsing of this file is a name of output file for function.tmplt, otherwise this template will not be processed.
......@@ -278,6 +287,9 @@ This file is optional, if exists the result of parsing of this file is a name of
|-
|Name
|The name of the function
|-
|Language
|DOCUMENTATION MISSING
|}
=== templates/skeletons/sub/function.tmplt ===
Template for a function in the skeleton or glue folder
......@@ -288,97 +300,152 @@ Template for a function in the skeleton or glue folder
|Name
|The name of the function
|-
|RIs_Have_Params
|DOCUMENTATION MISSING
|Language
|Implementation language
|-
|Zip_File
|DOCUMENTATION MISSING
|List_Of_PIs
|List of all provided interfaces (names only)
|-
|ASync_RI_Param_Type
|DOCUMENTATION MISSING
|List_Of_RIs
|List of all required interfaces (names only)
|-
|Is_Type
|DOCUMENTATION MISSING
|Provided_Interfaces
|Generated from interfaces.tmplt
|-
|CP_Values
|DOCUMENTATION MISSING
|Required_Interfaces
|Generated from interfaces.tmplt
|-
|CP_Asn1Modules
|DOCUMENTATION MISSING
|RIs_Have_Params
|True if at least one RI has an ASN.1 parameter
|-
|Provided_Interfaces
|DOCUMENTATION MISSING
|PIs_Have_Params
|True if at least one PI has an ASN.1 parameter
|-
|Zip_File
|Path to optional zip file containing the code of the function
|(deprecated functionality)
|-
|Is_Type
|True if it is a function type
|-
|Instance_Of
|Name of the function type if it is an instance
|-
|Language
|Implementation language
|Has_Context
|True if function has context parameters
|-
|CP_Names
|Vector tag: context parameters (names)
|-
|CP_Types
| ↳ corresponding ASN.1 type
|-
|CP_Values
| ↳ corresponding value
|-
|CP_Asn1Modules
| ↳ corresponding ASN.1 module containing the type
|-
|CP_Asn1Filenames
| ↳ corresponding ASN.1 filename
|-
|Property_Names
|Vector tag: user defined AADL property names
|-
|Property_Values
| ... and corresponding value
| ↳ corresponding value
|-
|List_Of_ASync_PIs
|DOCUMENTATION MISSING
|List of asynchronous provided interfaces
|-
|ASync_PI_Param_Name
| ↳ name of the parameter
|-
|ASync_PI_Param_Type
| ↳ ASN.1 typename of the parameter
|-
|ASync_PI_Kind
| ↳ CYCLIC_OPERATION or SPORADIC_OPERATION
|-
|ASync_PI_Is_Connected
| ↳ Flag set to true if PI is connected
|-
|Timers
|List of timers (names)
|-
|List_Of_Sync_RIs
|List of synchronous required interfaces
|-
|List_Of_Sync_PIs
|List of synchronous provided interfaces
|-
|Sync_RIs_Parent
|DOCUMENTATION MISSING
| ↳ and corresponding parent function name
|-
|ASN1_Modules
|List of ASN.1 modules containing types used in this function
|-
|ASN1_Files
|List of ASN.1 files containing types used in this function
|-
|List_Of_ASync_RIs
|vector tag: list of asynchronous required interfaces
|-
|Async_RIs_Parent
|DOCUMENTATION MISSING
| ↳ Corresponding parent function name
|-
|List_Of_PIs
|DOCUMENTATION MISSING
|ASync_RI_Param_Name
| ↳ parameter name of the required interface
|-
|CP_Asn1Filenames
|ASync_RI_Param_Type
| ↳ ASN1 typename of the parameter
|-
|Data_View
|DOCUMENTATION MISSING
|-
|Required_Interfaces
|Shared_Lib_Dir
|DOCUMENTATION MISSING
|-
|PIs_Have_Params
|Binary_Path
|DOCUMENTATION MISSING
|-
|ASync_PI_Param_Type
|Timer_Resolution
|DOCUMENTATION MISSING
|-
|CP_Types
|Skeletons
|DOCUMENTATION MISSING
|-
|ASync_PI_Param_Name
|Other_Files
|DOCUMENTATION MISSING
|-
|Timers
|Check_Data_View
|DOCUMENTATION MISSING
|-
|CP_Names
|Shared_Types
|DOCUMENTATION MISSING
|-
|List_Of_Sync_RIs
|Output_Dir
|DOCUMENTATION MISSING
|-
|List_Of_Sync_PIs
|Use_POHIC
|DOCUMENTATION MISSING
|-
|List_Of_RIs
|Debug_Flag
|DOCUMENTATION MISSING
|-
|Has_Context
|Target
|DOCUMENTATION MISSING
|-
|ASN1_Modules
|Interface_View
|DOCUMENTATION MISSING
|-
|ASync_RI_Param_Name
|Glue
|DOCUMENTATION MISSING
|-
|List_Of_ASync_RIs
|No_Stdlib_Flag
|DOCUMENTATION MISSING
|-
|ASN1_Files
|Deployment_View
|DOCUMENTATION MISSING
|}
=== templates/skeletons/sub/interface.tmplt ===
......@@ -394,7 +461,7 @@ This file is processed twice, first time for required interfaces of the function
|"PI" or "RI"
|-
|Kind
|The RCM Kind
|The RCM Kind (SPORADIC|CYCLIC|PROTECTED|UNPROTECTED_OPERATION)
|-
|Parent_Function
|The name of the function
......@@ -406,19 +473,19 @@ This file is processed twice, first time for required interfaces of the function
|All AADL properties (names) associated to the function
|-
|Property_Values
|... and corresponding values
|↳ and corresponding values
|-
|Param_Names
|List of parameter names
|-
|Param_Types
| |_ Corresponding parameter types
| ↳ Corresponding parameter types
|-
|Param_Directions
| |_ Corresponding direction
| ↳ Corresponding direction
|-
|Param_Encodings
| |_ Corresponding ASN.1 encoding
| ↳ Corresponding ASN.1 encoding
|-
|Is_Timer
|Flag set to true if this is a timer interface
......@@ -452,6 +519,54 @@ This file is processed twice, first time for required interfaces of the function
|-
|Param_Basic_Types
|DOCUMENTATION MISSING
|-
|Interface_View
|DOCUMENTATION MISSING
|-
|Check_Data_View
|DOCUMENTATION MISSING
|-
|Shared_Lib_Dir
|DOCUMENTATION MISSING
|-
|Use_POHIC
|DOCUMENTATION MISSING
|-
|Skeletons
|DOCUMENTATION MISSING
|-
|Debug_Flag
|DOCUMENTATION MISSING
|-
|Output_Dir
|DOCUMENTATION MISSING
|-
|Timer_Resolution
|DOCUMENTATION MISSING
|-
|Target
|DOCUMENTATION MISSING
|-
|Binary_Path
|DOCUMENTATION MISSING
|-
|Other_Files
|DOCUMENTATION MISSING
|-
|Deployment_View
|DOCUMENTATION MISSING
|-
|Shared_Types
|DOCUMENTATION MISSING
|-
|Data_View
|DOCUMENTATION MISSING
|-
|No_Stdlib_Flag
|DOCUMENTATION MISSING
|-
|Glue
|DOCUMENTATION MISSING
|}
=== templates/skeletons/sub/makefile.tmplt ===
This template is processed when makefile-filename.tmplt exists.
......@@ -554,13 +669,16 @@ This file is processed for every node. The result of this file indicates if the
|Value of command line flag --target=Target
|-
|CPU_Classifier
|DOCUMENTATION MISSING
|AADL CPU Classifier (e.g. ocarina_processors_x86::x86.linux)
|-
|Shared_Types
|List of available component types
|-
|Shared_Lib_Dir
|Folder hosting the shared component types
|-
|Is_Distributed
|True if the system contains at least one bus
|}
=== templates/concurrency_view/sub/thread.tmplt ===
This file is processed for every thread in every partition in every node.
......@@ -593,13 +711,13 @@ This file is processed for every thread in every partition in every node.
|Vector tag: output remote thread list
|-
|Remote_PIs
| |_ Associated PI Name
| ↳ Associated PI Name
|-
|Remote_PI_Sorts
| |_ Optional param type of the remote thread
| ↳ Optional param type of the remote thread
|-
|Remote_PI_Modules
| |_ Asn1 module of the optional param type
| ↳ Asn1 module of the optional param type
|-
|Name
|
......@@ -738,10 +856,10 @@ The result of every evaluation is joined to one string and passed as a parameter
|List of parameter names
|-
|Param_Types
| |_ Corresponding parameter types
| ↳ Corresponding parameter types
|-
|Param_Directions
| |_ Corresponding direction
| ↳ Corresponding direction
|-
|Is_Timer
|DOCUMENTATION MISSING
......@@ -889,67 +1007,82 @@ This template is evaluated for every block.
|Required interfaces (from ri.tmplt)
|-
|List_Of_PIs
|DOCUMENTATION MISSING
|Complete list of provided interfaces
|-
|List_Of_ASync_RIs
|Vector tag: name of asynchronous RIs
|-
|ASync_RI_Param_Name
| ↳ corresponding parameter Name
|-
|ASync_RI_Param_Type
|DOCUMENTATION MISSING
| ↳ corresponding parameter ASN.1 type
|-
|RIs_Have_Params
|DOCUMENTATION MISSING
|-
|List_Of_Sync_RIs
|DOCUMENTATION MISSING
|List of synchronous RIs
|-
|Debug_Flag
|DOCUMENTATION MISSING
|List_Of_ASync_PIs
|Vector tag: name of asynchronous PIs
|-
|ASync_PI_Kind
| ↳ CYCLIC_OPERATION or SPORADIC_OPERATION
|-
|ASync_PI_Is_Connected
| ↳ Flag set to true if PI is connected
|-
|ASync_PI_Param_Name
|DOCUMENTATION MISSING
| ↳ corresponding parameter Name
|-
|ASync_PI_Param_Type
| ↳ corresponding parameter ASN.1 type
|-
|Timer_Resolution
|DOCUMENTATION MISSING
|-
|Property_Names
|DOCUMENTATION MISSING
|Vector tag: AADL Property name
|-
|Property_Values
| ↳ corresponding AADL property value
|-
|Skeletons
|DOCUMENTATION MISSING
|Command line flag (--gw)
|-
|Interface_View
|Interface view filename
|-
|ASync_PI_Param_Type
|Binary_Path
|DOCUMENTATION MISSING
|-
|ASync_RI_Param_Name
|DOCUMENTATION MISSING
|CP_Names
|Vector tag: context parameter names
|-
|CP_Asn1Modules
|DOCUMENTATION MISSING
|CP_Values
| ↳ value
|-
|Property_Values
|DOCUMENTATION MISSING
|CP_Asn1Modules
| ↳ ASN.1 module
|-
|Binary_Path
|DOCUMENTATION MISSING
|CP_Asn1Filenames
| ↳ ASN.1 file name
|-
|CP_Values
|DOCUMENTATION MISSING
|CP_Types
| ↳ Context parameter ASN.1 type
|-
|Deployment_View
|DOCUMENTATION MISSING
|Path/name of Deployment view file
|-