How to disable automatic gradle builds?

已回答

Hello,

Each time when I make changes to my build.gradle IDEA runs build process. How to disable this?

1

Please try to disable "Use auto-import" in "Settings (Preferences) | Build... | Build Tools | Gradle"

0

Disable the Use auto-import option:

3
Avatar
Permanently deleted user

Even after disabling this the sync gets triggered after a Gradle task is completed.
Which is wasting quite some development time as our project has approx. 200 modules out of which roughly 10 are Android Apps and other 190 are Java based Gradle modules.

How to completely turn off auto-sync/auto-import?

Here are some logs that show that after Gradle task completion a Gradle Sync is triggered:

2018-02-19 16:19:07,816 [263467361]   INFO - idea.run.AndroidProcessHandler - Adding device xyz-OC4086K00530 to monitor for launched app: com.xyz.android.abc.def.ghi 
2018-02-19 16:19:14,715 [263474260]   INFO - pl.ProjectRootManagerComponent - project roots have changed
2018-02-19 16:19:14,876 [263474421]   INFO - a.gradle.run.MakeBeforeRunTask - Gradle invocation complete, success = true
2018-02-19 16:19:15,017 [263474562]   INFO - ild.invoker.GradleBuildInvoker - About to execute Gradle tasks: [:ABC Android.app1:assembleDebug]
2018-02-19 16:19:15,023 [263474568]   INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:\Program Files\Java\jdk1.8.0_144
2018-02-19 16:19:15,023 [263474568]   INFO - util.EmbeddedDistributionPaths - Looking for embedded Maven repo at 'C:\Program Files\prebuilts\tools\common\offline-m2'
2018-02-19 16:19:15,023 [263474568]   INFO - ild.invoker.GradleBuildInvoker - Build command line options: [--configure-on-demand, --parallel, -Pandroid.injected.invoked.from.ide=true, -Pandroid.injected.build.api=18, -Pandroid.injected.build.density=mdpi, -Pandroid.injected.build.abi=armeabi-v7a,armeabi]
2018-02-19 16:19:15,031 [263474576]   INFO - xecution.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: --configure-on-demand --parallel -Pandroid.injected.invoked.from.ide=true -Pandroid.injected.build.api=18 -Pandroid.injected.build.density=mdpi -Pandroid.injected.build.abi=armeabi-v7a,armeabi --offline
2018-02-19 16:19:15,125 [263474670]   INFO - .diagnostic.PerformanceWatcher - Pushing properties took 101ms; general responsiveness: ok; EDT responsiveness: ok
2018-02-19 16:19:15,190 [263474735]   INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 65ms; general responsiveness: ok; EDT responsiveness: ok
2018-02-19 16:19:28,555 [263488100]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 2ms
2018-02-19 16:19:28,555 [263488100]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 2ms
2018-02-19 16:19:52,810 [263512355]   INFO - pl.ProjectRootManagerComponent - project roots have changed
2018-02-19 16:19:53,215 [263512760]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 4 to update, calculated in 0ms
2018-02-19 16:19:53,216 [263512761]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:19:56,987 [263516532]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:20:00,175 [263519720]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 25ms
2018-02-19 16:20:00,622 [263520167]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 1ms
2018-02-19 16:20:00,782 [263520327]   INFO - .diagnostic.PerformanceWatcher - Reindexing refreshed files took 7567ms; general responsiveness: ok; EDT responsiveness: 1/7 sluggish, 6/7 very slow
2018-02-19 16:20:00,942 [263520487]   INFO - .diagnostic.PerformanceWatcher - Pushing properties took 101ms; general responsiveness: ok; EDT responsiveness: ok
2018-02-19 16:20:01,047 [263520592]   INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 105ms; general responsiveness: ok; EDT responsiveness: ok
2018-02-19 16:20:01,325 [263520870]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:20:41,628 [263561173]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 1ms
2018-02-19 16:20:41,689 [263561234]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:20:45,520 [263565065]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 11ms
2018-02-19 16:20:45,523 [263565068]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 1 to update, calculated in 1ms
2018-02-19 16:20:47,632 [263567177]   INFO - .diagnostic.PerformanceWatcher - Reindexing refreshed files took 2109ms; general responsiveness: ok; EDT responsiveness: 0/2 sluggish, 1/2 very slow
2018-02-19 16:20:57,361 [263576906]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 6ms
2018-02-19 16:20:57,361 [263576906]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 6ms
2018-02-19 16:20:58,231 [263577776]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:20:58,233 [263577778]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 1ms
2018-02-19 16:20:58,946 [263578491]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 1ms
2018-02-19 16:20:58,946 [263578491]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:20:59,736 [263579281]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:20:59,742 [263579287]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 5ms
2018-02-19 16:21:01,444 [263580989]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 1ms
2018-02-19 16:21:01,464 [263581009]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:21:03,106 [263582651]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:21:03,106 [263582651]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:21:05,796 [263585341]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:21:05,807 [263585352]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:21:07,680 [263587225]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 14ms
2018-02-19 16:21:07,680 [263587225]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 15ms
2018-02-19 16:21:09,249 [263588794]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:21:09,267 [263588812]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 9ms
2018-02-19 16:21:10,957 [263590502]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 9ms
2018-02-19 16:21:10,958 [263590503]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 2ms
2018-02-19 16:21:12,904 [263592449]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:21:12,928 [263592473]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 10ms
2018-02-19 16:21:14,174 [263593719]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 1ms
2018-02-19 16:21:14,183 [263593728]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 9ms
2018-02-19 16:21:16,467 [263596012]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 2ms
2018-02-19 16:21:16,496 [263596041]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 20ms
2018-02-19 16:21:17,717 [263597262]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:21:17,718 [263597263]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:21:18,700 [263598245]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 1ms
2018-02-19 16:21:18,751 [263598296]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:21:19,696 [263599241]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:21:19,708 [263599253]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 1ms
2018-02-19 16:21:21,784 [263601329]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:21:21,785 [263601330]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 1ms
2018-02-19 16:21:44,605 [263624150]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 1ms
2018-02-19 16:21:44,605 [263624150]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:22:03,340 [263642885]   INFO - pl.ProjectRootManagerComponent - project roots have changed
2018-02-19 16:22:06,552 [263646097]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 5 to update, calculated in 0ms
2018-02-19 16:22:06,595 [263646140]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 1ms
2018-02-19 16:22:07,230 [263646775]   INFO - .diagnostic.PerformanceWatcher - Reindexing refreshed files took 678ms; general responsiveness: ok; EDT responsiveness: 1/1 sluggish
2018-02-19 16:22:07,489 [263647034]   INFO - .diagnostic.PerformanceWatcher - Pushing properties took 207ms; general responsiveness: ok; EDT responsiveness: ok
2018-02-19 16:22:07,616 [263647161]   INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 127ms; general responsiveness: ok; EDT responsiveness: ok
2018-02-19 16:22:21,319 [263660864]   INFO - pl.ProjectRootManagerComponent - project roots have changed
2018-02-19 16:22:21,537 [263661082]   INFO - a.gradle.run.MakeBeforeRunTask - Gradle invocation complete, success = true
2018-02-19 16:22:21,684 [263661229]   INFO - e.project.sync.GradleSyncState - Started sync with Gradle for project 'ABC'.
2018-02-19 16:22:21,684 [263661229]   INFO - .diagnostic.PerformanceWatcher - Pushing properties took 54ms; general responsiveness: ok; EDT responsiveness: ok
2018-02-19 16:22:21,725 [263661270]   INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:\Program Files\Java\jdk1.8.0_144
2018-02-19 16:22:21,726 [263661271]   INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:\Program Files\Java\jdk1.8.0_144
2018-02-19 16:22:21,796 [263661341]   INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 112ms; general responsiveness: ok; EDT responsiveness: ok
2018-02-19 16:22:21,801 [263661346]   INFO - util.EmbeddedDistributionPaths - Looking for embedded Maven repo at 'C:\Program Files\prebuilts\tools\common\offline-m2'
2018-02-19 16:22:21,816 [263661361]   INFO - xecution.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: -Didea.version=2017.3.4 -Djava.awt.headless=true -Pandroid.injected.build.model.only=true -Pandroid.injected.build.model.only.advanced=true -Pandroid.injected.invoked.from.ide=true --init-script C:\Users\vij.MICRODOC\AppData\Local\Temp\ijinit.gradle --offline
2018-02-19 16:22:21,967 [263661512]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:22:22,059 [263661604]   INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-02-19 16:22:22,268 [263661813]   INFO -                    #InstantRun - Using legacy/main APK deploy task
2018-02-19 16:22:22,268 [263661813]   WARN - ols.idea.run.GradleApkProvider - Android model is null. Sync might have failed
0
Avatar
Permanently deleted user

is what you are looking for i think

0

请先登录再写评论。