Skip to content

Commit 692e55d

Browse files
committed
0.10.4
1 parent ac7a743 commit 692e55d

3 files changed

Lines changed: 19 additions & 6 deletions

File tree

‎code2code.feature/feature.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<feature
33
id="nnn.code2code"
44
label="code2code Feature"
5-
version="0.10.3"
5+
version="0.10.4"
66
provider-name="3Zen (original = Samuel Rizzo)">
77

88
<description url="http://nnn-dev.github.com/code2code">

‎code2code/META-INF/MANIFEST.MF‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: code2code Plug-in modified by 3Zen
44
Bundle-SymbolicName: nnn.code2code;singleton:=true
5-
Bundle-Version: 0.10.3
5+
Bundle-Version: 0.10.4
66
Bundle-Vendor: 3Zen (original = Samuel Rizzo)
77
Bundle-RequiredExecutionEnvironment: J2SE-1.5
88
Require-Bundle: org.eclipse.ui,

‎code2code/src/code2code/ui/wizards/generate/GenerateFilesWizard.java‎

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package code2code.ui.wizards.generate;
22

3+
import java.util.ArrayList;
4+
import java.util.List;
5+
36
import org.eclipse.core.resources.IContainer;
47
import org.eclipse.core.resources.IFile;
58
import org.eclipse.core.resources.IProject;
@@ -43,6 +46,7 @@ public boolean performFinish() {
4346
IProject project = selectedGenerator.getGeneratorFolder()
4447
.getProject();
4548

49+
List<IFile> projectfiles = new ArrayList<IFile>();
4650
for (Template template : selectedGenerator
4751
.calculateChoosenTemplatesToGenerate()) {
4852

@@ -56,8 +60,12 @@ public boolean performFinish() {
5660
Console.write("-------------------------------------------------------------");
5761
} else {
5862
Path destinationPath = new Path(destination);
63+
64+
IFile file = project.getFile(destinationPath);
65+
5966
if (project.exists(destinationPath)) {
60-
if (!template.isOverwriteAllowed()) {
67+
if (!template.isOverwriteAllowed()
68+
&& !projectfiles.contains(file)) {
6169

6270
Console.write("File already exists. Skipping: "
6371
+ destinationPath);
@@ -72,18 +80,23 @@ public boolean performFinish() {
7280
Console.write("Generating: " + template.getTemplateName()
7381
+ " to " + destination);
7482

75-
IFile file = project.getFile(destinationPath);
76-
7783
IContainer parent = file.getParent();
7884
while (parent != null) {
7985
if (parent instanceof IProject) {
8086
IProject p = (IProject) parent;
81-
if (!p.exists()) {
87+
boolean exists = p.exists();
88+
if (!exists) {
8289
p.create(null);
8390
}
8491
if (!p.isOpen()) {
8592
p.open(null);
8693
}
94+
if (!exists) {
95+
// we must indicate if .project must be
96+
// overwrited
97+
IFile f = p.getFile(".project");
98+
projectfiles.add(f);
99+
}
87100
}
88101
parent = parent.getParent();
89102
}

0 commit comments

Comments
 (0)