Skip to content

0.4.0 has been released

Compare
Choose a tag to compare
@zhangkun83 zhangkun83 released this 07 May 23:21
· 382 commits to master since this release

Changes:

  • Options are per-sourceSet, so you can configure a sourceSet to
    generate normal Java, and another sourceSet to generate nano.
  • protobufCodeGenPlugins and protobufNativeCodeGenPluginDeps
    will no longer apply all plugins automatically. Plugins need to be
    configured in the sourceSets explicitly.

Example:

sourceSets {
  main {
    proto {
      // Configure built-in outputs.
      builtins {
        // 'java' is added by default. If you don't want additional
        // options,
        // you don't need to write this block.
        java {
          // Options added to --java_out
          option 'option1=true'
        }
      }
    }
  }
  nano {
    proto {
      // Configure built-in outputs. Default is 'java'. Here we only
      // build javanano.
      builtins {
        remove java
        javanano {
          // Options added to --javanano_out
          option 'java_multiple_files=true'
          option 'option2=false'
        }
      }
      // Apply the 'grpc' plugin
      plugins {
        grpc {
          // Options added to --grpc_out
          option 'nano=true'
          option 'option2=false'
        }
        // Apply the 'xrpc' plugin without options
        xrpc { }
      }
    }
  }
}