Skip to content

Commit

Permalink
Fix the problem where some Windows developers are unable to build pro…
Browse files Browse the repository at this point in the history
…ject (#4844)

#### What type of PR is this?

/kind bug
/area core

#### What this PR does / why we need it:

Currently, some Windows developers using GBK as character encoding are unable to build project, please see #4771 for more. 

Because the source code are using UTF-8 character encoding, the `javadoc`, `compileJava`, `compileTestJava` and `delombok` tasks will use the default character encoding GBK to handle the sources, which prevents the `:api:javadoc` task from running properly.

At the same time, we thank to @DaiYuANg for his first proposed solution in #4517.

#### Which issue(s) this PR fixes:

Fixes #4771

#### Special notes for your reviewer:

Validate the result by executing command `./gradlew clean build -x check` on Windows environment.

#### Does this PR introduce a user-facing change?

```release-note
修复在部分 Windows 开发者无法正常构建 Halo 的问题
```
  • Loading branch information
JohnNiang authored Nov 12, 2023
1 parent 4ea2014 commit ee52adf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ plugins {
group = 'run.halo.app'
description = 'API of halo project, connecting by other projects.'

compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"
javadoc.options.encoding = "UTF-8"

repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
Expand Down
2 changes: 2 additions & 0 deletions application/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ plugins {

group = "run.halo.app"
sourceCompatibility = JavaVersion.VERSION_17
compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"

checkstyle {
toolVersion = "9.3"
Expand Down

0 comments on commit ee52adf

Please sign in to comment.