passepartout-apple/fastlane/xcconfig.rb
Davide 8972d9773e
Resolve several issues in bump script/lane (#1075)
- Simplify build/version updates by moving MARKETING_VERSION and
CURRENT_PROJECT_VERSION to Config.xcconfig
- Provide Ruby (for fastlane) and Bash (for CI) versions of
xconfig-get/set
- Copy release notes atomically inside the lane to guarantee they are
included in the version commit
- Add -nt to skip the build tag
2025-01-18 18:13:54 +01:00

24 lines
534 B
Ruby

def xcconfig_set(path, key, value)
unless File.exist?(path)
raise "File not found: #{path}"
end
content = File.read(path)
pattern = /^(#{key}) = .*$/
replacement = "\\1 = #{value}"
modified_content = content.gsub(pattern, replacement)
File.write(path, modified_content)
end
def xcconfig_get(path, key)
unless File.exist?(path)
raise "File not found: #{path}"
end
pattern = /^#{key} = (.*)$/
File.foreach(path) do |line|
if (match = line.match(pattern))
return match[1]
end
end
nil
end