Skip to content
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
.qodana
build
/src/main/java/com/wdf/fudoc/start/
.intellijPlatform/
idea-sandbox
64 changes: 45 additions & 19 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ plugins {
// Java support
id("java")
// Kotlin support
id("org.jetbrains.kotlin.jvm") version "1.6.10"
// Gradle IntelliJ Plugin
id("org.jetbrains.intellij") version "1.13.3"
id("org.jetbrains.kotlin.jvm") version "2.0.21"
// Gradle IntelliJ Platform Plugin 2.x - using 2.0.1 to avoid runIde bug in 2.1.0
id("org.jetbrains.intellij.platform") version "2.10.4"
// Gradle Changelog Plugin
id("org.jetbrains.changelog") version "1.3.1"
id("org.jetbrains.changelog") version "2.2.1"
}


Expand All @@ -27,11 +27,16 @@ repositories {
setUrl("https://maven.aliyun.com/nexus/content/groups/public/")
}
mavenCentral()

// IntelliJ Platform repositories
intellijPlatform {
defaultRepositories()
}
}

dependencies {
compileOnly("org.projectlombok:lombok:1.18.26")
annotationProcessor("org.projectlombok:lombok:1.18.26")
compileOnly("org.projectlombok:lombok:1.18.34")
annotationProcessor("org.projectlombok:lombok:1.18.34")
implementation("com.github.jsonzou:jmockdata:4.3.0")
implementation("org.freemarker:freemarker:2.3.31")
implementation("cn.hutool:hutool-json:5.8.20")
Expand All @@ -42,22 +47,31 @@ dependencies {
implementation("org.apache.commons:commons-lang3:3.10")
implementation("com.fasterxml.jackson.core:jackson-databind:2.14.2")
implementation("com.atlassian.commonmark:commonmark:0.17.0")
implementation("cn.fudoc:fu-api-commons:${properties["ideaVersion"]}.${properties["fudocVersion"]}")
}
implementation("cn.fudoc:fu-api-commons:222.${properties["fudocVersion"]}")

// IntelliJ Platform dependencies
intellijPlatform {
create(properties("platformType"), properties("platformVersion"))

// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
intellij {
pluginName.set(properties("pluginName"))
version.set(properties("platformVersion"))
type.set(properties("platformType"))
updateSinceUntilBuild.set(false)
// Bundled plugins (plugins that come with IntelliJ)
bundledPlugins(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))

//沙箱目录位置,用于保存IDEA的设置,默认在build文件下面,防止clean,放在根目录下。
sandboxDir.set("${rootProject.rootDir}/idea-sandbox")
// IntelliJ Platform instrumentation
instrumentationTools()

// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
// Test Framework
testFramework(org.jetbrains.intellij.platform.gradle.TestFrameworkType.Platform)
}
}

// Configure IntelliJ Platform Gradle Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html
intellijPlatform {
pluginConfiguration {
name.set(properties("pluginName"))
}

// 沙箱目录位置,用于保存 IDEA 的设置,默认在 build 文件下面,防止 clean,放在根目录下。
sandboxContainer.set(file("${rootProject.rootDir}/idea-sandbox"))
}


Expand All @@ -77,15 +91,27 @@ tasks {
options.encoding = "UTF-8"
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = it
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(it))
}
}
}

wrapper {
gradleVersion = properties("gradleVersion")
}

// Configure runIde task to avoid IndexOutOfBoundsException
runIde {
maxHeapSize = "2g"
jvmArgs = listOf(
"-Xms512m"
)
}

patchPluginXml {
sinceBuild.set("251")
untilBuild.set("")

// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
pluginDescription.set(
Expand Down
13 changes: 7 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,31 @@
pluginGroup = com.wdf.apidoc
pluginName = FuDoc
# SemVer format -> https://semver.org
pluginVersion = 222.1.8.9
pluginVersion = 251.1.8.9


# \u63D2\u4EF6\u652F\u6301\u7248\u672C
ideaVersion = 222
ideaVersion = 251
fudocVersion = 1.8

# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.

# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
platformType = IU
platformVersion = 2022.3.1
platformVersion = 2025.1.5

# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
# Note: 'json' is bundled into platform core in 2025.1+, removed from plugin list
platformPlugins = com.intellij.java,JavaScript,com.jetbrains.restClient,org.jetbrains.idea.maven
#platformPlugins = com.intellij.java,com.intellij.spring

# Java language level used to compile sources and to generate the files for - Java 11 is required since 2020.3
javaVersion = 17
# Java language level used to compile sources and to generate the files for - Java 21 is required for IDEA 2025.1
javaVersion = 21

# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion = 7.4
gradleVersion = 8.13

# Opt-out flag for bundling Kotlin standard library.
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.
Expand Down
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
44 changes: 31 additions & 13 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 21 additions & 16 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,24 @@
*/
public class AssembleServiceExecutor {

private static final List<FuDocAssembleService> SERVICE_LIST = Lists.newArrayList(
ServiceHelper.getService(ControllerAssembleService.class),
ServiceHelper.getService(FeignAssembleService.class),
ServiceHelper.getService(InterfaceAssembleService.class)
);
/**
* 懒加载服务列表
* 不在类初始化时加载,而是在第一次使用时加载
* 这样避免了类加载时就依赖 IntelliJ Platform 的服务容器
*
* @return 组装服务列表
*/
private static List<FuDocAssembleService> getServiceList() {
return Lists.newArrayList(
ServiceHelper.getService(ControllerAssembleService.class),
ServiceHelper.getService(FeignAssembleService.class),
ServiceHelper.getService(InterfaceAssembleService.class)
);
}


public static List<FuDocItemData> execute(FuDocContext fuDocContext, ClassInfoDesc classInfoDesc) {
for (FuDocAssembleService fuDocAssembleService : SERVICE_LIST) {
for (FuDocAssembleService fuDocAssembleService : getServiceList()) {
if (fuDocAssembleService.isAssemble(fuDocContext, classInfoDesc)) {
return fuDocAssembleService.assemble(fuDocContext, classInfoDesc);
}
Expand All @@ -37,7 +46,7 @@ public static List<FuDocItemData> execute(FuDocContext fuDocContext, ClassInfoDe


public static List<FuDocRootParamData> executeByRequest(FuDocContext fuDocContext, ClassInfoDesc classInfoDesc) {
for (FuDocAssembleService fuDocAssembleService : SERVICE_LIST) {
for (FuDocAssembleService fuDocAssembleService : getServiceList()) {
if (fuDocAssembleService.isAssemble(fuDocContext, classInfoDesc)) {
return fuDocAssembleService.requestAssemble(fuDocContext, classInfoDesc);
}
Expand Down
Loading
Loading