diff --git a/solara/lib/core/brands/brand_switcher.rb b/solara/lib/core/brands/brand_switcher.rb index 8057c06..86201dc 100644 --- a/solara/lib/core/brands/brand_switcher.rb +++ b/solara/lib/core/brands/brand_switcher.rb @@ -75,7 +75,7 @@ def switch GradleSwitcher.new(@brand_key).switch AndroidManifestSwitcher.new.switch(config) - AndroidStringsSwitcher.new.switch(config) + AndroidStringsSwitcher.new.switch @theme_switcher.switch(Language::Kotlin) @brand_config_switcher.switch(Language::Kotlin) @resource_manager.update_android @@ -101,10 +101,10 @@ def switch private def update_xcode_project - Solara.logger.start_step("Update Xcode project") + Solara.logger.start_step("Switch Xcode project") project_path = FilePath.xcode_project XcodeProjectSwitcher.new(project_path, @brand_key).switch - Solara.logger.end_step("Update Xcode project") + Solara.logger.end_step("Switch Xcode project") end end @@ -131,7 +131,7 @@ def initialize(platform) end def create_dirs - Solara.logger.start_step("Create artifacts directories") + Solara.logger.start_step("Switch artifacts directories") directories = case @platform when Platform::Flutter [FilePath::flutter_artifacts, FilePath::android_artifacts, FilePath.ios_artifacts] @@ -143,7 +143,7 @@ def create_dirs raise ArgumentError, "Invalid platform: #{@platform}" end DirectoryCreator.create_directories(directories, delete_if_exists: true) - Solara.logger.end_step("Create artifacts directories") + Solara.logger.end_step("Switch artifacts directories") end end diff --git a/solara/lib/core/scripts/brand_resources_manager.rb b/solara/lib/core/scripts/brand_resources_manager.rb index 1757f97..3b89ec8 100644 --- a/solara/lib/core/scripts/brand_resources_manager.rb +++ b/solara/lib/core/scripts/brand_resources_manager.rb @@ -10,7 +10,7 @@ def initialize(brand_key) require 'fileutils' def update_ios - Solara.logger.start_step("Update iOS resources") + Solara.logger.start_step("Switch iOS resources") source = FilePath.ios_brand_assets(@brand_key) destination = FilePath.ios_assets_artifacts FileManager.delete_if_exists(destination) @@ -25,7 +25,7 @@ def update_ios end end - Solara.logger.end_step("Update iOS resources") + Solara.logger.end_step("Switch iOS resources") end def add_to_asset_catalog @@ -36,7 +36,7 @@ def add_to_asset_catalog end def update_android - Solara.logger.start_step("Update Android resources") + Solara.logger.start_step("Switch Android resources") FileManager.new.copy_files_recursively( FilePath.android_brand_res(@brand_key), FilePath.android_res_artifacts) @@ -50,11 +50,11 @@ def update_android # Delete the original launcher icons to fix duplicate resources FileManager.new.delete_folders_by_prefix(FilePath.android_res, 'mipmap') - Solara.logger.end_step("Update Android resources") + Solara.logger.end_step("Switch Android resources") end def update_flutter - Solara.logger.start_step("Update Flutter resources") + Solara.logger.start_step("Switch Flutter resources") case SolaraSettingsManager.instance.platform when Platform::Flutter YamlManager.new(FilePath.pub_spec_yaml).add_to_nested_array( @@ -72,6 +72,6 @@ def update_flutter # Nothing end - Solara.logger.end_step("Update Flutter resources") + Solara.logger.end_step("Switch Flutter resources") end end \ No newline at end of file diff --git a/solara/lib/core/scripts/gitignore_manager.rb b/solara/lib/core/scripts/gitignore_manager.rb index 218ca17..0733427 100644 --- a/solara/lib/core/scripts/gitignore_manager.rb +++ b/solara/lib/core/scripts/gitignore_manager.rb @@ -5,7 +5,7 @@ def initialize(gitignore_path = '.gitignore') end def self.ignore - Solara.logger.start_step("Ignoring unneeded files and folders from Git") + Solara.logger.start_step("Exclude Brand-Generated Files and Folders from Git") GitignoreManager.new(FilePath.project_root) .add_items([ "# Generated by Solara. Ignore redundant brand specific changes.", @@ -15,7 +15,7 @@ def self.ignore "solara/.solara/aliases/", "solara/.solara/solara_settings.json", ]) - Solara.logger.end_step("Ignoring unneeded files and folders from Git") + Solara.logger.end_step("Exclude Brand-Generated Files and Folders from Git") end def add_items(items) diff --git a/solara/lib/core/scripts/platform/android/android_strings_switcher.rb b/solara/lib/core/scripts/platform/android/android_strings_switcher.rb index 73846c7..0cf4cd6 100644 --- a/solara/lib/core/scripts/platform/android/android_strings_switcher.rb +++ b/solara/lib/core/scripts/platform/android/android_strings_switcher.rb @@ -2,8 +2,8 @@ class AndroidStringsSwitcher def initialize end - def switch(config) - Solara.logger.start_step("Generate #{FilePath.artifacts_dir_name}/strings.xml") + def switch + Solara.logger.start_step("Switch strings.xml") strings_file = FilePath.android_artifacts_strings # Create the file if it doesn't exist @@ -11,12 +11,8 @@ def switch(config) FileUtils.mkdir_p(File.dirname(strings_file)) end - strings_content = generate_strings_xml_content(config) - File.write(strings_file, strings_content) - Solara.logger.debug("Updated #{strings_file} with name: \"#{config['brandName']}\"") - remove_app_name_from_strings - Solara.logger.end_step("Generate #{FilePath.artifacts_dir_name}/strings.xml") + Solara.logger.end_step("Switch strings.xml") end # It's important to delete app_name to avoid duplicate resources @@ -24,6 +20,7 @@ def remove_app_name_from_strings file_path = FilePath.android_strings manager = StringsXmlManager.new(file_path) manager.delete_app_name + Solara.logger.debug("Removed app_name from #{file_path} to avoid duplicates with #{FilePath.android_artifacts_strings}.") end private diff --git a/solara/lib/core/scripts/platform/android/gradle_switcher.rb b/solara/lib/core/scripts/platform/android/gradle_switcher.rb index e674331..f6e746c 100644 --- a/solara/lib/core/scripts/platform/android/gradle_switcher.rb +++ b/solara/lib/core/scripts/platform/android/gradle_switcher.rb @@ -41,14 +41,14 @@ def initialize(brand_key) end def switch - Solara.logger.start_step("Update app/build.gradle") + Solara.logger.start_step("Switch app/build.gradle") gradle_file = FilePath.android_app_gradle gradle_content = File.read(gradle_file) update_gradle(gradle_file, gradle_content) add_source_sets(gradle_file) update_keystore_config(gradle_file) - Solara.logger.end_step("Update app/build.gradle") + Solara.logger.end_step("Switch app/build.gradle") end private diff --git a/solara/lib/core/template/brands/android/res/values/strings.xml b/solara/lib/core/template/brands/android/res/values/strings.xml new file mode 100644 index 0000000..4b9b64f --- /dev/null +++ b/solara/lib/core/template/brands/android/res/values/strings.xml @@ -0,0 +1,4 @@ + + + +