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 sources are recognized as iOS source in Multiplatform Project #1260

Closed
yshrsmz opened this issue Mar 5, 2019 · 5 comments · Fixed by #1295
Closed

generated sources are recognized as iOS source in Multiplatform Project #1260

yshrsmz opened this issue Mar 5, 2019 · 5 comments · Fixed by #1295

Comments

@yshrsmz
Copy link
Contributor

yshrsmz commented Mar 5, 2019

when I build the project, SQLDelight sources are generated but recognized as iOS source set, thus can not be referenced from common source set.

below is the excerpt of my configuration.

Android Studio: 3.4-beta05
Kotlin: 1.3.21
SQLDelight: 1.1.1
Gradle: 5.1.1

sqldelight {
    Database {
        packageName = 'com.codingfeline.github.data.local'
    }
}

kotlin {
	android()
	targetFromPreset(presets.getByName("iosX64"), "ios") {
		binaries {
			framework()
		}
	}
}

.sq files are placed at src/commonMain/sqldelight/

and here's the complete project: https://github.com/yshrsmz/GitHubKotlinMPPSample/tree/sqldelight1.1.1

@yshrsmz
Copy link
Contributor Author

yshrsmz commented Mar 5, 2019

Update: IDE is confused, but it does compile.

I suspect this line is the cause, as it adds same directory to every target source sets

@AlecKazakova
Copy link
Collaborator

hmmm yea I need to think on this a little. Quick fix is to just only add the generated dir as a source root for common. Will remedy most of the IDE issues but I'd love to have a good solution here where being in the src/iosMain/kotlin folder can reference code generated for src/iosMain/sqldelight & src/commonMain/sqldelight

@designatednerd
Copy link

Quick fix is to just only add the generated dir as a source root for common. Could you elaborate on how you'd accomplish this? I'm at a point where I can't get anything to even import in my common code, even though I see the generated classes with an [iosMain] tag next to them.

@AlexisQapa
Copy link

Same issue here

@manu0396
Copy link

manu0396 commented Feb 20, 2022

Could you get you some solution to this? Same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants