Skip to content

Commit

Permalink
refactor: optimizing project structure and configuration (#10)
Browse files Browse the repository at this point in the history
### What this PR does?
优化项目配置

- 使用 Halo plugin maven 依赖替换原先 lib 依赖,为了此依赖必须将 gradle 升级至 8 版本
- 将 resources/console 加入到 .gitignore 中
- 增加了 .editconfig 配置

```release-note
None
```
  • Loading branch information
guqing committed May 11, 2023
1 parent 6f8b3dd commit b82aa93
Show file tree
Hide file tree
Showing 10 changed files with 528 additions and 21 deletions.
510 changes: 510 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,4 @@ application-local.properties

/admin-frontend/node_modules/
/workplace/
/src/main/resources/console/
22 changes: 9 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
plugins {
id 'java'
id "com.github.node-gradle.node" version "3.3.0"
id "io.freefair.lombok" version "8.0.1"
id "io.github.guqing.plugin-development" version "0.0.6-SNAPSHOT"
id 'java'
}

group 'run.halo.starter'
sourceCompatibility = JavaVersion.VERSION_17

repositories {
mavenCentral()
maven { url 'https://s01.oss.sonatype.org/content/repositories/releases' }
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'https://repo.spring.io/milestone' }
mavenCentral()
}

jar {
enabled = true
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest.attributes(
'Plugin-Version': "${project.version}",
)
manifest.attributes('Plugin-Version': "${project.version}",)
from {
configurations.runtimeClasspath.collect {
it.isDirectory() ? it : zipTree(it)
Expand All @@ -27,15 +27,11 @@ jar {
}

dependencies {
compileOnly platform("run.halo.dependencies:halo-dependencies:1.0.0")

compileOnly files("lib/halo-2.0.0-SNAPSHOT-plain.jar")

compileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'
implementation platform('run.halo.tools.platform:plugin:2.5.0-SNAPSHOT')
compileOnly 'run.halo.app:api'

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
testImplementation 'run.halo.app:api'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

test {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Wed May 10 13:57:01 CST 2023
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.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Binary file removed lib/halo-2.0.0-SNAPSHOT-plain.jar
Binary file not shown.
8 changes: 5 additions & 3 deletions src/main/java/run/halo/starter/StarterPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

import org.pf4j.PluginWrapper;
import org.springframework.stereotype.Component;
import run.halo.app.extension.Scheme;
import run.halo.app.extension.SchemeManager;
import run.halo.app.plugin.BasePlugin;

/**
* <p>Plugin main class to manage the lifecycle of the plugin.</p>
* <p>This class must be public and have a public constructor.</p>
* <p>Only one main class extending {@link BasePlugin} is allowed per plugin.</p>
*
* @author guqing
* @since 2.0.0
* @since 1.0.0
*/
@Component
public class StarterPlugin extends BasePlugin {
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/console/main.js

This file was deleted.

1 change: 0 additions & 1 deletion src/main/resources/console/style.css

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/resources/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
enabled: true
# 'version' is a valid semantic version string (see semver.org).
version: 1.0.0-SNAPSHOT
requires: "*"
requires: ">=2.5.0"
author:
name: Halo OSS Team
website: https://github.com/halo-dev
Expand Down

0 comments on commit b82aa93

Please sign in to comment.