th2 gRPC act template library
This is the template project for creating custom gRPC act libraries. It contains proto messages and Act service that are used th2 act template. See act_template.proto file for details.
Tool generates code from .proto files and uploads built packages (.proto files and generated code) to specified repositories.
How to transform template
- Create a directory with the same name as project name (use underscores instead of dashes) under
src/main/protodirectory (remove other files and directories if they exist). - Place your custom
.protofiles in created directory. Pay attention topackagespecifier andimportstatements. - Edit
release_versionandvcs_urlproperties ingradle.propertiesfile. - Edit
rootProject.namevariable insettings.gradlefile. This will be the name of Java package. - Edit
package_info.jsonfile in order to specify name and version for Python package (create file if it's absent). - Edit parameters of
setup.pyinsetupfunction invocation such as:author,author_email,url. Do not edit the others.
Note that the name of created directory under src/main/proto directory is used in Python (it's a package name).
How to maintain project
- Make your changes.
- Up version of Java package in
gradle.propertiesfile. - Up version of Python package in
package_info.jsonfile. - Commit everything.
How to run project
Java
If you wish to manually create and publish package for Java, run these command:
gradle --no-daemon clean build publish artifactoryPublish \
-Pbintray_user=${BINTRAY_USER} \
-Pbintray_key=${BINTRAY_KEY}
BINTRAY_USER and BINTRAY_KEY are parameters for publishing.
Python
If you wish to manually create and publish package for Python:
- Generate services by gradle:
You can find the generated files by following path:
gradle --no-daemon clean generateProtosrc/gen/main/services/python - Generate code from
.protofiles and publish everything:pip install -r requirements.txt python setup.py generate python setup.py sdist twine upload --repository-url ${PYPI_REPOSITORY_URL} --username ${PYPI_USER} --password ${PYPI_PASSWORD} dist/*PYPI_REPOSITORY_URL,PYPI_USERandPYPI_PASSWORDare parameters for publishing.