简体   繁体   English

AppCenter:在 Git 中构建 2 层深的 React-Native 项目

[英]AppCenter: build React-Native project which is 2 levels deep in Git

I'm setting up react-native build in AppCenter.我正在 AppCenter 中设置 react-native 构建。

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 ).我的 package.json 有 2 层深 ( /folder1/folder2/package.json ),所以build.gradle位于 5 层深 ( /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.因此,当我在 AppCenter 中设置构建时,我能够指定Project字段(指向我的package.json ),但是Build Variant组合框是空的。

Is there any solution for that?有什么解决办法吗? Can I specify Build Variant manually?我可以手动指定Build Variant吗?

PS If I simply move the project one folder above - everything works fine. PS 如果我只是将项目移动到上面的一个文件夹 - 一切正常。 But I can't do that in my monorepository.但是我不能在我的单一存储库中这样做。

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).我们目前使用的解决方法:我们创建了一个单独的回购协议,嵌套少了 1 级,并且我在每次推送时将我的文件夹复制到另一个回购协议(通过 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:我们设置 git-hooks 将frontend文件夹复制到另一个仓库:

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.所以我们得到了一层更深的存储库,这对 AppCenter 来说是可以的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM