Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Feat/cli base spring shell #10

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
031edc4
[test][*][*] add aci yml
zouxyan Nov 13, 2023
33f81bf
[fix][*][*] fix impl for bbc staff
zouxyan Nov 14, 2023
1805c5a
Merge branch 'test/unit_test' into test/unit_test_antcode
zouxyan Nov 14, 2023
964f760
[test][*][*] loose the requirement
zouxyan Nov 20, 2023
8f8c608
PullRequest: 3 [test][*][*] add aci yml
zouxyan Nov 20, 2023
39f64d7
Merge branch 'feat/bcdns_support' into test/unit_test_antcode
zouxyan Dec 8, 2023
4740783
[test][*][*] try to run the unit test in pipeline
zouxyan Dec 8, 2023
4b1a3b7
[test][*][*] try to run the unit test in pipline
zouxyan Dec 8, 2023
eb5960b
[test][*][*] try to run the unit test in pipeline
zouxyan Dec 8, 2023
2b646a4
[test][*][*] try to run the unit test in pipeline
zouxyan Dec 8, 2023
9784237
Merge branch 'feat/bcdns_support' into test/unit_test_antcode
zouxyan Dec 11, 2023
96a9a3f
[ci][*][*] delete `.linke-ci.yml`
zouxyan Dec 11, 2023
ac8a48e
Merge branch 'feat/bcdns_support' into test/unit_test_antcode
zouxyan Dec 11, 2023
d6f764b
Merge branch 'feat/bcdns_support' into test/unit_test_antcode
zouxyan Dec 11, 2023
490e788
[ci][*][*] exclude files from coverage
zouxyan Dec 11, 2023
09964c2
Merge branch 'test/unit_test_antcode' into antcode_repo/feat/bcdns_su…
zouxyan Dec 11, 2023
fe48183
[feat][r-cli][*]: fix desc_tar.xml for cli
dawn-to-dusk Dec 12, 2023
6779072
PullRequest: 6 [feat][r-cli][*]: fix desc_tar.xml for cli
dawn-to-dusk Dec 12, 2023
cdf5199
Merge remote-tracking branch 'origin/feat/bcdns_support' into antcode…
zouxyan Dec 12, 2023
2e7b5d5
Merge remote-tracking branch 'origin/feat/bcdns_support' into antcode…
zouxyan Dec 12, 2023
20bd749
Merge remote-tracking branch 'origin/feat/bcdns_support' into antcode…
zouxyan Dec 13, 2023
6d6e085
Merge remote-tracking branch 'origin/feat/bcdns_support' into antcode…
zouxyan Dec 13, 2023
e0c3047
Merge remote-tracking branch 'origin/feat/bcdns_support' into antcode…
zouxyan Dec 14, 2023
442841b
Merge remote-tracking branch 'origin/feat/bcdns_support' into antcode…
zouxyan Dec 15, 2023
b0523e6
Merge remote-tracking branch 'origin/feat/bcdns_support' into antcode…
zouxyan Dec 15, 2023
a3b3607
Merge remote-tracking branch 'origin/feat/bcdns_support' into antcode…
zouxyan Dec 18, 2023
5c75c77
Merge remote-tracking branch 'origin/feat/bcdns_support' into antcode…
zouxyan Dec 18, 2023
3bc00b2
Merge branch 'feat/bcdns_support' into antcode_repo/feat/bcdns_support
zouxyan Dec 19, 2023
bebcfd6
PullRequest: 7 antcode_repo/feat/bcdns_support
zouxyan Dec 19, 2023
700cbd1
Merge remote-tracking branch 'origin/develop' into antcode_repo/develop
zouxyan Dec 19, 2023
89d9732
Merge remote-tracking branch 'origin/develop' into antcode_repo/develop
zouxyan Dec 20, 2023
4693eec
[feat][r-cli][*]: improve comments
dawn-to-dusk Dec 12, 2023
15c7cac
[feat][r-cli][*]: delete Chinese comments
dawn-to-dusk Dec 12, 2023
d1bd7ca
[feat][r-cli][*]: delete Chinese comments and rebase to develop
dawn-to-dusk Dec 20, 2023
452a301
[refactor][cli][v0.1.0]: update `protobuf-maven-plugin` config in pom…
zouxyan Dec 20, 2023
12027a3
PullRequest: 8 将中文注释从r-cli中删除并重构
dawn-to-dusk Dec 20, 2023
8fb2242
Merge remote-tracking branch 'origin/develop' into antcode_repo/develop
zouxyan Dec 21, 2023
45bc7a5
Merge remote-tracking branch 'origin/develop' into antcode_repo/develop
zouxyan Dec 22, 2023
12b264b
[feat][cli][v0.1.0]: base on spring shell
zouxyan Dec 22, 2023
1c74f4a
[feat][*][v0.1.0]: service cmds ready
zouxyan Dec 25, 2023
180329f
[feat][*][v0.1.0]: bcdns cmds ready
zouxyan Dec 25, 2023
b11d0e2
[feat][*][v0.1.0]: CLI base on Spring Shell ready now
zouxyan Dec 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .aci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
version: "2.0"
stages:
- 代码检测
- 安全扫描
- 单元测试
jobs:
PMD:
stage: 代码检测
component: pmd
config:
execute:
timeout: 600 # 选填项,任务超时时间
afterExecute:
checkRule: # 选填项,卡点策略
- ${{outputs.critical}} <= 10
# stc:
# stage: 安全扫描
# component: stc
# inputs:
# isAutoSkip: true
# allowFailure: true
测试阶段:
stage: 单元测试
component: linkq-ut
inputs:
accurate: true #是否启用精准测试
#customBaselineBranch: xxx 自定义基线分支,必须和自定义基线commitId配合使用,与精准测试和变更覆盖率有关
#customBaselineCommitId: xxx 自定义基线commitId,必须和自定义基线分支配合使用,与精准测试和变更覆盖率有关
#gitSubmodule: "false" 是否使用gitSubmodule特性
#ciConfig的所有值都是字符串
ciConfig:
jdkVersion: "1.8" #jdk版本 1.6 1.7 1.8 11
mvnVersion: "3.2.5" #maven版本 2.2.1 3.0.3 3.2.5 3.5.4 3.5.4 3.6.1
encoding: "UTF-8" #文件编码 UTF-8 GBK
mvnArgs: "" #mvn参数 -D形式
parallelCount: "1" #分组数,将所有测试类分到N台机器运行
hostsMap: | #host映射定义,要换行
127.0.0.1 localhost
127.0.0.1 localhost2
coverageExclusions: "**/test/**,**/entities/**,**/mapper/**,**/dal/service/**,**/dal/utils/**,**/enums/**,**/constant/**,**/exception/**,**/cli/**" #覆盖率排除路径,未指定则会使用覆盖率平台默认的排除路径
autoPom: "true" #是否自动修改pom true false
config:
afterExecute:
checkRule: # 质量规则校验策略,outputs的数值在0-100之间
- ${{outputs.casePassRate}} >= 90 #通过率
# - ${{outputs.lineCoverage}} >= 100 #全量行覆盖率
# - ${{outputs.changeLineCoverage}} >= 100 #变更行覆盖率
# - ${{outputs.branchCoverage}} >= 100 #分支覆盖率
# - ${{outputs.changeBranchCoverage}} >= 100 #变更分支覆盖率
12 changes: 10 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
<modules>
<module>r-bootstrap</module>
<module>r-dal</module>
<module>r-cli</module>
<module>r-core</module>
<module>r-engine</module>
<module>r-server</module>
<module>r-commons</module>
<module>r-cli</module>
</modules>

<properties>
Expand All @@ -45,6 +45,7 @@
<grpc.version>1.42.2</grpc.version>
<bouncycastle.version>1.76</bouncycastle.version>
<commons-collections4.version>4.4</commons-collections4.version>
<spring-shell.version>2.1.15</spring-shell.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -207,7 +208,14 @@
<artifactId>commons-collections4</artifactId>
<version>${commons-collections4.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.shell</groupId>
<artifactId>spring-shell-dependencies</artifactId>
<version>${spring-shell.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

</project>
36 changes: 0 additions & 36 deletions r-cli/desc.xml

This file was deleted.

2 changes: 1 addition & 1 deletion r-cli/desc_tar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<directory>${project.build.directory}</directory>
<outputDirectory>${file.separator}lib</outputDirectory>
<includes>
<include>${artifactId}-release.jar</include>
<include>${artifactId}.jar</include>
</includes>
</fileSet>
<fileSet>
Expand Down
92 changes: 47 additions & 45 deletions r-cli/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2023 Ant Group
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
Expand All @@ -10,16 +26,19 @@
</parent>

<artifactId>r-cli</artifactId>
<description>CLI tool for ACB Relayer</description>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<lombok.version>1.18.24</lombok.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.shell</groupId>
<artifactId>spring-shell-starter</artifactId>
</dependency>
<!-- grpc -->
<dependency>
<groupId>io.grpc</groupId>
Expand All @@ -38,31 +57,6 @@
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.4.9</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.4</version>
</dependency>

<!-- You must introduce logback otherwise top will get strange errors. -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-core</artifactId>
Expand All @@ -84,37 +78,46 @@
<includes>
<include>**/*.xml</include>
<include>**/VERSION</include>
<include>**/banner.txt</include>
</includes>
<!-- 是否替换@xx@表示的maven properties属性值 -->
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<!-- 配置打包工具 -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!-- 工程主入口 -->
<mainClass>com.alipay.antchain.bridge.relayer.cli.Launcher</mainClass>
</configuration>
<executions>
<execution>
<id>build-info</id>
<goals>
<goal>build-info</goal>
</goals>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.alipay.antchain.bridge.relayer.cli.groovyshell.Launcher</mainClass>
</manifest>
</archive>
<descriptors>
<descriptor>desc.xml</descriptor>
</descriptors>
<additionalProperties>
<java.version>${java.version}</java.version>
<description>${project.description}</description>
</additionalProperties>
</configuration>
<id>make-assembly</id>
<phase>package</phase>
</execution>
<execution>
<goals>
<goal>single</goal>
<goal>repackage</goal>
</goals>
</execution>

</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<configuration>
<descriptors>
Expand Down Expand Up @@ -170,5 +173,4 @@
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright 2023 Ant Group
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.alipay.antchain.bridge.relayer.cli;

import java.util.List;
import java.util.stream.Collectors;

import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;

@SpringBootApplication(scanBasePackages = {"com.alipay.antchain.bridge.relayer.cli"})
public class Launcher {
public static void main(String[] args) {
List<String> propList = ListUtil.toList("logging.level.root=ERROR");
if (ObjectUtil.isNotEmpty(args)) {
List<String> argsList = ListUtil.toList(args);
String port = argsList.stream().filter(x -> StrUtil.startWith(x, "--port")).findAny().orElse("");
if (StrUtil.isNotEmpty(port)) {
propList.add(StrUtil.format("port={}", StrUtil.split(port, "=").get(1)));
}
String host = argsList.stream().filter(x -> StrUtil.startWith(x, "--host")).findAny().orElse("");
if (StrUtil.isNotEmpty(host)) {
propList.add(StrUtil.format("host={}", StrUtil.split(host, "=").get(1)));
}
argsList = argsList.stream().filter(x -> !StrUtil.startWithAny(x, "--port", "--host")).collect(Collectors.toList());
args = argsList.toArray(new String[0]);
}
new SpringApplicationBuilder(Launcher.class)
.web(WebApplicationType.NONE)
.properties(propList.toArray(new String[0]))
.run(args);
}
}

This file was deleted.

Loading