Gradle global build directory

后端 未结 3 1463
刺人心
刺人心 2020-12-04 18:21

I want to know is it possible to configure Gradle to use one global build directory for all projects? I need this because I store all my projects in Google Driv

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-04 19:06

    You could also go the opposite way. Replace the build folder with a global folder.

    1. Remove project's build folder
    2. mklink /d ...disk\path\to\project\build ...RAM\path\to\project (or ln in Unix)
    3. Build fast

    You can automate this in the clean task, so a gradlew clean cleans the folder contents and recreates the link.

    With some quick testing it seems that Google Drive doesn't recognize directory in junction links on Windows. It'll sync the folders, but not the contents. Weirdly if I upload files to Drive into those folders, they're synced into the local copy. But, if I delete the synced file from the disk, the deletion is not synced back. It seems links cause Drive to be one way.

提交回复
热议问题