This is an automated email from the ASF dual-hosted git repository.
jin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph-doc.git
The following commit(s) were added to refs/heads/master by this push:
new d62608a1 apache: how to add 3rd-party dependency in project (#263)
d62608a1 is described below
commit d62608a11d20788e4e87f506dcb7a64c479c5303
Author: Simon Cheung <[email protected]>
AuthorDate: Mon Jun 26 14:59:53 2023 +0800
apache: how to add 3rd-party dependency in project (#263)
* Update contribute.md
---------
Co-authored-by: imbajin <[email protected]>
---
content/cn/docs/contribution-guidelines/contribute.md | 15 +++++++++++++++
content/en/docs/contribution-guidelines/contribute.md | 14 ++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/content/cn/docs/contribution-guidelines/contribute.md
b/content/cn/docs/contribution-guidelines/contribute.md
index 40bee9b3..058d459f 100644
--- a/content/cn/docs/contribution-guidelines/contribute.md
+++ b/content/cn/docs/contribution-guidelines/contribute.md
@@ -76,6 +76,21 @@ mvn test -Pcore-test,memory
```
Note: In order to be consistent with the code style easily, if you use
[IDEA](https://www.jetbrains.com/idea/) as your IDE, you can directly
[import](https://www.jetbrains.com/help/idea/configuring-code-style.html) our
code style [configuration file](./hugegraph-style.xml).
+##### 3.2.1 添加第三方依赖
+
+如果我们要在 `HugeGraph` 项目中添加新的第三方依赖, 我们需要做下面的几件事情:
+1. 找到第三方依赖的仓库,将依赖的 `license` 文件放到
[./hugegraph-dist/release-docs/licenses/](https://github.com/apache/incubator-hugegraph/tree/master/hugegraph-dist/release-docs/licenses)
路径下。
+2.
在[./hugegraph-dist/release-docs/LICENSE](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/release-docs/LICENSE)
中声明该依赖的 `LICENSE` 信息。
+3. 找到仓库里的 NOTICE 文件,将其追加到
[./hugegraph-dist/release-docs/NOTICE](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/release-docs/NOTICE)
文件后面(如果没有NOTICE文件则跳过这一步)。
+4.
本地执行[./hugegraph-dist/scripts/dependency/regenerate_known_dependencies.sh](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/scripts/dependency/regenerate_known_dependencies.sh)
脚本来更新依赖列表[known-dependencies.txt](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/scripts/dependency/known-dependencies.txt)
(或者手动更新)。
+
+**例如**:在项目中引入了第三方新依赖 -> `ant-1.9.1.jar`
+- 项目源码位于:https://github.com/apache/ant/tree/rel/1.9.1
+- LICENSE 文件:https://github.com/apache/ant/blob/rel/1.9.1/LICENSE
+- NOTICE 文件:https://github.com/apache/ant/blob/rel/1.9.1/NOTICE
+
+`ant-1.9.1.jar` 的 license 信息需要在 LICENSE 文件中指定,notice 信息需要在 NOTICE 文件中指定。
ant-1.9.1.jar 对应的详细 LICENSE 文件需要复制到我们的 licenses/ 目录下。最后更新
known-dependencies.txt 文件。
+
#### 3.3 Commit changes to git repo
After the code has been completed, we submit them to the local git repo:
diff --git a/content/en/docs/contribution-guidelines/contribute.md
b/content/en/docs/contribution-guidelines/contribute.md
index 8363b52a..7e10d56f 100644
--- a/content/en/docs/contribution-guidelines/contribute.md
+++ b/content/en/docs/contribution-guidelines/contribute.md
@@ -74,6 +74,20 @@ mvn test -Pcore-test,memory
```
Note: In order to be consistent with the code style easily, if you use
[IDEA](https://www.jetbrains.com/idea/) as your IDE, you can directly
[import](https://www.jetbrains.com/help/idea/configuring-code-style.html) our
code style [configuration file](./hugegraph-style.xml).
+##### 3.2.1 Check licenses
+If we want to add new third-party dependencies to the `HugeGraph` project, we
need to do the following things:
+1. Find the third-party dependent repository, put the dependent `license` file
into
[./hugegraph-dist/release-docs/licenses/](https://github.com/apache/incubator-hugegraph/tree/master/hugegraph-dist/release-docs/licenses)
path.
+2. Declare the dependency in
[./hugegraph-dist/release-docs/LICENSE](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/release-docs/LICENSE)
`LICENSE` information.
+3. Find the NOTICE file in the repository and append it to
[./hugegraph-dist/release-docs/NOTICE](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/release-docs/NOTICE)
file (skip this step if there is no NOTICE file).
+4. Execute locally
[./hugegraph-dist/scripts/dependency/regenerate_known_dependencies.sh](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/scripts/dependency/regenerate_known_dependencies.sh)
to update the dependency list
[known-dependencies.txt](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-dist/scripts/dependency/known-dependencies.txt)
(or manually update) .
+
+**Example**: A new third-party dependency is introduced into the project ->
`ant-1.9.1.jar`
+- The project source code is located at:
https://github.com/apache/ant/tree/rel/1.9.1
+- LICENSE file: https://github.com/apache/ant/blob/rel/1.9.1/LICENSE
+- NOTICE file: https://github.com/apache/ant/blob/rel/1.9.1/NOTICE
+
+The license information of `ant-1.9.1.jar` needs to be specified in the
LICENSE file, and the notice information needs to be specified in the NOTICE
file. The detailed LICENSE file corresponding to ant-1.9.1.jar needs to be
copied to our licenses/ directory. Finally update the known-dependencies.txt
file.
+
#### 3.3 Commit changes to git repo
After the code has been completed, we submit them to the local git repo: