Skip to content

Commit

Permalink
测试通过,已支持 Java 8 API
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeBottle committed Aug 15, 2024
1 parent 8510d83 commit 3d7da65
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion source/PotatoPeeler/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mkdir -p $OUTPUT_DIR

# Maven Profiles

for p in java11 java16 java17 java21; do
for p in java8 java11 java16 java17 java21; do
# Skip tests
mvn clean package -f pom.multiple.xml -DskipTests -P$p
cp target/PotatoPeeler*java*.jar $OUTPUT_DIR
Expand Down
11 changes: 10 additions & 1 deletion source/PotatoPeeler/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>indi.somebottle</groupId>
<artifactId>potatopeeler</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -37,6 +37,15 @@
</plugins>
</build>
<profiles>
<profile>
<id>java8</id>
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<javaVersion>8</javaVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</profile>
<profile>
<id>java11</id>
<properties>
Expand Down
17 changes: 13 additions & 4 deletions source/PotatoPeeler/pom.multiple.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
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">
<modelVersion>4.0.0</modelVersion>

<groupId>indi.somebottle</groupId>
<artifactId>potatopeeler</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>

<dependencies>
<dependency>
Expand All @@ -28,6 +28,15 @@
</dependencies>

<profiles>
<profile>
<id>java8</id>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<javaVersion>8</javaVersion>
</properties>
</profile>
<profile>
<id>java11</id>
<properties>
Expand Down Expand Up @@ -90,7 +99,7 @@
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>indi.somebottle.Main</mainClass>
</transformer>
</transformers>
Expand Down
2 changes: 1 addition & 1 deletion source/PotatoPeeler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>indi.somebottle</groupId>
<artifactId>potatopeeler</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>

<properties>
<maven.compiler.source>21</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
public class LoggerFormatter extends Formatter {
private static final SimpleDateFormat dateFormatter = new SimpleDateFormat("[yyyy-MM-dd HH:mm:ss]");

// TODO:待测试:Logger 格式化不输出中文字符
@Override
public String format(LogRecord record) {
StringBuilder sb = new StringBuilder("[PotatoPeeler] ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public class ArgsUtils {
* @throws IOException 文件读取失败时抛出;文件没有提供任何参数时也会抛出
*/
public static String[] readArgsFromFile(String filePath) throws IOException {
// TODO: 待测试是否能正常工作
Path argFilePath = Paths.get(filePath);
byte[] allBytes = Files.readAllBytes(argFilePath);
String[] argList = new String(allBytes).split("\\s+");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public class TimeUtils {
// 上次运行的时间
private static long lastRunTime = 0;

// TODO: 测试在 Java 8 API 下是否能正常工作
static {
if (Files.exists(timeRecordFilePath)) {
try {
Expand Down

1 comment on commit 3d7da65

@SomeBottle
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

口误

应该是“已兼容 Java 8 API”

Please sign in to comment.