0

在 Eclipse 中,团队使用 python 脚本在 res 文件夹中生成一些字符串,这反过来会更新 gen.

我想知道如何将它包含在 intellij/Android Studio 中。有什么地方可以让我参与这个过程吗?

我们处于迁移的早期阶段,所以不要使用 gradle 来构建。

4

1 回答 1

2

您可以在 build.gradle 配置中创建自定义任务,然后将它们设置为相应默认任务的依赖项。例如,我需要在构建之前运行一个 python 脚本,所以我这样做了:

task myCustomTask(type:Exec, description: 'Run the pre-build python script') {
    workingDir 'scripts'
    commandLine 'python', 'my_script.py'
}
// This ensures my script will be called before building
preBuild.dependsOn myCustomTask
于 2013-10-09T17:13:54.113 回答