首页 > 解决方案 > Fatstlane - 我如何对车道进行分组?

问题描述

这个问题部分*在这里提出:https ://github.com/fastlane/fastlane/issues/6994

不幸的是,它从未得到回答,OP 在找到解决方法后将其关闭。重用他的示例,这是Appfile当前的样子:

app_identifier "my.beta.App"

for_lane :test do 
    app_identifier "my.production.App"
end

for_lane :distributeTestVersion do 
    app_identifier "my.production.App"
end

for_lane :release do
    app_identifier "my.production.App"
end

而不是所有的重复,能够做类似的事情会很好:

app_identifier "my.beta.App"

for_group :production do
    app_identifier "my.production.App"
end

然后Fastfile看起来像这样:

platform :ios do
    group :beta do
        # All lanes related to the beta
    end

    group :production do
        lane :test do
            # ...
        end
        
        lane :distributeTestVersion do
            # ...
        end
        
        lane :release do
            # ...
        end
    end
end

我想这可能是 的功能请求Fastlane,但是虽然我喜欢这个特定的解决方案,但我非常喜欢现在可用的东西。所以我认为在提出功能请求之前询问现在可用的内容是有意义的。

* 部分我的意思是这个问题只涉及配置文件中的通道分组(例如Appfile)。我想分组车道的主要目的是简化配置,但它也有助于构建你的Fastfile,我觉得这个问题根本不关心。例如,它可以用于before_all在组级别上实现只为该组执行的钩子(例如)。

标签: iosrubyconfigurationgroupingfastlane

解决方案


推荐阅读