建设机器人工作室项目时,运行皮棉皮棉、机器人、工作室、项目

2023-09-05 07:52:01 作者:一失足成大瘸子

我希望能够运行,当我建立了Android Studio项目,以确保得到遵守的规则皮棉皮棉任务。

我使用任务相关性,但没有运气都试过了。我的TeamCity构建服务器使用它运行皮棉任务生成任务,使伟大工程。然而,Android的工作室似乎使用generateDebugSources和compileDebugJava任务交替时,我选择了调试版本的变种。

下面是我曾在我的build.gradle:

  assemble.dependsOn皮棉
 

解决方案 杭州师范大学附属中学机器人工作室

如果你只是想配置你的Andr​​oid Studio项目,而不影响您的摇篮任务是如何配置运行默认的运行配置前皮棉检查,可以按照以下步骤。

打开运行配置下拉菜单,选择修改

选择您的应用程序的运行配置

preSS的+添加一个新的台阶

选择摇篮感知使

键入检查,并选择与您的应用程序模块名称和检查的选项。 (我的是:应用:检查

preSS向上箭头将新的检查现有的摇篮感知化妆前一步一步

现在,Android的工作室将运行绒毛检查和构建失败,如果发生任何皮棉错误。

I would like to be able to run the lint task when I'm building projects with android studio to ensure the lint rules are being followed.

I have tried using task dependencies but with no luck. My teamcity build server uses the build task which runs the lint task, so that works great. However, android studio appears to use generateDebugSources and compileDebugJava tasks interchangeably when I have selected the debug build variant.

Here is what I have tried in my build.gradle:

assemble.dependsOn lint

解决方案

If you just want to configure your Android Studio project to run the lint check before the default run configuration without affecting how your gradle tasks are configured, you can follow these steps.

Open the run configurations drop down and choose edit

Select your app run configuration

Press the '+' to add a new step

Choose "Gradle-aware Make"

Type 'check' and choose the option with your app module name and check. (Mine is :app:check)

Press the up arrow to move the new check step before the existing Gradle-aware make step

Now, Android Studio will run the lint check and fail the build if any lint errors occur.