1

I am using AutoParcel and Dagger2 for autogenerated code, which requires use of the gradle android-apt plugin. Which means that the first compile fails, but when you run the task for a second time, it succeeds. Normally this is only a slight annoyance, but this becomes a big issue with continuous integration tools like CircleCI or TravisCI, which always run clean builds.

./gradlew :app:clean
./gradlew :app:compileDebugJava   //fails
./gradlew :app:compileDebugJava   //succeeds

How can an Android dev get around this? Obviously, I do not want every CI build to report a failure.

circle.yml

test:
  pre:
     - ./gradlew :android:compileDebugJava -PdisablePreDex
  override:
     - ./gradlew :android:compileDebugJava -PdisablePreDex
4

1 回答 1

0

添加|| true将使用 CircleCI 将失败的任务报告为成功。

test:
  pre:
     - ./gradlew :android:compileDebugJava -PdisablePreDex || true
  override:
     - ./gradlew :android:compileDebugJava -PdisablePreDex
于 2015-03-30T16:54:40.087 回答