lisa-analyzer / lisa4ros2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LiSA4ROS2

Static Analysis of ROS2

⚠︎⚠︎⚠︎ Warning ⚠︎⚠︎⚠︎

Sometimes, LiSA4ROS2 will refer to a snapshot release of LiSA to exploit unreleased features. If, when building, you get the following error message:

> Could not resolve io.github.lisa-analyzer:lisa-project:ver-SNAPSHOT.
  > Could not get resource 'https://maven.pkg.github.com/lisa-analyzer/lisa/io/github/lisa-analyzer/lisa-project/ver-SNAPSHOT/maven-metadata.xml'.
    > Could not GET 'https://maven.pkg.github.com/lisa-analyzer/lisa/io/github/lisa-analyzer/lisa-project/ver-SNAPSHOT/maven-metadata.xml'. Received status code 401 from server: Unauthorized

Then you have to perform the following:

  • Create a GitHub PAT following this guide and grant read:packages permission
  • Create a gradle.properties file in the project root folder (where the gradlew scripts are located) with the following content:
gpr.user=your-github-username
gpr.key=github-access-token

Build

Build Using Docker

git clone git@github.com:lisa-analyzer/lisa4ros2.git # clone the repository
cs lisa4ros2 # move to the main folder of the project (where the Dockerfile is located)
docker build  -t lisa4ros2 . # build the image
# Crete a folder outside the project (for example, lisa-workdir):
cd ..
cd ..
mkdir lisa-workdir # create the directory
cd lisa-workdir # move to the directory
# Move the file(s) that you want to analyze inside this folder and then run the container. Assuming that your current folder is the lisa-workdir folder:
docker run  -v ${PWD}:/lisa4ros2/workspace -it lisa4ros2 ./lisa4ros2 workspace/file1.py workspace/output
# If you want to analyze multiple files of the same project at once:
docker run  -v ${PWD}:/lisa4ros2/workspace -it lisa4ros2 ./lisa4ros2 workspace/file1.py workspace/file2.py workspace/fileN.py workspace/output
# You can see the files generated by lisa4ros2 inside the lisa-workdir/output folder.

Build Using Gradle

./gradlew build
./gradlew run --args="path/to/file1.py path/to/fileN.py path/to/output/directory"

About

License:MIT License


Languages

Language:Java 55.2%Language:Python 42.2%Language:ANTLR 1.3%Language:HTML 1.2%Language:Shell 0.0%Language:Dockerfile 0.0%