IDEA-76090 Remove the option to use groovyc's native stub generator in Groovy compiler setting

This commit is contained in:
peter
2011-10-27 19:13:32 +02:00
parent 175bc68d4d
commit 0138cd266c
4 changed files with 15 additions and 45 deletions
@@ -8,7 +8,7 @@
<properties/>
<border type="none"/>
<children>
<grid id="838f2" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="838f2" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
@@ -37,14 +37,6 @@
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<component id="cb8cb" class="javax.swing.JCheckBox" binding="myUseGroovycStubs">
<constraints>
<grid row="1" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Use groovyc's native &amp;stub generator"/>
</properties>
</component>
</children>
</grid>
<grid id="4e3dc" binding="myExcludesPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
@@ -42,7 +42,6 @@ public class GroovyCompilerConfigurable implements SearchableConfigurable {
private JTextField myHeapSize;
private JPanel myMainPanel;
private JPanel myExcludesPanel;
private JCheckBox myUseGroovycStubs;
private final ExcludedEntriesConfigurable myExcludes;
private final GroovyCompilerConfiguration myConfig;
@@ -101,19 +100,16 @@ public class GroovyCompilerConfigurable implements SearchableConfigurable {
public boolean isModified() {
return !Comparing.equal(myConfig.getHeapSize(), myHeapSize.getText()) ||
myExcludes.isModified() ||
myConfig.isUseGroovycStubs() != myUseGroovycStubs.isSelected();
myExcludes.isModified();
}
public void apply() throws ConfigurationException {
myExcludes.apply();
myConfig.setHeapSize(myHeapSize.getText());
myConfig.setUseGroovycStubs(myUseGroovycStubs.isSelected());
}
public void reset() {
myHeapSize.setText(myConfig.getHeapSize());
myUseGroovycStubs.setSelected(myConfig.isUseGroovycStubs());
myExcludes.reset();
}
@@ -36,14 +36,12 @@ import org.jdom.Element;
)
public class GroovyCompilerConfiguration implements PersistentStateComponent<GroovyCompilerConfiguration.MyStateBean>, Disposable {
private String myHeapSize = "400";
private boolean myUseGroovycStubs = false;
public boolean transformsOk = false;
private final ExcludedEntriesConfiguration myExcludeFromStubGeneration = new ExcludedEntriesConfiguration();
public MyStateBean getState() {
final MyStateBean bean = new MyStateBean();
bean.heapSize = myHeapSize;
bean.useGroovycStubs = myUseGroovycStubs;
bean.transformsOk = transformsOk;
myExcludeFromStubGeneration.writeExternal(bean.excludes);
return bean;
@@ -59,7 +57,6 @@ public class GroovyCompilerConfiguration implements PersistentStateComponent<Gro
public void loadState(MyStateBean state) {
myHeapSize = state.heapSize;
myUseGroovycStubs = state.useGroovycStubs;
transformsOk = state.transformsOk;
myExcludeFromStubGeneration.readExternal(state.excludes);
@@ -77,14 +74,6 @@ public class GroovyCompilerConfiguration implements PersistentStateComponent<Gro
myHeapSize = heapSize;
}
public boolean isUseGroovycStubs() {
return myUseGroovycStubs;
}
public void setUseGroovycStubs(boolean useGroovycStubs) {
myUseGroovycStubs = useGroovycStubs;
}
public void dispose() {
Disposer.dispose(myExcludeFromStubGeneration);
}
@@ -94,8 +83,6 @@ public class GroovyCompilerConfiguration implements PersistentStateComponent<Gro
@Tag("excludes") public Element excludes = new Element("aaa");
public boolean useGroovycStubs = false;
public boolean transformsOk = false;
}
@@ -124,25 +124,20 @@ public class GroovycStubGenerator extends GroovyCompilerBase {
((CompileContextEx)compileContext).assignModule(tempOutput, module, tests, this);
if (GroovyCompilerConfiguration.getInstance(myProject).isUseGroovycStubs()) {
runGroovycCompiler(compileContext, module, toCompile, true, tempOutput, sink, tests);
ProgressIndicator indicator = compileContext.getProgressIndicator();
indicator.pushState();
try {
final GroovyToJavaGenerator generator = new GroovyToJavaGenerator(myProject, new HashSet<VirtualFile>(toCompile));
for (int i = 0; i < toCompile.size(); i++) {
indicator.setFraction((double)i / toCompile.size());
final Collection<VirtualFile> stubFiles = generateItems(generator, toCompile.get(i), tempOutput, compileContext, myProject);
((CompileContextEx)compileContext).addScope(new FileSetCompileScope(stubFiles, new Module[]{module}));
}
}
else {
ProgressIndicator indicator = compileContext.getProgressIndicator();
indicator.pushState();
try {
final GroovyToJavaGenerator generator = new GroovyToJavaGenerator(myProject, new HashSet<VirtualFile>(toCompile));
for (int i = 0; i < toCompile.size(); i++) {
indicator.setFraction((double)i / toCompile.size());
final Collection<VirtualFile> stubFiles = generateItems(generator, toCompile.get(i), tempOutput, compileContext, myProject);
((CompileContextEx)compileContext).addScope(new FileSetCompileScope(stubFiles, new Module[]{module}));
}
}
finally {
indicator.popState();
}
finally {
indicator.popState();
}
}