Hi, I hope this is the right channel (it is very m...
# getting-started
m
Hi, I hope this is the right channel (it is very much a beginner question, though it does relate to servers). I want to simulate a database on a server on my pc, to develop an Android app I'm working on. I'm going through the Ktor tutorials using IntelliJ Idea, but the tutorials are written for a previous version of Idea. Most of the changes, relating to a simplification of the file structure in the current version, are easy to translate, but one has me stumped: The tutorial says to edit the gradle/libs.versions.toml file in several places (most critically for creating the DAO in the 'Integrate a database' tutorial). This file doesn't seem to exist in the current version of Idea - the only directory under gradle in the Project pane is gradle/wrapper Can anyone either direct me to this file in the current version or suggest a workaround to get me through the tutorials? Thanks, Martin
c
Hey, how did you create your project?
gradle/libs.versions.toml
is typically where we store version numbers recently, but previously they were stored in
build.gradle.kts
files
m
Hi, sorry you replied quicker than I expected!
I created the project via File -> New Project in Idea, then selecting Ktor from the list of generators and adding the plugins stated in Integrate a database with Kotlin, Ktor, and Exposed | Ktor Documentation
This is my Project Pane in Idea, with the Gradle folder expanded
The tutorial says to add 'exposed-dao = { module = "org.jetbrains.exposed:exposed-dao", version.ref = "exposed-version" }' to *gradle/libs.versions.toml then add '*implementation(libs.exposed.dao)' to build.gradle.kts, but I can't find the libs file/folder!
c
Can you show me the contents of
build.gradle.kts
?
k
I think the problem is that you used the "New Ktor project" menu option in IntelliJ, which doesn't create a version catalog (i.e. the libs.versions.toml file) but instead uses the older style of putting version numbers in the build.gradle.kts file. The tutorial suggests navigating to the Ktor Project Generator web page which creates and downloads a project that includes the version catalog.
m
I've put the Dependencies in ( the whole file doesn't fit on screen). Klitos, what you're saying sounds promising so I'll try using the Project Generator and hope that fixes it. Thanks both