I am using the following gradle/groovy to execute a task, generate sources, and add them to my AS model. I copied this from gradle-samples-0.13. This works from CLI and AS builds, but often AS has error markers in code using the generated artifacts (warning below):
android.libraryVariants.all { variant -> File variantDir = file("${buildDir}/generated-ragel/${variant.dirName}") def ragelTask = tasks.create(name: "compile${variant.name.capitalize()}Ragel", type:RagelTask) { outputFile = new File(variantDir, 'com/me/Parser.java') } variant.registerJavaGeneratingTask(ragelTask, variantDir) } AS is saying Source folders generated at incorrect location Warning:Folder /Users/me/Projects/myproject/build/generated-ragel/debug Information:3rd-party Gradle plug-ins may be the cause (1) Where should we then ideally generate the sources, and what variables like ${buildDir} should I use to avoid hardcoding the path? right now the output looks like build/ generated/ source/ generated-ragel/ debug/com/me/... release/com/me/... Should I just put everything into build/generated like: build/ generated/ source/ ragel/ debug/ release/ (2) Do I also need to use variant.addJavaSourceFoldersToModel(outputDir)? Thanks -- You received this message because you are subscribed to the Google Groups "adt-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to adt-dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.