-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate apps for Build Distribution #43
Conversation
|
||
module EmergeCLI | ||
module Commands | ||
class ValidateApp < EmergeCLI::Commands::GlobalOptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be namespaced in a BuildDistribution
module? "Validate app" could mean a ton of things for us. 😅
when '.app' | ||
handle_app | ||
else | ||
raise 'Unknown file extension' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: include the extension in the message
return | ||
end | ||
|
||
command = "codesign -dvvv '#{app_path}'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long-term it would be nice to wrap this behavior in a class like Android perftesting does.
Logger.debug command | ||
stdout, _, status = Open3.capture3(command) | ||
Logger.debug stdout | ||
raise '❌ Codesign check failed' unless status.success? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this failing mean? Can we give the user more information on what is actionable on their part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It usually just fails, possibly a signature mismatch.
Hard to get the cause
end | ||
|
||
def read_entitlements(app_path) | ||
entitlements_path = File.join(app_path, 'embedded.mobileprovision') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct? It's named entitlements
but reading the provisioning profile file.
|
||
expiration_date = parsed_data['ExpirationDate'] | ||
if expiration_date > Time.now | ||
Logger.info '✅ Provisioning profile hasn\'t expired' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we include the expiration_date
in the messages?
lib/emerge_cli.rb
Outdated
@@ -61,6 +62,10 @@ module EmergeCLI | |||
prefix.register 'validate-linkmaps', Commands::ValidateLinkmaps | |||
prefix.register 'validate-xcode-project', Commands::ValidateXcodeProject | |||
end | |||
|
|||
register 'build-distribution' do |prefix| | |||
prefix.register 'validate-app', Commands::ValidateApp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will this work for Android?
No description provided.