是否有任何插件或解决方案来过滤源文件。当我使用maven时,有插件https://github.com/wavesoftware/templating-maven-plugin
这个插件就像魅力一样,有任何gradle解决方案,以达到相同的效果。
例如,我是crate接口,其中包含有关构建的所有信息:
public interface BuildConfig {
public static final String PROFILE_FAST = "fast";
public static final String PROFILE_DEV = "dev";
public static final String PROFILE_TEST = "test";
public static final String PROFILE_UAT = "uat";
public static final String PROFILE_PROD = "prod";
public static final String APP_CODE = "${app-code}";
public static final String PROFILE_ID = "${profile-id}";
public static final String APP_VERSION = "${project.version}";
public static final boolean DEBUG = !("${profile-id}").equals(PROFILE_PROD);
}
谢谢