Skip to content

Commit ede30f0

Browse files
authored
Merge branch 'main' into develop
2 parents 67ee1ea + f30c554 commit ede30f0

File tree

3 files changed

+299
-67
lines changed

3 files changed

+299
-67
lines changed

README.md

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# FOSSLight Dependency
22

3-
<img src="https://img.shields.io/pypi/l/fosslight_dependency" alt="FOSSLight Dependency is released under the Apache-2.0 License." /> <img src="https://img.shields.io/pypi/v/fosslight_dependency" alt="Current python package version." /> <img src="https://img.shields.io/pypi/pyversions/fosslight_dependency" />
3+
<img src="https://img.shields.io/pypi/l/fosslight_dependency" alt="License" /> <img src="https://img.shields.io/pypi/v/fosslight_dependency" alt="Current python package version." /> <img src="https://img.shields.io/pypi/pyversions/fosslight_dependency" />
4+
</p>
45

5-
---
6-
## Introduction
6+
## 💡 Introduction
77
This is the tool that supports the analysis of dependencies for multiple package managers. It detects the manifest file of package managers automatically and analyzes the dependencies with using open source tools. Then, it generates the report file that contains OSS information of dependencies.
88

99
Currently, it supports the following package managers.
@@ -15,25 +15,15 @@ Currently, it supports the following package managers.
1515
* [Cocoapods](https://cocoapods.org/) (Swift/Obj-C)
1616

1717

18-
## User Guide
19-
Please see the [User Guide](/docs/user-guide.md) for more information on how to run each package manager.
18+
## 📖 User Guide
19+
Please see the [**User Guide**](https://github.com/fosslight/fosslight_dependency/blob/main/docs/user-guide.md) for more information on how to install and run it.
2020

2121

22-
## Contributing Guide
23-
We always welcome your contributions.
24-
Please see the [CONTRIBUTING guide](/CONTRIBUTING.md) for how to contribute.
25-
26-
## License
27-
Unless otherwise specified, all content, including all source code files and documentation files in this repository are:
28-
29-
Copyright (c) 2020 LG Electronics, Inc.
30-
31-
All content, including all source code files and documentation files in this repository except otherwise noted are: Licensed under the Apache License, Version 2.0 (the "License"); you may not use this content except in compliance with the License. You may obtain a copy of the License at
32-
33-
http://www.apache.org/licenses/LICENSE-2.0
34-
35-
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
36-
37-
SPDX-License-Identifier: Apache-2.0
22+
## 👏 Contributing Guide
23+
We always welcome your contributions.
24+
Please see the [CONTRIBUTING guide](https://github.com/fosslight/fosslight_dependency/blob/main/CONTRIBUTING.md) for how to contribute.
3825

26+
## 📄 License
3927

28+
Copyright (c) 2020 LG Electronics, Inc.
29+
FOSSLight Dependency is licensed under Apache-2.0, as found in the [LICENSE](https://github.com/fosslight/fosslight_dependency/blob/main/LICENSE) file.

docs/user-guide.md

Lines changed: 85 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
1+
<p align='right'>
2+
<a href="https://github.com/fosslight/fosslight_dependency/blob/main/docs/user-guide_Kor.md">[Kor]</a>
3+
</p>
4+
15
# User Guide
6+
7+
## Contents
8+
- [How to analyze the dependencies](#-how-to-analyze-the-dependencies)
9+
- [Prerequisite](#-prerequisite)
10+
- [NPM](#npm)
11+
- [Gradle](#gradle)
12+
- [Pypi](#pypi)
13+
- [Maven](#maven-optional)
14+
- [Pub](#pub)
15+
- [Cocoapods](#cocoapods)
16+
- [How to install](#-how-to-install)
17+
- [How to run](#-how-to-run)
18+
- [Result](#-result)
19+
220
<br>
321

4-
## 1. Prerequisite
5-
### How to analyze the dependencies
6-
FOSSLight dependency utilizes the open source software for analyzing each package manager dependencies. We choose the open source software for each package manager that shows not only the direct dependencies but also the transitive dependencies including the information of dependencies such as oss name, oss version and license name.
22+
## 🧐 How to analyze the dependencies
23+
FOSSLight Dependency utilizes the open source software for analyzing each package manager dependencies. We choose the open source software for each package manager that shows not only the direct dependencies but also the transitive dependencies including the information of dependencies such as oss name, oss version and license name.
724

825
Each package manager uses the results of the following software:
926
- NPM : [NPM License Checker](https://github.com/davglass/license-checker)
@@ -12,19 +29,26 @@ Each package manager uses the results of the following software:
1229
- Maven : [license-maven-plugin](https://github.com/mojohaus/license-maven-plugin)
1330
- Pub : [flutter_oss_licenses](https://github.com/espresso3389/flutter_oss_licenses)
1431

15-
Because we utilizes the different open source software to analyze the dependencies of each package manager, you need to set up the below steps according to package manager to analyze.
32+
Because we utilizes the different open source software to analyze the dependencies of each package manager, you need to set up the below [Prerequisite](#-prerequisite) steps according to package manager to analyze.
33+
34+
<br>
1635

36+
## 📋 Prerequisite
1737
### NPM
18-
1. Install the NPM License Checker to ananlyze the npm dependencies. (required)
38+
1. Install the NPM License Checker to ananlyze the npm dependencies.
1939
```
2040
$ npm install -g license-checker
2141
```
22-
2. Run the command to install the dependencies (optional)
42+
2. Run the command to install the dependencies. (optional)
2343
```
2444
$ npm install
2545
```
46+
> - If the 'package.json' file exists in the input directory, it will be executed automatically by FOSSLight Dependency. So you can skip it.
47+
> - If the 'node_modules' directory already exists, you can run FOSSLight dependency by setting the input directory to the path where node_modules is located.
2648
27-
### Gradle (required)
49+
<br>
50+
51+
### Gradle
2852
1. Add the License Gradle Plugin in build.gradle file.
2953
```
3054
plugins {
@@ -33,29 +57,40 @@ plugins {
3357
3458
downloadLicenses {
3559
includeProjectDependencies = true
36-
dependencyConfiguration = 'runtimeClasspath' // If the gradle version is 4.6 or lower, then add the 'runtime' instead of 'runtimeClasspath'.
60+
dependencyConfiguration = 'runtimeClasspath'
3761
}
3862
```
39-
2. Run the task.
63+
> - If the gradle version is 4.6 or lower, then add the 'runtime' instead of 'runtimeClasspath' in the dependencyConfiguration.
64+
65+
2. Run the 'downloadLicenses' task.
4066
```
4167
$ gradle downloadLicenses
4268
```
4369

44-
### Pypi (required)
45-
You can run this tool with virtualenv environment for separating the project dependencies from system dependencies.
46-
1. Create the virtualenv environment
70+
<br>
71+
72+
### Pypi
73+
You can run this tool with virtual environment for separating the project dependencies from system global dependencies.
74+
1. Create and activate the virtual environment
4775
```
76+
// virtualenv example
77+
$ virtualenv -p /usr/bin/python3.6 venv
78+
$ source venv/bin/activate
79+
4880
// conda example
4981
$ conda create --name {venv name}
5082
$ conda activate {venv name}
5183
```
52-
2. Install the dependencies
84+
2. Install the dependencies in the virtual environment.
5385
```
5486
// If you install the dependencies with requirements.txt...
5587
$ pip install -r requirements.txt
5688
```
5789

90+
<br>
91+
5892
### Maven (optional)
93+
> - If the 'pom.xml' is located in the input directory, FOSSLight dependency will automatically add and execute the license-maven-plugin. So you can skip the prerequisites below.
5994
1. Add the license-maven-plugin into pom.xml file.
6095
```
6196
<project>
@@ -83,81 +118,85 @@ $ pip install -r requirements.txt
83118
...
84119
</project>
85120
```
86-
2. Run the license-maven-plugin.
121+
2. Run the license-maven-plugin task.
87122
```
88123
$ mvn license:aggregate-download-licenses
89124
```
90125

91-
### Pub (required)
126+
<br>
127+
128+
### Pub
92129
1. Run the flutter_oss_licenses.
93130
```
94131
$ flutter pub get
95132
$ flutter pub global activate flutter_oss_licenses
96133
$ flutter pub global run flutter_oss_licenses:generate.dart
97134
```
98135

136+
<br>
99137

100-
### Cocoapods (required)
138+
### Cocoapods
101139
1. Install the pod package through Podfile.
102140
```
103141
$ pod install
104142
```
105143

106144
<br>
107145

108-
## 2. How to install
109-
Python2.7 or Python3.6+ supports.
146+
## 🎉 How to install
147+
It is recommended to install in Python3.6+.
110148
### From pip
111149
```
112-
pip install fosslight-dependency
113-
```
114-
Or
115-
```
116-
pip install git+https://github.com/LGE-OSS/fosslight_dependency.git
150+
$ pip install fosslight-dependency
117151
```
118152
### From source code
119153
```
120-
git clone https://github.com/LGE-OSS/fosslight_dependency.git
121-
cd fosslight_dependency
122-
python setup.py install
154+
$ git clone https://github.com/fosslight/fosslight_dependency.git
155+
$ cd fosslight_dependency
156+
$ python setup.py install
123157
```
124158

125159
<br>
126160

127-
## 3. How to run
128-
You can run the FOSSLight dependency with options based on your package manager.
161+
## 🚀 How to run
162+
You can run the FOSSLight Dependency with options based on your package manager.
129163
```
130164
$ fosslight_dependency
131165
```
132-
| Options | Description | Value |
133-
| --------- | ------------- | ------- |
134-
| -m | (optional) <br> package manager for your project | npm, maven, gradle, pip, pub, cocoapods |
135-
| -p | (optional) <br> input directory | (path) |
136-
| -o | (optional) <br> output file directory | (path) |
137-
| -a | (pypi only required) <br> virtual environment activate command | conda example: 'conda activate (venv name)' |
138-
| -d | (pypi only required) <br> virtual environment deactivate command | conda example: 'conda deactivate' |
139-
| -c | (gradle, maven only optional) <br> customized build output directory name (default: target) | (customized output directory name) |
140-
| -v | version of the script | N/A |
166+
| Option | Argument | Description |
167+
| ------ | ------------- | ----------- |
168+
| -m | npm, maven, gradle, pip, pub, cocoapods | (optional) <br> package manager for your project |
169+
| -p | (path) |(optional) <br> input directory |
170+
| -o | (path) |(optional) <br> output file directory |
171+
| -a | conda example: 'conda activate (venv name)' |(pypi only required) <br> virtual environment activate command |
172+
| -d | conda example: 'conda deactivate' |(pypi only required) <br> virtual environment deactivate command |
173+
| -c | (customized output directory name) |(gradle, maven only optional) <br> customized build output directory name (default: target) |
174+
| -v | N/A | release version |
141175

142176
Note that input directory should be the top directory of the project where the manifest file of the package manager is located.
143177
For example, if your project uses the NPM package manager, then the input directory should be the path where 'package.json' file is located.
144-
Similarily, the manifest file of pip is 'requirements.txt', maven has 'pom.xml' manifest file and gradle has 'build.gradle' manifest file.
145-
If you want to run the command with other path, then you can use '-p' option.
178+
The manifest file of each package manager is as follows:
179+
180+
181+
| Package manager | Npm | Pip | Maven | Gradle | Pub | Cocoapods |
182+
| --------------- | ------------ | ---------------- | ------- | ------------ | ------------ | --------- |
183+
| Manifest file | package.json | requirements.txt | pom.xml | build.gradle | pubspec.yaml | Podfile |
146184

185+
In other words, the input directory('-p' option) should be designated as the top directory of the project where the package manager's manifest file exists as above.
147186

148187
<br>
149188

150-
## 4. How to generate Result file
151-
FOSSLight dependency creates the result file that has xlsx extension (Microsoft Excel file).
189+
## 📁 Result
190+
FOSSLight Dependency creates the result file that has xlsx extension (Microsoft Excel file).
152191

153192
It prints the OSS information based on manifest file(package.json, pom.xml) of dependencies (including transitive dependenices).
154193
For a unique OSS name, OSS name is printed such as (package_manager):(oss name) or (group id):(artifact id).
155194

156195
| Package manager | OSS Name | Download Location | Homepage |
157196
| --------------- | ------------------ | ----------------- | -------- |
158-
| Npm | npm:(oss name) | Priority1. repository in package.json <br> Priority2. www.npmjs.com/package/(oss_name)/v/(oss_version) | www.npmjs.com/package/(oss_name) |
159-
| Pip | pypi:(oss name) | https://pypi.org/project/(oss_name)/(version) | homepage in (pip show) information |
160-
| Maven (Gradle) | (group_id):(artifact_id) | https://mvnrepository.com/artifact/(group_id)/(artifact_id)/(version) | https://mvnrepository.com/artifact/(group_id)/(artifact_id) |
161-
| Pub | pub:(oss name) | https://pub.dev/packages/(oss_name)/versions/(version) | homepage in (pub information) |
162-
| Cocoapods | cocoapods:(oss name) | source in (pod spec information) | https://cocoapods.org/(oss name) |
197+
| Npm | npm:(oss name) | Priority1. repository in package.json <br> Priority2. npmjs.com/package/(oss name)/v/(oss version) | npmjs.com/package/(oss name) |
198+
| Pip | pypi:(oss name) | pypi.org/project/(oss name)/(version) | homepage in (pip show) information |
199+
| Maven<br>& Gradle | (group_id):(artifact_id) | mvnrepository.com/artifact/(group id)/(artifact id)/(version) | mvnrepository.com/artifact/(group id)/(artifact id) |
200+
| Pub | pub:(oss name) | pub.dev/packages/(oss name)/versions/(version) | homepage in (pub information) |
201+
| Cocoapods | cocoapods:(oss name) | source in (pod spec information) | cocoapods.org/(oss name) |
163202

0 commit comments

Comments
 (0)