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

Generated source should always be placed inside folder structure by build variant name (Android) #4267

Closed
joshfriend opened this issue Jun 12, 2023 · 0 comments · Fixed by #4269
Labels

Comments

@joshfriend
Copy link
Contributor

joshfriend commented Jun 12, 2023

SQLDelight Version

1.5.5

Operating System

macOS

Gradle Version

7.5

Kotlin Version

1.8.10

Dialect

Sqlite

AGP Version

7.3.1

Describe the Bug

SqlDelight does not place generated source in a folder named after the variant if there is only one variant enabled. This causes the output location to be unstable and can result in writing the database class multiple times, which then conflict with eachother.

sqldelightbug.zip

In the attached reproducer project, run the following:

./gradlew assembleDebug -PdebugOnly=true && ./gradlew assembleRelease -PdebugOnly=false && ./gradlew assembleDebug -PdebugOnly=true

The first two assemble tasks will succeed, but the third will fail with an error:

e: file:///Users/jfriend/Development/sqldelightbug/app/build/generated/sqldelight/code/Database/com/example/sqldelightbug/Database.kt:8:18 Redeclaration: Database

image

Reproducible in Gradle 8.1.1 and AGP 8.0 as well, I just put down the versions we are currently using in the project which exhibits this behavior regularly.

Stacktrace

No response

Gradle Build Script

No response

@joshfriend joshfriend added the bug label Jun 12, 2023
joshfriend added a commit to joshfriend/sqldelight that referenced this issue Jun 12, 2023
Always include the variant name as part of output path

Closes sqldelight#4267
joshfriend added a commit to joshfriend/sqldelight that referenced this issue Jun 12, 2023
Always include the variant name as part of output path

Closes sqldelight#4267
joshfriend added a commit to joshfriend/sqldelight that referenced this issue Jun 12, 2023
Always include the variant name as part of output path

Closes sqldelight#4267
hfhbd pushed a commit that referenced this issue Jun 13, 2023
Always include the variant name as part of output path

Closes #4267
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant