Is it somehow possible to exclude test classes from java-to-ObjcC conversion with j2objc-gradle
plugin?
Asked
Active
Viewed 179 times
1

brunobowden
- 1,492
- 19
- 37

nKognito
- 6,297
- 17
- 77
- 138
1 Answers
3
The J2ObjC Gradle Plugin can exclude files from both translation and tests. It uses Ant style exclude / include pattern matching on filenames. This is is described in the Gradle documentation with examples and the PatternFilterable class.
As a simple example:
j2objcConfig {
...
testPattern {
// Only run Java unit tests that end with "Test.java"
include '**/*Test.java'
// Exclude a single test without needing to specify the full path
exclude '**/LogTest.java'
// Exclude all tests within "ignoreDirectory"
exclude 'ignoreDirectory/**'
}
...
}

brunobowden
- 1,492
- 19
- 37
-
include '**/*Test.java' does not work in my case, it does not run tests that end with 'Test' – Taras Leskiv Jun 03 '16 at 08:54