You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli): enhance iOS bundle version formatting (#13218)
* feat(cli): enhance iOS bundle version formatting
follow-up for #13030 and tauri-apps/cargo-mobile2#450
the bundle version validation has been updated, now it can actually handle one or two integers (e.g. `100` or `10.7`) instead of just full triple semver strings (e.g. `10.7.1`).
* lint
"CFBundleShortVersionString cannot have prerelease tag; stripping from {app_version}"
162
+
);
163
+
strip_semver_prerelease_tag(&mut version)?;
144
164
}
165
+
// correctly serialize version - cannot contain `+` as build metadata separator
166
+
Some(format!(
167
+
"{}.{}.{}{}",
168
+
version.major,
169
+
version.minor,
170
+
version.patch,
171
+
if version.build.is_empty(){
172
+
"".to_string()
173
+
} else {
174
+
format!(".{}", version.build.as_str())
175
+
}
176
+
))
177
+
}else{
178
+
// let it go as is - cargo-mobile2 will validate it
179
+
Some(app_version.clone())
145
180
}
181
+
}else{
182
+
bundle_version.clone()
183
+
};
184
+
let bundle_version_short = ifletSome(full_version) = full_bundle_version_short.as_deref(){
185
+
letmut s = full_version.split('.');
186
+
let short_version = format!(
187
+
"{}.{}.{}",
188
+
s.next().unwrap_or("0"),
189
+
s.next().unwrap_or("0"),
190
+
s.next().unwrap_or("0")
191
+
);
146
192
147
-
let maybe_build_number = if version.build.is_empty(){
148
-
"".to_string()
149
-
}else{
150
-
format!(".{}", version.build.as_str())
151
-
};
193
+
if short_version != full_version {
194
+
log::warn!("{full_version:?} is not a valid CFBundleShortVersionString since it must contain exactly three dot separated integers; setting it to {short_version} instead");
0 commit comments