Skip to content

Conversation

@terrakok
Copy link
Member

@terrakok terrakok commented Apr 23, 2025

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
Collaborator

igordmn commented Apr 29, 2025

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

abstract val packageName: Property<String>

@get:Input
abstract val resClassName: Property<String>
Copy link
Collaborator

@igordmn igordmn Apr 29, 2025

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
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
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
Collaborator

igordmn commented Apr 29, 2025

Please, also fix the new failing check.

@terrakok terrakok force-pushed the res-customization branch from 99d2ff0 to ec241c1 Compare May 6, 2025 12:13
@terrakok terrakok merged commit 3c531dd into master May 6, 2025
12 of 14 checks passed
@terrakok terrakok deleted the res-customization branch May 6, 2025 13:23
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)
@terrakok terrakok mentioned this pull request May 9, 2025
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.

5 participants