mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Maven: 'keep source and test folders' import option
This commit is contained in:
+10
-8
@@ -101,22 +101,24 @@ public class MavenFoldersImporter {
|
||||
testFolders.add(each.getDirectory());
|
||||
}
|
||||
|
||||
// then sources
|
||||
sourceFolders.addAll(myMavenProject.getSources());
|
||||
testFolders.addAll(myMavenProject.getTestSources());
|
||||
|
||||
// and additional sources
|
||||
// then plugin-provided sources (can override resources )
|
||||
for (MavenImporter each : MavenImporter.getSuitableImporters(myMavenProject)) {
|
||||
each.collectSourceFolders(myMavenProject, sourceFolders);
|
||||
each.collectTestFolders(myMavenProject, testFolders);
|
||||
}
|
||||
|
||||
for (String each : sourceFolders) {
|
||||
myModel.addSourceFolder(each, false);
|
||||
}
|
||||
// and sources (can override resources and plugin-defined sources)
|
||||
sourceFolders.addAll(myMavenProject.getSources());
|
||||
testFolders.addAll(myMavenProject.getTestSources());
|
||||
|
||||
// first add test folders
|
||||
for (String each : testFolders) {
|
||||
myModel.addSourceFolder(each, true);
|
||||
}
|
||||
// when source folders (can override test folders)
|
||||
for (String each : sourceFolders) {
|
||||
myModel.addSourceFolder(each, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void configOutputFolders() {
|
||||
|
||||
+1
-1
@@ -162,7 +162,7 @@
|
||||
</grid>
|
||||
<component id="6d280" class="javax.swing.JCheckBox" binding="myKeepSourceFoldersCheckBox">
|
||||
<constraints>
|
||||
<grid row="6" column="0" row-span="1" col-span="4" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
<grid row="6" column="0" row-span="1" col-span="4" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Keep source and test &folders on reimport"/>
|
||||
|
||||
@@ -169,6 +169,10 @@ public class MavenProjectsManager extends SimpleProjectComponent
|
||||
synchronized (isInitialized) {
|
||||
if (isInitialized.getAndSet(true)) return;
|
||||
|
||||
if (isNew) {
|
||||
getImportingSettings().setKeepSourceFolders(false);
|
||||
}
|
||||
|
||||
initProjectsTree(!isNew);
|
||||
|
||||
initWorkers();
|
||||
|
||||
Reference in New Issue
Block a user