|
@@ -1,7 +1,7 @@
|
|
|
package cn.reghao.autodop.dmaster.app.util.buildtool.compiler;
|
|
package cn.reghao.autodop.dmaster.app.util.buildtool.compiler;
|
|
|
|
|
|
|
|
-import cn.reghao.autodop.common.util.shell.ShellExecutor;
|
|
|
|
|
-import cn.reghao.autodop.common.util.shell.ShellResult;
|
|
|
|
|
|
|
+import cn.reghao.jdkutil.shell.ShellExecutor;
|
|
|
|
|
+import cn.reghao.jdkutil.shell.ShellResult;
|
|
|
import cn.reghao.jdkutil.serializer.JsonConverter;
|
|
import cn.reghao.jdkutil.serializer.JsonConverter;
|
|
|
import cn.reghao.autodop.dmaster.app.model.po.config.build.CompilerConfig;
|
|
import cn.reghao.autodop.dmaster.app.model.po.config.build.CompilerConfig;
|
|
|
|
|
|
|
@@ -13,18 +13,18 @@ import cn.reghao.autodop.dmaster.app.model.po.config.build.CompilerConfig;
|
|
|
*/
|
|
*/
|
|
|
public class ShellCompiler implements CodeCompiler {
|
|
public class ShellCompiler implements CodeCompiler {
|
|
|
private final ShellExecutor shell;
|
|
private final ShellExecutor shell;
|
|
|
- private final String compileCmd;
|
|
|
|
|
|
|
+ private final String[] compileCmd;
|
|
|
|
|
|
|
|
public ShellCompiler(CompilerConfig compilerConfig) {
|
|
public ShellCompiler(CompilerConfig compilerConfig) {
|
|
|
- this.compileCmd = compilerConfig.getCompileCmd();
|
|
|
|
|
|
|
+ this.compileCmd = compilerConfig.getCompileCmd().split("\\s+");
|
|
|
this.shell = new ShellExecutor();
|
|
this.shell = new ShellExecutor();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void compile(String appId, String appCompileHome) throws Exception {
|
|
public void compile(String appId, String appCompileHome) throws Exception {
|
|
|
- ShellResult result = shell.exec(compileCmd, appCompileHome);
|
|
|
|
|
|
|
+ ShellResult result = shell.exec(appCompileHome, compileCmd);
|
|
|
if (!result.isSuccess()) {
|
|
if (!result.isSuccess()) {
|
|
|
- throw new Exception(JsonConverter.objectToJson(result.getOutput()));
|
|
|
|
|
|
|
+ throw new Exception(JsonConverter.objectToJson(result.getResult()));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|