如何从命令行运行“重建项目”

时间:2017-02-14 14:28:09

标签: android windows android-studio gradle msbuild

一些上下文:

我正在使用MSBuild进行持续集成管道,用于包含Android应用程序的大型项目。此应用程序包括一些需要定期集成到项目中的自动生成的文件。这通常是通过手动复制它们并在android studio中选择Build-> rebuild项目来完成的。

此步骤是必要的,因为该项目还使用AndroidAnnotations,它在编译时生成类。

问题:

我没有找到任何关于在an​​droid studio中选择'rebuild project'时运行的文档。

我尝试过的事情:

How to Rebuild and Run android project from command line

以及:

What is happened after I run rebuild project in Android studio?

但是doccumentation here没有谈论重建命令,而且6周的udacity课程也不是一个有用的资源。

当我点击'rebuild project'时,Android Studio事件日志显示为:

  

执行任务:[clean,:app:generateDevelopmentDebugSources,:app:generateDevelopmentDebugAndroidTestSources,:app:prepareDevelopmentDebugUnitTestDependencies,:app:mockableAndroidJar,:app:compileDevelopmentDebugSources,:app:compileDevelopmentDebugAndroidTestSources,:app:compileDevelopmentDebugUnitTestSources]

我在命令行中运行的内容如下:

  

gradlew.bat clean:app:generateDevelopmentDebugSources:app:generateDevelopmentDebugAndroidTestSources:app:prepareDevelopmentDebugUnitTestDependencies:app:mockableAndroidJar:app:compileDevelopmentDebugSources:app:compileDevelopmentDebugAndroidTestSources:app:compileDevelopmentDebugUnitTestSources

该命令执行,但构建完成时有几百个错误,当您尝试编译或清理而不首先运行重建时也会发生这种错误。显然这个命令不完整。

当我在Android Studio中查看Gradle控制台时,我看到了几十个运行的目标,但是我对于复制粘贴这些目标犹豫不决,因为我不知道项目的哪些小改动将需要不同的目标要运行。

我已将问题范围缩小到:app:compileDevelopmentDebugUnitTestJavaWithJavac目标。此目标需要Gradle控制台中列出的其他目标之一,但我不知道哪一个。

那些目标必须来自某个地方,但在哪里呢?

TL; DR:

当我从命令行运行'rebuild project'时,如何完成Android Studio所做的所有事情?

0 个答案:

没有答案
相关问题