-
Notifications
You must be signed in to change notification settings - Fork 325
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
Define proto module system #1819
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* Copyright 2018 The Chromium Authors. All rights reserved. | ||
* Use of this source code is governed by a BSD-style license that can be | ||
* found in the LICENSE file. | ||
*/ | ||
package io.flutter.project; | ||
|
||
import com.android.tools.idea.projectsystem.AndroidModuleSystem; | ||
import com.android.tools.idea.projectsystem.AndroidProjectSystem; | ||
import com.android.tools.idea.projectsystem.ProjectSystemSyncManager; | ||
import com.android.tools.idea.projectsystem.gradle.GradleProjectSystem; | ||
import com.intellij.openapi.module.Module; | ||
import com.intellij.openapi.project.Project; | ||
import com.intellij.openapi.vfs.VirtualFile; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.nio.file.Path; | ||
|
||
public class FlutterProjectSystem implements AndroidProjectSystem { | ||
@NotNull final private GradleProjectSystem gradleProjectSystem; | ||
|
||
public FlutterProjectSystem(Project project) { | ||
gradleProjectSystem = new GradleProjectSystem(project); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public VirtualFile getDefaultApkFile() { | ||
return gradleProjectSystem.getDefaultApkFile(); | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public Path getPathToAapt() { | ||
return gradleProjectSystem.getPathToAapt(); | ||
} | ||
|
||
@Override | ||
public void buildProject() { | ||
// flutter build ? | ||
} | ||
|
||
@Override | ||
public boolean allowsFileCreation() { | ||
return true; // Enable File>New>New Module | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public AndroidModuleSystem getModuleSystem(@NotNull Module module) { | ||
return gradleProjectSystem.getModuleSystem(module); | ||
} | ||
|
||
@Override | ||
public boolean upgradeProjectToSupportInstantRun() { | ||
return false; // Already done. | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public String mergeBuildFiles(@NotNull String dependencies, | ||
@NotNull String destinationContents, | ||
@Nullable String supportLibVersionFilter) { | ||
return gradleProjectSystem.mergeBuildFiles(dependencies, destinationContents, supportLibVersionFilter); | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public ProjectSystemSyncManager getSyncManager() { | ||
return gradleProjectSystem.getSyncManager(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!-- Defines Android Studio IDE-specific contributions and implementations. --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We may want to look into a system to generate plugin.xml and studio-contribs.xml from the templates and remove the others from source control. Or, have a task on travis fail if changes are made to one file but not to the the other (template and non-template), else they risk getting out of sync. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this sounds good, lets open an issue to track. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We really need to get into the habit of using Adding a fail-safe check to travis sounds good, too. See #1842. |
||
<idea-plugin> | ||
|
||
<extensions defaultExtensionNs="com.android"> | ||
<!-- Add Flutter module types to the New Module wizard --> | ||
<moduleDescriptionProvider implementation="io.flutter.module.FlutterDescriptionProvider"/> | ||
</extensions> | ||
|
||
<extensions defaultExtensionNs="com.android.project"> | ||
@PROJECTSYSTEM@ | ||
</extensions> | ||
|
||
<extensions defaultExtensionNs="com.intellij"> | ||
<!-- TODO(messick): Remove this extension if the class is never needed. --> | ||
<androidStudioInitializer implementation="io.flutter.FlutterStudioInitializer"/> | ||
</extensions> | ||
|
||
<actions> | ||
|
||
<!-- Define the 'New Flutter Project' menu item --> | ||
<action id="flutter.NewProject" class="io.flutter.actions.FlutterNewProjectAction" | ||
text="New Flutter Project..." | ||
description="Create a new Flutter project"> | ||
<add-to-group group-id="NewProjectOrModuleGroup" anchor="after" relative-to-action="NewProject"/> | ||
</action> | ||
|
||
<!-- The icon isn't being used here, but the same syntax works for menu items --> | ||
<!-- We can't change it in a StartupActivity because those don't run until a project is opened --> | ||
<action id="flutter.NewProject.welcome" class="io.flutter.actions.FlutterNewProjectAction" | ||
text="Start a new Flutter project" | ||
icon="FlutterIcons.Flutter" | ||
description="Create a new Flutter project"> | ||
<add-to-group group-id="WelcomeScreen.QuickStart.IDEA" anchor="after" relative-to-action="WelcomeScreen.CreateNewProject"/> | ||
</action> | ||
|
||
</actions> | ||
|
||
</idea-plugin> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍