fix(agents): compile shared runtime with Java 21
This commit is contained in:
parent
f8a4cc0564
commit
545c2c9e00
|
|
@ -76,9 +76,7 @@ jobs:
|
|||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: |
|
||||
8
|
||||
21
|
||||
java-version: "21"
|
||||
- uses: gradle/actions/setup-gradle@v4
|
||||
- run: ./gradlew shadowJar --parallel
|
||||
working-directory: agents
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ plugins {
|
|||
id 'com.gradleup.shadow' version '9.0.0-beta12' apply false
|
||||
}
|
||||
|
||||
def java8Projects = ['common', 'test-support'] as Set
|
||||
def infrastructureProjects = ['common', 'test-support'] as Set
|
||||
def legacyStandaloneProjects = ['mongodb', 'kafka', 'rocketmq', 'rabbitmq'] as Set
|
||||
def agentProjects = subprojects.findAll { !infrastructureProjects.contains(it.name) }
|
||||
|
|
@ -23,7 +22,7 @@ subprojects {
|
|||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(java8Projects.contains(name) ? 8 : 21)
|
||||
languageVersion = JavaLanguageVersion.of(21)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -182,18 +182,16 @@ The root `build.gradle` convention derives the archive name from the module name
|
|||
Default to:
|
||||
|
||||
```groovy
|
||||
def java8Projects = ['common', 'test-support'] as Set
|
||||
|
||||
subprojects {
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(java8Projects.contains(name) ? 8 : 21)
|
||||
languageVersion = JavaLanguageVersion.of(21)
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Most agents use JRE 21. If an agent needs a special runtime, update the root Gradle convention, the release workflow JRE detection logic, and document the reason in the module.
|
||||
All Java agent modules and shared infrastructure modules use Java 21. If an agent needs a special runtime, update the root Gradle convention, the release workflow JRE detection logic, and document the reason in the module.
|
||||
|
||||
## Tests
|
||||
|
||||
|
|
|
|||
|
|
@ -182,18 +182,16 @@ tasks.named('shadowJar') {
|
|||
默认配置如下:
|
||||
|
||||
```groovy
|
||||
def java8Projects = ['common', 'test-support'] as Set
|
||||
|
||||
subprojects {
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(java8Projects.contains(name) ? 8 : 21)
|
||||
languageVersion = JavaLanguageVersion.of(21)
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
大多数 Agent 使用 JRE 21。如果某个 Agent 需要特殊的运行时,请更新根 Gradle 约定、发布工作流的 JRE 检测逻辑,并在该模块中记录原因。
|
||||
所有 Java Agent 和共享基础设施模块均使用 Java 21。如果某个 Agent 需要特殊的运行时,请更新根 Gradle 约定、发布工作流的 JRE 检测逻辑,并在该模块中记录原因。
|
||||
|
||||
## 测试
|
||||
|
||||
|
|
@ -315,4 +313,4 @@ class ExampleAgentTest extends JdbcFakeExecutionBehaviorTest {
|
|||
- `settings.gradle`、`versions.json`、README 同步更新。
|
||||
- 至少有一个执行路径回归测试。
|
||||
- `python3 scripts/validate_agents.py` 通过。
|
||||
- `./gradlew test shadowJar --continue` 通过。
|
||||
- `./gradlew test shadowJar --continue` 通过。
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ configure([project(':common'), project(':test-support')]) {
|
|||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(8)
|
||||
languageVersion = JavaLanguageVersion.of(21)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue