Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

Commit

Permalink
LANG: getEffectiveEvaluatedBuildArguments
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-medeiros committed Aug 21, 2015
1 parent 43f7b2c commit 7605da9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


public class LaunchUtils { public class LaunchUtils {


public static String[] getEvaluatedAndParsedArguments(String extraOptionsString) throws CommonException { public static String[] getEvaluatedArguments(String extraOptionsString) throws CommonException {
try { try {
IStringVariableManager varMgr = VariablesPlugin.getDefault().getStringVariableManager(); IStringVariableManager varMgr = VariablesPlugin.getDefault().getStringVariableManager();
extraOptionsString = varMgr.performStringSubstitution(extraOptionsString, true); extraOptionsString = varMgr.performStringSubstitution(extraOptionsString, true);
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;


import melnorme.lang.ide.core.launch.LaunchUtils;
import melnorme.lang.ide.core.operations.AbstractToolManagerOperation; import melnorme.lang.ide.core.operations.AbstractToolManagerOperation;
import melnorme.lang.ide.core.operations.OperationInfo; import melnorme.lang.ide.core.operations.OperationInfo;
import melnorme.lang.ide.core.operations.build.BuildManager.BuildType; import melnorme.lang.ide.core.operations.build.BuildManager.BuildType;
Expand All @@ -36,7 +35,7 @@ public abstract class CommonBuildTargetOperation extends AbstractToolManagerOper


protected final BuildConfiguration buildConfiguration; protected final BuildConfiguration buildConfiguration;
protected final BuildType buildType; protected final BuildType buildType;
protected final String effectiveBuildArguments; protected final String[] evaluatedBuildArguments;


public CommonBuildTargetOperation(BuildManager buildManager, ValidatedBuildTarget validatedBuildTarget, public CommonBuildTargetOperation(BuildManager buildManager, ValidatedBuildTarget validatedBuildTarget,
OperationInfo opInfo, Path buildToolPath) throws CommonException, CoreException { OperationInfo opInfo, Path buildToolPath) throws CommonException, CoreException {
Expand All @@ -48,7 +47,8 @@ public CommonBuildTargetOperation(BuildManager buildManager, ValidatedBuildTarge
assertNotNull(validatedBuildTarget); assertNotNull(validatedBuildTarget);
this.buildConfiguration = assertNotNull(validatedBuildTarget.getBuildConfiguration()); this.buildConfiguration = assertNotNull(validatedBuildTarget.getBuildConfiguration());
this.buildType = assertNotNull(validatedBuildTarget.getBuildType()); this.buildType = assertNotNull(validatedBuildTarget.getBuildType());
this.effectiveBuildArguments = validatedBuildTarget.getEffectiveBuildArguments();
this.evaluatedBuildArguments = validatedBuildTarget.getEffectiveEvaluatedBuildArguments();
} }


public BuildConfiguration getConfiguration() { public BuildConfiguration getConfiguration() {
Expand All @@ -75,10 +75,6 @@ protected Path getBuildToolPath() throws CommonException {
return buildToolPath; return buildToolPath;
} }


protected String getEffectiveBuildArguments() throws CommonException, CoreException {
return effectiveBuildArguments;
}

@Override @Override
public void execute(IProgressMonitor parentPM) throws CoreException, CommonException, OperationCancellation { public void execute(IProgressMonitor parentPM) throws CoreException, CommonException, OperationCancellation {
try(ProgressSubTaskHelper pm = new ProgressSubTaskHelper(parentPM, getBuildOperationName())) { try(ProgressSubTaskHelper pm = new ProgressSubTaskHelper(parentPM, getBuildOperationName())) {
Expand All @@ -92,7 +88,7 @@ protected String getBuildOperationName() {
} }


protected ProcessBuilder getToolProcessBuilder() throws CoreException, CommonException, OperationCancellation { protected ProcessBuilder getToolProcessBuilder() throws CoreException, CommonException, OperationCancellation {
return getToolProcessBuilder(getEvaluatedAndParsedArguments()); return getToolProcessBuilder(getEffectiveEvaluatedArguments());
} }


protected ProcessBuilder getToolProcessBuilder(String[] buildArguments) protected ProcessBuilder getToolProcessBuilder(String[] buildArguments)
Expand All @@ -108,8 +104,8 @@ protected void addToolCommand(ArrayList2<String> commands)
commands.add(getBuildToolPath().toString()); commands.add(getBuildToolPath().toString());
} }


protected String[] getEvaluatedAndParsedArguments() throws CoreException, CommonException { protected String[] getEffectiveEvaluatedArguments() throws CoreException, CommonException {
return LaunchUtils.getEvaluatedAndParsedArguments(getEffectiveBuildArguments()); return evaluatedBuildArguments;
} }


protected abstract ProcessBuilder getProcessBuilder(ArrayList2<String> commands) protected abstract ProcessBuilder getProcessBuilder(ArrayList2<String> commands)
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import melnorme.lang.ide.core.BundleInfo; import melnorme.lang.ide.core.BundleInfo;
import melnorme.lang.ide.core.LangCore; import melnorme.lang.ide.core.LangCore;
import melnorme.lang.ide.core.launch.LaunchMessages; import melnorme.lang.ide.core.launch.LaunchMessages;
import melnorme.lang.ide.core.launch.LaunchUtils;
import melnorme.lang.ide.core.operations.build.BuildManager.BuildType; import melnorme.lang.ide.core.operations.build.BuildManager.BuildType;
import melnorme.lang.ide.core.project_model.ProjectBuildInfo; import melnorme.lang.ide.core.project_model.ProjectBuildInfo;
import melnorme.lang.tooling.bundle.BuildConfiguration; import melnorme.lang.tooling.bundle.BuildConfiguration;
Expand Down Expand Up @@ -101,6 +102,10 @@ public String getDefaultBuildArguments() throws CommonException {
return getBuildType().getDefaultBuildOptions(this); return getBuildType().getDefaultBuildOptions(this);
} }


public String[] getEffectiveEvaluatedBuildArguments() throws CommonException {
return LaunchUtils.getEvaluatedArguments(getEffectiveBuildArguments());
}

/* ----------------- ----------------- */ /* ----------------- ----------------- */


protected String getExecutablePath() { protected String getExecutablePath() {
Expand Down

0 comments on commit 7605da9

Please sign in to comment.