halo/platform/application/build.gradle

72 lines
2.0 KiB
Groovy
Raw Normal View History

Refactor project structure for a better development (#3552) #### What type of PR is this? /kind cleanup /area core #### What this PR does / why we need it: This PR totally refactor project structure for a better plugin development. Now we can maintain and publish api and platform modules at Halo application side, which will be references by plugins. Currently, we can execute command `./gradlew clean publish` to publish api and platform modules into **local** Maven repository, so that we can refer these dependencies (`run.halo.tools.platform:plugin:2.4.0-SNAPSHOT` and `run.halo.app:api:2.4.0-SNAPSHOT`) in plugin projects. I will make another pull request to publish api library and platforms into Maven central repository. **Modules explanation**: - API module contains common classes which might be used by plugins. - Plugin Platform module contains dependency declarations of other plugin API modules. - Application Platform module contains dependency declarations application module might uses. If we want to build application only(exclude check and jar), we have to execute the command below: ```bash ./gradlew clean :application:build -x :application:check -x :application:jar ``` The executable Jar will be generated at folder `application/build/libs/`. If we want to build a Docker image, we could execute the command below: ```bash docker build -t johnniang/halo:project-structure . # Test the Docker image docker run -it --rm -p8090:8090 johnniang/halo:project-structure ``` #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/2730 #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? ```release-note 重构项目结构 ```
2023-03-23 08:02:33 +00:00
import org.springframework.boot.gradle.plugin.SpringBootPlugin
plugins {
id 'org.springframework.boot' version '3.0.5' apply false
Refactor project structure for a better development (#3552) #### What type of PR is this? /kind cleanup /area core #### What this PR does / why we need it: This PR totally refactor project structure for a better plugin development. Now we can maintain and publish api and platform modules at Halo application side, which will be references by plugins. Currently, we can execute command `./gradlew clean publish` to publish api and platform modules into **local** Maven repository, so that we can refer these dependencies (`run.halo.tools.platform:plugin:2.4.0-SNAPSHOT` and `run.halo.app:api:2.4.0-SNAPSHOT`) in plugin projects. I will make another pull request to publish api library and platforms into Maven central repository. **Modules explanation**: - API module contains common classes which might be used by plugins. - Plugin Platform module contains dependency declarations of other plugin API modules. - Application Platform module contains dependency declarations application module might uses. If we want to build application only(exclude check and jar), we have to execute the command below: ```bash ./gradlew clean :application:build -x :application:check -x :application:jar ``` The executable Jar will be generated at folder `application/build/libs/`. If we want to build a Docker image, we could execute the command below: ```bash docker build -t johnniang/halo:project-structure . # Test the Docker image docker run -it --rm -p8090:8090 johnniang/halo:project-structure ``` #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/2730 #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? ```release-note 重构项目结构 ```
2023-03-23 08:02:33 +00:00
id 'java-platform'
id 'maven-publish'
}
group = 'run.halo.tools.platform'
description = 'Platform of application.'
ext {
commonsLang3 = "3.12.0"
base62 = "0.1.3"
pf4j = '3.9.0'
javaDiffUtils = "4.12"
guava = "31.1-jre"
jsoup = '1.15.3'
jsonPatch = "1.13"
springDocOpenAPI = "2.0.4"
lucene = "9.5.0"
}
javaPlatform {
allowDependencies()
}
dependencies {
api platform(SpringBootPlugin.BOM_COORDINATES)
constraints {
api "org.springdoc:springdoc-openapi-starter-webflux-ui:$springDocOpenAPI"
api 'org.openapi4j:openapi-schema-validator:1.0.7'
// Apache Lucene
api "org.apache.lucene:lucene-core:$lucene"
api "org.apache.lucene:lucene-queryparser:$lucene"
api "org.apache.lucene:lucene-highlighter:$lucene"
api "org.apache.lucene:lucene-backward-codecs:$lucene"
api 'cn.shenyanchao.ik-analyzer:ik-analyzer:9.0.0'
api "org.apache.commons:commons-lang3:$commonsLang3"
api "io.seruco.encoding:base62:$base62"
api "org.pf4j:pf4j:$pf4j"
api "com.google.guava:guava:$guava"
api "org.jsoup:jsoup:$jsoup"
api "io.github.java-diff-utils:java-diff-utils:$javaDiffUtils"
api "org.springframework.integration:spring-integration-core"
api "com.github.java-json-tools:json-patch:$jsonPatch"
api "org.thymeleaf.extras:thymeleaf-extras-springsecurity6"
runtime 'io.r2dbc:r2dbc-h2'
runtime 'org.postgresql:postgresql'
runtime 'org.postgresql:r2dbc-postgresql'
runtime 'org.mariadb:r2dbc-mariadb:1.1.4'
Refactor project structure for a better development (#3552) #### What type of PR is this? /kind cleanup /area core #### What this PR does / why we need it: This PR totally refactor project structure for a better plugin development. Now we can maintain and publish api and platform modules at Halo application side, which will be references by plugins. Currently, we can execute command `./gradlew clean publish` to publish api and platform modules into **local** Maven repository, so that we can refer these dependencies (`run.halo.tools.platform:plugin:2.4.0-SNAPSHOT` and `run.halo.app:api:2.4.0-SNAPSHOT`) in plugin projects. I will make another pull request to publish api library and platforms into Maven central repository. **Modules explanation**: - API module contains common classes which might be used by plugins. - Plugin Platform module contains dependency declarations of other plugin API modules. - Application Platform module contains dependency declarations application module might uses. If we want to build application only(exclude check and jar), we have to execute the command below: ```bash ./gradlew clean :application:build -x :application:check -x :application:jar ``` The executable Jar will be generated at folder `application/build/libs/`. If we want to build a Docker image, we could execute the command below: ```bash docker build -t johnniang/halo:project-structure . # Test the Docker image docker run -it --rm -p8090:8090 johnniang/halo:project-structure ``` #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/2730 #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? ```release-note 重构项目结构 ```
2023-03-23 08:02:33 +00:00
runtime 'com.github.jasync-sql:jasync-r2dbc-mysql:2.1.23'
}
}
publishing {
publications {
applicationPlatform(MavenPublication) {
from components.javaPlatform
}
}
repositories {
mavenLocal()
}
}