@@ -13,28 +13,27 @@ use zip::{DateTime, ZipWriter};
1313use crate :: api:: { Api , AuthenticatedApi , ChunkUploadCapability , ChunkedFileState , VcsInfo } ;
1414use crate :: config:: Config ;
1515use crate :: utils:: args:: ArgExt as _;
16+ #[ cfg( all( target_os = "macos" , target_arch = "aarch64" ) ) ]
17+ use crate :: utils:: build:: { handle_asset_catalogs, ipa_to_xcarchive, is_apple_app, is_ipa_file} ;
18+ use crate :: utils:: build:: { is_aab_file, is_apk_file, is_zip_file, normalize_directory} ;
1619use crate :: utils:: chunks:: { upload_chunks, Chunk } ;
1720use crate :: utils:: fs:: get_sha1_checksums;
1821use crate :: utils:: fs:: TempDir ;
1922use crate :: utils:: fs:: TempFile ;
20- #[ cfg( all( target_os = "macos" , target_arch = "aarch64" ) ) ]
21- use crate :: utils:: mobile_app:: {
22- handle_asset_catalogs, ipa_to_xcarchive, is_apple_app, is_ipa_file,
23- } ;
24- use crate :: utils:: mobile_app:: { is_aab_file, is_apk_file, is_zip_file, normalize_directory} ;
2523use crate :: utils:: progress:: ProgressBar ;
2624use crate :: utils:: vcs:: {
2725 self , get_provider_from_remote, get_repo_from_remote, git_repo_remote_url,
2826} ;
2927
3028pub fn make_command ( command : Command ) -> Command {
3129 #[ cfg( all( target_os = "macos" , target_arch = "aarch64" ) ) ]
32- const HELP_TEXT : & str = "The path to the mobile app files to upload. Supported files include Apk, Aab, XCArchive, and IPA." ;
30+ const HELP_TEXT : & str =
31+ "The path to the build to upload. Supported files include Apk, Aab, XCArchive, and IPA." ;
3332 #[ cfg( not( all( target_os = "macos" , target_arch = "aarch64" ) ) ) ]
3433 const HELP_TEXT : & str =
35- "The path to the mobile app files to upload. Supported files include Apk, and Aab." ;
34+ "The path to the build to upload. Supported files include Apk, and Aab." ;
3635 command
37- . about ( "[EXPERIMENTAL] Upload mobile app files to a project." )
36+ . about ( "[EXPERIMENTAL] Upload builds to a project." )
3837 . org_arg ( )
3938 . project_arg ( false )
4039 . arg (
@@ -149,10 +148,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
149148 let api = Api :: current ( ) ;
150149 let authenticated_api = api. authenticated ( ) ?;
151150
152- debug ! (
153- "Starting mobile app upload for {} paths" ,
154- path_strings. len( )
155- ) ;
151+ debug ! ( "Starting upload for {} paths" , path_strings. len( ) ) ;
156152
157153 let mut normalized_zips = vec ! [ ] ;
158154 for path_string in path_strings {
@@ -166,7 +162,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
166162 let byteview = ByteView :: open ( path) ?;
167163 debug ! ( "Loaded file with {} bytes" , byteview. len( ) ) ;
168164
169- validate_is_mobile_app ( path, & byteview) ?;
165+ validate_is_supported_build ( path, & byteview) ?;
170166
171167 let normalized_zip = if path. is_file ( ) {
172168 debug ! ( "Normalizing file: {}" , path. display( ) ) ;
@@ -285,8 +281,8 @@ fn handle_file(path: &Path, byteview: &ByteView) -> Result<TempFile> {
285281 } )
286282}
287283
288- fn validate_is_mobile_app ( path : & Path , bytes : & [ u8 ] ) -> Result < ( ) > {
289- debug ! ( "Validating mobile app format for: {}" , path. display( ) ) ;
284+ fn validate_is_supported_build ( path : & Path , bytes : & [ u8 ] ) -> Result < ( ) > {
285+ debug ! ( "Validating build format for: {}" , path. display( ) ) ;
290286
291287 #[ cfg( all( target_os = "macos" , target_arch = "aarch64" ) ) ]
292288 if is_apple_app ( path) {
@@ -325,7 +321,7 @@ fn validate_is_mobile_app(path: &Path, bytes: &[u8]) -> Result<()> {
325321 let format_list = "APK, or AAB" ;
326322
327323 Err ( anyhow ! (
328- "File is not a recognized mobile app format ({format_list}): {}" ,
324+ "File is not a recognized supported build format ({format_list}): {}" ,
329325 path. display( )
330326 ) )
331327}
@@ -379,7 +375,7 @@ fn upload_file(
379375 vcs_info : & VcsInfo < ' _ > ,
380376) -> Result < String > {
381377 const SELF_HOSTED_ERROR_HINT : & str = "If you are using a self-hosted Sentry server, \
382- update to the latest version of Sentry to use the mobile-app upload command.";
378+ update to the latest version of Sentry to use the build upload command.";
383379
384380 debug ! (
385381 "Uploading file to organization: {}, project: {}, build_configuration: {}, vcs_info: {:?}" ,
@@ -392,7 +388,7 @@ fn upload_file(
392388 let chunk_upload_options = api. get_chunk_upload_options ( org) ?. ok_or_else ( || {
393389 anyhow ! (
394390 "The Sentry server lacks chunked uploading support, which \
395- is required for mobile app uploads. {SELF_HOSTED_ERROR_HINT}"
391+ is required for build uploads. {SELF_HOSTED_ERROR_HINT}"
396392 )
397393 } ) ?;
398394
@@ -433,7 +429,7 @@ fn upload_file(
433429 // n. state=error, artifact_url unset
434430
435431 let result = loop {
436- let response = api. assemble_mobile_app (
432+ let response = api. assemble_build (
437433 org,
438434 project,
439435 checksum,
@@ -497,7 +493,7 @@ mod tests {
497493 #[ cfg( all( target_os = "macos" , target_arch = "aarch64" ) ) ]
498494 fn test_xcarchive_upload_includes_parsed_assets ( ) -> Result < ( ) > {
499495 // Test that XCArchive uploads include parsed asset catalogs
500- let xcarchive_path = Path :: new ( "tests/integration/_fixtures/mobile_app /archive.xcarchive" ) ;
496+ let xcarchive_path = Path :: new ( "tests/integration/_fixtures/build /archive.xcarchive" ) ;
501497
502498 // Process the XCArchive directory
503499 let result = handle_directory ( xcarchive_path) ?;
@@ -529,7 +525,7 @@ mod tests {
529525 #[ cfg( all( target_os = "macos" , target_arch = "aarch64" ) ) ]
530526 fn test_ipa_upload_includes_parsed_assets ( ) -> Result < ( ) > {
531527 // Test that IPA uploads handle missing asset catalogs gracefully
532- let ipa_path = Path :: new ( "tests/integration/_fixtures/mobile_app /ipa_with_asset.ipa" ) ;
528+ let ipa_path = Path :: new ( "tests/integration/_fixtures/build /ipa_with_asset.ipa" ) ;
533529 let byteview = ByteView :: open ( ipa_path) ?;
534530
535531 // Process the IPA file - this should work even without asset catalogs
0 commit comments