Skip to content

Commit b82aa93

Browse files
authored
refactor: optimizing project structure and configuration (#10)
### What this PR does? 优化项目配置 - 使用 Halo plugin maven 依赖替换原先 lib 依赖,为了此依赖必须将 gradle 升级至 8 版本 - 将 resources/console 加入到 .gitignore 中 - 增加了 .editconfig 配置 ```release-note None ```
1 parent 6f8b3dd commit b82aa93

File tree

10 files changed

+528
-21
lines changed

10 files changed

+528
-21
lines changed

.editorconfig

Lines changed: 510 additions & 0 deletions
Large diffs are not rendered by default.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,4 @@ application-local.properties
7272

7373
/admin-frontend/node_modules/
7474
/workplace/
75+
/src/main/resources/console/

build.gradle

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
plugins {
2+
id 'java'
23
id "com.github.node-gradle.node" version "3.3.0"
4+
id "io.freefair.lombok" version "8.0.1"
35
id "io.github.guqing.plugin-development" version "0.0.6-SNAPSHOT"
4-
id 'java'
56
}
67

78
group 'run.halo.starter'
89
sourceCompatibility = JavaVersion.VERSION_17
910

1011
repositories {
12+
mavenCentral()
1113
maven { url 'https://s01.oss.sonatype.org/content/repositories/releases' }
14+
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
1215
maven { url 'https://repo.spring.io/milestone' }
13-
mavenCentral()
1416
}
1517

1618
jar {
1719
enabled = true
1820
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
19-
manifest.attributes(
20-
'Plugin-Version': "${project.version}",
21-
)
21+
manifest.attributes('Plugin-Version': "${project.version}",)
2222
from {
2323
configurations.runtimeClasspath.collect {
2424
it.isDirectory() ? it : zipTree(it)
@@ -27,15 +27,11 @@ jar {
2727
}
2828

2929
dependencies {
30-
compileOnly platform("run.halo.dependencies:halo-dependencies:1.0.0")
31-
32-
compileOnly files("lib/halo-2.0.0-SNAPSHOT-plain.jar")
33-
34-
compileOnly 'org.projectlombok:lombok:1.18.22'
35-
annotationProcessor 'org.projectlombok:lombok:1.18.22'
30+
implementation platform('run.halo.tools.platform:plugin:2.5.0-SNAPSHOT')
31+
compileOnly 'run.halo.app:api'
3632

37-
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
38-
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
33+
testImplementation 'run.halo.app:api'
34+
testImplementation 'org.springframework.boot:spring-boot-starter-test'
3935
}
4036

4137
test {

gradle/wrapper/gradle-wrapper.jar

935 Bytes
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#Wed May 10 13:57:01 CST 2023
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

lib/halo-2.0.0-SNAPSHOT-plain.jar

-1.19 MB
Binary file not shown.

src/main/java/run/halo/starter/StarterPlugin.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
import org.pf4j.PluginWrapper;
44
import org.springframework.stereotype.Component;
5-
import run.halo.app.extension.Scheme;
6-
import run.halo.app.extension.SchemeManager;
75
import run.halo.app.plugin.BasePlugin;
86

97
/**
8+
* <p>Plugin main class to manage the lifecycle of the plugin.</p>
9+
* <p>This class must be public and have a public constructor.</p>
10+
* <p>Only one main class extending {@link BasePlugin} is allowed per plugin.</p>
11+
*
1012
* @author guqing
11-
* @since 2.0.0
13+
* @since 1.0.0
1214
*/
1315
@Component
1416
public class StarterPlugin extends BasePlugin {

src/main/resources/console/main.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/main/resources/console/style.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/main/resources/plugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ spec:
77
enabled: true
88
# 'version' is a valid semantic version string (see semver.org).
99
version: 1.0.0-SNAPSHOT
10-
requires: "*"
10+
requires: ">=2.5.0"
1111
author:
1212
name: Halo OSS Team
1313
website: https://github.com/halo-dev

0 commit comments

Comments
 (0)