-
Notifications
You must be signed in to change notification settings - Fork 308
ide: Include .idea/zulip.iml #637
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
ide: Include .idea/zulip.iml #637
Conversation
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.
Thanks for sending this!
One complication in trying to merge something like this for general use is that Android Studio seems to pick a variety of names for this .iml
file.
- For you, it's
.idea/zulip-flutter.iml
. - For me on my desktop in the office, it's
.idea/flutter.iml
.
From those two, it seemed like the pattern was that it uses the basename of the project's parent directory — your clone of this repo is in a directory whose name ends in …/zulip-flutter
, and mine is at ~/z/flutter
. (Generally I leave the zulip-
prefix off of these directories' names, to keep down the amount of typing or tab-completion to get to them. Similarly I have my zulip-mobile tree at ~/z/mobile
.)
But then the wrinkles continue:
-
For me on my main desktop, at home, the file is at
zulip.iml
— outside the.idea/
directory, at the root of the tree.(Meanwhile this tree is at
~/z/flutterz
— same idea as above, but I also wanted it to have a different basename from my checkout of Flutter itself, because parts of the Android Studio UI identify a project by just the basename of its directory.)
I don't know why that one's in a different place.
… Aha — it's because flutter create
put it there, back when I began the prototype. See the template file packages/flutter_tools/templates/app_shared/projectName.iml.tmpl
in the Flutter upstream tree.
So, maybe we can put the file there and it'll work? The experiment to try would be:
- Exit Android Studio.
- Move your
.idea/zulip-flutter.iml
to justzulip.iml
. - Re-open Android Studio.
- Confirm that it's using the file from its new location: that it hasn't made any new
.iml
file, and that the excluded folders are excluded.
.idea/zulip-flutter.iml
Outdated
<excludeFolder url="file://$MODULE_DIR$/packages/zulip_plugin/.pub" /> | ||
<excludeFolder url="file://$MODULE_DIR$/packages/zulip_plugin/build" /> | ||
<excludeFolder url="file://$MODULE_DIR$/packages/zulip_plugin/.dart_tool" /> | ||
<excludeFolder url="file://$MODULE_DIR$/macos/Flutter/ephemeral" /> |
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.
Another good line to add, from looking at what I have on my home desktop:
<excludeFolder url="file://$MODULE_DIR$/scripts/icons/node_modules" />
.idea/zulip-flutter.iml
Outdated
<excludeFolder url="file://$MODULE_DIR$/linux/flutter/ephemeral" /> | ||
<excludeFolder url="file://$MODULE_DIR$/windows/flutter/ephemeral" /> | ||
</content> | ||
<orderEntry type="inheritedJdk" /> |
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.
This element is absent in the file on my home desktop. I'm not sure what it means.
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.
Yeah, I'm not sure either. Maybe leave it out, and if we need it we'll eventually find out?
I think I've gotten this to work, but I think an <?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/zulip.iml" />
</modules>
</component>
</project>
Should we commit that file too, and if so, is it OK for it to stay in Is there a reason to prefer moving the |
Sure, let's try that, then.
FWIW I have such a file too, and it looks like this: <?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/zulip.iml" filepath="$PROJECT_DIR$/zulip.iml" />
<module fileurl="file://$PROJECT_DIR$/android/zulip_android.iml" filepath="$PROJECT_DIR$/android/zulip_android.iml" />
</modules>
</component>
</project> The timestamp looks like when I started the prototype. There's a corresponding template in the Flutter tree, which fits. The |
I've found this very helpful when I want to use Android Studio's "merged manifest" feature. The "Merged Manifest" tab isn't offered when you open the project from the root, but it is offered when you open the |
9148cc6
to
f18a408
Compare
Thanks for the review! Revision pushed. |
Thanks! Pushed to the branch a couple of changes, based on testing on my office desktop just now and our in-person discussion. |
Also tried that updated branch on my laptop, and it seems to work smoothly there too. |
64ae2e0
to
08a7116
Compare
Thanks for the review, testing, and updates to the branch! Revision pushed, incorporating those proposed changes. |
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.
Thanks! Comments below. One minor line to change… and then one boring-looking line that's missing that turns out to be important.
I think this is very close, though — I'm hoping that after those two tweaks, it'll be ready.
.idea/zulip.iml
Outdated
<excludeFolder url="file://$MODULE_DIR$/packages/zulip_plugin/.dart_tool" /> | ||
<excludeFolder url="file://$MODULE_DIR$/packages/zulip_plugin/.pub" /> | ||
<excludeFolder url="file://$MODULE_DIR$/packages/zulip_plugin/build" /> | ||
<excludeFolder url="file://$MODULE_DIR$/scripts/icons/node_modules" /> |
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.
Ha, what this should actually be (contra #637 (comment) ) is:
<excludeFolder url="file://$MODULE_DIR$/scripts/icons/node_modules" /> | |
<excludeFolder url="file://$MODULE_DIR$/tools/icons/node_modules" /> |
There is no scripts/
; that must have been… aha, it's what tools/
was called before e5d1e3b.
If we'd had this file in those versions of the tree, we'd want it to say scripts/
; but we didn't, and at this point it should say tools/
.
My local zulip.iml
has both; it was just hard to spot with all the noise from .dart_tool
, .pub
, and build
in every plugin package. To make sure there's nothing else hiding there, here it is with all the noise stripped out:
$ grep -vFe '/.dart_tool"' -e '/.pub"' -e '/build"' zulip.iml
<?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$">
<excludeFolder url="file://$MODULE_DIR$/scripts/icons/node_modules" />
<excludeFolder url="file://$MODULE_DIR$/linux/flutter/ephemeral" />
<excludeFolder url="file://$MODULE_DIR$/tools/icons/node_modules" />
<excludeFolder url="file://$MODULE_DIR$/windows/flutter/ephemeral" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Flutter Plugins" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>
So, looks like everything else there is covered in this revision. There is this line:
<orderEntry type="library" name="Dart Packages" level="project" />
But I can't find anything missing as a consequence of leaving that line out. For example…
… hmm no. I tried a search and found it did get results from "Dart Packages":
But then I found that that entry had been added back in somehow:
--- .idea/zulip.iml
+++ .idea/zulip.iml
@@ -18,5 +18,6 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Flutter Plugins" level="project" />
+ <orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>
\ No newline at end of file
I discarded that with git reset --hard
, tried again, and now I'm only seeing the results that can also be found under "Flutter Plugins":
Similarly try searching for "Table" (a class from package:drift
); it doesn't appear.
Or in fact something from the Flutter framework, like "Widget".
So yeah, that's a line we want to include. 🙂
08a7116
to
4e9d813
Compare
Cool, thanks! Revision pushed. Android Studio wanted to add back a newline at the end of the file; do we want to keep that? I think we would usually include the newline. |
Great, yeah. This is a file it's inevitably going to keep modifying at its whim, so whatever it wants to automatically do we'll follow (because it'd be a big pain to try to do otherwise); glad the answer happens to be to include the final newline. |
In Greg's testing, the modules.xml file seemed needed in order for Android Studio to know where to find the .iml file. This has some useful `excludeFolder` items that should help Android Studio see that certain files are not part of our project, and should be excluded in searches that are supposed to be limited to "project files".
Thanks for all the revisions on this! Looks good; merging, with a small commit-message tweak mainly to mention the |
4e9d813
to
e511902
Compare
This has some useful
excludeFolder
items that should help Android Studio see that certain files are not part of our project and should be excluded in searches that are supposed to be limited to "project files".