Skip to content

Commit 9d7bb8c

Browse files
authored
Merge pull request #14758 from apache/documentation-updates
2 parents 7b5c671 + 16faa88 commit 9d7bb8c

File tree

16 files changed

+441
-169
lines changed

16 files changed

+441
-169
lines changed

.github/workflows/gradle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
name: "Java CI"
16+
name: "CI"
1717
on:
1818
push:
1919
branches:

CODE_OF_CONDUCT.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Code of Conduct
2+
3+
Apache Grails (Incubating) follows the ASF [Code of
4+
Conduct](https://www.apache.org/foundation/policies/conduct).
5+
6+
If you observe behavior that violates those rules please follow the
7+
[ASF reporting
8+
guidelines](https://www.apache.org/foundation/policies/conduct#reporting-guidelines).

CONTRIBUTING.md

Lines changed: 59 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ All types of contributions are encouraged and valued. See the [Table of Contents
2525

2626
> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
2727
> - Star the project
28-
> - Tweet about it
28+
> - Talk about it on Social Media
2929
> - Refer to this project in your project's readme
3030
> - Mention the project at local meetups and tell your friends/colleagues
31-
> - [Donate](https://opencollective.com/friends-of-grails) to the Friends of Grails initiative so others can work on the project.
31+
> - As an independent initiative, community members have set up an open collective for Apache Grails - https://opencollective.com/friends-of-grails. This initiative is designed to complement the Apache project and the many contributions we get from our great community and supporters.
3232
3333
<!-- omit in toc -->
3434
## Table of Contents
@@ -68,7 +68,8 @@ If you then still feel the need to ask a question and need clarification, we rec
6868
## I Want to Contribute
6969

7070
> ### Legal Notice <!-- omit in toc -->
71-
> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license. All committers must sign the project's CLA. More detailed requirements are available in the project's [CLA](https://cla-assistant.io/apache/grails-core).
71+
> When contributing to this project, you must agree that you have authored 100% of the content, that you have the
72+
> necessary rights to the content and that the content you contribute may be provided under the project license.
7273
7374
### Reporting Bugs
7475

@@ -142,23 +143,44 @@ One of the benefits of [GitHub](http://github.com) is the way that you can easil
142143
If you're interested in contributing fixes and features to any part of grails, you will have to learn how to get hold of the project's source, build it and test it with your own applications. Before you start, make sure you have:
143144

144145
* A git client
145-
* An Editor such as [IntelliJ](https://www.jetbrains.com/idea/).
146+
* An Editor such as [IntelliJ](https://www.jetbrains.com/idea/)
147+
* A JDK (17 or higher)
148+
* A container runtime
146149

147-
Once you have the pre-requisite packages installed, the next step is to download the Grails source code, which is hosted at [GitHub](http://github.com) in several repositories owned by the ["grails" GitHub user](http://github.com/grails). This is a simple case of cloning the repository you're interested in. For example, to get the core framework run:
150+
Once you have the pre-requisite packages installed, the next step is to download the Apache Grails source code, which is
151+
hosted at [GitHub](http://github.com/apache/grails-core). This is a simple case of cloning the repository you're
152+
interested in. For example, to get the core framework run:
148153

149154
git clone http://github.com/apache/grails-core.git
150155

151-
This will create a `grails-core` directory in your current working directory containing all the project source files. The next step is setting up the JDK to use. Grails makes use of [SDKMAN!](https://sdkman.io/) for easy JDK setup. Each Grails project should have a `.sdkmanrc` in it's root directory. Change to the `grails-core` directory and install the preferred JDK by issuing the command:
156+
This will create a `grails-core` directory in your current working directory containing all the project source files.
157+
The next step is setting up the JDK to use. Grails makes use of [SDKMAN!](https://sdkman.io/) for easy JDK setup. Each
158+
Grails project should have a `.sdkmanrc` in it's root directory. Change to the `grails-core` directory and install the
159+
preferred JDK by issuing the command:
152160

153161
sdk env .
154162

163+
##### 3. Building the Code
164+
165+
To build the code, without tests, simply run:
166+
167+
./gradlew build -PskipTests
168+
169+
If you encounter out of memory errors when trying to run the build, try adjusting Gradle build settings. For example:
170+
171+
export GRADLE_OPTS="-Xmx2G -Xms2G -XX:NewSize=512m -XX:MaxNewSize=512m"
172+
173+
Please note that a valid container runtime is required to run Grails Tests. The example above omits the tests so the
174+
build will pass.
175+
155176
<!-- omit in toc -->
156177
#### Testing Your Change
157-
Grails has both local test coverage in the form of `unit` and `integration` tests.
158178

159-
To run the full suite of tests in `grails-core` execute:
179+
Grails has test coverage in the form of `unit`, `integration`, and `functional` tests.
160180

161-
./gradlew check
181+
To force a full run of the full suite of tests in `grails-core` execute:
182+
183+
./gradlew build --rerun-tasks
162184

163185
Check the test results & verify that the build completes successfully.
164186

@@ -170,10 +192,13 @@ Sometimes it's useful to debug your local application to see what's going wrong.
170192
By default, Grails forks a JVM to run the application. The `-debug-jvm` argument causes the debugger to be associated with the forked JVM. You can then attach your debugger as proceed as normal.
171193

172194
### Improving The Documentation
173-
There are many aspects to [Grail's documentation](https://grails.org/documentation.html):
195+
196+
There are many aspects to [Grail's documentation](https://docs.grails.org/)
174197
- [API](https://docs.grails.org/latest/api/) documentation in the code itself via javadoc & groovydoc.
175-
- [The Grails User Guide](https://docs.grails.org/6.2.1/guide/single.html) from the [grails-doc](https://github.com/apache/grails-doc) project.
176-
- Various how-to [Guides](https://guides.grails.org/index.html) from the [grails-guides](https://github.com/grails/grails-guides) project.
198+
- [The Grails User Guide](https://docs.grails.org/latest/guide/single.html) from the `grails-doc` project in this
199+
repository.
200+
- Various how-to [Guides](https://guides.grails.org/index.html) from
201+
the [grails-guides](https://github.com/grails-guides) Organization.
177202

178203
<!-- omit in toc -->
179204
#### <u>Improving the User Guide</u>
@@ -183,12 +208,10 @@ This will link to the GitHub edit screen where you can make changes, preview the
183208

184209
<!-- omit in toc -->
185210
#### <u>Building the Guide</u>
186-
If you want to make significant changes, such as changing the structure of the table of contents etc. then we recommend you build the user guide. To do that simply checkout the sources from GitHub:
187-
188-
$ git clone https://github.com/apache/grails-doc/
189-
$ cd grails-doc
190211

191-
The source files can be found in the `src/en/guide` directory. Whilst the Table of Contents (TOC) is defined in the `src/en/guide/toc.yml` file.
212+
If you want to make significant changes, such as changing the structure of the table of contents etc. then we recommend
213+
you build the user guide. The source files can be found in the `grails-doc/src/en/guide` directory. Whilst the Table of
214+
Contents (TOC) is defined in the `grails-doc/src/en/guide/toc.yml` file.
192215

193216
Each YAML key points to a Asciidoc template. For example consider the following YAML:
194217

@@ -198,27 +221,39 @@ Each YAML key points to a Asciidoc template. For example consider the following
198221
title: What's new in Grails 3.2?
199222
...
200223

201-
The `introduction` key points to `src/en/guide/introduction.adoc`. The `title` key defines the title that is dislayed in the TOC. Because `whatsNew` key is nested underneath the `introduction` key it points to `src/en/guide/introduction/whatsNew.adoc`, which is nested in a directory called `introduction`.
224+
The `introduction` key points to `grails-doc/src/en/guide/introduction.adoc`. The `title` key defines the title that is
225+
dislayed in the TOC. Because `whatsNew` key is nested underneath the `introduction` key it points to
226+
`grails-doc/src/en/guide/introduction/whatsNew.adoc`, which is nested in a directory called `introduction`.
202227

203228
Essentially, using the `toc.yml` file and the directory structure you can manipulate the structure of the user guide.
204229

205-
To generate the documentation run the `publishGuide` task:
230+
To generate the documentation run the `publishGuide` in the `grails-doc` task:
206231

207-
./gradlew publishGuide -x apiDocs
232+
./gradlew :grails-doc:publishGuide -x aggregateGroovydoc
208233

209-
NOTE: In the above example we skip the `apiDocs` task to speed up building of the guide, otherwise all Groovydoc documentation will be built too!
234+
NOTE: In the above example we skip the `aggregateGroovydoc` task to speed up building of the guide, otherwise all
235+
Groovydoc documentation will be built too!
210236

211-
Once the guide is built simply open the `build/docs/index.html` file in a browser to review your changes.
237+
Once the guide is built simply open the `grails-doc/build/original-guide/index.html` file in a browser to review your
238+
changes.
212239

213240
## Code Style
214241

215242
Grails code style mostly mirrors the Spring Framework's [Style Guide](https://github.com/spring-projects/spring-framework/blob/main/CONTRIBUTING.md#source-code-style). We are currently working on a more detailed proposal under ticket [#13754](https://github.com/apache/grails-core/issues/13754).
216243

217244
### Commit Messages
218-
Grails makes use of [Release Drafter](https://github.com/release-drafter/release-drafter) to draft its release notes so commit messages are important. They should follow the project's rules. While a change can be incrementally made under many commits, pull requests should be squashed into a single, meaningful commit message.
245+
246+
Grails makes use of [Release Drafter](https://github.com/release-drafter/release-drafter) to draft its release notes so
247+
commit messages are important. They should follow the project's rules. While a change can be incrementally made under
248+
many commits, pull requests should be squashed into a single, meaningful commit message.
219249

220250
### Change Review Process
221-
The Grails project uses different review processes based on the change being made. We use both a `Review then Commit` policy and a `Commit then Review` policy. These policies only apply to what we consider `protected` branches - where a `protected` branch is a branch that will result in published code or tracks a Grails release version (i.e. 7.0.x is for the Grails 7 release). Development will often occur in side branches without review and the review will be performed at the time of merging those changes into a `protected` branch.
251+
252+
The Apache Grails project uses different review processes based on the change being made. We use both a
253+
`Review then Commit` policy and a `Commit then Review` policy. These policies only apply to what we consider `protected`
254+
branches - where a `protected` branch is a branch that will result in published code or tracks an Apache Grails release
255+
version (i.e. 7.0.x is for the Apache Grails 7 release). Development will often occur in side branches without review
256+
and the review will be performed at the time of merging those changes into a `protected` branch.
222257

223258
Concerning when a review is required for a `protected` branch:
224259
* Build Related Changes - `Commit then Review`

0 commit comments

Comments
 (0)