Unverified Commit 013f615d authored by ZackYoung's avatar ZackYoung Committed by GitHub

[Fix] [UDF]Fix git maven build (#2195)

* fix git maven build
parent c3c35e84
...@@ -133,20 +133,27 @@ public class MavenUtil { ...@@ -133,20 +133,27 @@ public class MavenUtil {
String settingsPath, String settingsPath,
List<String> goals, List<String> goals,
List<String> args) { List<String> args) {
projectDir = StrUtil.wrap(projectDir, "\"");
settingsPath = StrUtil.wrap(settingsPath, "\"");
List<String> commandLine = new LinkedList<>(); List<String> commandLine = new LinkedList<>();
String classpath = String classpath =
FileUtil.loopFiles(mavenHome + "/boot").stream() FileUtil.loopFiles(mavenHome + "/boot").stream()
.filter(x -> FileUtil.getSuffix(x).equals("jar")) .filter(x -> "jar".equals(FileUtil.getSuffix(x)))
.map(x -> x.getAbsolutePath()) .map(File::getAbsolutePath)
.collect(Collectors.joining(File.pathSeparator)); .collect(Collectors.joining(File.pathSeparator));
classpath = StrUtil.wrap(classpath, "\"");
commandLine.add(javaExecutor); commandLine.add(javaExecutor);
commandLine.add("-Dfile.encoding=UTF-8"); commandLine.add("-Dfile.encoding=UTF-8");
commandLine.add("-Dmaven.multiModuleProjectDirectory=" + projectDir); commandLine.add("-Dmaven.multiModuleProjectDirectory=" + projectDir);
commandLine.add("-Dmaven.home=" + mavenHome); commandLine.add("-Dmaven.home=" + StrUtil.wrap(mavenHome, "\""));
Opt.ofBlankAble(repositoryDir) Opt.ofBlankAble(repositoryDir)
.ifPresent(x -> commandLine.add("-Dmaven.repo.local=" + repositoryDir)); .ifPresent(
commandLine.add("-Dclassworlds.conf=" + mavenHome + "/bin/m2.conf"); x ->
commandLine.add(
"-Dmaven.repo.local=" + StrUtil.wrap(repositoryDir, "\"")));
commandLine.add("-Dclassworlds.conf=" + StrUtil.wrap(mavenHome + "/bin/m2.conf", "\""));
commandLine.add("-classpath " + classpath + " org.codehaus.classworlds.Launcher"); commandLine.add("-classpath " + classpath + " org.codehaus.classworlds.Launcher");
commandLine.add("-s " + settingsPath); commandLine.add("-s " + settingsPath);
commandLine.add("-f " + projectDir); commandLine.add("-f " + projectDir);
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* *
*/ */
import {Editor } from "@monaco-editor/react"; import {Editor} from "@monaco-editor/react";
import {convertCodeEditTheme} from "@/utils/function"; import {convertCodeEditTheme} from "@/utils/function";
import {MonacoEditorOptions} from "@/types/Public/data"; import {MonacoEditorOptions} from "@/types/Public/data";
import React, {useState} from "react"; import React, {useState} from "react";
...@@ -25,10 +25,13 @@ import {editor} from "monaco-editor"; ...@@ -25,10 +25,13 @@ import {editor} from "monaco-editor";
import EditorFloatBtn from "@/components/CustomEditor/EditorFloatBtn"; import EditorFloatBtn from "@/components/CustomEditor/EditorFloatBtn";
import FullscreenBtn from "../FullscreenBtn"; import FullscreenBtn from "../FullscreenBtn";
import * as monaco from 'monaco-editor'; import * as monaco from 'monaco-editor';
import { loader } from '@monaco-editor/react'; import {loader} from '@monaco-editor/react';
import {EditorLanguage} from "monaco-editor/esm/metadata"; import {EditorLanguage} from "monaco-editor/esm/metadata";
import {Space} from "antd";
import {CircleBtn} from "@/components/CallBackButton/CircleBtn";
import {DownCircleTwoTone} from "@ant-design/icons";
loader.config({ monaco }); loader.config({monaco});
/** /**
* props * props
* todo: * todo:
...@@ -37,7 +40,7 @@ loader.config({ monaco }); ...@@ -37,7 +40,7 @@ loader.config({ monaco });
* 2. Callback for right-clicking to clear logs (optional, not required) * 2. Callback for right-clicking to clear logs (optional, not required)
*/ */
export type CodeShowFormProps = { export type CodeShowFormProps = {
height?: string|number; height?: string | number;
width?: string; width?: string;
language?: EditorLanguage; language?: EditorLanguage;
options?: any; options?: any;
...@@ -169,12 +172,12 @@ const CodeShow = (props: CodeShowFormProps) => { ...@@ -169,12 +172,12 @@ const CodeShow = (props: CodeShowFormProps) => {
setEditorRef(editor); setEditorRef(editor);
editor.layout(); editor.layout();
editor.focus(); editor.focus();
if (scrollBeyondLastLine){ if (scrollBeyondLastLine) {
editor.onDidChangeModelContent(()=>{ editor.onDidChangeModelContent(() => {
const lineCount = editor.getModel()?.getLineCount() as number; const lineCount = editor.getModel()?.getLineCount() as number;
if (lineCount>20){ if (lineCount > 20) {
editor.revealLine(lineCount); editor.revealLine(lineCount);
}else { } else {
editor.revealLine(1); editor.revealLine(1);
} }
}); });
...@@ -203,7 +206,8 @@ const CodeShow = (props: CodeShowFormProps) => { ...@@ -203,7 +206,8 @@ const CodeShow = (props: CodeShowFormProps) => {
return (<> return (<>
<div className={"monaco-float"}> <div className={"monaco-float"}>
{/* fullScreen button */} {/* fullScreen button */}
{fullScreenBtn && <FullscreenBtn isFullscreen={fullScreen} fullScreenCallBack={() => setFullScreen(!fullScreen)}/>} {fullScreenBtn &&
<FullscreenBtn isFullscreen={fullScreen} fullScreenCallBack={() => setFullScreen(!fullScreen)}/>}
{/* editor */} {/* editor */}
<Editor <Editor
...@@ -248,7 +252,9 @@ const CodeShow = (props: CodeShowFormProps) => { ...@@ -248,7 +252,9 @@ const CodeShow = (props: CodeShowFormProps) => {
/> />
{/* float button */} {/* float button */}
{showFloatButton && <EditorFloatBtn {...restEditBtnProps}/>} {showFloatButton && (<div style={{width: 35, height: height, backgroundColor: "#f4f4f4", paddingBlock: 10}}>
<EditorFloatBtn {...restEditBtnProps}/>
</div>)}
</div> </div>
</>); </>);
}; };
......
...@@ -16,10 +16,17 @@ ...@@ -16,10 +16,17 @@
*/ */
import React from "react"; import React from "react";
import {FloatButton, Space} from "antd"; import {Space} from "antd";
import {l} from "@/utils/intl"; import {l} from "@/utils/intl";
import {DownCircleFilled, StopFilled, SyncOutlined, UpCircleFilled} from "@ant-design/icons"; import {
DownCircleFilled,
StopFilled,
SyncOutlined,
UpCircleFilled, VerticalAlignBottomOutlined,
VerticalAlignTopOutlined
} from "@ant-design/icons";
import {PlayCircleFilled} from "@ant-design/icons/lib/icons"; import {PlayCircleFilled} from "@ant-design/icons/lib/icons";
import {CircleBtn} from "@/components/CallBackButton/CircleBtn";
/** /**
* props * props
...@@ -61,61 +68,24 @@ const EditorFloatBtn: React.FC<EditFloatBtnProps> = (props) => { ...@@ -61,61 +68,24 @@ const EditorFloatBtn: React.FC<EditFloatBtnProps> = (props) => {
* render * render
*/ */
return <> return <>
<FloatButton.Group <Space direction={"vertical"} size={0}>
shape="circle" {
className={"float-button"} refreshLogCallback && <>
> <CircleBtn icon={<SyncOutlined spin={loading}/>} onClick={handleSyncLog} title={l("button.refresh")}/>
<Space direction={"vertical"}> {autoRefresh ?
{/* if refreshLogCallback is not null, then show sync button , auto refresh button and stop auto refresh button */} <CircleBtn icon={<StopFilled spin={stopping}/>} onClick={handleStopAutoRefresh}
{refreshLogCallback && title={l("button.stopRefresh")}/>
<> :
<FloatButton <CircleBtn icon={<PlayCircleFilled spin={loading}/>} onClick={handleStartAutoRefresh}
tooltip={l("button.refresh")} title={l("button.startRefresh")}/>
icon={<SyncOutlined spin={loading}/>} }
onClick={handleSyncLog} </>
/> }
<CircleBtn icon={<VerticalAlignTopOutlined/>} onClick={handleBackTop} title={l("button.backTop")}/>
{autoRefresh ? <CircleBtn icon={<VerticalAlignBottomOutlined/>} onClick={handleBackBottom} title={l("button.backBottom")}/>
<FloatButton <CircleBtn icon={<UpCircleFilled/>} onClick={handleUpScroll} title={l("button.upScroll")}/>
icon={<StopFilled spin={stopping}/>} <CircleBtn icon={<DownCircleFilled/>} onClick={handleDownScroll} title={l("button.downScroll")}/>
tooltip={l("button.stopRefresh")} </Space>
onClick={handleStopAutoRefresh}
/> :
<FloatButton
icon={<PlayCircleFilled/>}
tooltip={l("button.startRefresh")}
onClick={handleStartAutoRefresh}
/>
}
</>
}
{/* back top */}
<FloatButton.BackTop
tooltip={l("button.backTop")}
onClick={handleBackTop}
visibilityHeight={0}
/>
{/* go bottom */}
<FloatButton.BackTop
className={"back-bottom"}
tooltip={l("button.backBottom")}
onClick={handleBackBottom}
visibilityHeight={0}
/>
{/* scroll up */}
<FloatButton
icon={<UpCircleFilled/>}
tooltip={l("button.upScroll")}
onClick={handleUpScroll}
/>
{/* scroll down */}
<FloatButton
icon={<DownCircleFilled/>}
tooltip={l("button.downScroll")}
onClick={handleDownScroll}
/>
</Space>
</FloatButton.Group>
</>; </>;
}; };
......
...@@ -9,7 +9,7 @@ const Console: React.FC= (props:any) => { ...@@ -9,7 +9,7 @@ const Console: React.FC= (props:any) => {
},[]) },[])
return <CodeShow code={props.console} height={(props.height-53)} language={"kotlin"} lineNumbers={"off"}/> return <CodeShow code={props.console} height={(props.height-53)} language={"kotlin"} lineNumbers={"off"} showFloatButton/>
}; };
export default connect(({Studio}: { Studio: StateType }) => ({ export default connect(({Studio}: { Studio: StateType }) => ({
......
...@@ -68,8 +68,6 @@ export const AutoSteps: React.FC<BuildStepsProps> = (props) => { ...@@ -68,8 +68,6 @@ export const AutoSteps: React.FC<BuildStepsProps> = (props) => {
const contentStyle: React.CSSProperties = { const contentStyle: React.CSSProperties = {
lineHeight: "300px",
// textAlign: "center",
color: token.colorTextTertiary, color: token.colorTextTertiary,
backgroundColor: token.colorFillAlter, backgroundColor: token.colorFillAlter,
borderRadius: token.borderRadiusLG, borderRadius: token.borderRadiusLG,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment