Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Commit

Permalink
updating docs
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Hoang <mhoang@redhat.com>
  • Loading branch information
mike-hoang committed Jun 13, 2023
1 parent 835b552 commit d4b9676
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 173 deletions.
122 changes: 110 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
# Alizer

[release-svg]: https://img.shields.io/nexus/r/com.redhat.devtools.alizer/alizer?server=https%3A%2F%2Frepository.jboss.org%2Fnexus
[nightly-svg]: https://img.shields.io/nexus/s/com.redhat.devtools.alizer/alizer?server=https%3A%2F%2Frepository.jboss.org%2Fnexus

![Go](https://img.shields.io/badge/Go-1.19-blue)
![Build status](https://github.com/redhat-developer/alizer/actions/workflows/CI.yml/badge.svg)
![Release][release-svg]
![Nightly][nightly-svg]

## Overview
[![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg)](./LICENSE)

Alizer (which stands for Application Analyzer) is a utilily whose goal is to extract informations about an application source code.
Such informations are:
Expand All @@ -21,7 +16,114 @@ detect components (the concept of component is taken from Odo and its definition

## Usage

- [Go library & CLI](go/README.md#Usage)
### CLI

The Go CLI can be built with the below command:

```bash
# inside the go/ dir
$ go build alizer.go
```

```shell
$ ./alizer analyze <path>
$ ./alizer component <path>
$ ./alizer devfile <path>
```

### CLI Arguments

#### --log

Sets the logging level of the CLI. The arg accepts only 3 values [`debug`, `info`, `warning`]. The default value is `warning` and the logging level is `ErrorLevel`. Example usage

```shell
$ ./alizer analyze --log debug <path>
```

### Library Package

#### Language Detection

To analyze your source code with Alizer, just import it and use the recognizer:

```go
import "github.com/redhat-developer/alizer/pkg/apis/recognizer"

languages, err := recognizer.Analyze("./")
```

#### Component Detection

It detects all components which are found in the source tree.

```go
import "github.com/redhat-developer/alizer/pkg/apis/recognizer"

components, err := recognizer.DetectComponents("./")
```

#### Devfile Detection

It selects a devfile from a list of devfiles (from a devfile registry or other storage) based on the information found in the source tree.

```go
import "github.com/redhat-developer/alizer/pkg/apis/recognizer"

devfile, err := recognizer.SelectDevFileFromTypes("myproject", devfiles)
```

## Outputs

Example of `analyze` command:

```json
[
{
"Name": "Go",
"Aliases": ["golang"],
"Weight": 94.72,
"Frameworks": [],
"Tools": ["1.18"],
"CanBeComponent": true
}
]
```

Example of `component` command:

```json
[
{
"Name": "spring4mvc-jpa",
"Path": "path-of-the-component",
"Languages": [
{
"Name": "Java",
"Aliases": null,
"Weight": 100,
"Frameworks": ["Spring"],
"Tools": ["Maven"],
"CanBeComponent": true
}
],
"Ports": null
}
]
```

Example of `devfile` command:

```json
[
{
"Name": "nodejs",
"Language": "JavaScript",
"ProjectType": "Node.js",
"Tags": ["Node.js", "Express", "ubi8"]
}
]
```

## Contributing

Expand All @@ -41,7 +143,3 @@ The release process of `alizer` is very straightforward. You can create a new re
If you discover an issue please file a bug and we will fix it as soon as possible.

- File a bug in [GitHub Issues](https://github.com/redhat-developer/alizer/issues).

## License

EPL 2.0, See [LICENSE](LICENSE) for more information.
File renamed without changes.
File renamed without changes.
File renamed without changes.
161 changes: 0 additions & 161 deletions go/README.md

This file was deleted.

0 comments on commit d4b9676

Please sign in to comment.