Skip to content

Commit

Permalink
chore: remove deprecated plugin wrapper (#19)
Browse files Browse the repository at this point in the history
### What this PR does?
移除对已过时的 PluginWrapper 的引用,Halo 2.18.0 版本后将不在支持从 BasePlugin 中获取 PluginWrapper ,也不再支持依赖注入 PluginWrapper,使用 PluginContext 代替

see also halo-dev/halo#6243 for more details

```release-note
None
```
  • Loading branch information
guqing authored Jul 2, 2024
1 parent d91e481 commit 5d18a15
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ plugins {
}

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

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

repositories {
maven { url 'https://s01.oss.sonatype.org/content/repositories/releases' }
Expand All @@ -16,7 +20,7 @@ repositories {
}

dependencies {
implementation platform('run.halo.tools.platform:plugin:2.6.0-SNAPSHOT')
implementation platform('run.halo.tools.platform:plugin:2.10.0-SNAPSHOT')
compileOnly 'run.halo.app:api'

testImplementation 'run.halo.app:api'
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/run/halo/lightgallery/LightGalleryPlugin.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package run.halo.lightgallery;

import org.pf4j.PluginWrapper;
import org.springframework.stereotype.Component;
import run.halo.app.plugin.BasePlugin;
import run.halo.app.plugin.PluginContext;

/**
* @author ryanwang
*/
@Component
public class LightGalleryPlugin extends BasePlugin {

public LightGalleryPlugin(PluginWrapper wrapper) {
super(wrapper);
public LightGalleryPlugin(PluginContext pluginContext) {
super(pluginContext);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: PluginLightGallery
spec:
enabled: true
requires: ">=2.4.0"
requires: ">=2.10.0"
author:
name: Halo OSS Team
website: https://github.com/halo-dev
Expand Down

0 comments on commit 5d18a15

Please sign in to comment.