Skip to content

feat: ✨ add websocket-markdown support;update license validi… #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ly/doc/gradle/chain/FilterChain.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/com/ly/doc/gradle/constant/GlobalConstants.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down Expand Up @@ -104,8 +104,12 @@ public interface GlobalConstants {
/**
* Generate Swagger document
*/
String Swagger_TASK = "swagger";
String SWAGGER_TASK = "swagger";

/**
* Generate WebSocket markdown document
*/
String WEBSOCKET_MARKDOWN = "webSocketMarkdown";

/**
* Plugin extension name
Expand Down
18 changes: 10 additions & 8 deletions src/main/java/com/ly/doc/gradle/constant/TaskConstants.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down Expand Up @@ -35,10 +35,10 @@ public class TaskConstants {
/**
* Map of Gradle Task
*/
public static Map<String, Class> taskMap = new HashMap<>();
public static Map<String, Class<?>> taskMap = new HashMap<>();

static {
//create html
// create html
taskMap.put(GlobalConstants.REST_HTML_TASK, RestHtmlTask.class);
// create adoc
taskMap.put(GlobalConstants.REST_ADOC_TASK, RestAdocTask.class);
Expand All @@ -50,19 +50,21 @@ public class TaskConstants {
taskMap.put(GlobalConstants.POSTMAN_TASK, PostmanTask.class);
// create open api
taskMap.put(GlobalConstants.OPEN_API_TASK, OpenApiTask.class);
//create rpc html
// create rpc html
taskMap.put(GlobalConstants.RPC_HTML_TASK, RpcHtmlTask.class);
// create rpc adoc
taskMap.put(GlobalConstants.RPC_ADOC_TASK, RpcAdocTask.class);
// create rpc markdown
// create rpc Markdown
taskMap.put(GlobalConstants.RPC_MARKDOWN_TASK, RpcMarkdownTask.class);
// create torna rest
taskMap.put(GlobalConstants.TORNA_REST_TASK,TornaRestTask.class);
taskMap.put(GlobalConstants.TORNA_REST_TASK, TornaRestTask.class);
// create torna rpc
taskMap.put(GlobalConstants.TORNA_RPC_TASK,TornaRpcTask.class);
taskMap.put(GlobalConstants.TORNA_RPC_TASK, TornaRpcTask.class);
// create word rest
taskMap.put(GlobalConstants.WORD_TASK, WordTask.class);
// create Swagger
taskMap.put(GlobalConstants.Swagger_TASK, SwaggerTask.class);
taskMap.put(GlobalConstants.SWAGGER_TASK, SwaggerTask.class);
// create websocket markdown
taskMap.put(GlobalConstants.WEBSOCKET_MARKDOWN, WebSocketMarkdownTask.class);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ly/doc/gradle/model/CustomArtifact.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ly/doc/gradle/plugin/SmartDocPlugin.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ly/doc/gradle/task/DocBaseTask.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ly/doc/gradle/task/JMeterTask.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ly/doc/gradle/task/OpenApiTask.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ly/doc/gradle/task/PostmanTask.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ly/doc/gradle/task/RestAdocTask.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ly/doc/gradle/task/RestHtmlTask.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ly/doc/gradle/task/RestMarkdownTask.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ly/doc/gradle/task/RpcAdocTask.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ly/doc/gradle/task/RpcHtmlTask.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ly/doc/gradle/task/RpcMarkdownTask.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ly/doc/gradle/task/SwaggerTask.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ly/doc/gradle/task/TornaRestTask.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ly/doc/gradle/task/TornaRpcTask.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
44 changes: 44 additions & 0 deletions src/main/java/com/ly/doc/gradle/task/WebSocketMarkdownTask.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* smart-doc
*
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.ly.doc.gradle.task;

import com.ly.doc.builder.websocket.WebSocketMarkdownBuilder;
import com.ly.doc.model.ApiConfig;
import com.thoughtworks.qdox.JavaProjectBuilder;
import org.gradle.api.logging.Logger;

/**
* Support for WebSocket markdown
*
* @author linwumingshi
*/
public class WebSocketMarkdownTask extends DocBaseTask {
@Override
public void executeAction(ApiConfig apiConfig, JavaProjectBuilder javaProjectBuilder, Logger logger) {
try {
WebSocketMarkdownBuilder.buildApiDoc(apiConfig, javaProjectBuilder);
} catch (Exception e) {
e.printStackTrace();
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/ly/doc/gradle/task/WordTask.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ly/doc/gradle/util/ClassLoaderUtil.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/com/ly/doc/gradle/util/GradleUtil.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand All @@ -26,16 +26,17 @@
import com.google.gson.FieldAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.ly.doc.model.*;
import com.power.common.util.FileUtil;
import com.power.common.util.StringUtil;
import com.ly.doc.model.*;
import org.gradle.api.Project;
import org.gradle.api.logging.Logger;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;
import java.util.List;
import java.util.Objects;

/**
* @author yu 2020/2/16.
Expand All @@ -61,6 +62,7 @@ public boolean shouldSkipClass(Class<?> aClass) {
*
* @param configFile config file
* @param project Project object
* @param increment increment
* @param log gradle plugin log
* @return com.power.doc.model.ApiConfig
*/
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/com/ly/doc/gradle/util/I18nMsgUtil.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* smart-doc
*
* Copyright (C) 2018-2023 smart-doc
* Copyright (C) 2018-2024 smart-doc
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand Down Expand Up @@ -35,6 +35,9 @@ public interface I18nMsgUtil {

/**
* Abbreviations, instead of full writing: 👇
*
* @param key key
* @return value
*/
@SuppressWarnings("JavadocDeclaration")
static String get(String key) {
Expand Down
Loading