Skip to content

Commit

Permalink
Add android generate proto tasks filters to java project test
Browse files Browse the repository at this point in the history
  • Loading branch information
rougsig committed Jul 10, 2022
1 parent 58e505f commit fe768bf
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions testProjectBase/build_base.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,18 @@ def assertFileExists(boolean exists, String path) {
}

test.doLast {
assert ['generateProto', 'generateGrpcProto', 'generateTestProto'] as Set ==
protobuf.generateProtoTasks.all().collect({ it.name }) as Set
assert [
'generateProto',
'generateGrpcProto',
'generateTestProto'
] as Set == protobuf.generateProtoTasks.all().collect({ it.name }) as Set

assert ['generateProto'] as Set == protobuf.generateProtoTasks.ofSourceSet('main').collect({ it.name }) as Set
assert [] as Set == protobuf.generateProtoTasks.ofTest().collect({ it.name }) as Set
assert [] as Set == protobuf.generateProtoTasks.ofNonTest().collect({ it.name }) as Set
assert [] as Set == protobuf.generateProtoTasks.ofFlavor('flavor-name').collect({ it.name }) as Set
assert [] as Set == protobuf.generateProtoTasks.ofBuildType('buildType-name').collect({ it.name }) as Set
assert [] as Set == protobuf.generateProtoTasks.ofVariant('variant-name').collect({ it.name }) as Set

assertJavaCompileHasProtoGeneratedDir('main', ['java'])
assertJavaCompileHasProtoGeneratedDir('test', ['java'])
Expand Down

0 comments on commit fe768bf

Please sign in to comment.