Skip to content

Changing build folder destination issue ( .flutter_settings file) #18140

@cfkloss

Description

@cfkloss

In native android development we can change the build folder destination adding the line below to the project "build.gradle" file:

allprojects {
    repositories {
      ...
    }
    buildDir = "C:/dev_build/android/${rootProject.name}/${project.name}"
}

With Flutter I tried @cbracken instructions to create the .flutter_settings file at the home folder with this content: {"build-dir": "somePath"} and I found the following issues:

  • It affects all flutter projects.
  • The path have to be relative or we get an exception
  • The path have to exist beforehand or we get an exception
  • After an complete build I found only 3 files in this new path: frontend_server.d, app.dill and app.dill.incremental.dill. All the others files went to the default "build" folder inside the project.

Ideally, I think, it should (as in native android):

  1. Have an absolute path support
  2. Create the path when it does not exist.
  3. Have some way to interpolate the project name into the path
  4. Be a by project configuration.

The reasons to change the build destination that I can think of are:

  1. To avoid polluting the project folder with generated files
  2. To avoid copying the build files (>300MB) when doing a backup of the project folder
  3. To avoid wearing out a SSD when the project is in one
  4. Put the build files on a faster device to reduce building time

I know that this is not a priority issue for now but it would be nice to have it visited in a near future.

By the way, congratulations on building this amazing framework. I'm really loving Flutter.

flutter build apk --verbose -->build.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: new featureNothing broken; request for a new capabilityteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions