Skip to content

Commit

Permalink
Update Spring Boot to v3.3.6 (#27959)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima authored Nov 21, 2024
1 parent 8b8c35b commit 790840a
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ exports[`generator - java:graalvm with default options should call source snapsh
<classesDirectory>\${project.build.outputDirectory}</classesDirectory>
<metadataRepository>
<enabled>true</enabled>
<version>GRAALVM_REACHABILITY_METADATA_VERSION</version>
</metadataRepository>
<imageName>\${native-image-name}</imageName>
<verbose>true</verbose>
Expand Down
26 changes: 25 additions & 1 deletion generators/java/generators/graalvm/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { createNeedleCallback } from '../../../base/support/needles.js';
import { addJavaAnnotation, addJavaImport } from '../../../java/support/add-java-annotation.js';
import { javaMainPackageTemplatesBlock } from '../../../java/support/files.js';
import { mavenDefinition } from './internal/maven-definition.js';
import { GRAALVM_REACHABILITY_METADATA } from './internal/constants.js';

export default class GraalvmGenerator extends BaseApplicationGenerator {
async beforeQueue() {
Expand All @@ -49,6 +50,20 @@ export default class GraalvmGenerator extends BaseApplicationGenerator {
return this.delegateTasksToBlueprint(() => this.initializing);
}

get loading() {
return this.asLoadingTaskGroup({
loading({ application }) {
application.graalvmReachabilityMetadata = this.useVersionPlaceholders
? 'GRAALVM_REACHABILITY_METADATA_VERSION'
: GRAALVM_REACHABILITY_METADATA;
},
});
}

get [BaseApplicationGenerator.LOADING]() {
return this.delegateTasksToBlueprint(() => this.loading);
}

get preparing() {
return this.asPreparingTaskGroup({
load({ application }) {
Expand Down Expand Up @@ -179,11 +194,20 @@ export default class GraalvmGenerator extends BaseApplicationGenerator {
},

async customizeMaven({ application, source }) {
const { buildToolMaven, reactive, databaseTypeSql, javaDependencies, nativeLanguageDefinition, languagesDefinition } = application;
const {
buildToolMaven,
reactive,
databaseTypeSql,
javaDependencies,
nativeLanguageDefinition,
languagesDefinition,
graalvmReachabilityMetadata,
} = application;
if (!buildToolMaven) return;

source.addMavenDefinition!(
mavenDefinition({
graalvmReachabilityMetadata,
reactive,
nativeBuildToolsVersion: javaDependencies!.nativeBuildTools!,
databaseTypeSql,
Expand Down
1 change: 1 addition & 0 deletions generators/java/generators/graalvm/internal/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const GRAALVM_REACHABILITY_METADATA = '0.3.14';
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
import type { MavenDefinition } from '../../../../maven/types.js';

export const mavenDefinition = ({
graalvmReachabilityMetadata,
reactive,
nativeBuildToolsVersion,
databaseTypeSql,
userLanguage,
languages,
}: {
graalvmReachabilityMetadata: string;
reactive?: boolean;
nativeBuildToolsVersion?: string;
databaseTypeSql?: boolean;
Expand All @@ -30,6 +32,7 @@ export const mavenDefinition = ({
<classesDirectory>\${project.build.outputDirectory}</classesDirectory>
<metadataRepository>
<enabled>true</enabled>
<version>${graalvmReachabilityMetadata}</version>
</metadataRepository>
<imageName>\${native-image-name}</imageName>
<verbose>true</verbose>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ graalvmNative {
jvmArgs.add('-Xms4g')
jvmArgs.add('-Xmx10g')
}
metadataRepository {
enabled = true
version = '<%- graalvmReachabilityMetadata %>'
}
}
processTestAot {
Expand Down
1 change: 1 addition & 0 deletions generators/java/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export type JavaApplication = JavaBootstrapStorageProperties &

addOpenapiGeneratorPlugin: boolean;
useNpmWrapper: boolean;
graalvmReachabilityMetadata: string;
};

export type ConditionalJavaDefinition = JavaDefinition & { condition?: boolean };
Expand Down
Loading

0 comments on commit 790840a

Please sign in to comment.