android-analyzer icon indicating copy to clipboard operation
android-analyzer copied to clipboard

inclusion/exclusion patterns

Open dinhthaidaica opened this issue 5 years ago • 5 comments

I'm trying to integrate this plug in to my existing project but seems I still miss some things.

I got this message when execute Gradle command :

File tests/instrumentationTest/assets/scenarios/longclickshift.feature can't be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files

I even tried with customExclusions but seems doesn't help. Still get the same message. Here is my setup:

customExclusions = ['tests/instrumentationTest/**', 'tests/unitTest/**','libs/**', '*.feature', "tests/instrumentationTest/assets/scenarios/longclickshift.feature"]

Did I do something wrong or miss somethings else?

dinhthaidaica avatar Dec 12 '19 14:12 dinhthaidaica

Could you please show your androidAnalyzer { .. } block? Didn't see this happen before. Perhaps you are importing Jacoco yourself, that's causing double indexing?

AndroideRob-zz avatar Dec 18 '19 11:12 AndroideRob-zz

you can see it by the image below

Screen Shot 2019-12-18 at 12 55 25

And please be notice that longclickshift.feature is my cucumber file.

dinhthaidaica avatar Dec 18 '19 11:12 dinhthaidaica

I have a feeling you are trying to execute androidAnalyzer on a test config.

Could you try running the following command: ./gradlew {module}:androidAnalyzer, where {module} = your target module name (probably app)?

If that doesn't work, could you still share how you invoke the task? I'm looking into Cucumber atm.

AndroideRob-zz avatar Dec 20 '19 11:12 AndroideRob-zz

@AndroideRob a have a similar problem:

Execution failed for task ':app:sonarqube'.
> File src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker can't be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files

adding customExclusions = ['src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker'] was solved, but I didn't understand why it was necessary

josinaldobarbosa avatar Jan 04 '20 03:01 josinaldobarbosa

@AndroideRob I tried with both solutions(adding customExclusions = ['src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker'] or run ./gradlew {module}:androidAnalyzer ) but got no luck.

Even though, when I added a list of json files for mocking data in testing then got an other same error:

tests/unitTest/resources/punchclockapproval/punchClockApprovalNonDefaultShiftType.json can't be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files

My updated config: customExclusions = ['tests/instrumentationTest/**', 'tests/unitTest/**', 'tests/unitTest/resources/**', 'src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker', 'libs/**', '*.feature', '*.json', "tests/instrumentationTest/assets/scenarios/longclickshift.feature"]

dinhthaidaica avatar Jan 16 '20 14:01 dinhthaidaica