Skip to content

Commit

Permalink
Merge main into feature/q-mega
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-toolkit-automation authored Nov 15, 2024
2 parents d546373 + e225cdc commit 495c753
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type" : "feature",
"description" : "Code Transform: Enable support for Java 17 projects."
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ class CodeModernizerManager(private val project: Project) : PersistentStateCompo
private val supportedJavaMappings = mapOf(
JavaSdkVersion.JDK_1_8 to setOf(JavaSdkVersion.JDK_17),
JavaSdkVersion.JDK_11 to setOf(JavaSdkVersion.JDK_17),
JavaSdkVersion.JDK_17 to setOf(JavaSdkVersion.JDK_17),
)
init {
CodeModernizerSessionState.getInstance(project).setDefaults()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ fun buildProjectValidChatContent() = CodeTransformChatMessageContent(
)
fun buildProjectInvalidChatContent(validationResult: ValidationResult): CodeTransformChatMessageContent {
val errorMessage = when (validationResult.invalidTelemetryReason.category) {
CodeTransformPreValidationError.NoPom -> message("codemodernizer.chat.message.validation.error.no_pom")
CodeTransformPreValidationError.NoPom -> message("codemodernizer.chat.message.validation.error.no_pom", CODE_TRANSFORM_PREREQUISITES)
CodeTransformPreValidationError.UnsupportedJavaVersion -> message("codemodernizer.chat.message.validation.error.unsupported_java_version")

Check warning on line 193 in plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/constants/CodeTransformChatItems.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Usage of redundant or deprecated syntax or deprecated symbols

'message(String, vararg Any): String' is deprecated. Use extension-specific localization bundle instead
else -> message("codemodernizer.chat.message.validation.error.other")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class QuickActionGenerator {
? [
{
command: '/transform',
description: 'Transform your Java 8 or 11 Maven project to Java 17',
description: 'Transform your Java project',
},
]
: []),
Expand Down
5 changes: 1 addition & 4 deletions plugins/amazonq/mynah-ui/src/mynah-ui/ui/tabs/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ What would you like to work on?`,
],
[
'codetransform',
`Welcome to Code Transformation!
I can help you upgrade your Java 8 and 11 codebases to Java 17.
`,
`Welcome to Code Transformation!`,
],
])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,9 +632,9 @@ codemodernizer.chat.message.upload_failed_url_expired=Sorry, I couldn't upload y
codemodernizer.chat.message.validation.check_eligible_projects=I'm checking for open projects that are eligible for Code Transformation.
codemodernizer.chat.message.validation.check_passed=I can upgrade your Java module. To start the transformation, I need some information from you. Choose the module you want to upgrade and the target code version to upgrade to. Then, choose **Confirm**.\n\nIf you do not see the module you want to transform, you might need to configure your project so that I can find it. Go to File and choose Project Structure. In the Projects tab, set the correct project JDK and language level. In the Modules tab, set the correct module JDK and language level.
codemodernizer.chat.message.validation.error.more_info=For more information, see the [Amazon Q documentation]({0}).
codemodernizer.chat.message.validation.error.no_pom=Sorry, I couldn't find a module that I can upgrade. I couldn't find a pom.xml file in any of your open projects. Currently, I can only upgrade Java 8 or Java 11 projects built on Maven.
codemodernizer.chat.message.validation.error.other=Sorry, I couldn't find a module that I can upgrade. Currently, I can only upgrade Java 8 or Java 11 projects built on Maven. If you have a Java 8 or Java 11 module in your workspace, you might need to configure your project so that I can find it. Go to File and choose Project Structure. In the Projects tab, set the correct project JDK and the correct language level. In the Modules tab, set the correct module JDK and language level.
codemodernizer.chat.message.validation.error.unsupported_java_version=Sorry, I couldn't find a module that I can upgrade. Currently, I can only upgrade Java 8 or Java 11 modules built on Maven. If you have a Java 8 or Java 11 module in your workspace, you might need to configure your project so that I can find it. Go to File and choose Project Structure. In the Projects tab, set the correct project JDK and the correct language level. In the Modules tab, set the correct module JDK and language level.
codemodernizer.chat.message.validation.error.no_pom=I couldn't find a module that I can upgrade. Your Java project must be built on Maven and contain a pom.xml file. For more information, see the [Amazon Q documentation]({0}).
codemodernizer.chat.message.validation.error.other=I couldn't find a module that I can upgrade. Currently, I support Java 8, Java 11, and Java 17 projects built on Maven. Make sure your project is open in the IDE. If you have a Java 8, Java 11, or Java 17 module in your workspace, you might need to configure your project so that I can find it. Go to File and choose Project Structure. In the Projects tab, set the correct project JDK and the correct language level. In the Modules tab, set the correct module JDK and language level.
codemodernizer.chat.message.validation.error.unsupported_java_version=I couldn't find a module that I can upgrade. Currently, I support Java 8, Java 11, and Java 17 projects built on Maven. Make sure your project is open in the IDE. If you have a Java 8, Java 11, or Java 17 in your workspace, you might need to configure your project so that I can find it. Go to File and choose Project Structure. In the Projects tab, set the correct project JDK and the correct language level. In the Modules tab, set the correct module JDK and language level.
codemodernizer.chat.message.validation.no_jdk=I couldn't build your project with your current JDK configuration. To update your JDK, go to File and choose Project Structure. In the Projects tab, set the correct project JDK in the SDK field. In the Modules tab, set the correct module JDK in the SDK field. In Maven Runner settings, set the correct JDK in the JRE field.
codemodernizer.chat.prompt.label.dependency_current_version=Current version
codemodernizer.chat.prompt.label.dependency_name=Dependency name
Expand Down Expand Up @@ -709,11 +709,11 @@ codemodernizer.notification.warn.download_failed_other.content=Amazon Q ran into
codemodernizer.notification.warn.download_failed_ssl.content=Please make sure all your certificates for your proxy client have been set up correctly for your IDE.
codemodernizer.notification.warn.download_failed_wildcard.content=Check your IDE proxy settings and remove any wildcard (*) references, and then try viewing the diff again.
codemodernizer.notification.warn.expired_credentials.title=Your connection to Q has expired
codemodernizer.notification.warn.invalid_project.description.reason.invalid_jdk_versions=None of your open modules are supported by Amazon Q Code Transformation. Currently, Amazon Q can only upgrade Java 8 or Java 11 projects built on Maven.
codemodernizer.notification.warn.invalid_project.description.reason.missing_content_roots=None of your open modules are supported by Amazon Q Code Transformation. Currently, Amazon Q can only upgrade Java 8 or Java 11 projects built on Maven.
codemodernizer.notification.warn.invalid_project.description.reason.no_valid_files=None of your open modules are supported by Amazon Q Code Transformation. Amazon Q could not find a pom.xml file in any of your open modules. Currently, Amazon Q can only upgrade Java 8 or Java 11 projects built on Maven.
codemodernizer.notification.warn.invalid_project.description.reason.invalid_jdk_versions=None of your open modules are supported for code transformation with Amazon Q. Amazon Q can upgrade Java 8, Java 11, and Java 17 projects built on Maven.
codemodernizer.notification.warn.invalid_project.description.reason.missing_content_roots=None of your open modules are supported for code transformation with Amazon Q. Amazon Q can upgrade Java 8, Java 11, and Java 17 projects built on Maven.
codemodernizer.notification.warn.invalid_project.description.reason.no_valid_files=None of your open modules are supported for code transformation with Amazon Q. A pom.xml is required for transformation. Amazon Q can upgrade Java 8, Java 11, and Java 17 projects built on Maven.
codemodernizer.notification.warn.invalid_project.description.reason.not_logged_in=Amazon Q cannot start the transformation as you are not logged in with Identity Center or Builder ID. Also ensure that you are not using IntelliJ version 232.8660.185 and that you are not developing on a remote host (uncommon).
codemodernizer.notification.warn.invalid_project.description.reason.remote_backend=None of your open modules are supported by Amazon Q Code Transformation. Currently, Amazon Q can only upgrade Java 8 or Java 11 projects built on Maven, and cannot upgrade projects running on a remote host.
codemodernizer.notification.warn.invalid_project.description.reason.remote_backend=None of your open modules are supported for code transformation with Amazon Q. Amazon Q cannot transform projects running on a remote host.
codemodernizer.notification.warn.maven_failed.content=Amazon Q could not run the Maven clean install command to build your module.
codemodernizer.notification.warn.maven_failed.title=Amazon Q Code Transform unable to zip dependencies
codemodernizer.notification.warn.on_resume.unknown_status_response.content=We received data from Amazon Q in a format that the plugin cannot handle. You may need to update the plugin and then try again.
Expand Down

0 comments on commit 495c753

Please sign in to comment.