Skip to content

Commit

Permalink
docs: Add basic documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
elldritch committed Feb 15, 2018
1 parent 0634835 commit 60a1e38
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 14 deletions.
8 changes: 1 addition & 7 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions docs/integrations/adding-new-languages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Adding New Languages

## How language integrations work
You can add support for a languages by creating a `Builder` for that language.
The `Builder` interface describes key functionality that FOSSA CLI relies on to
perform dependency analysis:

- `Initialize` does initialization for the builder and gathers environment
context (e.g. binary paths).
- `Build` runs a default build of the module if the user requests it.
- `Analyze` returns a list of dependencies in a standard format.
- `IsBuilt` detects whether a module requires a build.

A `Dependency` is a component with a locator. Locators are built out of 3 parts:
- `Fetcher`: the component's source ecosystem (e.g. `npm` or `mvn`).
- `Package`: the package name in the ecosystem's registries.
- `Revision`: the revision (or version) name in the ecosystem's registries.
26 changes: 26 additions & 0 deletions docs/integrations/bower.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Bower Support

Bower support in FOSSA CLI depends on the following tools existing in your environment:

- Node.js
- Bower

## Configuration

Add a `bower` module with the path to the `bower.json` in your project.

```yaml
analyze:
modules:
- name: your-bower-project
path: bower.json
type: bower
```
If you have an existing passing production build, you can run `fossa` from within the build environment and it should succeed.

Otherwise, you can run `fossa build` to execute the default build command `bower install --production`.

## Troubleshooting

FOSSA CLI parses the package manifests in `bower_components` to generate dependency IDs. If FOSSA fails, your build might be failing.
28 changes: 28 additions & 0 deletions docs/integrations/composer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Composer Support

Composer support in FOSSA CLI depends on the following tools existing in your environment:

- PHP
- Composer

## Configuration

Add a `composer` module with the path to the `composer.json` in your project.

```yaml
analyze:
modules:
- name: your-composer-project
path: composer.json
type: composer
```
If you have an existing passing production build, you can run `fossa` from within the build environment and it should succeed.

Otherwise, you can run `fossa build` to execute the default build command `composer install --no-dev --prefer-dist`.

## Troubleshooting

FOSSA CLI runs and parses the output of `composer show -f json` to generate dependency IDs. If FOSSA fails, your build or `composer show -f json` might be failing.

Run `composer show -f json` and check the output to diagnose what went wrong.
14 changes: 7 additions & 7 deletions docs/integrations/maven.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# Maven Support

Maven support in Fossa CLI depends on the following tools existing in your environment:
Maven support in FOSSA CLI depends on the following tools existing in your environment:

- Java
- Maven
- `mvn:dependencyList` plugin (supported by the official Maven team; auto-installed by Maven if missing)

## Configuration

Add a `MavenArtifact` module with the **relative** path to the `pom.xml` in your root directory.
Add a `maven` module with the **relative** path to the `pom.xml` in your root directory.

```yaml
analyze:
modules:
- name: yourmavenpackage
- name: your-maven-project
path: pom.xml
type: MavenArtifact
type: maven
```
If you have an existing passing production build, you can run `fossa` in your existing environment and it should succeed.
If you have an existing passing production build, you can run `fossa` from within the build environment and it should succeed.

Otherwise, you can run `fossa build` to execute with a default build command `mvn clean install -DskipTests -Drat.skip=true -f $PATH_TO_POM`.
Otherwise, you can run `fossa build` to execute the default build command `mvn clean install -DskipTests -Drat.skip=true -f $PATH_TO_POM`.

## Troubleshooting

Fossa CLI runs and parses the output of the `mvn:dependencyList` plugin to generate dependency IDs. If FOSSA fails, chances are your build or the `mvn:dependencyList` plugin is failing.
FOSSA CLI runs and parses the output of the `mvn:dependencyList` plugin to generate dependency IDs. If FOSSA fails, your build or the `mvn:dependencyList` plugin might be failing.

Run `mvn:dependencyList -f $PATH_TO_POM` and check the output to diagnose what went wrong.
26 changes: 26 additions & 0 deletions docs/integrations/nodejs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Node.js Support

Node.js support in FOSSA CLI depends on the following tools existing in your environment:

- Node.js
- Either Yarn or NPM

## Configuration

Add a `nodejs` module with the path to the `package.json` in your project.

```yaml
analyze:
modules:
- name: your-nodejs-project
path: package.json
type: nodejs
```
If you have an existing passing production build, you can run `fossa` from within the build environment and it should succeed.

Otherwise, you can run `fossa build` to execute the default build command. If a Yarn lockfile is detected, FOSSA will run `yarn install --production --frozen-lockfile`. Otherwise, it will run `npm install --production`.

## Troubleshooting

FOSSA CLI parses the package manifests in `node_modules` to generate dependency IDs. If FOSSA fails, your build might be failing.
Empty file removed docs/integrations/php.md
Empty file.
File renamed without changes.
Empty file removed docs/integrations/scala.md
Empty file.
2 changes: 2 additions & 0 deletions test/fixtures/composer/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# This is from Sylius

vendor
bin

0 comments on commit 60a1e38

Please sign in to comment.