zpy
zpy

Reputation: 187

how to sync gradle with terminal

Android studio sync build.gradle is so slow, this is a part of log:

:app:incrementalApkFlavorReleaseUnitTestJavaCompilationSafeguard UP-TO-DATE
:app:preApkFlavorReleaseUnitTestBuild UP-TO-DATE
:app:prepareApkFlavorReleaseUnitTestDependencies
:app:compileApkFlavorReleaseUnitTestJavaWithJavac UP-TO-DATE
:app:processApkFlavorReleaseUnitTestJavaRes UP-TO-DATE
:app:compileApkFlavorReleaseUnitTestSources UP-TO-DATE
:app:assembleApkFlavorReleaseUnitTest
:app:testApkFlavorReleaseUnitTest UP-TO-DATE
:app:incrementalPluginFlavorDebugUnitTestJavaCompilationSafeguard UP-TO-DATE
:app:prePluginFlavorDebugUnitTestBuild UP-TO-DATE
:app:preparePluginFlavorDebugUnitTestDependencies
:app:compilePluginFlavorDebugUnitTestJavaWithJavac UP-TO-DATE
:app:processPluginFlavorDebugUnitTestJavaRes UP-TO-DATE
:app:compilePluginFlavorDebugUnitTestSources UP-TO-DATE
:app:assemblePluginFlavorDebugUnitTest
:app:testPluginFlavorDebugUnitTest UP-TO-DATE
:app:incrementalPluginFlavorReleaseUnitTestJavaCompilationSafeguard UP-TO-DATE
:app:prePluginFlavorReleaseUnitTestBuild UP-TO-DATE
:app:preparePluginFlavorReleaseUnitTestDependencies
:app:compilePluginFlavorReleaseUnitTestJavaWithJavac UP-TO-DATE
:app:processPluginFlavorReleaseUnitTestJavaRes UP-TO-DATE
:app:compilePluginFlavorReleaseUnitTestSources UP-TO-DATE
:app:assemblePluginFlavorReleaseUnitTest
:app:testPluginFlavorReleaseUnitTest UP-TO-DATE
:app:test UP-TO-DATE
:app:check
:app:build

BUILD SUCCESSFUL

it will build all flavor ,do check , etc.. I was very hurt, you never know how hard one gay from China want to build a project. the slow DNS, the netwok limit.. Pzzzz.. my heart..oh..

So, what can i do with terminal , is there a task do sync ? I don't want do any redundant task. By the way , can I see the source code of android studio sync ? can i configure it?

Upvotes: 5

Views: 9950

Answers (2)

dosentmatter
dosentmatter

Reputation: 1624

If you have

apply plugin: 'eclipse'

You can do gradle eclipse cleanEclipse. It sets up the project for eclipse and downloads all dependencies. Then cleanEclipse to remove the eclipse files.

I haven't tested, but I think this should allow gradle sync to run those two tasks. Adapted from this stackoverflow post

task sync(type: GradleBuild) {
     tasks = ['eclipse', 'cleanEclipse']
}

Upvotes: 0

Sachin Saxena
Sachin Saxena

Reputation: 604

With command line in your root project

./gradlew build

It will sync and build your app

To see all available gradle task, use ./gradlew tasks

Upvotes: 6

Related Questions