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 {
String settingsPath,
List<String> goals,
List<String> args) {
projectDir = StrUtil.wrap(projectDir, "\"");
settingsPath = StrUtil.wrap(settingsPath, "\"");
List<String> commandLine = new LinkedList<>();
String classpath =
FileUtil.loopFiles(mavenHome + "/boot").stream()
.filter(x -> FileUtil.getSuffix(x).equals("jar"))
.map(x -> x.getAbsolutePath())
.filter(x -> "jar".equals(FileUtil.getSuffix(x)))
.map(File::getAbsolutePath)
.collect(Collectors.joining(File.pathSeparator));
classpath = StrUtil.wrap(classpath, "\"");
commandLine.add(javaExecutor);
commandLine.add("-Dfile.encoding=UTF-8");
commandLine.add("-Dmaven.multiModuleProjectDirectory=" + projectDir);
commandLine.add("-Dmaven.home=" + mavenHome);
commandLine.add("-Dmaven.home=" + StrUtil.wrap(mavenHome, "\""));
Opt.ofBlankAble(repositoryDir)
.ifPresent(x -> commandLine.add("-Dmaven.repo.local=" + repositoryDir));
commandLine.add("-Dclassworlds.conf=" + mavenHome + "/bin/m2.conf");
.ifPresent(
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("-s " + settingsPath);
commandLine.add("-f " + projectDir);
......
......@@ -17,7 +17,7 @@
*
*/
import {Editor } from "@monaco-editor/react";
import {Editor} from "@monaco-editor/react";
import {convertCodeEditTheme} from "@/utils/function";
import {MonacoEditorOptions} from "@/types/Public/data";
import React, {useState} from "react";
......@@ -25,10 +25,13 @@ import {editor} from "monaco-editor";
import EditorFloatBtn from "@/components/CustomEditor/EditorFloatBtn";
import FullscreenBtn from "../FullscreenBtn";
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 {Space} from "antd";
import {CircleBtn} from "@/components/CallBackButton/CircleBtn";
import {DownCircleTwoTone} from "@ant-design/icons";
loader.config({ monaco });
loader.config({monaco});
/**
* props
* todo:
......@@ -37,7 +40,7 @@ loader.config({ monaco });
* 2. Callback for right-clicking to clear logs (optional, not required)
*/
export type CodeShowFormProps = {
height?: string|number;
height?: string | number;
width?: string;
language?: EditorLanguage;
options?: any;
......@@ -169,12 +172,12 @@ const CodeShow = (props: CodeShowFormProps) => {
setEditorRef(editor);
editor.layout();
editor.focus();
if (scrollBeyondLastLine){
editor.onDidChangeModelContent(()=>{
if (scrollBeyondLastLine) {
editor.onDidChangeModelContent(() => {
const lineCount = editor.getModel()?.getLineCount() as number;
if (lineCount>20){
if (lineCount > 20) {
editor.revealLine(lineCount);
}else {
} else {
editor.revealLine(1);
}
});
......@@ -203,7 +206,8 @@ const CodeShow = (props: CodeShowFormProps) => {
return (<>
<div className={"monaco-float"}>
{/* fullScreen button */}
{fullScreenBtn && <FullscreenBtn isFullscreen={fullScreen} fullScreenCallBack={() => setFullScreen(!fullScreen)}/>}
{fullScreenBtn &&
<FullscreenBtn isFullscreen={fullScreen} fullScreenCallBack={() => setFullScreen(!fullScreen)}/>}
{/* editor */}
<Editor
......@@ -248,7 +252,9 @@ const CodeShow = (props: CodeShowFormProps) => {
/>
{/* float button */}
{showFloatButton && <EditorFloatBtn {...restEditBtnProps}/>}
{showFloatButton && (<div style={{width: 35, height: height, backgroundColor: "#f4f4f4", paddingBlock: 10}}>
<EditorFloatBtn {...restEditBtnProps}/>
</div>)}
</div>
</>);
};
......
......@@ -16,10 +16,17 @@
*/
import React from "react";
import {FloatButton, Space} from "antd";
import {Space} from "antd";
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 {CircleBtn} from "@/components/CallBackButton/CircleBtn";
/**
* props
......@@ -61,61 +68,24 @@ const EditorFloatBtn: React.FC<EditFloatBtnProps> = (props) => {
* render
*/
return <>
<FloatButton.Group
shape="circle"
className={"float-button"}
>
<Space direction={"vertical"}>
{/* if refreshLogCallback is not null, then show sync button , auto refresh button and stop auto refresh button */}
{refreshLogCallback &&
<>
<FloatButton
tooltip={l("button.refresh")}
icon={<SyncOutlined spin={loading}/>}
onClick={handleSyncLog}
/>
{autoRefresh ?
<FloatButton
icon={<StopFilled spin={stopping}/>}
tooltip={l("button.stopRefresh")}
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>
<Space direction={"vertical"} size={0}>
{
refreshLogCallback && <>
<CircleBtn icon={<SyncOutlined spin={loading}/>} onClick={handleSyncLog} title={l("button.refresh")}/>
{autoRefresh ?
<CircleBtn icon={<StopFilled spin={stopping}/>} onClick={handleStopAutoRefresh}
title={l("button.stopRefresh")}/>
:
<CircleBtn icon={<PlayCircleFilled spin={loading}/>} onClick={handleStartAutoRefresh}
title={l("button.startRefresh")}/>
}
</>
}
<CircleBtn icon={<VerticalAlignTopOutlined/>} onClick={handleBackTop} title={l("button.backTop")}/>
<CircleBtn icon={<VerticalAlignBottomOutlined/>} onClick={handleBackBottom} title={l("button.backBottom")}/>
<CircleBtn icon={<UpCircleFilled/>} onClick={handleUpScroll} title={l("button.upScroll")}/>
<CircleBtn icon={<DownCircleFilled/>} onClick={handleDownScroll} title={l("button.downScroll")}/>
</Space>
</>;
};
......
......@@ -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 }) => ({
......
......@@ -68,8 +68,6 @@ export const AutoSteps: React.FC<BuildStepsProps> = (props) => {
const contentStyle: React.CSSProperties = {
lineHeight: "300px",
// textAlign: "center",
color: token.colorTextTertiary,
backgroundColor: token.colorFillAlter,
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