flutter create: enable Java support in IDEA (#9335)
Generates an android.iml file and a package-level library for flutter.jar. Does not set up an Android SDK in IDEA; this isn't possible with a template-based approach. But IDEA shows a clear warning, so the user can fix this by setting the SDK. (When creating a Flutter project from within IDEA, we can fix this up afterwards in the plugin.)
This commit is contained in:
25
packages/flutter_tools/templates/create/.idea/libraries/Dart_SDK.xml.tmpl
generated
Normal file
25
packages/flutter_tools/templates/create/.idea/libraries/Dart_SDK.xml.tmpl
generated
Normal file
@@ -0,0 +1,25 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Dart SDK">
|
||||
<CLASSES>
|
||||
<root url="file://{{dartSdk}}/lib/async" />
|
||||
<root url="file://{{dartSdk}}/lib/collection" />
|
||||
<root url="file://{{dartSdk}}/lib/convert" />
|
||||
<root url="file://{{dartSdk}}/lib/core" />
|
||||
<root url="file://{{dartSdk}}/lib/developer" />
|
||||
<root url="file://{{dartSdk}}/lib/html" />
|
||||
<root url="file://{{dartSdk}}/lib/indexed_db" />
|
||||
<root url="file://{{dartSdk}}/lib/io" />
|
||||
<root url="file://{{dartSdk}}/lib/isolate" />
|
||||
<root url="file://{{dartSdk}}/lib/js" />
|
||||
<root url="file://{{dartSdk}}/lib/js_util" />
|
||||
<root url="file://{{dartSdk}}/lib/math" />
|
||||
<root url="file://{{dartSdk}}/lib/mirrors" />
|
||||
<root url="file://{{dartSdk}}/lib/svg" />
|
||||
<root url="file://{{dartSdk}}/lib/typed_data" />
|
||||
<root url="file://{{dartSdk}}/lib/web_audio" />
|
||||
<root url="file://{{dartSdk}}/lib/web_gl" />
|
||||
<root url="file://{{dartSdk}}/lib/web_sql" />
|
||||
</CLASSES>
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
9
packages/flutter_tools/templates/create/.idea/libraries/flutter_for_android.xml.tmpl
generated
Normal file
9
packages/flutter_tools/templates/create/.idea/libraries/flutter_for_android.xml.tmpl
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Flutter for Android">
|
||||
<CLASSES>
|
||||
<root url="jar://{{androidFlutterJar}}!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
@@ -3,6 +3,7 @@
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/{{projectName}}.iml" filepath="$PROJECT_DIR$/{{projectName}}.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/android.iml" filepath="$PROJECT_DIR$/android.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
|
||||
12
packages/flutter_tools/templates/create/android.iml.tmpl
Normal file
12
packages/flutter_tools/templates/create/android.iml.tmpl
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$/android">
|
||||
<sourceFolder url="file://$MODULE_DIR$/android/app/src/main/java" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android API {{androidSdkVersion}} Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Flutter for Android" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
Reference in New Issue
Block a user