-
Notifications
You must be signed in to change notification settings - Fork 304
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
Allow importing project that contains existing project directory #5211
base: master
Are you sure you want to change the base?
Conversation
7c4f351
to
305e6a1
Compare
More and more I think about this, I feel like I may be missing something that exists. We checkin files under .idea for reasons mentioned above, and I'd be surprised if users of bazel do not have some way of sharing/managing settings. Let me know if I'm missing something |
public @Nullable Project createProject(String name, String path) { | ||
//Allows checked in files to be used. createProject deletes the directory. | ||
if (new File(path, Project.DIRECTORY_STORE_FOLDER).exists()) { | ||
return ProjectManagerEx.getInstanceEx().loadProject(Path.of(path)); |
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.
what if existing project is incomplete?
305e6a1
to
f205c9b
Compare
if (workspaceIdeaDir.exists() && workspaceIdeaDir.isDirectory()) { | ||
Path bazelProjectPath = currentPath.resolve(Project.DIRECTORY_STORE_FOLDER); | ||
try { | ||
FileUtil.copyDirContent(workspaceIdeaDir, bazelProjectPath.toFile()); |
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.
Can we make this conditional based on some registry value to not happen for everyone from now on?
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.
I was debating it...
@@ -43,4 +57,31 @@ public List<Module> commit( | |||
public BlazeNewProjectBuilder builder() { | |||
return builder; | |||
} | |||
|
|||
@Override | |||
public @Nullable Project createProject(String name, String path) { |
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.
Will this be called on Auto Import?
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.
Yep
@brian-mcnamara could you please make sure that checks are not failing? |
This change prevents deleting the .ijwb/.idea directory when importing the project. This is useful for cases where the project checks-in the project files to VCS. Examples where this is useful are copyright configuration, VCS settings, code style among others.
One thing to note, loadProject is marked as @internal.