Skip to content

Commit 48c1bbd

Browse files
committed
feat: ✨ add websocket-markdown support;update license validity period
1 parent 6f413cd commit 48c1bbd

31 files changed

+89
-35
lines changed

src/main/java/com/ly/doc/gradle/chain/CommonArtifactFilterChain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/chain/ContainsFilterChain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/chain/FilterChain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/chain/GroupIdFilterChain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/chain/SpringBootArtifactFilterChain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/chain/StartsWithFilterChain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/constant/GlobalConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/constant/TaskConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/extension/SmartDocPluginExtension.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/model/CustomArtifact.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/plugin/SmartDocPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/DocBaseTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/JMeterTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/OpenApiTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/PostmanTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/RestAdocTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/RestHtmlTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/RestMarkdownTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/RpcAdocTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/RpcHtmlTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/RpcMarkdownTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/SwaggerTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/TornaRestTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/task/TornaRpcTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* smart-doc
3+
*
4+
* Copyright (C) 2018-2024 smart-doc
5+
*
6+
* Licensed to the Apache Software Foundation (ASF) under one
7+
* or more contributor license agreements. See the NOTICE file
8+
* distributed with this work for additional information
9+
* regarding copyright ownership. The ASF licenses this file
10+
* to you under the Apache License, Version 2.0 (the
11+
* "License"); you may not use this file except in compliance
12+
* with the License. You may obtain a copy of the License at
13+
*
14+
* http://www.apache.org/licenses/LICENSE-2.0
15+
*
16+
* Unless required by applicable law or agreed to in writing,
17+
* software distributed under the License is distributed on an
18+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19+
* KIND, either express or implied. See the License for the
20+
* specific language governing permissions and limitations
21+
* under the License.
22+
*/
23+
package com.ly.doc.gradle.task;
24+
25+
import com.ly.doc.builder.websocket.WebSocketMarkdownBuilder;
26+
import com.ly.doc.model.ApiConfig;
27+
import com.thoughtworks.qdox.JavaProjectBuilder;
28+
import org.gradle.api.logging.Logger;
29+
30+
/**
31+
* Support for WebSocket markdown
32+
*
33+
* @author linwumingshi
34+
*/
35+
public class WebSocketMarkdownTask extends DocBaseTask {
36+
@Override
37+
public void executeAction(ApiConfig apiConfig, JavaProjectBuilder javaProjectBuilder, Logger logger) {
38+
try {
39+
WebSocketMarkdownBuilder.buildApiDoc(apiConfig, javaProjectBuilder);
40+
} catch (Exception e) {
41+
e.printStackTrace();
42+
}
43+
}
44+
}

src/main/java/com/ly/doc/gradle/task/WordTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/util/ArtifactFilterUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/util/ClassLoaderUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file

src/main/java/com/ly/doc/gradle/util/GradleUtil.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file
@@ -26,16 +26,17 @@
2626
import com.google.gson.FieldAttributes;
2727
import com.google.gson.Gson;
2828
import com.google.gson.GsonBuilder;
29+
import com.ly.doc.model.*;
2930
import com.power.common.util.FileUtil;
3031
import com.power.common.util.StringUtil;
31-
import com.ly.doc.model.*;
3232
import org.gradle.api.Project;
3333
import org.gradle.api.logging.Logger;
3434

3535
import java.io.File;
3636
import java.io.FileInputStream;
3737
import java.io.FileNotFoundException;
38-
import java.util.*;
38+
import java.util.List;
39+
import java.util.Objects;
3940

4041
/**
4142
* @author yu 2020/2/16.
@@ -61,6 +62,7 @@ public boolean shouldSkipClass(Class<?> aClass) {
6162
*
6263
* @param configFile config file
6364
* @param project Project object
65+
* @param increment increment
6466
* @param log gradle plugin log
6567
* @return com.power.doc.model.ApiConfig
6668
*/

src/main/java/com/ly/doc/gradle/util/I18nMsgUtil.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file
@@ -35,6 +35,9 @@ public interface I18nMsgUtil {
3535

3636
/**
3737
* Abbreviations, instead of full writing: 👇
38+
*
39+
* @param key key
40+
* @return value
3841
*/
3942
@SuppressWarnings("JavadocDeclaration")
4043
static String get(String key) {

src/main/java/com/ly/doc/gradle/util/SourceSetUtil.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* smart-doc
33
*
4-
* Copyright (C) 2018-2023 smart-doc
4+
* Copyright (C) 2018-2024 smart-doc
55
*
66
* Licensed to the Apache Software Foundation (ASF) under one
77
* or more contributor license agreements. See the NOTICE file
@@ -22,8 +22,8 @@
2222
*/
2323
package com.ly.doc.gradle.util;
2424

25-
import com.power.common.util.CollectionUtil;
2625
import com.ly.doc.constants.DocGlobalConstants;
26+
import com.power.common.util.CollectionUtil;
2727
import org.gradle.api.Project;
2828
import org.gradle.api.file.SourceDirectorySet;
2929
import org.gradle.api.internal.tasks.DefaultSourceSetContainer;
@@ -47,6 +47,8 @@ public interface SourceSetUtil {
4747
/**
4848
* inquire {@code SourceSet} configure the custom source code root directory
4949
*
50+
* @param project project
51+
* @return source code root directory
5052
* @implNote limited support:
5153
* not supported {@code SourceSet} inclusions and exclusions are configured in {@link SourceDirectorySet#getExcludes()} {@link SourceDirectorySet#getIncludes()}
5254
* <p>
@@ -77,15 +79,18 @@ static Set<File> getMainJava(Project project) {
7779

7880
/**
7981
* try using the default project structure: src/main/java
82+
*
83+
* @param project Project
84+
* @return optional default project structure
8085
*/
8186
static Optional<File> getDefaultMainJava(Project project) {
8287
String projectDir = project.getProjectDir().getPath();
8388
String projectCodePath = String.join(DocGlobalConstants.FILE_SEPARATOR, projectDir, DocGlobalConstants.PROJECT_CODE_PATH);
8489
File src = new File(projectCodePath);
8590

8691
return src.exists() && src.listFiles() != null
87-
? Optional.of(src)
88-
: Optional.empty();
92+
? Optional.of(src)
93+
: Optional.empty();
8994
}
9095

9196
}

0 commit comments

Comments
 (0)