Skip to content

Commit

Permalink
init project
Browse files Browse the repository at this point in the history
  • Loading branch information
DioxideCN committed Feb 17, 2024
1 parent 187a7ad commit 5b2304f
Show file tree
Hide file tree
Showing 33 changed files with 2,201 additions and 9 deletions.
510 changes: 510 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

69 changes: 60 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,75 @@
# Compiled class file
### Maven
target/
logs/
!.mvn/wrapper/maven-wrapper.jar

### Gradle
.gradle
/build/
/out/
!gradle/wrapper/gradle-wrapper.jar
bin/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
log/

### NetBeans ###
nbproject/private/
build/
nbbuild/
dist/
nbdist/
.nb-gradle/

### Mac
.DS_Store
*/.DS_Store

### VS Code ###
*.project
*.factorypath

### Compiled class file
*.class

# Log file
### Log file
*.log

# BlueJ files
### BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
### Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
### Package Files
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
### VSCode
.vscode

### Local file
application-local.yml
application-local.yaml
application-local.properties

/ui/node_modules/
/workplace/
/src/main/resources/console/
10 changes: 10 additions & 0 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
reviewers:
- ruibaby
- guqing
- JohnNiang
- wangzhen-fit2cloud

approvers:
- ruibaby
- guqing
- JohnNiang
76 changes: 76 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# plugin-starter

Halo 2.0 插件开发快速开始模板。

## 开发环境

插件开发的详细文档请查阅:<https://docs.halo.run/developer-guide/plugin/hello-world>

所需环境:

1. Java 17
2. Node 18
3. pnpm 8
4. Docker (可选)

克隆项目:

```bash
git clone git@github.com:halo-sigs/plugin-starter.git

# 或者当你 fork 之后

git clone git@github.com:{your_github_id}/plugin-starter.git
```

```bash
cd path/to/plugin-starter
```

### 运行方式 1(推荐)

> 此方式需要本地安装 Docker
```bash
# macOS / Linux
./gradlew pnpmInstall

# Windows
./gradlew.bat pnpmInstall
```

```bash
# macOS / Linux
./gradlew haloServer

# Windows
./gradlew.bat haloServer
```

执行此命令后,会自动创建一个 Halo 的 Docker 容器并加载当前的插件,更多文档可查阅:<https://github.com/halo-sigs/halo-gradle-plugin>

### 运行方式 2

> 此方式需要使用源码运行 Halo
编译插件:

```bash
# macOS / Linux
./gradlew build

# Windows
./gradlew.bat build
```

修改 Halo 配置文件:

```yaml
halo:
plugin:
runtime-mode: development
fixedPluginPath:
- "/path/to/plugin-starter"
```

最后重启 Halo 项目即可。
48 changes: 48 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
plugins {
id 'java'
id "com.github.node-gradle.node" version "5.0.0"
id "io.freefair.lombok" version "8.0.1"
id "run.halo.plugin.devtools" version "0.0.7"
}

group 'cn.dioxide.gravity'
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' }
}

dependencies {
implementation platform('run.halo.tools.platform:plugin:2.11.0-SNAPSHOT')
implementation 'com.maxmind.geoip2:geoip2:4.0.1'
implementation 'com.github.ben-manes.caffeine:caffeine:3.1.7'

compileOnly 'run.halo.app:api'

testImplementation 'run.halo.app:api'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

test {
useJUnitPlatform()
}

tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
}

build {
// build frontend before build
tasks.getByName('compileJava')
}

halo {
version = '2.11'
}

configurations.runtimeClasspath {
exclude group: 'com.fasterxml.jackson.core'
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version=1.0.0
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Wed May 10 13:57:01 CST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 5b2304f

Please sign in to comment.