Skip to content

Conversation

@devoncarew
Copy link
Contributor

@devoncarew devoncarew commented Jul 18, 2017

  • pass the value of the android sdk in flutter config --machine
  • mark flutter config as one of the commands that doesn't need the cache populated (otherwise, querying for the android sdk location could be a very expensive operation)
  • pretty print the returned json

@tvolkert, @pq

@devoncarew
Copy link
Contributor Author

{
  "android-studio-dir": "/Applications/Android Studio 3.0 Preview.app/Contents",
  "android-sdk": "/Users/devoncarew/tools/android-sdk-macosx"
}

Copy link
Contributor

@tvolkert tvolkert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to allow the user to use flutter config to specify the Android SDK directory, for cases where ANDROID_HOME doesn't work (like a dock-launched IDE).

Can the IDE trigger ConfigCommand to write preferences?

@override
final List<String> aliases = <String>['configure'];

@override
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parent class already defaults to true - is this just to be explicit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Urk - no. This was a copy-paste error - this should be disabling shouldUpdateCache for flutter config.

Copy link
Contributor

@pq pq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@devoncarew
Copy link
Contributor Author

We probably want to allow the user to use flutter config to specify the Android SDK directory, for cases where ANDROID_HOME doesn't work (like a dock-launched IDE).

Makes sense - I can add a flutter config --android-sdk=/foo/bar option.

Can the IDE trigger ConfigCommand to write preferences?

Not sure what you mean here. The IDE could pass in flutter config --android-sdk=/foo/bar. I don't know that the IDE currently needs to have flutter tools persist the value. Or do you mean that it should write the inferred value (discovered indirectly via the path) to the config file?

}

printStatus(JSON.encode(results));
printStatus(const JsonEncoder.withIndent(' ').convert(results));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IntelliJ can handle formatted JSON?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup!

Copy link
Contributor

@tvolkert tvolkert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tvolkert
Copy link
Contributor

The IDE could pass in flutter config --android-sdk=/foo/bar. I don't know that the IDE currently needs to have flutter tools persist the value.

Yeah, that's what I meant. My thought is that if IntelliJ knows that there's no Android SDK configured as far as flutter tools sees it (which it should be able to know after this PR), then it could allow the user to specify the SDK location in IntelliJ, and that data would get written to the flutter config store.

@devoncarew
Copy link
Contributor Author

devoncarew commented Jul 18, 2017

My thought is that if IntelliJ knows that there's no Android SDK configured as far as flutter tools sees it (which it should be able to know after this PR), then it could allow the user to specify the SDK location in IntelliJ, and that data would get written to the flutter config store.

Makes sense. We could implement something like that - the user already has a way in IntelliJ to specify where the android sdk is from the POV of the intellij android tooling.

I updated this PR to allow the user to pass in flutter config --android-sdk=/foo/bar, and added tests to match -

Copy link
Contributor

@tvolkert tvolkert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@devoncarew devoncarew merged commit c186d0d into flutter:master Jul 19, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants