Is there any way to run KSP before the `processMan...
# ksp
l
Is there any way to run KSP before the
processManifest
task? KSP adds a dependency on the
processResources
task (which also depends on
processManifest
). I've tried to remove it from
dependsOn
but somehow it's never removed and I end up with cyclic dependencies. I want to generate a class with KSP and add a reference to it in
AndroidManifest.xml
for dynamic loading
👀 1
t
I may misunderstand your question, but IIUC processResources depends on KSP's task rather than the other way around? So that processor generated resources can be included in the artifacts.
l
I actually set a breakpoint on that line the other day, and that line never gets executed on Android, probably because
ProcessAndroidResources
doesn't inherit from
ProcessResources
. You can see here the current dependency resolution (
En
is a product flavor):
Copy code
❯ ./gradlew :sample-single:assembleDebug --dry-run | grep sample-single
:sample-single:preBuild SKIPPED
:sample-single:preEnDebugBuild SKIPPED
:sample-single:checkEnDebugAarMetadata SKIPPED
:sample-single:generateEnDebugResources SKIPPED
:sample-single:mergeEnDebugResources SKIPPED
:sample-single:createEnDebugCompatibleScreenManifests SKIPPED
:sample-single:extractDeepLinksEnDebug SKIPPED
:sample-single:processEnDebugMainManifest SKIPPED
:sample-single:processEnDebugManifest SKIPPED
:sample-single:processEnDebugManifestForPackage SKIPPED
:sample-single:processEnDebugResources SKIPPED
:sample-single:kspEnDebugKotlin SKIPPED
:sample-single:compileEnDebugKotlin SKIPPED
:sample-single:javaPreCompileEnDebug SKIPPED
:sample-single:compileEnDebugJavaWithJavac SKIPPED
:sample-single:compileEnDebugSources SKIPPED
:sample-single:mergeEnDebugNativeDebugMetadata SKIPPED
:sample-single:generateEnDebugAssets SKIPPED
:sample-single:mergeEnDebugAssets SKIPPED
:sample-single:compressEnDebugAssets SKIPPED
:sample-single:checkEnDebugDuplicateClasses SKIPPED
:sample-single:dexBuilderEnDebug SKIPPED
:sample-single:desugarEnDebugFileDependencies SKIPPED
:sample-single:mergeExtDexEnDebug SKIPPED
:sample-single:mergeDexEnDebug SKIPPED
:sample-single:processEnDebugJavaRes SKIPPED
:sample-single:mergeEnDebugJavaResource SKIPPED
:sample-single:mergeEnDebugJniLibFolders SKIPPED
:sample-single:mergeEnDebugNativeLibs SKIPPED
:sample-single:stripEnDebugDebugSymbols SKIPPED
:sample-single:validateSigningEnDebug SKIPPED
:sample-single:writeEnDebugAppMetadata SKIPPED
:sample-single:writeEnDebugSigningConfigVersions SKIPPED
:sample-single:packageEnDebug SKIPPED
:sample-single:assembleEnDebug SKIPPED
:sample-single:assembleDebug SKIPPED
I wasn't able to find who is adding that dependency on
processResources
, I tried to debug it but I'm not very familiar with gradle. I think it's the Android Gradle Plugin who is adding it, but I can't find any "ksp" instance on the plugin so it's not easy to find. FWIW the same thing happens with KAPT, it adds a dependency on processResources somewhere