halo/build.gradle

118 lines
4.0 KiB
Groovy
Raw Permalink Normal View History

plugins {
id 'org.springframework.boot' version '3.0.4'
id 'io.spring.dependency-management' version '1.1.0'
Provide system config endpoint (#3182) #### What type of PR is this? /kind feature /area core /milestone 2.2.x #### What this PR does / why we need it: Provide `globalconfig` actuator endpoint to let console and theme know how to do according various system configuration. The endpoint allows anonymous users to access, but other actuator endpoints can be accessed by admin users. #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/3055 #### Special notes for your reviewer: Try to request <http://localhost:8090/actuator/globalinfo> and see the result. ```json { "externalUrl":"http://localhost:8090", "timeZone":"Asia/Shanghai", "locale":"en_US", "allowComments":true, "allowRegistration":false } ``` You can request <http://localhost:8090/actuator/info> to see more detail as well. ```json { "git": { "branch": "feat/system-info", "commit": { "id": "ca4e93d", "time": "2023-01-19T08:56:15Z" } }, "build": { "artifact": "halo", "name": "halo", "time": "2023-01-29T15:04:42.151Z", "version": "2.2.0-SNAPSHOT", "group": "run.halo.app" }, "java": { "version": "17.0.6", "vendor": { "name": "Amazon.com Inc.", "version": "Corretto-17.0.6.10.1" }, "runtime": { "name": "OpenJDK Runtime Environment", "version": "17.0.6+10-LTS" }, "jvm": { "name": "OpenJDK 64-Bit Server VM", "vendor": "Amazon.com Inc.", "version": "17.0.6+10-LTS" } }, "os": { "name": "Windows 11", "version": "10.0", "arch": "amd64" } } ``` #### Does this PR introduce a user-facing change? ```release-note 提供系统配置详情端口 ```
2023-01-30 07:20:11 +00:00
id "com.gorylenko.gradle-git-properties" version "2.3.2"
id "checkstyle"
id 'java'
}
group = "run.halo.app"
sourceCompatibility = JavaVersion.VERSION_17
checkstyle {
toolVersion = "9.3"
showViolations = false
ignoreFailures = false
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
feat: support validate requires version for plugin (#3114) #### What type of PR is this? /kind feature /area core /milestone 2.2.x #### What this PR does / why we need it: 插件安装和升级支持版本校验 BTW: 此 PR 中 PluginReconciler 有一些异常提示是没有加 i18n 的,主要是考虑 Reconciler 与请求不挂钩,无法获取到 request 上下文的 Locale,如果用 Locale.getDefault() 那么后续用户切换语言时也更改不到已经持久化到数据库中的错误信息,可能得靠客户端翻译异常。 参考文档: - [semver-expressions-api-ranges](https://github.com/zafarkhaja/jsemver#semver-expressions-api-ranges) - [integrating-with-actuator.build-info](https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/htmlsingle/#integrating-with-actuator.build-info) - [BuildInfoContributor](https://github.com/spring-projects/spring-boot/blob/v3.0.1/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/BuildInfoContributor.java) #### Which issue(s) this PR fixes: Fixes #3089 #### Special notes for your reviewer: how to test it? - 开发模式下不会校验插件填写的 requires,但通过接口安装和升级都会统一校验。 - 在 deployment 模式下安装插件和升级插件会根据 halo 的版本校验插件的 spec.requires 是否符合要求,参考 [semver-expressions-api-ranges](https://github.com/zafarkhaja/jsemver#semver-expressions-api-ranges)。 - 如果 spec.requires 为 `*` 则表示允许所有,如果填写为具体的版本号,例如 requires: "2.2.0" 则隐式表示为 `>=2.2.0`。 可以测试这几种情况是否符合期望。 /cc @halo-dev/sig-halo #### Does this PR introduce a user-facing change? ```release-note 插件安装和升级支持版本校验 ```
2023-01-13 02:50:12 +00:00
springBoot {
buildInfo()
}
bootJar {
manifest {
attributes "Implementation-Title": "Halo Application",
"Implementation-Version": archiveVersion
}
}
2022-04-13 11:38:34 +00:00
ext {
commonsLang3 = "3.12.0"
base62 = "0.1.3"
pf4j = '3.9.0'
feat: add post module basic implementation (#2326) <!-- Thanks for sending a pull request! Here are some tips for you: 1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。 1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>. 2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。 2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. 3. 请确保你已经添加并运行了适当的测试。 3. Ensure you have added or ran the appropriate tests for your PR. --> #### What type of PR is this? /kind feature /milestone 2.0 /area core <!-- 添加其中一个类别: Add one of the following kinds: /kind bug /kind cleanup /kind documentation /kind feature /kind improvement 适当添加其中一个或多个类别(可选): Optionally add one or more of the following kinds if applicable: /kind api-change /kind deprecation /kind failing-test /kind flake /kind regression --> #### What this PR does / why we need it: 新增文章模块的基本实现 提供创建文章,更新草稿和发布文章三个 API #### Which issue(s) this PR fixes: <!-- PR 合并时自动关闭 issue。 Automatically closes linked issue when PR is merged. 用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)` Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. --> A part of #2322 #### Special notes for your reviewer: /cc @halo-dev/sig-halo #### Does this PR introduce a user-facing change? <!-- 如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。 否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change), Release Note 需要以 `action required` 开头。 If no, just write "NONE" in the release-note block below. If yes, a release note is required: Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required". --> ```release-note None ```
2022-08-22 07:32:11 +00:00
javaDiffUtils = "4.12"
guava = "31.1-jre"
jsoup = '1.15.3'
jsonPatch = "1.13"
springDocOpenAPI = "2.0.2"
lucene = "9.5.0"
2022-04-13 11:38:34 +00:00
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-mail'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-data-r2dbc'
// Spring Security
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.security:spring-security-oauth2-jose'
implementation 'org.springframework.security:spring-security-oauth2-resource-server'
implementation "org.springdoc:springdoc-openapi-starter-webflux-ui:$springDocOpenAPI"
implementation 'org.openapi4j:openapi-schema-validator:1.0.7'
implementation "net.bytebuddy:byte-buddy"
2022-04-13 11:38:34 +00:00
// Apache Lucene
implementation "org.apache.lucene:lucene-core:$lucene"
implementation "org.apache.lucene:lucene-queryparser:$lucene"
implementation "org.apache.lucene:lucene-highlighter:$lucene"
implementation "org.apache.lucene:lucene-backward-codecs:$lucene"
implementation 'cn.shenyanchao.ik-analyzer:ik-analyzer:9.0.0'
2022-04-13 11:38:34 +00:00
implementation "org.apache.commons:commons-lang3:$commonsLang3"
implementation "io.seruco.encoding:base62:$base62"
implementation "org.pf4j:pf4j:$pf4j"
feat: add post module basic implementation (#2326) <!-- Thanks for sending a pull request! Here are some tips for you: 1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。 1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>. 2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。 2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. 3. 请确保你已经添加并运行了适当的测试。 3. Ensure you have added or ran the appropriate tests for your PR. --> #### What type of PR is this? /kind feature /milestone 2.0 /area core <!-- 添加其中一个类别: Add one of the following kinds: /kind bug /kind cleanup /kind documentation /kind feature /kind improvement 适当添加其中一个或多个类别(可选): Optionally add one or more of the following kinds if applicable: /kind api-change /kind deprecation /kind failing-test /kind flake /kind regression --> #### What this PR does / why we need it: 新增文章模块的基本实现 提供创建文章,更新草稿和发布文章三个 API #### Which issue(s) this PR fixes: <!-- PR 合并时自动关闭 issue。 Automatically closes linked issue when PR is merged. 用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)` Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. --> A part of #2322 #### Special notes for your reviewer: /cc @halo-dev/sig-halo #### Does this PR introduce a user-facing change? <!-- 如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。 否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change), Release Note 需要以 `action required` 开头。 If no, just write "NONE" in the release-note block below. If yes, a release note is required: Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required". --> ```release-note None ```
2022-08-22 07:32:11 +00:00
implementation "com.google.guava:guava:$guava"
implementation "org.jsoup:jsoup:$jsoup"
implementation "io.github.java-diff-utils:java-diff-utils:$javaDiffUtils"
implementation "org.springframework.integration:spring-integration-core"
implementation "com.github.java-json-tools:json-patch:$jsonPatch"
implementation "org.thymeleaf.extras:thymeleaf-extras-springsecurity6"
compileOnly 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
annotationProcessor "org.springframework:spring-context-indexer:6.0.4"
developmentOnly 'org.springframework.boot:spring-boot-devtools'
// R2DBC
// Currently, official doesn't support mssql and mariadb yet until drivers are available.
// See https://github.com/spring-projects/spring-data-relational/commit/ee6c2c89b5c433748b22a79cf40dc8e01142caa3
// for more.
runtimeOnly 'io.r2dbc:r2dbc-h2'
runtimeOnly 'com.github.jasync-sql:jasync-r2dbc-mysql:2.1.23'
runtimeOnly 'org.mariadb:r2dbc-mariadb:1.1.3'
runtimeOnly 'org.postgresql:postgresql'
runtimeOnly 'org.postgresql:r2dbc-postgresql'
annotationProcessor 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'io.projectreactor:reactor-test'
}
tasks.named('test') {
useJUnitPlatform()
}