1

Is it somehow possible to exclude test classes from java-to-ObjcC conversion with j2objc-gradle plugin?

brunobowden
  • 1,492
  • 19
  • 37
nKognito
  • 6,297
  • 17
  • 77
  • 138

1 Answers1

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