Skip to content

Enable envars for run configs #6765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions flutter-idea/src/io/flutter/run/FlutterConfigurationEditorForm.form
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@
</constraints>
<properties/>
</component>
<component id="9a5c8" class="javax.swing.JLabel">
<constraints>
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<enabled value="false"/>
<text value="An optional build flavor; either a Gradle product flavor or an Xcode custom scheme."/>
</properties>
</component>
<component id="45360" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
Expand All @@ -65,7 +56,7 @@
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<margin top="1" left="6" bottom="1" right="27"/>
<margin top="2" left="6" bottom="2" right="29"/>
<text value=""/>
</properties>
</component>
Expand Down Expand Up @@ -93,7 +84,7 @@
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<margin top="1" left="6" bottom="1" right="27"/>
<margin top="2" left="6" bottom="2" right="29"/>
</properties>
</component>
<component id="42996" class="javax.swing.JLabel">
Expand Down Expand Up @@ -143,7 +134,16 @@
</constraints>
<properties>
<enabled value="false"/>
<text value="Additional environment variables; only valid for desktop apps"/>
<text value="Additional environment variables."/>
</properties>
</component>
<component id="9a5c8" class="javax.swing.JLabel">
<constraints>
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<enabled value="false"/>
<text value="An optional build flavor; either a Gradle product flavor or an Xcode custom scheme."/>
</properties>
</component>
</children>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,8 @@ public class FlutterConfigurationEditorForm extends SettingsEditor<SdkRunConfig>
private EnvironmentVariablesTextFieldWithBrowseButton myEnvironmentVariables;
private JLabel myEnvvarLabel;

private static final List<String> DESKTOP_PLATFORMS =
Lists.newArrayList("enable-linux-desktop", "enable-macos-desktop", "enable-windows-desktop", "enable-windows-uwp-desktop");

public FlutterConfigurationEditorForm(final Project project) {
initDartFileTextWithBrowse(project, myFileField);
final FlutterSdk sdk = FlutterSdk.getFlutterSdk(project);
if (sdk != null) {
final Set<String> platforms = sdk.queryConfiguredPlatforms(true);
for (String platform : platforms) {
if (DESKTOP_PLATFORMS.contains(platform)) {
return;
}
}
}
myEnvironmentVariables.setEnabled(false);
myEnvvarLabel.setEnabled(false);
}

@Override
Expand Down