Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from Groovy to Kotlin Gradle build scripts #460

Closed
josdem opened this issue Jan 17, 2025 · 7 comments
Closed

Migrate from Groovy to Kotlin Gradle build scripts #460

josdem opened this issue Jan 17, 2025 · 7 comments

Comments

@josdem
Copy link
Owner

josdem commented Jan 17, 2025

Background
Since April 2023, Kotlin DSL is the default for new Gradle builds; therefore, we want to migrate our build scripts from Groovy to Gradle.

Reference

Acceptance Criteria

  • Kotlin DSL is the build.gradle language
  • Able to run the application
  • Able to build the project
  • Able to execute JacocoReports
@kaminuma
Copy link
Collaborator

Hi @josdem
might need some extra time as I'm a bit busy, but I’d like to gain experience, so may I ask to be assigned to this?"

@josdem
Copy link
Owner Author

josdem commented Jan 27, 2025

Hi @josdem might need some extra time as I'm a bit busy, but I’d like to gain experience, so may I ask to be assigned to this?"

Hi @kaminuma , your collaboration is appreciated! do not worry if you need help just let me know

@kaminuma
Copy link
Collaborator

Hi @josdem

I'm in the process of migrating build.gradle to kotlin, but I'm stuck.
Currently,

tasks.named<JavaExec>("bootRun") {
 
systemProperties.putAll(System.getProperties().map { it.key.toString() to it.value.toString() })
  dependsOn("flywayMigrate")
}

I have confirmed that it can be executed except for flywayMigrate, but when executing flywayMigrate,


 Task :flywayMigrate FAILED

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':flywayMigrate'.
Error occurred while executing flywayMigrate
No database found to handle jdbc:mysql://localhost:3306/vetlog

It becomes. Let me share it once. I'm looking for any ideas or help.
Pushing the intermediate state to feature/460

@josdem
Copy link
Owner Author

josdem commented Jan 31, 2025

Hi @josdem

I'm in the process of migrating build.gradle to kotlin, but I'm stuck. Currently,

tasks.named<JavaExec>("bootRun") {
 
systemProperties.putAll(System.getProperties().map { it.key.toString() to it.value.toString() })
  dependsOn("flywayMigrate")
}

I have confirmed that it can be executed except for flywayMigrate, but when executing flywayMigrate,

 Task :flywayMigrate FAILED

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':flywayMigrate'.
Error occurred while executing flywayMigrate
No database found to handle jdbc:mysql://localhost:3306/vetlog

It becomes. Let me share it once. I'm looking for any ideas or help. Pushing the intermediate state to feature/460

Hi @kaminuma , let me take a look and I will get back to you.

josdem added a commit that referenced this issue Jan 31, 2025
@josdem
Copy link
Owner Author

josdem commented Jan 31, 2025

Hi @kaminuma I was able to solve the issue, please take a look at the commit I did, let me know if is not working as expected. I found the missing structure named buildscript in this technical post: https://docs.gradle.org/current/userguide/migrating_from_groovy_to_kotlin_dsl.html#applying_plugins

@kaminuma
Copy link
Collaborator

Hi @josdem

Thank you for your investigation.
I'm sorry. I didn't understand that I needed to specify flyway in the buildscript classpath.
I checked that the application works by pulling and bootRun, and flayway works.

Continue testing, building, and adding build.gradle.

@josdem
Copy link
Owner Author

josdem commented Feb 1, 2025

PR merged: #474

@josdem josdem closed this as completed Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants