Closed Link184 closed 1 week ago
@fmck3516 now we have the right source sets but the plugin is still not working. Maybe we also need to provide the exact path to the compiled class files? Right now we provide the path to /build
dir only, in android class files are located not in build/classes/java
@fmck3516 now we have the right source sets but the plugin is still not working. Maybe we also need to provide the exact path to the compiled class files? Right now we provide the path to
/build
dir only, in android class files are located not inbuild/classes/java
classesDirs
needs to point to the output folders (not the source files):
build/intermediates/javac/debug/classes
build/intermediates/javac/debugUnitTest/classes
...
build/tmp/kotlin-classes/debug
build/tmp/kotlin-classes/debugUnitTest
....
buildDir
pointing to build
is okay (it's only used for https://www.skippy.io/docs/#coverage-for-skipped-tests).
I also took a stab: https://github.com/skippy-io/skippy/pull/183/files
I have to read up more on the variants stuff (debug vs. release) - I just hard-coded the plugin to consider the debug variant.
Love the PR 👍
I assume that there is more work required (see below), but I'm tempted to merge it since it's a great first step towards Android support.
One thing that might cause issues is the fact that outputs for the release
and debug
build types are now cobbled together in test-impact-analysis.json
:
{
...
"classes": {
...
"16": {
"name": "com.example.testskippy.JavaSkippy",
"path": "com/example/testskippy/JavaSkippy.class",
"outputFolder": "build/intermediates/javac/debug/compileDebugJavaWithJavac/classes",
"hash": "CFA4BEFE"
},
"17": {
"name": "com.example.testskippy.JavaSkippy",
"path": "com/example/testskippy/JavaSkippy.class",
"outputFolder": "build/intermediates/javac/release/compileReleaseJavaWithJavac/classes",
"hash": "CFA4BEFE"
},
...
"22": {
"name": "com.example.testskippy.MyJavaSkippyTest",
"path": "com/example/testskippy/MyJavaSkippyTest.class",
"outputFolder": "build/intermediates/javac/debugUnitTest/compileDebugUnitTestJavaWithJavac/classes",
"hash": "2E272DFA"
},
"23": {
"name": "com.example.testskippy.MyJavaSkippyTest",
"path": "com/example/testskippy/MyJavaSkippyTest.class",
"outputFolder": "build/intermediates/javac/releaseUnitTest/compileReleaseUnitTestJavaWithJavac/classes",
"hash": "2E272DFA"
},
...
},
"tests": [
{
"class": 22,
"tags": ["PASSED"],
"coveredClasses": [16,17,22,23]
},
...
]
}
At runtime, Skippy
picks the first entry that matches a given class name:
Have to think about how to properly separate the data for the release and debug build types.
BTW: That's not directly related to Android-based builds. I already had that on my radar: https://github.com/skippy-io/skippy/issues/133
Extract all the android source sets using kotlin gradle plugin and JavaCompile task
Issue: https://github.com/skippy-io/skippy/issues/162