Fastlane SVG Generator for Xcode SaaS Projects
Managing SVG assets across multiple SaaS projects with unique color and size requirements can be challenging. This project provides a Ruby script using Fastlane to automate the generation and replacement of shared SVG assets, making it easier to keep all projects up-to-date.
- Automated SVG generation for each Xcode project.
- Centralized management of shared icons with color customization.
- Supports dynamic resizing to adapt to project-specific needs.
Fastlane/
├── actions/
│ └── svg_generator.rb # Main Ruby script for SVG generation
├── svg/ # Folder containing base SVG assets
└── Fastfile # Fastlane configuration file
- Ruby: Ensure Ruby is installed on your system.
- Fastlane: Install Fastlane in your Xcode project.
-
Clone this repository into your Xcode project’s
Fastlane
folder:git clone https://github.com/hojatdelfan/saas-svg-generator.git
-
Place your SVG resources in the svg folder.
-
Set up your color configurations:
-
In the
Color
folder, add your custom colors based on your project needs. You should include the following files:iconDarkEnd.colorset
iconDarkStart.colorset
iconLightEnd.colorset
iconLightStart.colorset
-
Each of these
.colorset
files should be customized to fit your desired color scheme.
-
-
Modify the
Fastfile
as needed to run thesvg_generator
script.
To generate and replace SVG assets, run the following Fastlane command:
fastlane generate_svg
- Icon Colors: Customize colors by editing the SVG files directly.
- Dynamic Sizing: Modify
svg_generator.rb
to adjust icon sizes based on project requirements.
Here’s an example of what the generated SVG files might look like:
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
feature/YourFeature
). - Commit your changes.
- Push the branch and create a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.