How to access output files in Travis?

↘锁芯ラ 提交于 2019-12-04 05:04:53

You can use lynx -dump to dump a plain-text rendering of outputs/lint-results-debug.html.

To make Travis install lynx -dump: To the top of your .travis.yml, add this:

addons:
  apt:
    packages:
      - lynx

To make Travis show the lint output using lynx: In the script part of your .travis.yml, add:

after_failure:
  - if [ -f /home/travis/build/leandroBorgesFerreira/MoreCLoseButton/app/build/outputs/lint-results-debug.html ]; then lynx -dump /home/travis/build/leandroBorgesFerreira/MoreCLoseButton/app/build/outputs/lint-results-debug.html; fi

While sideshowbarker gave a generic answer, I'd like to point out that Android lint has an option for console output, so you can do this in your build.gradle:

android {
    lintOptions {
        textReport = true
        //textOutput "stdout" // default location, perfect for travis
    }
}

Which removes the need for an extra dependency, and an extra script; plus it's reproducible on local machine easily.

One can take this a step further (in case spamming console on local machine is to be avoided) and do

android {
    lintOptions {
        textReport = project.property("lint.output.console").toBoolean()
    }
}

and in gradle.properties: lint.output.console=false

and in .travis.yml: gradlew -Plint.output.console=true build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!