User avatar
pathetic piss kitten @kitten@elizabeth.cat
5mo
I'll never be able to fully grasp Gradle
2
0
2
0
User avatar
pathetic piss kitten @kitten@elizabeth.cat
5mo
not sure if any of my followers knows about Android or Gradle, but I want to use the output of one task as an android sourceSet. right now I have the following in my build.gradle, because I know those are the sourceSets I have and that that's the directory where the files are generated:
android {
	sourceSets {
		getByName("debug").kotlin.directories.add("build/generated/sqldelight/code/AppDatabase/debug")
		getByName("release").kotlin.directories.add("build/generated/sqldelight/code/AppDatabase/release")
	}
}


but if I try to make it programatic:
androidComponents {
	onVariants { variant ->
		afterEvaluate {
			val capName = variant.name.replaceFirstChar { it.uppercase() }
			val task = tasks.getByName<SqlDelightTask>("generate${capName}AppDatabaseInterface")

			android.sourceSets.getByName<AndroidSourceSet>(variant.name).kotlin.directories.add(task.outputs.toString())
		}
	}
}


it fails, saying it doesn't find the generated classes
1
0
0
0

User avatar
Klaus Frank @agowa338@chaos.social
5mo
@kitten Gradle the first build system I got exposed to and I still hate it. Admittedly that's most likely because I never got a good explanation for how it worked or what it did. Oh and also back then it was incredibly hard to find documentation about it too. And as I was quite nooby in programming in general that also kinda didn't help.

0/10 would not recommend (for beginners)
1
0
0
0
User avatar
pathetic piss kitten @kitten@elizabeth.cat
5mo
@agowa338 at least from my perception it doesn't seem like that last thing has changed much...
1
0
0
0
User avatar
Klaus Frank @agowa338@chaos.social
5mo
@kitten Nah, I was just forced to interact with it without any explanation what so ever at a time when most I did (outside of very small single file programs following textbooks) was doing minor modifications like changing some values or adding some debug output somewhere...
0
0
1
0