如何在构建期间修改Java / Swift源代码

时间:2020-01-31 16:41:54

标签: java android ios swift feature-selection

让我说

Given def color = 'red '
And def num = 5
Then assert color + num == 'red 5'

我想在构建时修改源代码,以便根据某些构建时参数完全删除1或2的源代码。

那里有图书馆吗? 我不想将bash脚本与'sed'一起使用。

编辑:这是针对iOS和Android建筑

1 个答案:

答案 0 :(得分:0)

这听起来像是Makefile的绝佳应用...

https://github.com/therealglazou/swift-makefiles

http://www.glazman.org/weblog/dotclear/index.php?post/2016/02/19/A-makefile-based-build-system-for-Swift

众所周知,Unix / Linux make命令专门用于轻松指定在构建过程中要包含或排除的功能。