Skip to content

Gradle Plugin DSL to change the generated Res class name#5296

Merged
Konstantin (terrakok) merged 1 commit into
masterfrom
res-customization
May 6, 2025
Merged

Gradle Plugin DSL to change the generated Res class name#5296
Konstantin (terrakok) merged 1 commit into
masterfrom
res-customization

Conversation

@terrakok

@terrakok Konstantin (terrakok) commented Apr 23, 2025

Copy link
Copy Markdown
Member

Gradle Plugin DSL to change the generated Res class name:

compose.resources {
    nameOfResClass = "MyRes"
}

Fixes CMP-7341 Support generating custom resource class name

Testing

Integration tests.

Release Notes

Features - Resources

  • Gradle Plugin DSL to change the generated Res class name

@igordmn

Copy link
Copy Markdown
Collaborator

Requires 2 approvals, as this is new API in Gradle plugin

abstract val packageName: Property<String>

@get:Input
abstract val resClassName: Property<String>

@igordmn Igor Demin (igordmn) Apr 29, 2025

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we name it just className? To be consistent with packageName and to avoid double wording in resources { res... =

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't think so, because it changes the Res class name only.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

for the consistency I'll rename it to nameOfResClass

@igordmn

Copy link
Copy Markdown
Collaborator

Please, also fix the new failing check.

@terrakok Konstantin (terrakok) merged commit 3c531dd into master May 6, 2025
12 of 14 checks passed
@terrakok Konstantin (terrakok) deleted the res-customization branch May 6, 2025 13:23
Konstantin (terrakok) added a commit that referenced this pull request May 9, 2025
Gradle Plugin DSL to change the generated Res class name:

```kotlin
compose.resources {
    nameOfResClass = "MyRes"
}
```

Fixes [CMP-7341](https://youtrack.jetbrains.com/issue/CMP-7341) Support
generating custom resource class name
## Testing
Integration tests.

## Release Notes
### Features - Resources
- Gradle Plugin DSL to change the generated Res class name

Co-authored-by: Omico <me@omico.icu>
(cherry picked from commit 3c531dd)
Vlad Konstantinov (Kpotko) pushed a commit that referenced this pull request May 9, 2025
Gradle Plugin DSL to change the generated Res class name:

```kotlin
compose.resources {
    nameOfResClass = "MyRes"
}
```

Fixes [CMP-7341](https://youtrack.jetbrains.com/issue/CMP-7341) Support
generating custom resource class name
## Testing
Integration tests.

## Release Notes
### Features - Resources
- Gradle Plugin DSL to change the generated Res class name

Co-authored-by: Omico <me@omico.icu>
(cherry picked from commit 3c531dd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants