You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+59-24Lines changed: 59 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -25,10 +25,10 @@ All types of contributions are encouraged and valued. See the [Table of Contents
25
25
26
26
> 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:
27
27
> - Star the project
28
-
> -Tweet about it
28
+
> -Talk about it on Social Media
29
29
> - Refer to this project in your project's readme
30
30
> - 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.
32
32
33
33
<!-- omit in toc -->
34
34
## Table of Contents
@@ -68,7 +68,8 @@ If you then still feel the need to ask a question and need clarification, we rec
68
68
## I Want to Contribute
69
69
70
70
> ### 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.
72
73
73
74
### Reporting Bugs
74
75
@@ -142,23 +143,44 @@ One of the benefits of [GitHub](http://github.com) is the way that you can easil
142
143
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:
143
144
144
145
* 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
146
149
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:
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:
152
160
153
161
sdk env .
154
162
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:
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
+
155
176
<!-- omit in toc -->
156
177
#### Testing Your Change
157
-
Grails has both local test coverage in the form of `unit` and `integration` tests.
158
178
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.
160
180
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
162
184
163
185
Check the test results & verify that the build completes successfully.
164
186
@@ -170,10 +192,13 @@ Sometimes it's useful to debug your local application to see what's going wrong.
170
192
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.
171
193
172
194
### 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/)
174
197
-[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.
177
202
178
203
<!-- omit in toc -->
179
204
#### <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
183
208
184
209
<!-- omit in toc -->
185
210
#### <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
190
211
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.
192
215
193
216
Each YAML key points to a Asciidoc template. For example consider the following YAML:
194
217
@@ -198,27 +221,39 @@ Each YAML key points to a Asciidoc template. For example consider the following
198
221
title: What's new in Grails 3.2?
199
222
...
200
223
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`.
202
227
203
228
Essentially, using the `toc.yml` file and the directory structure you can manipulate the structure of the user guide.
204
229
205
-
To generate the documentation run the `publishGuide` task:
230
+
To generate the documentation run the `publishGuide`in the `grails-doc`task:
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!
210
236
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.
212
239
213
240
## Code Style
214
241
215
242
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).
216
243
217
244
### 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.
219
249
220
250
### 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.
222
257
223
258
Concerning when a review is required for a `protected` branch:
0 commit comments