Optional generation of Images extension. Make extensionOutputPath optional for Images and Colors cause it's not needed if no extensionName are provided

This commit is contained in:
2025-07-17 10:23:05 +02:00
parent 4426091dcb
commit e22f9ba894
12 changed files with 132 additions and 97 deletions

View File

@@ -54,12 +54,13 @@ swift run -c release ResgenSwift colors $FORCE_FLAG "./Colors/colors.txt" \
1. `-f`: force generation
2. Input colors file
3. `--style` can be `all` or `light`
4. `--extension-output-path`: path where to generate generated extension
4. `--extension-output-path` *(optional)* : path where to generate generated extension
5. `--extension-name` *(optional)* : name of the class to add SwiftUI getters
6. `--extension-name-ui-kit` *(optional)* : name of the class to add UIKit getters
7. `--extension-suffix` *(optional)* : additional text which is added to filename (ex: `AppColor+GreatApp.swift`)
8. `--static-members` *(optional)*: generate static properties or not
> ⚠️ Passing a `extensionOutputPath` without any `extensionName` does not generate extension. **But** passing an `extensionName` without `extensionOutputPath` will result in a error.
## Strings
@@ -266,7 +267,7 @@ events:
## Images
Images generator will generate images assets along with extensions to access those images easily.
Images generator will generate images assets along with extensions to access those images easily. If the extension name is not specified, no extension will be generated.
```sh
swift run -c release ResgenSwift images $FORCE_FLAG "./Images/images.txt" \
@@ -283,12 +284,13 @@ swift run -c release ResgenSwift images $FORCE_FLAG "./Images/images.txt" \
1. `-f`: force generation
2. Input images definitions file
3. `--xcassets-path`: xcasset path where to generate imagesets
4. `--extension-output-path`: path where to generate generated extension
4. `--extension-output-path` *(optional)* : path where to generate generated extension
5. `--extension-name` *(optional)* : name of the class to add SwiftUI getters
6. `--extension-name-ui-kit` *(optional)* : name of the class to add UIKit getters
6. `--extension-suffix` *(optional)* : additional text which is added to filename (ex: `AppImage+GreatApp.swift`)
7. `--static-members` *(optional)*: generate static properties or not
> ⚠️ Passing a `extensionOutputPath` without any `extensionName` does not generate extension. **But** passing an `extensionName` without `extensionOutputPath` will result in a error.
> ⚠️ Svg images will be copied in the assets and rendered as "Original", however if those images are not rendered correctly you can force the png generation by adding the key word "png" like this: id arrow_back 15 ? png
## All at once