Add visibility parameters to control scope of generated extension
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit

This commit is contained in:
2025-07-18 11:53:46 +02:00
parent beca2c6b2b
commit 7162f13166
61 changed files with 1511 additions and 791 deletions

View File

@ -1,21 +1,21 @@
// Generated by ResgenSwift.Color 2.1.0
// Generated by ResgenSwift.Color 2.2.0
import SwiftUI
extension ColorYolo {
/// Color red is #FF0000 (light) or #FF0000 (dark)"
var red: Color {
public var red: Color {
Color("red")
}
/// Color green_alpha_50 is #A000FF00 (light) or #A000FF00 (dark)"
var green_alpha_50: Color {
public var green_alpha_50: Color {
Color("green_alpha_50")
}
/// Color blue_light_dark is #0000FF (light) or #0000AA (dark)"
var blue_light_dark: Color {
public var blue_light_dark: Color {
Color("blue_light_dark")
}
}

View File

@ -1,21 +1,21 @@
// Generated by ResgenSwift.Color 2.1.0
// Generated by ResgenSwift.Color 2.2.0
import UIKit
extension UIColorYolo {
/// Color red is #FF0000 (light) or #FF0000 (dark)"
@objc var red: UIColor {
@objc public var red: UIColor {
UIColor(named: "red")!
}
/// Color green_alpha_50 is #A000FF00 (light) or #A000FF00 (dark)"
@objc var green_alpha_50: UIColor {
@objc public var green_alpha_50: UIColor {
UIColor(named: "green_alpha_50")!
}
/// Color blue_light_dark is #0000FF (light) or #0000AA (dark)"
@objc var blue_light_dark: UIColor {
@objc public var blue_light_dark: UIColor {
UIColor(named: "blue_light_dark")!
}
}

View File

@ -1,10 +1,10 @@
// Generated by ResgenSwift.Fonts 2.1.0
// Generated by ResgenSwift.Fonts 2.2.0
import SwiftUI
extension FontYolo {
enum FontName: String {
public enum FontName: String {
case LatoItalic = "Lato-Italic"
case LatoLightItalic = "Lato-LightItalic"
case LatoHairline = "Lato-Hairline"
@ -19,43 +19,43 @@ extension FontYolo {
// MARK: - Getter
func LatoItalic(withSize size: CGFloat) -> Font {
public func LatoItalic(withSize size: CGFloat) -> Font {
Font.custom(FontName.LatoItalic.rawValue, size: size)
}
func LatoLightItalic(withSize size: CGFloat) -> Font {
public func LatoLightItalic(withSize size: CGFloat) -> Font {
Font.custom(FontName.LatoLightItalic.rawValue, size: size)
}
func LatoHairline(withSize size: CGFloat) -> Font {
public func LatoHairline(withSize size: CGFloat) -> Font {
Font.custom(FontName.LatoHairline.rawValue, size: size)
}
func LatoBold(withSize size: CGFloat) -> Font {
public func LatoBold(withSize size: CGFloat) -> Font {
Font.custom(FontName.LatoBold.rawValue, size: size)
}
func LatoBlack(withSize size: CGFloat) -> Font {
public func LatoBlack(withSize size: CGFloat) -> Font {
Font.custom(FontName.LatoBlack.rawValue, size: size)
}
func LatoRegular(withSize size: CGFloat) -> Font {
public func LatoRegular(withSize size: CGFloat) -> Font {
Font.custom(FontName.LatoRegular.rawValue, size: size)
}
func LatoBlackItalic(withSize size: CGFloat) -> Font {
public func LatoBlackItalic(withSize size: CGFloat) -> Font {
Font.custom(FontName.LatoBlackItalic.rawValue, size: size)
}
func LatoBoldItalic(withSize size: CGFloat) -> Font {
public func LatoBoldItalic(withSize size: CGFloat) -> Font {
Font.custom(FontName.LatoBoldItalic.rawValue, size: size)
}
func LatoLight(withSize size: CGFloat) -> Font {
public func LatoLight(withSize size: CGFloat) -> Font {
Font.custom(FontName.LatoLight.rawValue, size: size)
}
func LatoHairlineItalic(withSize size: CGFloat) -> Font {
public func LatoHairlineItalic(withSize size: CGFloat) -> Font {
Font.custom(FontName.LatoHairlineItalic.rawValue, size: size)
}
}

View File

@ -1,10 +1,10 @@
// Generated by ResgenSwift.Fonts 2.1.0
// Generated by ResgenSwift.Fonts 2.2.0
import UIKit
extension UIFontYolo {
enum FontName: String {
public enum FontName: String {
case LatoItalic = "Lato-Italic"
case LatoLightItalic = "Lato-LightItalic"
case LatoHairline = "Lato-Hairline"
@ -19,43 +19,43 @@ extension UIFontYolo {
// MARK: - Getter
func LatoItalic(withSize size: CGFloat) -> UIFont {
UIFont(name: FontName.LatoItalic.rawValue, size: size)!
}
func LatoLightItalic(withSize size: CGFloat) -> UIFont {
UIFont(name: FontName.LatoLightItalic.rawValue, size: size)!
}
func LatoHairline(withSize size: CGFloat) -> UIFont {
UIFont(name: FontName.LatoHairline.rawValue, size: size)!
}
func LatoBold(withSize size: CGFloat) -> UIFont {
UIFont(name: FontName.LatoBold.rawValue, size: size)!
}
func LatoBlack(withSize size: CGFloat) -> UIFont {
UIFont(name: FontName.LatoBlack.rawValue, size: size)!
}
func LatoRegular(withSize size: CGFloat) -> UIFont {
UIFont(name: FontName.LatoRegular.rawValue, size: size)!
}
func LatoBlackItalic(withSize size: CGFloat) -> UIFont {
UIFont(name: FontName.LatoBlackItalic.rawValue, size: size)!
}
func LatoBoldItalic(withSize size: CGFloat) -> UIFont {
UIFont(name: FontName.LatoBoldItalic.rawValue, size: size)!
}
func LatoLight(withSize size: CGFloat) -> UIFont {
UIFont(name: FontName.LatoLight.rawValue, size: size)!
}
func LatoHairlineItalic(withSize size: CGFloat) -> UIFont {
UIFont(name: FontName.LatoHairlineItalic.rawValue, size: size)!
}
public func LatoItalic(withSize size: CGFloat) -> UIFont {
UIFont(name: FontName.LatoItalic.rawValue, size: size)!
}
public func LatoLightItalic(withSize size: CGFloat) -> UIFont {
UIFont(name: FontName.LatoLightItalic.rawValue, size: size)!
}
public func LatoHairline(withSize size: CGFloat) -> UIFont {
UIFont(name: FontName.LatoHairline.rawValue, size: size)!
}
public func LatoBold(withSize size: CGFloat) -> UIFont {
UIFont(name: FontName.LatoBold.rawValue, size: size)!
}
public func LatoBlack(withSize size: CGFloat) -> UIFont {
UIFont(name: FontName.LatoBlack.rawValue, size: size)!
}
public func LatoRegular(withSize size: CGFloat) -> UIFont {
UIFont(name: FontName.LatoRegular.rawValue, size: size)!
}
public func LatoBlackItalic(withSize size: CGFloat) -> UIFont {
UIFont(name: FontName.LatoBlackItalic.rawValue, size: size)!
}
public func LatoBoldItalic(withSize size: CGFloat) -> UIFont {
UIFont(name: FontName.LatoBoldItalic.rawValue, size: size)!
}
public func LatoLight(withSize size: CGFloat) -> UIFont {
UIFont(name: FontName.LatoLight.rawValue, size: size)!
}
public func LatoHairlineItalic(withSize size: CGFloat) -> UIFont {
UIFont(name: FontName.LatoHairlineItalic.rawValue, size: size)!
}
}

View File

@ -1,31 +1,31 @@
// Generated by ResgenSwift.Images 2.1.0
// Generated by ResgenSwift.Images 2.2.0
// Images from sampleImages
import SwiftUI
extension ImageYolo {
var article_notification_pull_detail: Image {
public var article_notification_pull_detail: Image {
Image("article_notification_pull_detail")
}
var article_notification_pull: Image {
public var article_notification_pull: Image {
Image("article_notification_pull")
}
var new_article: Image {
public var new_article: Image {
Image("new_article")
}
var welcome_background: Image {
public var welcome_background: Image {
Image("welcome_background")
}
var article_trash: Image {
public var article_trash: Image {
Image("article_trash")
}
var ic_close_article: Image {
public var ic_close_article: Image {
Image("ic_close_article")
}
}

View File

@ -1,31 +1,31 @@
// Generated by ResgenSwift.Images 2.1.0
// Generated by ResgenSwift.Images 2.2.0
// Images from sampleImages
import UIKit
extension UIImageYolo {
var article_notification_pull_detail: UIImage {
public var article_notification_pull_detail: UIImage {
UIImage(named: "article_notification_pull_detail")!
}
var article_notification_pull: UIImage {
public var article_notification_pull: UIImage {
UIImage(named: "article_notification_pull")!
}
var new_article: UIImage {
public var new_article: UIImage {
UIImage(named: "new_article")!
}
var welcome_background: UIImage {
public var welcome_background: UIImage {
UIImage(named: "welcome_background")!
}
var article_trash: UIImage {
public var article_trash: UIImage {
UIImage(named: "article_trash")!
}
var ic_close_article: UIImage {
public var ic_close_article: UIImage {
UIImage(named: "ic_close_article")!
}
}

View File

@ -1,4 +1,4 @@
// Generated by ResgenSwift.Strings.Stringium 2.1.0
// Generated by ResgenSwift.Strings.Stringium 2.2.0
import UIKit
@ -6,7 +6,7 @@ fileprivate let kStringsFileName = "sampleStrings"
extension String {
enum KeyGenAllScript: String {
public enum KeyGenAllScript: String {
case param_lang = "param_lang"
case generic_back = "generic_back"
case generic_loading_data = "generic_loading_data"
@ -14,7 +14,7 @@ extension String {
case test_equal_symbol = "test_equal_symbol"
case placeholders_test_one = "placeholders_test_one"
var keyPath: KeyPath<String, String> {
public var keyPath: KeyPath<String, String> {
switch self {
case .param_lang: return \String.param_lang
case .generic_back: return \String.generic_back
@ -33,7 +33,7 @@ extension String {
///
/// Comment :
/// No comment
var param_lang: String {
public var param_lang: String {
NSLocalizedString("param_lang", tableName: kStringsFileName, bundle: Bundle.main, value: "en", comment: "")
}
@ -44,7 +44,7 @@ extension String {
///
/// Comment :
/// No comment
var generic_back: String {
public var generic_back: String {
NSLocalizedString("generic_back", tableName: kStringsFileName, bundle: Bundle.main, value: "Back", comment: "")
}
@ -53,7 +53,7 @@ extension String {
///
/// Comment :
/// No comment
var generic_loading_data: String {
public var generic_loading_data: String {
NSLocalizedString("generic_loading_data", tableName: kStringsFileName, bundle: Bundle.main, value: "Loading data...", comment: "")
}
@ -62,7 +62,7 @@ extension String {
///
/// Comment :
/// No comment
var generic_welcome_firstname_format: String {
public var generic_welcome_firstname_format: String {
NSLocalizedString("generic_welcome_firstname_format", tableName: kStringsFileName, bundle: Bundle.main, value: "Welcome \"%@\" !", comment: "")
}
/// Translation in en :
@ -70,7 +70,7 @@ extension String {
///
/// Comment :
/// No comment
func generic_welcome_firstname_format(arg0: String) -> String {
public func generic_welcome_firstname_format(arg0: String) -> String {
String(format: self.generic_welcome_firstname_format, arg0)
}
@ -81,7 +81,7 @@ extension String {
///
/// Comment :
/// No comment
var test_equal_symbol: String {
public var test_equal_symbol: String {
NSLocalizedString("test_equal_symbol", tableName: kStringsFileName, bundle: Bundle.main, value: "1€ = 1 point !", comment: "")
}
@ -92,7 +92,7 @@ extension String {
///
/// Comment :
/// No comment
var placeholders_test_one: String {
public var placeholders_test_one: String {
NSLocalizedString("placeholders_test_one", tableName: kStringsFileName, bundle: Bundle.main, value: "You %%: %2$@ %1$@ Age: %3$d", comment: "")
}
/// Translation in en :
@ -100,7 +100,7 @@ extension String {
///
/// Comment :
/// No comment
func placeholders_test_one(arg0: String, arg1: String, arg2: Int) -> String {
public func placeholders_test_one(arg0: String, arg1: String, arg2: Int) -> String {
String(format: self.placeholders_test_one, arg0, arg1, arg2)
}
}

View File

@ -1,4 +1,4 @@
// Generated by ResgenSwift.Analytics 2.1.0
// Generated by ResgenSwift.Analytics 2.2.0
import Foundation
import MatomoTracker
@ -6,7 +6,7 @@ import FirebaseAnalytics
// MARK: - Protocol
protocol AnalyticsManagerProtocol {
public protocol AnalyticsManagerProtocol {
func logScreen(
name: String,
@ -24,6 +24,72 @@ protocol AnalyticsManagerProtocol {
func setEnable(_ enable: Bool)
}
// MARK: - Matomo
class MatomoAnalyticsManager: AnalyticsManagerProtocol {
// MARK: - Properties
private var tracker: MatomoTracker
// MARK: - Init
init(siteId: String, url: String) {
debugPrint("[Matomo service] Server URL: \(url)")
debugPrint("[Matomo service] Site ID: \(siteId)")
tracker = MatomoTracker(
siteId: siteId,
baseURL: URL(string: url)!
)
#if DEBUG
tracker.dispatchInterval = 5
#endif
#if DEBUG
tracker.logger = DefaultLogger(minLevel: .verbose)
#endif
debugPrint("[Matomo service] Configured with content base: \(tracker.contentBase?.absoluteString ?? "-")")
debugPrint("[Matomo service] Opt out: \(tracker.isOptedOut)")
}
// MARK: - Methods
func logScreen(
name: String,
path: String,
params: [String: Any]?
) {
guard let trackerUrl = tracker.contentBase?.absoluteString else { return }
let urlString = URL(string: "\(trackerUrl)" + "/" + "\(path)" + "iOS")
tracker.track(
view: [name],
url: urlString
)
}
func logEvent(
name: String,
action: String,
category: String,
params: [String: Any]?
) {
tracker.track(
eventWithCategory: category,
action: action,
name: name,
number: nil,
url: nil
)
}
func setEnable(_ enable: Bool) {
tracker.isOptedOut = !enable
}
}
// MARK: - Firebase
class FirebaseAnalyticsManager: AnalyticsManagerProtocol {
@ -50,7 +116,7 @@ class FirebaseAnalyticsManager: AnalyticsManagerProtocol {
}) {
continue
}
parameters[newKey] = newValue as? NSObject
}
}
@ -74,11 +140,11 @@ class FirebaseAnalyticsManager: AnalyticsManagerProtocol {
if category.isEmpty == false {
parameters["AnalyticsParameterItemCategory"] = category as NSObject
}
if action.isEmpty == false {
parameters["action"] = action as NSObject
}
if let supplementaryParameters = params {
for (newKey, newValue) in supplementaryParameters {
if parameters.contains(where: { (key: String, value: NSObject) in
@ -104,16 +170,17 @@ class FirebaseAnalyticsManager: AnalyticsManagerProtocol {
// MARK: - Traker Type
enum TrackerType: CaseIterable {
public enum TrackerType: CaseIterable {
case matomo
case firebase
}
// MARK: - Manager
class AnalyticsManager {
public class AnalyticsManager {
static var shared = AnalyticsManager()
public static var shared = AnalyticsManager()
private init() {}
@ -141,18 +208,22 @@ class AnalyticsManager {
}
}
func enableAnalytics(_ analytics: [TrackerType] = TrackerType.allCases) {
public func enableAnalytics(_ analytics: [TrackerType] = TrackerType.allCases) {
setAnalytics(enable: true, analytics)
}
func disableAnalytics(_ analytics: [TrackerType] = TrackerType.allCases) {
public func disableAnalytics(_ analytics: [TrackerType] = TrackerType.allCases) {
setAnalytics(enable: false, analytics)
}
func configure() {
public func configure(siteId: String, url: String) {
managers[TrackerType.matomo] = MatomoAnalyticsManager(
siteId: siteId,
url: url
)
managers[TrackerType.firebase] = FirebaseAnalyticsManager()
}
// MARK: - Private Log Methods
private func logScreen(
@ -191,15 +262,15 @@ class AnalyticsManager {
// MARK: - section_one
static func logScreenS1DefOne(title: String) {
AnalyticsManager.shared.logScreen(
public func logScreenS1DefOne(title: String) {
logScreen(
name: "s1 def one \(title)",
path: "s1_def_one/\(title)",
params: nil
)
}
func logEventS1DefTwo(
public func logEventS1DefTwo(
title: String,
count: String,
test2: String = "test"
@ -219,8 +290,8 @@ class AnalyticsManager {
// MARK: - section_two
static func logScreenS2DefOne() {
AnalyticsManager.shared.logScreen(
public func logScreenS2DefOne() {
logScreen(
name: "s2 def one",
path: "s2_def_one/",
params: nil

View File

@ -1,4 +1,4 @@
// Generated by ResgenSwift.Strings.Tags 2.1.0
// Generated by ResgenSwift.Strings.Tags 2.2.0
import UIKit
@ -11,8 +11,7 @@ extension Tags {
///
/// Comment :
/// No comment
var screen_one: String {
public var screen_one: String {
"Ecran un"
}
@ -21,8 +20,7 @@ extension Tags {
///
/// Comment :
/// No comment
var screen_two: String {
public var screen_two: String {
"Ecran deux"
}
}

View File

@ -30,13 +30,14 @@ architecture:
#
strings:
-
inputFile: ./Strings/sampleStrings.txt
outputPath: ./Strings/Generated
langs: "fr en en-us"
defaultLang: en
extensionOutputPath: ./Strings/Generated
extensionName: String
extensionSuffix: GenAllScript
inputFile: ./Strings/sampleStrings.txt
outputPath: ./Strings/Generated
langs: "fr en en-us"
defaultLang: en
extensionOutputPath: ./Strings/Generated
extensionName: String
extensionSuffix: GenAllScript
visibility: public
#
@ -50,6 +51,7 @@ images:
extensionName: ImageYolo
extensionNameUIKit: UIImageYolo
extensionSuffix: GenAllScript
visibility: public
#
@ -57,13 +59,14 @@ images:
#
colors:
-
inputFile: ./Colors/sampleColors1.txt
style: all
xcassetsPath: ./Colors/colors.xcassets
extensionOutputPath: ./Colors/Generated/
extensionName: ColorYolo
extensionNameUIKit: UIColorYolo
extensionSuffix: GenAllScript
inputFile: ./Colors/sampleColors1.txt
style: all
xcassetsPath: ./Colors/colors.xcassets
extensionOutputPath: ./Colors/Generated/
extensionName: ColorYolo
extensionNameUIKit: UIColorYolo
extensionSuffix: GenAllScript
visibility: public
#
@ -76,6 +79,7 @@ tags:
extensionOutputPath: ./Tags/Generated
extensionName: Tags
extensionSuffix: GenAllScript
visibility: public
#
@ -85,9 +89,8 @@ analytics:
-
inputFile: ./Tags/sampleTags.yml
target: "matomo firebase"
extensionOutputPath: ./Tags/Generated
extensionName: Analytics
extensionSuffix: GenAllScript
outputFile: ./Tags/Generated/Analytics+GenAllScript.swift
visibility: public
#
@ -95,9 +98,10 @@ analytics:
#
fonts:
-
inputFile: ./Fonts/sampleFontsAll.txt
extensionOutputPath: ./Fonts/Generated
extensionName: FontYolo
extensionNameUIKit: UIFontYolo
extensionSuffix: GenAllScript
infoPlistPaths: "./Fonts/Generated/test.plist ./Fonts/Generated/test2.plist"
inputFile: ./Fonts/sampleFontsAll.txt
extensionOutputPath: ./Fonts/Generated
extensionName: FontYolo
extensionNameUIKit: UIFontYolo
extensionSuffix: GenAllScript
infoPlistPaths: "./Fonts/Generated/test.plist ./Fonts/Generated/test2.plist"
visibility: public