apache / apache/grails-core

Way to have custom build.gradle in custom profiles

Open
#11,019 1 comment 0 reactions 0 assignees View on GitHub
type: enhancement
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

Thanks for reporting an issue for Grails framework, please review the task list below before submitting the
issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed.

NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (http://stackoverflow.com/tags/grails) or Slack (http://slack-signup.grails.org). DO NOT use the issue tracker to ask questions.

### Task List

- [x] Steps to reproduce provided
- [] Stacktrace (if present) provided
- [] Example that reproduces the problem uploaded to Github
- [x] Full description of the issue provided (see below)

### Steps to Reproduce

1. Create custom profile with custom build.gradle that extends for example "plugin" -profile
2. Create for example plugin with the custom profile

### Expected Behaviour

I would like to have custom build.gradle in my profile that extends another profile.

For example if I extend "base" and "plugin" -profiles then the "plugin" -pfofiles build.gradle is concatenated with "base" -profiles build.gradle and then my profiles build.gradle is concatenated to that result. I would like to just have my own build.gradle with no concatenation.

It would be nice to use the feature that already exists, but it does not work for the build.gradle because there is custom code for handling those.

https://github.com/grails/grails-core/blob/master/grails-shell/src/main/groovy/org/grails/cli/profile/commands/CreateAppCommand.groovy

```
skeleton:
excludes:
- build.gradle
```

I have not checked but mayby this same behaviour is true also for application.yml

### Actual Behaviour

build.gradle files are now concatenated and there is no way to just have custom build.gradle in my profile.

Contributor guide

Open the contributing guide

Research direction

Start with grails-shell/src/main/groovy/org/grails/cli/profile/commands/CreateAppCommand.groovy, especially the profile skeleton handling and the build.gradle exclusion. Trace how build.gradle files are combined when a custom profile extends other profiles. Done means a custom profile can supply its own build.gradle without concatenation from the extended profiles.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.