使用 J2ObjC Gradle 插件排除测试

Exclude tests using J2ObjC Gradle Plugin

是否可以通过 j2objc-gradle 插件从 java 到 ObjcC 的转换中排除测试 类?

J2ObjC Gradle 插件可以从翻译和测试中排除文件。它在文件名上使用 Ant 样式排除/包含模式匹配。 Gradle 文档中描述了 examples and the PatternFilterable class

举个简单的例子:

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/**'
    }
    ...
}