generated from halo-dev/plugin-starter
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: restructure RSS generation to support extension by other plugins (
#39) ### What this PR does? 重写 RSS 生成并支持被其他插件扩展 ```release-note 重写 RSS 生成并支持被其他插件扩展 ```
- Loading branch information
Showing
40 changed files
with
1,621 additions
and
834 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ jobs: | |
with: | ||
app-id: app-KhIVw | ||
skip-node-setup: true | ||
artifacts-path: 'app/build/libs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,3 +72,4 @@ application-local.properties | |
|
||
/admin-frontend/node_modules/ | ||
/workplace/ | ||
*/workplace/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
plugins { | ||
id 'java-library' | ||
id 'maven-publish' | ||
id "io.freefair.lombok" version "8.0.0-rc2" | ||
} | ||
|
||
group = 'run.halo.feed' | ||
version = rootProject.version | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
withSourcesJar() | ||
} | ||
|
||
compileJava.options.encoding = "UTF-8" | ||
compileTestJava.options.encoding = "UTF-8" | ||
javadoc.options.encoding = "UTF-8" | ||
|
||
dependencies { | ||
api platform('run.halo.tools.platform:plugin:2.20.11') | ||
compileOnly 'run.halo.app:api' | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
from components.java | ||
artifact tasks.sourcesJar | ||
|
||
artifactId = 'api' | ||
version = project.hasProperty('version') ? project.property('version') : 'unspecified' | ||
|
||
pom { | ||
name = 'RSS' | ||
description = '为站点生成 RSS 订阅链接' | ||
url = 'https://www.halo.run/store/apps/app-KhIVw' | ||
|
||
licenses { | ||
license { | ||
name = 'GPL-3.0' | ||
url = 'https://github.com/halo-dev/plugin-feed/blob/main/LICENSE' | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id = 'guqing' | ||
name = 'guqing' | ||
email = '[email protected]' | ||
} | ||
} | ||
|
||
scm { | ||
connection = 'scm:git:[email protected]:halo-dev/plugin-feed.git' | ||
developerConnection = 'scm:git:[email protected]:halo-dev/plugin-feed.git' | ||
url = 'https://github.com/halo-dev/plugin-feed' | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
url = version.endsWith('-SNAPSHOT') ? 'https://s01.oss.sonatype.org/content/repositories/snapshots/' : | ||
'https://s01.oss.sonatype.org/content/repositories/releases/' | ||
credentials { | ||
username = project.findProperty("ossr.user") ?: System.getenv("OSSR_USERNAME") | ||
password = project.findProperty("ossr.password") ?: System.getenv("OSSR_PASSWORD") | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package run.halo.feed; | ||
|
||
import org.springframework.util.Assert; | ||
|
||
public record CacheClearRule(Type type, String value) { | ||
public CacheClearRule { | ||
Assert.notNull(type, "Type cannot be null"); | ||
Assert.notNull(value, "Value cannot be null"); | ||
if (type == Type.EXACT && !value.startsWith("/")) { | ||
throw new IllegalArgumentException("Exact value must start with /"); | ||
} | ||
} | ||
|
||
public static CacheClearRule forPrefix(String prefix) { | ||
return new CacheClearRule(Type.PREFIX, prefix); | ||
} | ||
|
||
public static CacheClearRule forExact(String exact) { | ||
return new CacheClearRule(Type.EXACT, exact); | ||
} | ||
|
||
public static CacheClearRule forContains(String contains) { | ||
return new CacheClearRule(Type.CONTAINS, contains); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "CacheClearRule{" + | ||
"type=" + type + | ||
", value='" + value + '\'' + | ||
'}'; | ||
} | ||
|
||
public enum Type { | ||
PREFIX, | ||
EXACT, | ||
CONTAINS | ||
} | ||
} | ||
|
Oops, something went wrong.