在 Jenkins 上构建产品风味时出现编译错误

Compilation Error on building product flavors on Jenkins

我配置了2种产品风格,我很少有根据特定产品风格定制的文件,常用文件在main.xml中。 我可以使用命令行和 Android studio 构建项目。当我使用 Jenkin 构建项目时,它会报告编译错误并期望产品风味特定文件出现在 main 中。 为什么会有这种不同的行为?详细阐述了以下问题:

src/flavorA/java/MyFragment
src/flavorB/java/MyFragment
src/main/java/MainActivity
gradlew clean build, this is building fine with command line and Android Studio
While Jenkin reports error as
> Task :test-apps:compileClientAppDebugJavaWithJavac FAILED
/opt/jenkins_home/workspace/A-9807/app/src/main/java/com/example/sampleapp/HomePagerAdapter.java:8 error: cannot find symbol
import com.example.sampleapp.MyFragment;

终于找到了根本原因,我的 Jenkins 机器是 Linux 机器,Linux 中的文件系统区分大小写。虽然我的本地机器有 Windows 并且我已经在 camelCase 中定义了产品风味,但实际上在 PascalCase[=10 中为风味创建了目录=]