Skip to content

Build for AS canary #5868

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 2 commits into from
Dec 1, 2021
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
2 changes: 1 addition & 1 deletion .github/workflows/presubmit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [AF.3.1, AS.211, 2021.2]
version: [AF.3.1, AS.211, 2021.2, AS.212]
steps:
- name: checkout
uses: actions/checkout@v2
Expand Down
19 changes: 12 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ You can do this online, and it only takes a minute. If you've never submitted co
you must add your (or your organization's) name and contact info to the [AUTHORS](AUTHORS)
file.

NEEDS UPDATING a/o 9 NOV 21

* Install Flutter SDK from [Flutter SDK download](https://flutter.dev/docs/get-started/install) or
[github](https://github.com/flutter/flutter) and set it up according to its instructions.
* Verify installation from the command line:
Expand Down Expand Up @@ -213,19 +211,26 @@ Sometimes browsing the source code of IntelliJ is helpful for understanding plat

## Working with Android Studio

Android Studio cannot use the Gradle-based project definition, so it still needs the `flutter-intellij-community.iml`
file. Obviously, unit tests can only be run from the command line.

1. Initialize Android Studio sources.
2. Checkout Flutter plugin sources, tip of tree.
3. Follow the directions for setting up the Dart plugin sources in
intellij-plugins/Dart/README.md with these changes:
- you do not need to clone the intellij-community repo
- open studio-master-dev/tools/idea in IntelliJ
- open studio-main/tools/adt/idea in IntelliJ
- possibly skip running intellij-community/getPlugins.sh
4. Checkout Dart plugin sources.
5. Using the Project Structure editor, import
- intellij-plugins/Dart/Dart-community.iml
- flutter-intellij
6. Using the Project Structure editor, select the `studio` module and add a module dependency to all modules
that begin with `flutter`, plus `Dart` (make sure `Dart` is at the bottom of the list)
- intellij-plugins/Dart/Dart-community.iml (if there are lots of errors, see step 7)
- flutter-intellij/flutter-intellij-community.iml
6. Using the Project Structure editor, expand the tree to show `intellij > android > adt > ui`. Select the `ui`
module then add a module dependency from it to `flutter-intellij-community`. Also add a dependency on the Dart
module unless using step 7.
7. (Optional, when Dart sources are not usable.) Make sure the `flutter-intellij-community` module has a dependency on a library named
`Dart`. It should be pre-defined, but if it is out-of-date then adjust it to point to `flutter-intellij/lib/dart-plugin/xxx.yyyy/Dart.jar`.
Delete the Dart module from the Project Structure modules list.

## Working with Embedded DevTools (JxBrowser)

Expand Down
11 changes: 0 additions & 11 deletions flutter-idea/src/io/flutter/FlutterUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,6 @@ public static boolean isAndroidStudio() {
return StringUtil.equals(PlatformUtils.getPlatformPrefix(), "AndroidStudio");
}

public static boolean isNewAndroidStudioProjectWizard() {
// TODO (messick) Remove this and its references when Android Studio 4.2 is stable.
if (isAndroidStudio()) {
ApplicationInfo info = ApplicationInfo.getInstance();
int major = Integer.parseInt(info.getMajorVersion());
int minor = Integer.parseInt(info.getMinorVersion());
return true; //major >= 4 && minor >= 2;
}
return false;
}

/**
* Write a warning message to the IntelliJ log.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public void setFlutterSdkPath(String s) {
combo.setItem(s);
}

FlutterCreateAdditionalSettingsFields getSettingsField() {
public FlutterCreateAdditionalSettingsFields getSettingsField() {
return mySettingsFields;
}

Expand Down
84 changes: 24 additions & 60 deletions flutter-intellij-community.iml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
<sourceFolder url="file://$MODULE_DIR$/third_party/intellij-plugins-dart/testSrc" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/third_party/vmServiceDrivers" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/testData" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/flutter-idea/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/flutter-idea/testSrc/unit" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/flutter-idea/third_party/vmServiceDrivers" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/flutter-studio/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/artifacts" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/flutter-idea" />
<excludeFolder url="file://$MODULE_DIR$/flutter-idea/testData/sample_tests/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/flutter-idea/testData/sample_tests/.pub" />
<excludeFolder url="file://$MODULE_DIR$/flutter-idea/testData/sample_tests/build" />
Expand All @@ -38,22 +41,22 @@
<excludeFolder url="file://$MODULE_DIR$/tool/plugin/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/tool/plugin/.pub" />
<excludeFolder url="file://$MODULE_DIR$/tool/plugin/build" />
<excludeFolder url="file://$MODULE_DIR$/flutter-gui-tests" />
<excludeFolder url="file://$MODULE_DIR$/releases" />
<excludeFolder url="file://$MODULE_DIR$/flutter-idea/artifacts" />
<excludeFolder url="file://$MODULE_DIR$/flutter-idea/build" />
<excludeFolder url="file://$MODULE_DIR$/flutter-idea/resources" />
<excludeFolder url="file://$MODULE_DIR$/flutter-idea/testData" />
<excludeFolder url="file://$MODULE_DIR$/flutter-idea/third_party/intellij-plugins-dart" />
<excludeFolder url="file://$MODULE_DIR$/flutter-studio/build" />
<excludeFolder url="file://$MODULE_DIR$/flutter-studio/resources" />
<excludeFolder url="file://$MODULE_DIR$/flutter-studio/testData" />
<excludeFolder url="file://$MODULE_DIR$/flutter-idea/testSrc/integration" />
<excludeFolder url="file://$MODULE_DIR$/flutter-studio/testSrc" />
<excludeFolder url="file://$MODULE_DIR$/flutter-studio/src/io/flutter/module" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="intellij.platform.ide" />
<orderEntry type="module" module-name="intellij.platform.lang" />
<orderEntry type="module" module-name="intellij.platform.lang.impl" />
<orderEntry type="module" module-name="intellij.platform.debugger" />
<orderEntry type="module" module-name="intellij.platform.debugger.impl" />
<orderEntry type="module" module-name="intellij.platform.externalSystem.impl" />
<orderEntry type="module" module-name="intellij.platform.externalSystem.rt" />
<orderEntry type="module" module-name="intellij.platform.testFramework" scope="TEST" />
<orderEntry type="library" name="Velocity" level="project" />
<orderEntry type="module" module-name="intellij.platform.smRunner" />
<orderEntry type="module" module-name="intellij.xml.impl" />
<orderEntry type="module" module-name="intellij.java.ui" />
<orderEntry type="module" module-name="intellij.java.psi.impl" />
<orderEntry type="module-library">
<library>
<CLASSES>
Expand All @@ -75,24 +78,11 @@
</SOURCES>
</library>
</orderEntry>
<orderEntry type="library" exported="" name="Dart SDK" level="project" />
<orderEntry type="module" module-name="intellij.android.core" />
<orderEntry type="module" module-name="intellij.platform.externalSystem" />
<orderEntry type="module" module-name="intellij.gradle.common" />
<orderEntry type="module" module-name="intellij.java.compiler.impl" />
<orderEntry type="module" module-name="intellij.platform.serviceContainer" />
<orderEntry type="library" name="snakeyaml" level="project" />
<orderEntry type="library" name="miglayout-swing" level="project" />
<orderEntry type="library" name="commons-io" level="project" />
<orderEntry type="library" name="com.android.tools:common" level="project" />
<orderEntry type="library" name="studio-analytics-proto" level="project" />
<orderEntry type="library" name="protobuf" level="project" />
<orderEntry type="library" name="com.android.tools.analytics-library:protos" level="project" />
<orderEntry type="module" module-name="intellij.android.gradle.dsl" />
<orderEntry type="module" module-name="intellij.android.projectSystem" />
<orderEntry type="library" name="Trove4j" level="project" />
<orderEntry type="module" module-name="intellij.android.observable" />
<orderEntry type="library" name="jxbrowser-7.19" level="project" />
<orderEntry type="module-library">
<library>
<CLASSES>
Expand All @@ -111,9 +101,7 @@
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Trove4j" level="project" />
<orderEntry type="module" module-name="intellij.android.observable" />
<orderEntry type="library" name="jxbrowser-7.19" level="project" />
<orderEntry type="library" name="studio-plugin-git4idea" level="project" />
<orderEntry type="library" name="studio-plugin-yaml" level="project" />
<orderEntry type="library" name="studio-plugin-gradle" level="project" />
Expand All @@ -127,37 +115,13 @@
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/dart-plugin/203.6912/Dart.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module" module-name="intellij.vcs.git.rt" />
<orderEntry type="module" module-name="intellij.platform.vcs" />
<orderEntry type="module" module-name="intellij.vcs.git" />
<orderEntry type="module" module-name="intellij.platform.ide.util.io" />
<orderEntry type="module" module-name="intellij.platform.core.ui" />
<orderEntry type="module" module-name="intellij.platform.util.classLoader" />
<orderEntry type="module" module-name="intellij.platform.coverage" />
<orderEntry type="module" module-name="intellij.android.common" />
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
<orderEntry type="module-library" scope="RUNTIME">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/dart-plugin/203.6912/resources_en.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
<jarDirectory url="jar://$MODULE_DIR$/lib/dart-plugin/203.6912/resources_en.jar!/" recursive="false" />
</library>
</orderEntry>
<orderEntry type="library" name="Dart Packages" level="project" />
<orderEntry type="library" name="java-string-similarity-2.0.0" level="project" />
<orderEntry type="module" module-name="intellij.yaml" />
<orderEntry type="library" name="mockito" level="project" />
<orderEntry type="library" name="java-string-similarity-2.0.0" level="project" />
<orderEntry type="module" module-name="assistant" />
<orderEntry type="module" module-name="intellij.android.newProjectWizard" />
<orderEntry type="library" name="Dart" level="project" />
<orderEntry type="module" module-name="intellij.android.wizard" />
<orderEntry type="module" module-name="intellij.android.wizard.model" />
</component>
</module>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.intellij.openapi.project.Project;
import com.intellij.openapi.startup.StartupActivity;
import io.flutter.android.AndroidModuleLibraryManager;
import io.flutter.project.FlutterProjectCreator;
//import io.flutter.project.FlutterProjectCreator;
import io.flutter.settings.FlutterSettings;
import io.flutter.utils.AddToAppUtils;
import io.flutter.utils.AndroidUtils;
Expand All @@ -28,7 +28,7 @@ public void runActivity(@NotNull Project project) {

// Unset this flag for all projects, mainly to ease the upgrade from 3.0.1 to 3.1.
// TODO(messick) Delete once 3.0.x has 0 7DA's.
FlutterProjectCreator.disableUserConfig(project);
//FlutterProjectCreator.disableUserConfig(project);
// Monitor Android dependencies.
if (FlutterSettings.getInstance().isSyncingAndroidLibraries() ||
System.getProperty("flutter.android.library.sync", null) != null) {
Expand Down
50 changes: 4 additions & 46 deletions flutter-studio/src/io/flutter/actions/FlutterNewProjectAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,86 +5,44 @@
*/
package io.flutter.actions;

import com.android.tools.idea.ui.wizard.StudioWizardDialogBuilder;
import com.android.tools.idea.wizard.model.ModelWizard;
import com.android.tools.idea.wizard.model.ModelWizardDialog;
import com.intellij.icons.AllIcons;
import com.intellij.ide.impl.NewProjectUtil;
import com.intellij.ide.projectWizard.NewProjectWizard;
import com.intellij.ide.projectWizard.ProjectCategory;
import com.intellij.ide.util.projectWizard.ModuleBuilderFactory;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.module.ModuleType;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.roots.ui.configuration.ModulesProvider;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.wm.impl.welcomeScreen.NewWelcomeScreen;
import com.intellij.ui.LayeredIcon;
import com.intellij.ui.OffsetIcon;
import icons.FlutterIcons;
import io.flutter.FlutterBundle;
import io.flutter.FlutterUtils;
import io.flutter.module.FlutterProjectType;
import io.flutter.project.ChoseProjectTypeStep;
import io.flutter.project.FlutterProjectModel;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.NoSuchElementException;
import javax.swing.Icon;
import org.jetbrains.annotations.NotNull;

@SuppressWarnings("ComponentNotRegistered")
public class FlutterNewProjectAction extends AnAction implements DumbAware {

ModuleBuilderFactory[] originalModuleBuilders;
ProjectCategory[] originalCategories;
List<ModuleType<?>> originalTypes;
ModuleType<?>[] originalModuleTypes;
LinkedHashMap<ModuleType<?>, Boolean> originalModuleMap;

public FlutterNewProjectAction() {
super(FlutterBundle.message("action.new.project.title"));
}

@Override
public void update(@NotNull AnActionEvent e) {
if (NewWelcomeScreen.isNewWelcomeScreen(e)) {
e.getPresentation().setIcon(getFlutterDecoratedIcon());
//e.getPresentation().setIcon(getFlutterDecoratedIcon());
e.getPresentation().setText(FlutterBundle.message("welcome.new.project.compact"));
}
}

@Override
public void actionPerformed(@NotNull AnActionEvent e) {
if (!FlutterUtils.isNewAndroidStudioProjectWizard()) {
FlutterProjectModel model = new FlutterProjectModel(FlutterProjectType.APP);
try {
ModelWizard wizard = new ModelWizard.Builder()
.addStep(new ChoseProjectTypeStep(model))
.build();
StudioWizardDialogBuilder builder = new StudioWizardDialogBuilder(wizard, "Create New Flutter Project");
ModelWizardDialog dialog = builder.build();
try {
dialog.show();
}
catch (NoSuchElementException ex) {
// This happens if no Flutter SDK is installed and the user cancels the FlutterProjectStep.
}
}
catch (NoSuchMethodError x) {
Messages.showMessageDialog("Android Studio canary is not supported", "Unsupported IDE", Messages.getErrorIcon());
}
}
else {
NewProjectWizard wizard = new NewProjectWizard(null, ModulesProvider.EMPTY_MODULES_PROVIDER, null);
NewProjectUtil.createNewProject(wizard);
}
NewProjectWizard wizard = new NewProjectWizard(null, ModulesProvider.EMPTY_MODULES_PROVIDER, null);
NewProjectUtil.createNewProject(wizard);
}

@NotNull
Icon getFlutterDecoratedIcon() {
Icon icon = AllIcons.Welcome.CreateNewProjectTab;
Icon icon = AllIcons.Welcome.CreateNewProject;
Icon badgeIcon = new OffsetIcon(0, FlutterIcons.Flutter_badge).scale(0.666f);

LayeredIcon decorated = new LayeredIcon(2);
Expand Down
Loading