Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ch.32): Close #17: Gradle Cheatsheet #71

Open
wants to merge 4 commits into
base: bleeding
Choose a base branch
from
Open

Conversation

3TUSK
Copy link
Member

@3TUSK 3TUSK commented Apr 24, 2020

Synopsis / 简介

Close #17.

Description / 详细说明

收集一堆 Mod 开发时常用的 Gradle 脚本片段。

Justification / 理由

「Harbinger 写了吗?」—— @exzhawk

实际上新人遇到的 Gradle 问题真的不少。特此开一章整理。顺手 Close #17

大部分内容可以无缝迁移到 Sputnik。

Remarks / 备注

谁在帮我挖坑?!

@3TUSK 3TUSK added Type: New Content Requesting new contents. This also applies to Pull Request. Status: Work In Progress Actions has been taken, please stand by. labels Apr 24, 2020
@Snownee Snownee removed their request for review April 24, 2020 09:42
@Snownee
Copy link
Contributor

Snownee commented Apr 24, 2020

对此一窍不通,让我来实在不合适

dependencies {
// Efficient Java Matrix Library (EJML) 是个专门解决线性代数相关问题的库。
// 网站:http://ejml.org/
compile 'org.ejml:all:0.30'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在?为什么我 idea 里运行没问题,打包成 jar 传服务器启动就会报 NoClassDefFound ?有没有大佬知道怎么解决?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

32 章 -> 构建与发布 -> Shadow/Shade。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

还没写,而且建议这里加个 referer 过去(

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already planned.

Copy link
Contributor

@Yesterday17 Yesterday17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rua


## 引入新的依赖项目

[和普通的基于 Gradle 的 Java 项目完全一致][ref-1]。就像这样:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

和基于 Gradle 的普通 Java 项目完全一致

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

少点 '的' 看起来会舒服一点(


```groovy
repositories {
// 我们在这里声明阿里云的 maven 镜像站。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

句号


Gradle 的存在让我们可以直接一行 `gradle build` 命令就能搞定编译(甚至是发布)而不用头疼别的什么。

而这一章附录则收录一些在使用 Gradle 甚至是 ForgeGradle 时会遇到的常见需求解决方案。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

语境下没有 "甚至" 的递进关系,改为 "或是" 或许更恰当。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

或者写成 (Forge)Gradle ?(

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmmmmmmmm

@@ -2,6 +2,8 @@

ForgeGradle 是 Forge 开发团队推出的 Gradle 插件,主要用途就是简化基于 MCP+Forge 的 Minecraft Mod 开发的流程。

如果你还不知道 Gradle 是什么,[可以考虑先读一下这个](../chapter-32/index.md)。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以考虑先读一下[这个](../chapter-32/index.md)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Work In Progress Actions has been taken, please stand by. Type: New Content Requesting new contents. This also applies to Pull Request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New Content Request] 如何编写构建脚本
4 participants