Skip to content

Commit 886878f

Browse files
Copilotsbglasius
authored andcommitted
co-pilot suggested changes
* Missing codestyle and codecoverage added, fixing codenarc violations * correct plugin test task path and load project metadata in docs build * allow publish jobs for both grails-plugins and gpc orgs * Potential fix for pull request finding * correct contributor name typo and duplicated wording in docs * correct typo in documentation URL (templatae -> template)
1 parent 0928c4b commit 886878f

24 files changed

Lines changed: 369 additions & 64 deletions

File tree

.github/dependency-graph/external-references.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55

66
version: 1
77
references:
8-
- purl: pkg:maven/io.github.gpc/grails-export
8+
- purl: pkg:maven/io.github.gpc/grails-plugin-template

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
-PskipCodeStyle
6161
publish:
6262
# only run the publishing task on this repo (not on forks)
63-
if: github.repository_owner == 'gpc' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
63+
if: (github.repository_owner == 'grails-plugins' || github.repository_owner == 'gpc') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
6464
needs: build
6565
name: "Publish Snapshot"
6666
runs-on: ubuntu-24.04
@@ -109,7 +109,7 @@ jobs:
109109
GRADLE_PUBLISH_RELEASE: 'false'
110110
SOURCE_FOLDER: build/docs
111111
update-index:
112-
if: github.repository_owner == 'gpc' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
112+
if: (github.repository_owner == 'grails-plugins' || github.repository_owner == 'gpc') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
113113
needs: publish
114114
uses: ./.github/workflows/update-versions.yml
115115
permissions:

.skills/example-apps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Each example app declares the plugin as a regular dependency, just as an externa
2828

2929
```groovy
3030
dependencies {
31-
implementation project(':grails-server-timing')
31+
implementation project(':grails-plugin-template')
3232
}
3333
```
3434

.skills/gradle-best-practices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ plugins {
4848
}
4949
```
5050

51-
The ONLY exception is the `root-publish.gradle` convention plugin, which exists solely as a workaround for a Nexus
51+
The ONLY exception is the `config.publish-root` convention plugin, which exists solely as a workaround for a Nexus
5252
publishing bug (https://github.com/gradle-nexus/publish-plugin/issues/310) that requires version/group to be set at the
5353
root level.
5454

.skills/plugin-project.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,27 @@ plugin/
4141
│ ├── conf/
4242
│ │ ├── application.yml # Plugin-specific config defaults
4343
│ ├── controllers/ # Interceptors, controller-scoped artifacts
44-
│ │ └── org/grails/plugins/servertiming/
45-
│ │ └── ServerTimingInterceptor.groovy
44+
│ │ └── org/grails/plugins/exampleplugin/
45+
│ │ └── ExamplePluginInterceptor.groovy
4646
└── src/
4747
├── main/groovy/ # Core plugin classes
48-
│ └── org/grails/plugins/servertiming/
49-
│ ├── ServerTimingAutoConfiguration.groovy
50-
│ ├── ServerTimingFilter.groovy
51-
│ ├── ServerTimingGrailsPlugin.groovy
52-
│ ├── ServerTimingResponseWrapper.groovy
48+
│ └── org/grails/plugins/exampleplugin/
49+
│ ├── ExamplePluginAutoConfiguration.groovy
50+
│ ├── ExamplePluginFilter.groovy
51+
│ ├── ExamplePluginGrailsPlugin.groovy
52+
│ ├── ExamplePluginResponseWrapper.groovy
5353
│ ├── config/
5454
│ │ ├── EnabledCondition.groovy
55-
│ │ └── ServerTimingConfig.groovy
55+
│ │ └── ExamplePluginConfig.groovy
5656
│ └── core/
5757
│ ├── Metric.groovy
5858
│ └── TimingMetric.groovy
59-
├── main/resources/
59+
├── main/resources/
6060
│ ├── META-INF/spring
6161
│ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports
62-
│ └── spring-configuration-metadata.json
62+
│ └── spring-configuration-metadata.json
6363
└── test/groovy/ # Unit tests ONLY
64-
└── org/grails/plugins/servertiming/
64+
└── org/grails/plugins/exampleplugin/
6565
├── MetricSpec.groovy
6666
└── TimingMetricSpec.groovy
6767
```

.skills/repository-structure.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ flows through convention plugins.
104104
plugins {
105105
id 'idea'
106106
id 'config.docs'
107-
id 'config.root-publish'
107+
id 'config.publish-root'
108108
}
109109
```
110110

@@ -182,7 +182,7 @@ These are available in all subprojects as project properties (`projectVersion`,
182182
./gradlew build
183183

184184
# Plugin unit tests only
185-
./gradlew :export:test
185+
./gradlew :grails-plugin-template:test
186186

187187
# Example app integration tests
188188
./gradlew :app1:integrationTest

CONTRIBUTING.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Thank you for your interest in contributing! This guide will help you get starte
44

55
## Code of Conduct
66

7-
This project has a [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold it. Please report
7+
This project has a Code of Conduct. By participating, you are expected to uphold it. Please report
88
unacceptable behavior to the project maintainers.
99

1010
## Getting Started
@@ -57,7 +57,7 @@ Key architectural rules:
5757
./gradlew build
5858

5959
# Plugin unit tests only
60-
./gradlew :export:test
60+
./gradlew :grails-plugin-template:test
6161

6262
# Integration tests (runs the example app)
6363
./gradlew :app1:integrationTest
@@ -152,8 +152,9 @@ categorize changes in release notes.
152152

153153
## Security Vulnerabilities
154154

155-
If you discover a security vulnerability, **do not open a public issue**. Please see [SECURITY.md](.github/SECURITY.md)
156-
for responsible disclosure instructions.
155+
If you discover a security vulnerability, **do not open a public issue**. Instead, please report it privately to the
156+
project maintainers and include details to help reproduce and assess the issue. Responsible disclosure helps us protect
157+
users while we investigate and prepare a fix.
157158

158159
## License
159160

README.md

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,33 @@
1-
[![Maven Central](https://img.shields.io/maven-central/v/io.github.gpc/grails-export)](https://img.shields.io/maven-central/v/io.github.gpc/grails-export)
2-
[![License](https://img.shields.io/github/license/gpc/grails-export)](https://www.apache.org/licenses/LICENSE-2.0)
3-
[![CI](https://github.com/gpc/grails-export/actions/workflows/ci.yml/badge.svg?event=push)](https://github.com/gpc/grails-export/actions/workflows/ci.yml)
1+
[![Maven Central](https://img.shields.io/maven-central/v/io.github.gpc/grails-plugin-template)](https://central.sonatype.com/artifact/io.github.gpc/grails-plugin-template)
2+
[![License](https://img.shields.io/github/license/grails-plugins/grails-plugin-template)](https://www.apache.org/licenses/LICENSE-2.0)
3+
[![CI](https://github.com/grails-plugins/grails-plugin-template/actions/workflows/ci.yml/badge.svg?event=push)](https://github.com/grails-plugins/grails-plugin-template/actions/workflows/ci.yml)
44

5-
Grails Export Plugin
6-
====================
5+
Grails Plugin Template
6+
======================
77

8-
The official Grails Export Plugin.
8+
A template repository for building Grails plugins with a standardised multi-project structure,
9+
automated CI/CD workflows, and publishing configuration.
910

10-
This plugin offers export functionality supporting different formats e.g. CSV, Excel (xls, xlsx),
11-
Open Document Spreadsheet, PDF and XML and can be extended to add additional formats.
11+
Use this repository as the starting point when creating a new Grails plugin under the
12+
`grails-plugins` or `gpc` organisations. It provides:
1213

13-
The user guide can be found here: 📚 [Documentation]
14+
- Multi-project Gradle build with convention plugins in `build-logic/`
15+
- An example Grails app under `examples/app1/` for integration testing
16+
- Automated dependency updates via Dependabot and Renovate
17+
- GitHub Actions workflows for CI, publishing, release notes, and documentation
1418

15-
This was previously forked from [Nathan Wells]
19+
The user guide can be found here: 📚 [Documentation]
1620

1721
## Installation
1822

1923
Add the following dependency to the `build.gradle` file:
2024

2125
### Grails 7.x
2226

23-
```
24-
dependencies {
25-
implementation("io.github.gpc:grails-export:7.0.0")
26-
}
27-
```
28-
29-
### Grails 5.x - 6.x
30-
31-
```
32-
dependencies {
33-
implementation("org.grails.plugins:export:2.0.0")
34-
}
35-
```
36-
37-
### Grails 3.x - 4.x
38-
39-
```
27+
```groovy
4028
dependencies {
41-
compile("org.grails.plugins:export:2.0.0")
29+
implementation("io.github.gpc:grails-plugin-template:1.0.0")
4230
}
4331
```
4432

45-
[Documentation]: https://gpc.github.io/grails-export/
46-
[Nathan Wells]: https://github.com/nwwells/grails-export
33+
[Documentation]: https://grails-plugins.github.io/grails-plugin-template/
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE suppressions PUBLIC "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
3+
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
4+
<suppressions>
5+
</suppressions>
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
3+
"https://checkstyle.org/dtds/configuration_1_3.dtd">
4+
<module name="Checker">
5+
6+
<!-- Suppressions -->
7+
<module name="SuppressionFilter">
8+
<property name="file" value="${config_loc}/checkstyle-suppressions.xml"/>
9+
</module>
10+
11+
<!-- Root Checks -->
12+
<module name="NewlineAtEndOfFile"/>
13+
<module name="FileTabCharacter"/>
14+
<module name="SuppressWarningsFilter"/>
15+
16+
<!-- TreeWalker Checks -->
17+
<module name="TreeWalker">
18+
19+
<module name="SuppressWarningsHolder"/>
20+
21+
<!-- Imports -->
22+
<module name="AvoidStarImport"/>
23+
<module name="RedundantImport"/>
24+
<module name="UnusedImports">
25+
<property name="processJavadoc" value="false"/>
26+
</module>
27+
<module name="ImportOrderCheck">
28+
<!-- Import groups: JAVA, JAVAX, GROOVY, JAKARTA, OTHER, SPRING, GRAILS, STATIC -->
29+
<property name="groups"
30+
value="java,javax,/^(groovy|org\.apache\.groovy|org\.codehaus\.groovy)\..+/,jakarta,*,/(^io\.spring|org\.springframework)\..+/,/^(grails|org\.apache\.grails|org\.grails)\..+/"/>
31+
<property name="ordered" value="true"/>
32+
<property name="option" value="bottom"/>
33+
<property name="separated" value="true"/>
34+
<property name="sortStaticImportsAlphabetically" value="true"/>
35+
</module>
36+
37+
<!-- Whitespace -->
38+
<module name="CommentsIndentation"/>
39+
<module name="EmptyLineSeparator">
40+
<property name="allowMultipleEmptyLines" value="false"/>
41+
<property name="allowMultipleEmptyLinesInsideClassMembers" value="false"/>
42+
<property name="allowNoEmptyLineBetweenFields" value="true"/>
43+
<property name="tokens"
44+
value="IMPORT, STATIC_IMPORT, CLASS_DEF, INTERFACE_DEF, ENUM_DEF, STATIC_INIT, INSTANCE_INIT, METHOD_DEF, CTOR_DEF, VARIABLE_DEF, RECORD_DEF, COMPACT_CTOR_DEF"/><!-- PACKAGE_DEF removed from defaults -->
45+
</module>
46+
<module name="GenericWhitespace"/>
47+
<module name="Indentation"/>
48+
<module name="NoLineWrap"/>
49+
<module name="MethodParamPad"/>
50+
<module name="NoWhitespaceAfter">
51+
<property name="tokens"
52+
value="AT, INC, DEC, UNARY_MINUS, UNARY_PLUS, BNOT, LNOT, DOT, ARRAY_DECLARATOR, INDEX_OP"/><!-- ARRAY_INIT removed from defaults -->
53+
</module>
54+
<module name="NoWhitespaceBefore"/>
55+
<module name="NoWhitespaceBeforeCaseDefaultColon"/>
56+
<module name="OperatorWrap">
57+
<property name="option" value="eol"/>
58+
</module>
59+
<module name="ParenPad"/>
60+
<module name="SeparatorWrap">
61+
<property name="option" value="nl"/>
62+
<property name="tokens" value="DOT"/>
63+
</module>
64+
<module name="SingleSpaceSeparator"/>
65+
<module name="TypecastParenPad"/>
66+
<module name="WhitespaceAfter"/>
67+
<module name="WhitespaceAround">
68+
<property name="allowEmptyCatches" value="true"/>
69+
<property name="allowEmptyConstructors" value="true"/>
70+
<property name="allowEmptyMethods" value="true"/>
71+
<property name="allowEmptyTypes" value="true"/>
72+
</module>
73+
</module>
74+
75+
</module>

0 commit comments

Comments
 (0)