fastlane-community / fastlane-plugin-ionic

Integrate your Ionic build into your Fastlane setup
MIT License
86 stars 45 forks source link

Lane Continues Running After Build Failure #32

Open btate opened 5 years ago

btate commented 5 years ago

I'm getting a build error for my android build that has something to do with a gradle configuration. The troubling thing about this is that the plugin doesn't report it.

begin
   ionic(
     platform: 'android',
      keystore_path: ENV['ANDROID_KEYSTORE_PATH'],
      keystore_alias: ENV['ANDROID_KEYSTORE_ALIAS'],
      keystore_password: ENV['ANDROID_KEYSTORE_PASSWORD'],
    )
rescue
  puts "Ionic build failed"
end

When this runs I get an error

[14:03:45]: ▸ BUILD FAILED in 2s
[14:03:45]: ▸ at ChildProcess.whenDone (/path/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
[14:03:45]: ▸ at emitTwo (events.js:126:13)
[14:03:46]: ▸ at ChildProcess.emit (events.js:214:7)
[14:03:46]: ▸ at maybeClose (internal/child_process.js:925:16)
[14:03:46]: ▸ at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

When that build error happens, the "Ionic build failed" message is never displayed. So I'm assuming the rescue block is never run. How do I account for a build failure and stop executing my lane?

janpio commented 5 years ago

You probably can't right now - one would have to investigate where in the chain of tools it doesn't properly throw an error that can stop the execution of the lane. ionic, cordova, this plugin... one of those current doesn't properly handle that error event it seems :/