Sha256: f6d77d0173344bef09eea86cbe148e7b9ff90aae3562fe3a3b5ca922e4c1b788
Contents?: true
Size: 1.12 KB
Versions: 2
Compression:
Stored size: 1.12 KB
Contents
class AndroidStringsSwitcher def initialize end def update(config) Solara.logger.start_step("Generate artifacts/strings.xml") strings_file = FilePath.android_artifacts_strings # Create the file if it doesn't exist unless File.exist?(strings_file) 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 artifacts/strings.xml") end # It's important to delete app_name to avoid duplicate resources def remove_app_name_from_strings file_path = FilePath.android_strings manager = StringsXmlManager.new(file_path) manager.delete_app_name end private def generate_strings_xml_content(config) <<-XML <?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">#{config['brandName']}</string> </resources> XML end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
solara-0.2.0 | solara/lib/core/scripts/platform/android/android_strings_switcher.rb |
solara-0.1.0 | solara/lib/core/scripts/platform/android/android_strings_switcher.rb |