问题
I'm setting up react-native build in AppCenter.
Everything works on test projects, but in a real repository I'm facing the following issue:
For best performance, the analysis is currently limited to four directory levels including the root of your repository. (Quote from official docs)
My package.json is 2 levels deep (/folder1/folder2/package.json), so build.gradle is located 5 levels deep (/folder1/folder2/android/app/build.gradle).
So when I set up the build in AppCenter I'm able to specify the Project field (pointing to my package.json), but Build Variant combobox is empty.
Is there any solution for that? Can I specify Build Variant manually?
P.S. If I simply move the project one folder above - everything works fine. But I can't do that in my monorepository.
回答1:
The workaround we are currently using: we created a separate repo with 1-level less nesting, and I'm copying my folder to another repo on each push (via TeamCity). So, having a repo structure like this:
project
│───frontend
│ └───shared
│ └───web
│ └───react-native
│ │ package.json --> this is the folder we want to build in AppCenter
│ │ ...
│
└───backend
└── somefile.cs
We set up git-hooks to copy the frontend folder to another repo:
root
└───shared
└───web
└───react-native
│ package.json --> this is the folder we want to build in AppCenter
│ ...
So we got one level less deep repository which is ok for AppCenter.
来源:https://stackoverflow.com/questions/55887561/appcenter-build-react-native-project-which-is-2-levels-deep-in-git