Home  >  Q&A  >  body text

gradle - Android 中 BuildConfig文件为什么能直接使用?

BuildConfig类在/build/generated/source/buildConfig目录下,请问,为什么在/src/java/<package> /下的Java类可以直接调用呢?

是不是编译时通过一些方法忽略了BuildConfig的物理路径?

怪我咯怪我咯2765 days ago518

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-04-18 09:19:03

    gradle has sourceSetsomething to say. The generated code under build and the handwritten code under main/test are all within the SourceSet at compile time.

    reply
    0
  • PHPz

    PHPz2017-04-18 09:19:03

    In fact, this BuildConfig class is similar to the R class, and there is also apt or similar ASM.

    reply
    0
  • Cancelreply