Exclude specific file in Gradle protobuf plugin
Asked Answered
A

0

8

I am using Gradle to build my project and compile some protocol buffers using the Gradle Protobuf Plugin. I'd like to build the protos in several directories and exclude a single file.

sourceSets {
    main {
        java {
            srcDirs = [
                    'src/main/java',
                    'generated/main/java'
            ]
        }
        proto {
            srcDirs = [
              'foo/proto',
              '../bar/proto'
            ]
            exclude '../bar/proto/names.proto'
        }
    } }

However the exclude statement does not work and names.proto is still included in the protoc invocation, any ideas?

Aboard answered 5/2, 2019 at 22:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.