Skip to content

Commit 9470b7b

Browse files
authored
Merge pull request #22 from fosslight/develop2
change user guide
2 parents f06fc76 + f6c48c7 commit 9470b7b

File tree

2 files changed

+96
-32
lines changed

2 files changed

+96
-32
lines changed

docs/user-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ SPDX-License-Identifier: Apache-2.0
1414
- [Prerequisite](#-prerequisite)
1515
- [NPM](#npm)
1616
- [Gradle](#gradle)
17-
- [Gradle - Android](#Android)
17+
- [Gradle - Android](#android-gradle)
1818
- [Pypi](#pypi)
1919
- [Maven](#maven-optional)
2020
- [Pub](#pub)
@@ -216,7 +216,7 @@ $ pip install fosslight-dependency
216216
```
217217
$ git clone https://github.com/fosslight/fosslight_dependency.git
218218
$ cd fosslight_dependency
219-
$ python setup.py install
219+
$ pip install .
220220
```
221221

222222
<br>

docs/user-guide_Kor.md

Lines changed: 94 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,34 @@ SPDX-License-Identifier: Apache-2.0
66
<a href="https://github.com/fosslight/fosslight_dependency/blob/main/docs/user-guide.md">[Eng]</a>
77
</p>
88

9-
# User Guide
9+
# User Guide
1010

1111
## Contents
12+
1213
- [How to analyze the dependencies](#-how-to-analyze-the-dependencies)
1314
- [Prerequisite](#-prerequisite)
14-
- [NPM](#npm)
15-
- [Gradle](#gradle)
16-
- [Pypi](#pypi)
17-
- [Maven](#maven-optional)
18-
- [Pub](#pub)
19-
- [Cocoapods](#cocoapods)
15+
- [NPM](#npm)
16+
- [Gradle](#gradle)
17+
- [Gradle - Android](#android-gradle)
18+
- [Pypi](#pypi)
19+
- [Maven](#maven-optional)
20+
- [Pub](#pub)
21+
- [Cocoapods](#cocoapods)
2022
- [How to install](#-how-to-install)
2123
- [How to run](#-how-to-run)
2224
- [Result](#-result)
2325

2426
<br>
2527

2628
## 🧐 How to analyze the dependencies
29+
2730
FOSSLight Dependency는 다른 오픈소스 소프트웨어를 이용하여 여러 패키지 매니저들의 dependency 분석을 수행하고 있습니다. 그 중 다음 기준에 따라 오픈소스 소프트웨어를 선택하고 있습니다.
31+
2832
1. Direct dependency뿐만 아니라 transitive dependency까지 추출 가능
2933
2. 오픈소스 이름, 버전, License명 추출 가능
3034

3135
각 패키지 매니저에 따라 이용하는 오픈소스 소프트웨어는 다음과 같습니다:
36+
3237
- NPM : [NPM License Checker](https://github.com/davglass/license-checker)
3338
- Pypi : [pip-licenses](https://github.com/raimon49/pip-licenses)
3439
- Gradle : [License Gradle Plugin](https://github.com/hierynomus/license-gradle-plugin)
@@ -40,44 +45,83 @@ FOSSLight Dependency는 다른 오픈소스 소프트웨어를 이용하여 여
4045
<br>
4146

4247
## 📋 Prerequisite
48+
4349
### NPM
50+
4451
1. Npm dependency 분석을 수행하기 위해 NPM License Checker를 설치합니다.
52+
4553
```
4654
$ npm install -g license-checker
4755
```
56+
4857
2. dependency를 설치하기 위해 다음 명령어를 실행합니다. (optional)
58+
4959
```
5060
$ npm install
5161
```
62+
5263
> - package.json 파일이 input directory에 존재하는 경우, 해당 명령어 실행은 FOSSLight dependency에서 자동으로 수행하므로 skip 가능합니다.
5364
> - 이미 dependency들이 설치된 node_modules 디렉토리가 존재하는 경우, node_modules폴더가 존재하는 path를 input directory로 설정하여 실행 가능합니다.
5465
5566
<br>
5667

5768
### Gradle
69+
5870
1. 'build.gradle' 파일에 License Gradle Plugin을 추가합니다.
71+
5972
```
6073
plugins {
6174
id 'com.github.hierynomus.license' version '0.15.0'
6275
}
63-
76+
6477
downloadLicenses {
6578
includeProjectDependencies = true
6679
dependencyConfiguration = 'runtimeClasspath'
6780
}
6881
```
82+
6983
> - 사용하는 gradle 버전이 4.6 또는 더 낮은 버전인 경우에는, dependencyConfiguration에 'runtimeClasspath' 대신 'runtime'을 추가합니다.
7084
7185
2. 'downloadLicenses' task를 실행합니다.
86+
7287
```
7388
$ gradle downloadLicenses
7489
```
7590

7691
<br>
7792

93+
### Android (gradle)
94+
95+
1. 'build.gradle' 파일에 Android License Plugin을 추가합니다.
96+
97+
```
98+
buildscript {
99+
repositories {
100+
jcenter()
101+
}
102+
103+
dependencies {
104+
classpath 'com.lge.android.licensetools:dependency-scanning-tool:0.4.0'
105+
}
106+
}
107+
108+
apply plugin: 'com.lge.android.licensetools'
109+
```
110+
111+
2. 'generateLicenseTxt' task를 실행합니다.
112+
113+
```
114+
$ gradle generateLicenseTxt
115+
```
116+
117+
<br>
118+
78119
### Pypi
120+
79121
시스템 내 전역으로 설치된 파이썬 dependency로부터 분석하고자 하는 프로젝트 dependency를 분리하기 위해 가상환경을 설정하여 이용하기를 권장합니다.
122+
80123
1. 가상환경을 생성하고 활성화합니다.
124+
81125
```
82126
// virtualenv example
83127
$ virtualenv -p /usr/bin/python3.6 venv
@@ -87,7 +131,9 @@ $ source venv/bin/activate
87131
$ conda create --name {venv name}
88132
$ conda activate {venv name}
89133
```
134+
90135
2. 가상환경 내 분석하고자 하는 프로젝트의 dependency를 설치합니다.
136+
91137
```
92138
// If you install the dependencies with requirements.txt...
93139
$ pip install -r requirements.txt
@@ -96,8 +142,11 @@ $ pip install -r requirements.txt
96142
<br>
97143

98144
### Maven (optional)
145+
99146
> - Maven의 경우, input directory에 pom.xml 파일이 존재하는 경우, plugin 추가 및 실행을 FOSSLight dependency 내부에서 자동으로 수행하므로 다음은 skip하셔도 됩니다.
147+
100148
1. pom.xml 파일에 license-maven-plugin을 추가합니다.
149+
101150
```
102151
<project>
103152
...
@@ -124,15 +173,19 @@ $ pip install -r requirements.txt
124173
...
125174
</project>
126175
```
176+
127177
2. license-maven-plugin task를 실행합니다.
178+
128179
```
129180
$ mvn license:aggregate-download-licenses
130181
```
131182

132183
<br>
133184

134185
### Pub
186+
135187
1. 다음 명령어를 통해 flutter_oss_licenses를 실행합니다.
188+
136189
```
137190
$ flutter pub get
138191
$ flutter pub global activate flutter_oss_licenses
@@ -142,66 +195,77 @@ $ flutter pub global run flutter_oss_licenses:generate.dart
142195
<br>
143196

144197
### Cocoapods
198+
145199
1. Podfile을 통해 pod package를 설치합니다.
200+
146201
```
147202
$ pod install
148203
```
149204

150205
<br>
151206

152207
## 🎉 How to install
208+
153209
FOSSLight Dependency는 Python3.6+ 환경에서 설치할 것을 권장합니다.
210+
154211
### From pip
212+
155213
```
156214
$ pip install fosslight-dependency
157215
```
216+
158217
### From source code
218+
159219
```
160220
$ git clone https://github.com/fosslight/fosslight_dependency.git
161221
$ cd fosslight_dependency
162-
$ python setup.py install
222+
$ pip install .
163223
```
164224

165225
<br>
166226

167227
## 🚀 How to run
228+
168229
FOSSLight Dependency는 패키지 매니저에 따라 다음 option들을 이용하여 실행할 수 있습니다.
230+
169231
```
170232
$ fosslight_dependency
171233
```
172-
| Option | Argument | Description |
173-
| ------ | ------------- | ----------- |
174-
| -m | npm, maven, gradle, pip, pub, cocoapods | (optional) <br> 프로젝트의 package manager |
175-
| -p | (path) |(optional) <br> 분석하고자 하는 input directory |
176-
| -o | (path) |(optional) <br> 결과 파일이 생성되는 output directory |
177-
| -a | conda example: 'conda activate (venv name)' |(pypi only required) <br> 가상환경 activate command |
178-
| -d | conda example: 'conda deactivate' |(pypi only required) <br> 가상환경 deactivate command |
179-
| -c | (customized output directory name) |(gradle, maven only optional) <br> 커스터마이즈한 build output directory명 (default: target) |
180-
| -v | N/A | release 버전 |
234+
235+
| Option | Argument | Description |
236+
| ------ | ------------------------------------------- | -------------------------------------------------------------------------------------------- |
237+
| -m | npm, maven, gradle, pip, pub, cocoapods | (optional) <br> 프로젝트의 package manager |
238+
| -p | (path) | (optional) <br> 분석하고자 하는 input directory |
239+
| -o | (path) | (optional) <br> 결과 파일이 생성되는 output directory |
240+
| -a | conda example: 'conda activate (venv name)' | (pypi only required) <br> 가상환경 activate command |
241+
| -d | conda example: 'conda deactivate' | (pypi only required) <br> 가상환경 deactivate command |
242+
| -c | (customized output directory name) | (gradle, maven only optional) <br> 커스터마이즈한 build output directory명 (default: target) |
243+
| -n | (app name) | (android only optional) <br> app directory name (default: app) |
244+
| -v | N/A | release 버전 |
181245

182246
이때, FOSSLight Dependency는 패키지 매니저의 manifest 파일이 존재하는 프로젝트의 top directory에서 실행되어야 합니다.
183247
예를 들면, NPM 패키지 매니저를 이용하는 프로젝트의 경우, input directory는 'package.json' 파일이 존재하는 directory여야 합니다.
184248
각 패키지 매니저별 manifest 파일은 다음과 같습니다.
185249

186-
| Package manager | Npm | Pip | Maven | Gradle | Pub | Cocoapods |
187-
| --------------- | ------------ | ---------------- | ------- | ------------ | ------------ | --------- |
188-
| Manifest file | package.json | requirements.txt | pom.xml | build.gradle | pubspec.yaml | Podfile |
250+
| Package manager | Npm | Pip | Maven | Gradle | Pub | Cocoapods | Android |
251+
| --------------- | ------------ | ---------------- | ------- | ------------ | ------------ | --------- | ------- |
252+
| Manifest file | package.json | requirements.txt | pom.xml | build.gradle | pubspec.yaml | Podfile | gradlew |
189253

190254
즉, FOSSLight Dependency 실행 시, input directory('-p' 옵션)는 위와 같이 패키지 매니저의 manifest 파일이 존재하는 프로젝트의 top directory로 지정해 주어야 합니다.
191-
255+
Android 프로젝트의 실제 manifest file은 다른 gradle 프로젝트와 동일한 'build.gradle' 파일이지만, 다른 java 프로젝트와 구별하기 위해 gradlew 파일로 지정하였습니다.
192256
<br>
193257

194258
## 📁 Result
259+
195260
FOSSLight Dependency는 xlsx(Microsoft Excel file)양식의 결과 파일을 생성합니다.
196261

197262
결과 파일에는 transitive dependency들을 포함한 모든 분석된 dependency들의 manifest 파일을 기반으로 OSS 정보가 기록됩니다.
198263
이때, 고유한 OSS명을 작성하기 위해, OSS명은 (패키지 매니저):(OSS명) 또는 (group id):(artifact id) 양식으로 기록됩니다.
199264

200-
| Package manager | OSS Name | Download Location | Homepage |
201-
| --------------- | ------------------ | ----------------- | -------- |
202-
| Npm | npm:(oss name) | 우선순위1. repository in package.json <br> 우선순위2. npmjs.com/package/(oss name)/v/(oss version) | npmjs.com/package/(oss name) |
203-
| Pip | pypi:(oss name) | pypi.org/project/(oss name)/(version) | homepage in (pip show) information |
204-
| Maven<br>& Gradle | (group_id):(artifact_id) | mvnrepository.com/artifact/(group id)/(artifact id)/(version) | mvnrepository.com/artifact/(group id)/(artifact id) |
205-
| Pub | pub:(oss name) | pub.dev/packages/(oss name)/versions/(version) | homepage in (pub information) |
206-
| Cocoapods | cocoapods:(oss name) | source in (pod spec information) | cocoapods.org/(oss name) |
207-
265+
| Package manager | OSS Name | Download Location | Homepage |
266+
| ------------------------------ | ------------------------ | -------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
267+
| Npm | npm:(oss name) | 우선순위1. repository in package.json <br> 우선순위2. npmjs.com/package/(oss name)/v/(oss version) | npmjs.com/package/(oss name) |
268+
| Pip | pypi:(oss name) | pypi.org/project/(oss name)/(version) | homepage in (pip show) information |
269+
| Maven<br>& Gradle<br>& Android | (group_id):(artifact_id) | mvnrepository.com/artifact/(group id)/(artifact id)/(version) | mvnrepository.com/artifact/(group id)/(artifact id) |
270+
| Pub | pub:(oss name) | pub.dev/packages/(oss name)/versions/(version) | homepage in (pub information) |
271+
| Cocoapods | cocoapods:(oss name) | source in (pod spec information) | cocoapods.org/(oss name) |

0 commit comments

Comments
 (0)