Browse Source

无jira任务 设置一个指定目录方式用于调试

persist/11.0
vito 5 years ago
parent
commit
c8149fecfb
  1. 12
      designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java

12
designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java

@ -5,8 +5,10 @@ import com.fr.design.EnvChangeEntrance;
import com.fr.design.constants.DesignerLaunchStatus; import com.fr.design.constants.DesignerLaunchStatus;
import com.fr.design.env.DesignerWorkspaceGenerator; import com.fr.design.env.DesignerWorkspaceGenerator;
import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.env.LocalDesignerWorkspaceInfo;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.module.Activator; import com.fr.module.Activator;
import com.fr.stable.StringUtils;
import com.fr.value.NotNullLazyValue; import com.fr.value.NotNullLazyValue;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace; import com.fr.workspace.Workspace;
@ -19,6 +21,8 @@ import org.jetbrains.annotations.NotNull;
*/ */
public class DesignerWorkspaceProvider extends Activator { public class DesignerWorkspaceProvider extends Activator {
private static final String SPECIFY_WORKSPACE = "fr.designer.workspace";
private NotNullLazyValue<StartupArgs> startupArgs = new NotNullLazyValue<StartupArgs>() { private NotNullLazyValue<StartupArgs> startupArgs = new NotNullLazyValue<StartupArgs>() {
@NotNull @NotNull
@Override @Override
@ -37,7 +41,13 @@ public class DesignerWorkspaceProvider extends Activator {
} else { } else {
try { try {
String current = DesignerEnvManager.getEnvManager().getCurEnvName(); String current = DesignerEnvManager.getEnvManager().getCurEnvName();
DesignerWorkspaceInfo workspaceInfo = DesignerEnvManager.getEnvManager().getWorkspaceInfo(current); String workspacePath;
DesignerWorkspaceInfo workspaceInfo;
if (StringUtils.isNotEmpty(workspacePath = System.getProperty(SPECIFY_WORKSPACE))) {
workspaceInfo = LocalDesignerWorkspaceInfo.create(StringUtils.EMPTY, workspacePath);
} else {
workspaceInfo = DesignerEnvManager.getEnvManager().getWorkspaceInfo(current);
}
Workspace workspace = DesignerWorkspaceGenerator.generate(workspaceInfo); Workspace workspace = DesignerWorkspaceGenerator.generate(workspaceInfo);
boolean checkValid = workspace != null && workspaceInfo.checkValid(); boolean checkValid = workspace != null && workspaceInfo.checkValid();
if (!checkValid) { if (!checkValid) {

Loading…
Cancel
Save