Class: Luciq::Commands::Upload

Inherits:
Object
  • Object
show all
Defined in:
lib/luciq/commands/upload.rb

Constant Summary collapse

ALLOWED_ARCHITECTURES =
%w[armeabi-v7a arm64-v8a x86 x86_64].freeze

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Upload

Returns a new instance of Upload.



10
11
12
13
# File 'lib/luciq/commands/upload.rb', line 10

def initialize(options = {})
  @options = options
  @client = API::Client.new
end

Instance Method Details

#android_mapping(file_path) ⇒ Object



21
22
23
24
25
26
27
28
29
30
# File 'lib/luciq/commands/upload.rb', line 21

def android_mapping(file_path)
  run_upload(file_path, 'Android mapping file') do
    @client.upload_android_mapping(
      file_path: file_path,
      app_token: @options[:app_token],
      version_code: @options[:version_code],
      version_name: @options[:version_name]
    )
  end
end

#android_ndk(file_path) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/luciq/commands/upload.rb', line 32

def android_ndk(file_path)
  run_upload(file_path, 'Android NDK .so files', format: :zip) do
    validate_arch!
    @client.upload_android_ndk(
      file_path: file_path,
      app_token: @options[:app_token],
      app_version: @options[:version_name],
      arch: @options[:arch]
    )
  end
end

#flutter_android_mapping(file_path) ⇒ Object



110
111
112
113
114
115
116
117
118
119
# File 'lib/luciq/commands/upload.rb', line 110

def flutter_android_mapping(file_path)
  run_upload(file_path, 'Flutter Android mapping file') do
    @client.upload_flutter_android_mapping(
      file_path: file_path,
      app_token: @options[:app_token],
      version_code: @options[:version_code],
      version_name: @options[:version_name]
    )
  end
end

#flutter_android_sourcemap(file_path) ⇒ Object



121
122
123
124
125
126
127
128
129
130
# File 'lib/luciq/commands/upload.rb', line 121

def flutter_android_sourcemap(file_path)
  run_upload(file_path, 'Flutter Android Dart sourcemap', format: :zip) do
    @client.upload_flutter_android_sourcemap(
      file_path: file_path,
      app_token: @options[:app_token],
      version_name: @options[:version_name],
      version_code: @options[:version_code]
    )
  end
end

#flutter_ios_dsym(file_path) ⇒ Object



93
94
95
96
97
# File 'lib/luciq/commands/upload.rb', line 93

def flutter_ios_dsym(file_path)
  run_upload(file_path, 'Flutter iOS dSYM', format: :zip) do
    @client.upload_flutter_ios_dsym(file_path: file_path, app_token: @options[:app_token])
  end
end

#flutter_ios_sourcemap(file_path) ⇒ Object



99
100
101
102
103
104
105
106
107
108
# File 'lib/luciq/commands/upload.rb', line 99

def flutter_ios_sourcemap(file_path)
  run_upload(file_path, 'Flutter iOS Dart sourcemap', format: :zip) do
    @client.upload_flutter_ios_sourcemap(
      file_path: file_path,
      app_token: @options[:app_token],
      version_name: @options[:version_name],
      version_code: @options[:version_code]
    )
  end
end

#flutter_ndk(file_path) ⇒ Object



132
133
134
135
136
137
138
139
140
141
142
# File 'lib/luciq/commands/upload.rb', line 132

def flutter_ndk(file_path)
  run_upload(file_path, 'Flutter NDK .so files', format: :zip) do
    validate_arch!
    @client.upload_flutter_ndk(
      file_path: file_path,
      app_token: @options[:app_token],
      app_version: @options[:version_name],
      arch: @options[:arch]
    )
  end
end

#ios_dsym(file_path) ⇒ Object



15
16
17
18
19
# File 'lib/luciq/commands/upload.rb', line 15

def ios_dsym(file_path)
  run_upload(file_path, 'iOS dSYM file', format: :zip) do
    @client.upload_ios_dsym(file_path: file_path, app_token: @options[:app_token])
  end
end

#react_native_android_mapping(file_path) ⇒ Object



60
61
62
63
64
65
66
67
68
69
# File 'lib/luciq/commands/upload.rb', line 60

def react_native_android_mapping(file_path)
  run_upload(file_path, 'React Native Android mapping file') do
    @client.upload_react_native_android_mapping(
      file_path: file_path,
      app_token: @options[:app_token],
      version_code: @options[:version_code],
      version_name: @options[:version_name]
    )
  end
end

#react_native_android_sourcemap(file_path) ⇒ Object



71
72
73
74
75
76
77
78
79
# File 'lib/luciq/commands/upload.rb', line 71

def react_native_android_sourcemap(file_path)
  run_upload(file_path, 'React Native Android source map', format: :sourcemap) do
    @client.upload_react_native_android_sourcemap(
      file_path: file_path,
      app_token: @options[:app_token],
      app_version: build_app_version
    )
  end
end

#react_native_ios_dsym(file_path) ⇒ Object



44
45
46
47
48
# File 'lib/luciq/commands/upload.rb', line 44

def react_native_ios_dsym(file_path)
  run_upload(file_path, 'React Native iOS dSYM', format: :zip) do
    @client.upload_react_native_ios_dsym(file_path: file_path, app_token: @options[:app_token])
  end
end

#react_native_ios_sourcemap(file_path) ⇒ Object



50
51
52
53
54
55
56
57
58
# File 'lib/luciq/commands/upload.rb', line 50

def react_native_ios_sourcemap(file_path)
  run_upload(file_path, 'React Native iOS source map', format: :sourcemap) do
    @client.upload_react_native_ios_sourcemap(
      file_path: file_path,
      app_token: @options[:app_token],
      app_version: build_app_version
    )
  end
end

#react_native_ndk(file_path) ⇒ Object



81
82
83
84
85
86
87
88
89
90
91
# File 'lib/luciq/commands/upload.rb', line 81

def react_native_ndk(file_path)
  run_upload(file_path, 'React Native NDK .so files', format: :zip) do
    validate_arch!
    @client.upload_react_native_ndk(
      file_path: file_path,
      app_token: @options[:app_token],
      app_version: @options[:version_name],
      arch: @options[:arch]
    )
  end
end