mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Never minify TeaVM output in Eclipse builder
This commit is contained in:
parent
09d857f572
commit
02f61b5d50
|
@ -88,7 +88,7 @@ public class TeaVMProjectConfigurator extends AbstractProjectConfigurator {
|
||||||
|
|
||||||
private void configureProfile(MojoExecution execution, TeaVMProfile profile, IProgressMonitor monitor)
|
private void configureProfile(MojoExecution execution, TeaVMProfile profile, IProgressMonitor monitor)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
monitor.beginTask("Configuring profile " + profile.getName(), 120);
|
monitor.beginTask("Configuring profile " + profile.getName(), 110);
|
||||||
String buildDir = getProjectBuildDirectory();
|
String buildDir = getProjectBuildDirectory();
|
||||||
|
|
||||||
String mainClass = maven.getMojoParameterValue(mavenSession, execution, "mainClass", String.class);
|
String mainClass = maven.getMojoParameterValue(mavenSession, execution, "mainClass", String.class);
|
||||||
|
@ -104,10 +104,6 @@ public class TeaVMProjectConfigurator extends AbstractProjectConfigurator {
|
||||||
profile.setTargetFileName(targetFileName != null ? targetFileName : "classes.js");
|
profile.setTargetFileName(targetFileName != null ? targetFileName : "classes.js");
|
||||||
monitor.worked(10);
|
monitor.worked(10);
|
||||||
|
|
||||||
Boolean minifying = maven.getMojoParameterValue(mavenSession, execution, "minifying", Boolean.class);
|
|
||||||
profile.setMinifying(minifying != null ? minifying : true);
|
|
||||||
monitor.worked(10);
|
|
||||||
|
|
||||||
String runtime = maven.getMojoParameterValue(mavenSession, execution, "runtime", String.class);
|
String runtime = maven.getMojoParameterValue(mavenSession, execution, "runtime", String.class);
|
||||||
profile.setRuntimeMode(runtime != null ? getRuntimeMode(runtime) : TeaVMRuntimeMode.SEPARATE);
|
profile.setRuntimeMode(runtime != null ? getRuntimeMode(runtime) : TeaVMRuntimeMode.SEPARATE);
|
||||||
monitor.worked(10);
|
monitor.worked(10);
|
||||||
|
|
|
@ -93,7 +93,6 @@ public class PreferencesBasedTeaVMProjectSettings implements TeaVMProjectSetting
|
||||||
profile.setEnabled(true);
|
profile.setEnabled(true);
|
||||||
profile.setTargetDirectory(varManager.generateVariableExpression("workspace_loc", "/" + projectName));
|
profile.setTargetDirectory(varManager.generateVariableExpression("workspace_loc", "/" + projectName));
|
||||||
profile.setTargetFileName("classes.js");
|
profile.setTargetFileName("classes.js");
|
||||||
profile.setMinifying(true);
|
|
||||||
profile.setIncremental(false);
|
profile.setIncremental(false);
|
||||||
profile.setCacheDirectory(varManager.generateVariableExpression("workspace_loc", "/" + projectName));
|
profile.setCacheDirectory(varManager.generateVariableExpression("workspace_loc", "/" + projectName));
|
||||||
profile.setSourceMapsGenerated(true);
|
profile.setSourceMapsGenerated(true);
|
||||||
|
@ -156,7 +155,6 @@ public class PreferencesBasedTeaVMProjectSettings implements TeaVMProjectSetting
|
||||||
private String mainClass;
|
private String mainClass;
|
||||||
private String targetDirectory;
|
private String targetDirectory;
|
||||||
private String targetFileName;
|
private String targetFileName;
|
||||||
private boolean minifying;
|
|
||||||
private TeaVMRuntimeMode runtimeMode = TeaVMRuntimeMode.SEPARATE;
|
private TeaVMRuntimeMode runtimeMode = TeaVMRuntimeMode.SEPARATE;
|
||||||
private boolean incremental;
|
private boolean incremental;
|
||||||
private String cacheDirectory;
|
private String cacheDirectory;
|
||||||
|
@ -224,16 +222,6 @@ public class PreferencesBasedTeaVMProjectSettings implements TeaVMProjectSetting
|
||||||
this.targetFileName = targetFileName;
|
this.targetFileName = targetFileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isMinifying() {
|
|
||||||
return minifying;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setMinifying(boolean minifying) {
|
|
||||||
this.minifying = minifying;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TeaVMRuntimeMode getRuntimeMode() {
|
public TeaVMRuntimeMode getRuntimeMode() {
|
||||||
return runtimeMode;
|
return runtimeMode;
|
||||||
|
@ -344,7 +332,6 @@ public class PreferencesBasedTeaVMProjectSettings implements TeaVMProjectSetting
|
||||||
mainClass = preferences.get(MAIN_CLASS, "");
|
mainClass = preferences.get(MAIN_CLASS, "");
|
||||||
targetDirectory = preferences.get(TARGET_DIRECTORY, "");
|
targetDirectory = preferences.get(TARGET_DIRECTORY, "");
|
||||||
targetFileName = preferences.get(TARGET_FILE_NAME, "");
|
targetFileName = preferences.get(TARGET_FILE_NAME, "");
|
||||||
minifying = preferences.getBoolean(MINIFYING, true);
|
|
||||||
runtimeMode = TeaVMRuntimeMode.valueOf(preferences.get(RUNTIME, TeaVMRuntimeMode.SEPARATE.name()));
|
runtimeMode = TeaVMRuntimeMode.valueOf(preferences.get(RUNTIME, TeaVMRuntimeMode.SEPARATE.name()));
|
||||||
incremental = preferences.getBoolean(INCREMENTAL, false);
|
incremental = preferences.getBoolean(INCREMENTAL, false);
|
||||||
cacheDirectory = preferences.get(CACHE_DIRECTORY, "");
|
cacheDirectory = preferences.get(CACHE_DIRECTORY, "");
|
||||||
|
@ -370,7 +357,6 @@ public class PreferencesBasedTeaVMProjectSettings implements TeaVMProjectSetting
|
||||||
preferences.put(MAIN_CLASS, mainClass);
|
preferences.put(MAIN_CLASS, mainClass);
|
||||||
preferences.put(TARGET_DIRECTORY, targetDirectory);
|
preferences.put(TARGET_DIRECTORY, targetDirectory);
|
||||||
preferences.put(TARGET_FILE_NAME, targetFileName);
|
preferences.put(TARGET_FILE_NAME, targetFileName);
|
||||||
preferences.putBoolean(MINIFYING, minifying);
|
|
||||||
preferences.put(RUNTIME, runtimeMode.name());
|
preferences.put(RUNTIME, runtimeMode.name());
|
||||||
preferences.putBoolean(INCREMENTAL, incremental);
|
preferences.putBoolean(INCREMENTAL, incremental);
|
||||||
preferences.put(CACHE_DIRECTORY, cacheDirectory);
|
preferences.put(CACHE_DIRECTORY, cacheDirectory);
|
||||||
|
|
|
@ -39,10 +39,6 @@ public interface TeaVMProfile {
|
||||||
|
|
||||||
void setTargetFileName(String targetFileName);
|
void setTargetFileName(String targetFileName);
|
||||||
|
|
||||||
boolean isMinifying();
|
|
||||||
|
|
||||||
void setMinifying(boolean minifying);
|
|
||||||
|
|
||||||
TeaVMRuntimeMode getRuntimeMode();
|
TeaVMRuntimeMode getRuntimeMode();
|
||||||
|
|
||||||
void setRuntimeMode(TeaVMRuntimeMode runtimeMode);
|
void setRuntimeMode(TeaVMRuntimeMode runtimeMode);
|
||||||
|
|
|
@ -151,7 +151,7 @@ public class TeaVMProjectBuilder extends IncrementalProjectBuilder {
|
||||||
String targetDir = profile.getTargetDirectory();
|
String targetDir = profile.getTargetDirectory();
|
||||||
tool.setTargetDirectory(new File(varManager.performStringSubstitution(targetDir, false)));
|
tool.setTargetDirectory(new File(varManager.performStringSubstitution(targetDir, false)));
|
||||||
tool.setTargetFileName(profile.getTargetFileName());
|
tool.setTargetFileName(profile.getTargetFileName());
|
||||||
tool.setMinifying(profile.isMinifying());
|
tool.setMinifying(false);
|
||||||
tool.setRuntime(mapRuntime(profile.getRuntimeMode()));
|
tool.setRuntime(mapRuntime(profile.getRuntimeMode()));
|
||||||
tool.setMainClass(profile.getMainClass());
|
tool.setMainClass(profile.getMainClass());
|
||||||
tool.getProperties().putAll(profile.getProperties());
|
tool.getProperties().putAll(profile.getProperties());
|
||||||
|
|
|
@ -79,7 +79,6 @@ public class TeaVMProfileDialog extends Dialog {
|
||||||
private Button targetDirectoryWorkspaceButton;
|
private Button targetDirectoryWorkspaceButton;
|
||||||
private Button targetDirectoryFileSystemButton;
|
private Button targetDirectoryFileSystemButton;
|
||||||
private Text targetFileNameField;
|
private Text targetFileNameField;
|
||||||
private Button minifyingButton;
|
|
||||||
private Combo runtimeField;
|
private Combo runtimeField;
|
||||||
private Button incrementalButton;
|
private Button incrementalButton;
|
||||||
private Text cacheDirectoryField;
|
private Text cacheDirectoryField;
|
||||||
|
@ -178,7 +177,6 @@ public class TeaVMProfileDialog extends Dialog {
|
||||||
createTargetDirectoryField(group);
|
createTargetDirectoryField(group);
|
||||||
createTargetFileNameField(group);
|
createTargetFileNameField(group);
|
||||||
createRuntimeField(group);
|
createRuntimeField(group);
|
||||||
createMinifyField(group);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createIncrementalGroup(Composite parent) {
|
private void createIncrementalGroup(Composite parent) {
|
||||||
|
@ -438,12 +436,6 @@ public class TeaVMProfileDialog extends Dialog {
|
||||||
runtimeField.add("don't attach");
|
runtimeField.add("don't attach");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createMinifyField(Composite container) {
|
|
||||||
minifyingButton = new Button(container, SWT.CHECK);
|
|
||||||
minifyingButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
|
|
||||||
minifyingButton.setText("generate minified (&obfuscated) code");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createIncrementalField(Composite container) {
|
private void createIncrementalField(Composite container) {
|
||||||
incrementalButton = new Button(container, SWT.CHECK);
|
incrementalButton = new Button(container, SWT.CHECK);
|
||||||
incrementalButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
|
incrementalButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
|
||||||
|
@ -634,7 +626,6 @@ public class TeaVMProfileDialog extends Dialog {
|
||||||
mainClassField.setText(profile.getMainClass() != null ? profile.getMainClass() : "");
|
mainClassField.setText(profile.getMainClass() != null ? profile.getMainClass() : "");
|
||||||
targetDirectoryField.setText(profile.getTargetDirectory());
|
targetDirectoryField.setText(profile.getTargetDirectory());
|
||||||
targetFileNameField.setText(profile.getTargetFileName());
|
targetFileNameField.setText(profile.getTargetFileName());
|
||||||
minifyingButton.setSelection(profile.isMinifying());
|
|
||||||
runtimeField.select(runtimeModes.indexOf(profile.getRuntimeMode()));
|
runtimeField.select(runtimeModes.indexOf(profile.getRuntimeMode()));
|
||||||
incrementalButton.setSelection(profile.isIncremental());
|
incrementalButton.setSelection(profile.isIncremental());
|
||||||
cacheDirectoryField.setText(profile.getCacheDirectory());
|
cacheDirectoryField.setText(profile.getCacheDirectory());
|
||||||
|
@ -672,7 +663,6 @@ public class TeaVMProfileDialog extends Dialog {
|
||||||
profile.setMainClass(!mainClass.isEmpty() ? mainClass : null);
|
profile.setMainClass(!mainClass.isEmpty() ? mainClass : null);
|
||||||
profile.setTargetDirectory(targetDirectoryField.getText());
|
profile.setTargetDirectory(targetDirectoryField.getText());
|
||||||
profile.setTargetFileName(targetFileNameField.getText().trim());
|
profile.setTargetFileName(targetFileNameField.getText().trim());
|
||||||
profile.setMinifying(minifyingButton.getSelection());
|
|
||||||
profile.setRuntimeMode(runtimeModes.get(runtimeField.getSelectionIndex()));
|
profile.setRuntimeMode(runtimeModes.get(runtimeField.getSelectionIndex()));
|
||||||
profile.setIncremental(incrementalButton.getSelection());
|
profile.setIncremental(incrementalButton.getSelection());
|
||||||
profile.setCacheDirectory(cacheDirectoryField.getText());
|
profile.setCacheDirectory(cacheDirectoryField.getText());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user