Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: google/protobuf-gradle-plugin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.9.1
Choose a base ref
...
head repository: google/protobuf-gradle-plugin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Oct 8, 2022

  1. Copy the full SHA
    d6f7cff View commit details

Commits on Oct 21, 2022

  1. Change PluginClasspath for tests to binary plugin from maven local (#613

    )
    
    * Change PluginClasspath for tests to binary plugin from maven local
    
    * Revert "Use withId() to wait for kotlin-android plugin"
    
    This reverts commit 1be9931.
    
    * Fix code review comments
    
    * Publish plugin for tests to build/testRepo folder
    
    * Fix magic groovy cast problem
    rougsig authored Oct 21, 2022
    Copy the full SHA
    f510de7 View commit details
  2. Copy the full SHA
    e20df5b View commit details

Commits on Nov 4, 2022

  1. Do not use compileClasspath as source of proto files (#631)

    * Do not use compileClasspath as source of proto files
    
    * Add failing test case for #624
    
    * Fix codenarc problems
    rougsig authored Nov 4, 2022
    Copy the full SHA
    0521fe7 View commit details

Commits on Nov 17, 2022

  1. Wire proto sources/outputs/etc through ProtoSourceSet (#637)

    * Wire proto sources/outputs/etc through ProtoSourceSet
    
    * Use ProtoSourceSet as input for kotlin compile task
    
    * Fix pr comments
    
    - Update copyright in DefaultProtoSourceSet
    - Do better isTest variant check
    
    * Don't use protoSourceSet.output as kotlin compile sources
    
    KotlinCompile configuration block can be executed before generateTask lazy configuration.
    Request generate task configuration.
    rougsig authored Nov 17, 2022
    Copy the full SHA
    7b37f79 View commit details

Commits on Nov 18, 2022

  1. Remove DefaultProtoSourceSet casting to ProtoSourceSet in domainObjec…

    …tContainer factory method (#640)
    rougsig authored Nov 18, 2022
    Copy the full SHA
    0ba3ce0 View commit details

Commits on Jan 4, 2023

  1. Fix typo in README

    fml2 authored and ejona86 committed Jan 4, 2023
    Copy the full SHA
    2fbe179 View commit details

Commits on Jan 5, 2023

  1. Emulate and deprecate generatedFilesBaseDir (#636)

    Fixes #33 for users not changing generatedFilesBaseDir. Stop documenting
    generatedFilesBaseDir since it produces poor results, but keep it
    functional with its existing Copy semantics. Fixes #332
    
    This deprecates the setter, but I don't know how to make this trigger a warning,
    for either Groovy and Kotlin. Both seem to ignore it.
    
    Turn off UnnecessaryObjectReferences because it isn't providing value.
    ejona86 authored Jan 5, 2023
    Copy the full SHA
    278f21b View commit details

Commits on Jan 8, 2023

  1. Set default command length limit to 64k (#653)

    Various operating systems impose command length limits that are far short of the current Integer.MAX_VALUE default. For example, on MacOS 12.6.2, getconf ARG_MAX returns 1048576.
    
    Hence set a reasonable default command line length limit of 64k.
    karthikrg authored Jan 8, 2023
    Copy the full SHA
    4052f42 View commit details

Commits on Jan 9, 2023

  1. 0.9.2 release

    ejona86 committed Jan 9, 2023
    Copy the full SHA
    7246cdb View commit details
  2. Copy the full SHA
    6f43013 View commit details

Commits on Jan 10, 2023

  1. Avoid OOM during tests by forking

    Generally on my laptop I cannot run many of the tests before they fail
    with out-of-memory. With this, I can run all the tests successfully.
    
    There does not seem to be a way to request forking directly. Instead,
    the docs warn about passing an environment because it will cause
    forking. In our case, that seems to be exactly what we want.
    
    I believe this is a workaround and only benefitting indirectly, but it
    works and is easy and I'll take what I can get.
    ejona86 committed Jan 10, 2023
    Copy the full SHA
    70578a6 View commit details
  2. Use KotlinCompile type directly (#657)

    * Use KotlinCompile type directly
    
    * Add Kotlin 1.7.20, Gradle 7.6 versions to tests
    
    * Fix codenarc issues
    
    * Do not run all gradleVersion * kotlinVersion combinations
    
    * Bump kotlin and agp versions
    rougsig authored Jan 10, 2023
    Copy the full SHA
    69c7a31 View commit details

Commits on Jan 19, 2023

  1. Copy the full SHA
    13cecec View commit details
  2. Copy the full SHA
    3f6e8a8 View commit details

Commits on Jan 20, 2023

  1. build.gradle: Remove old/unnecessary repositories

    kotlin.bintray.com is dead and has an invalid certificate.
    repo.gradle.org was for gradle-kotlin-dsl which we're getting through
    plugins.gradle.org.
    ejona86 committed Jan 20, 2023
    Copy the full SHA
    7f240e8 View commit details
  2. Copy the full SHA
    ccf96a9 View commit details
  3. Copy the full SHA
    781fad2 View commit details

Commits on Feb 9, 2023

  1. Delay buildDir evaluation until needed

    This causes the plugin to use the correct configuration when users
    use a non-default buildDir.
    
    Note that for IDEs we create directories in afterEvaluate{}. It is
    possible for the user's own afterEvaluate{} to change buildDir. In that
    case, the task will output to the 'correct' directory but the mkdirs for
    IDEs can be the 'old' buildDir. But users shouldn't be using
    afterEvaluate{}, so we don't care and there's no real fix anyway.
    
    Fixes #674
    ejona86 committed Feb 9, 2023
    Copy the full SHA
    7deeb2a View commit details

Commits on Feb 10, 2023

  1. Copy the full SHA
    a801fa3 View commit details

Commits on Apr 19, 2023

  1. GenerateProtoTask.getIsTest() is internal, not an input

    This fixes a configuration cache incompatibility seen on Gradle 8.1 and
    that seemed to requiring other configuration bits as well. I have not
    reproduced the original issue, but a user has confirmed this fix works
    and the original stack trace definitely pointed to the annotation:
    ```
    ...
    at com.google.protobuf.gradle.GenerateProtoTask.getIsTest(GenerateProtoTask.groovy:482)
    at com.google.protobuf.gradle.GenerateProtoTask_Decorated.getIsTest(Unknown Source)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.gradle.internal.reflect.annotations.impl.DefaultPropertyAnnotationMetadata.getPropertyValue(DefaultPropertyAnnotationMetadata.java:97)
    at org.gradle.internal.properties.annotations.DefaultTypeMetadataStore$DefaultPropertyMetadata.getPropertyValue(DefaultTypeMetadataStore.java:266)
    at org.gradle.internal.properties.bean.DefaultPropertyWalker$1.lambda$visitLeaf$0(DefaultPropertyWalker.java:88)
    at org.gradle.internal.deprecation.DeprecationLogger.whileDisabled(DeprecationLogger.java:258)
    at org.gradle.internal.properties.bean.DefaultPropertyWalker$CachedPropertyValue.lambda$new$0(DefaultPropertyWalker.java:105)
    at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:183)
    at org.gradle.internal.properties.bean.DefaultPropertyWalker$CachedPropertyValue.call(DefaultPropertyWalker.java:147)
    at org.gradle.util.internal.GUtil.uncheckedCall(GUtil.java:437)
    at org.gradle.util.internal.DeferredUtil.unpackNestableDeferred(DeferredUtil.java:83)
    at org.gradle.util.internal.DeferredUtil.unpack(DeferredUtil.java:57)
    at org.gradle.util.internal.DeferredUtil.unpackOrNull(DeferredUtil.java:49)
    at org.gradle.api.internal.tasks.properties.InputParameterUtils.prepareInputParameterValue(InputParameterUtils.java:38)
    at org.gradle.api.internal.tasks.properties.InputParameterUtils.prepareInputParameterValue(InputParameterUtils.java:30)
    ...
    ```
    
    Fixes #687
    ejona86 committed Apr 19, 2023
    Copy the full SHA
    a3f6072 View commit details

Commits on Apr 26, 2023

  1. Copy the full SHA
    d7c23d9 View commit details

Commits on May 9, 2023

  1. Copy the full SHA
    b94ffeb View commit details

Commits on May 10, 2023

  1. Copy the full SHA
    6434c1d View commit details
  2. Avoid duplicate GenerateProtoTask output dir (#703)

    Remove duplicate output source dir that breaks in android in source jar
    task.
    
    When using the insertion point, custom plugin needs to use the same
    output directory as the code gen output directory from java/javalite.
    This causes other tasks to fail if it depends on the output source and
    duplicationStrategy is set to `DuplicatesStrategy.FAIL`
    csv8674xn authored May 10, 2023
    Copy the full SHA
    96e23fa View commit details

Commits on May 15, 2023

  1. Copy the full SHA
    9d2a328 View commit details

Commits on Jun 28, 2023

  1. Avoid eagerly resolving input files in ProtobufExtract (#713)

    Rely on FileCollection.getElements() (available in Gradle 5.6+) to
    ensure no files are accessed eagerly during configuration. This also
    ensures configuration cache key does not depend on them.
    
    Fixes issue #711.
    
    Test: Added "testProjectDependent proto extraction with configuration cache" with Gradle 8.1
    gavra0 authored Jun 28, 2023
    Copy the full SHA
    6b74668 View commit details

Commits on Jul 7, 2023

  1. stop using configuration Configuration#fileCollection(Dependency...),…

    … soon to be deprecated (#716)
    
    The files(Dependency...) method filters the contents of the configuration to only include files from the provided dependencies and it's transitive dependencies. Since there is only one dependency in the configuration, using this method is unnecessary.
    YifeiZhuang authored Jul 7, 2023
    Copy the full SHA
    a80bf81 View commit details

Commits on Jul 10, 2023

  1. Fix plugin compatibility with Kotlin Gradle Plugin 1.9.0 release (#715)

    Kotlin Gradle Plugin 1.9.0 release has changed how kapt tasks are configured: https://youtrack.jetbrains.com/issue/KT-54468/KAPT-Gradle-plugin-causes-eager-task-creation. Because of this change, generated proto sources are not passed to kaptGenerateStubs task leading to compilation error even in default setup.
    
    If the Kotlin plugin version is 1.7.20 - protobuf plugin now, instead of directly configuring KotlinCompile task inputs, configures related KotlinSourceSet. This way additional sources are passed both for KotlinCompile and KaptGenerateStubs tasks.
    
    Fixes issue #714
    Tapchicoma authored Jul 10, 2023
    Copy the full SHA
    fe24ff4 View commit details

Commits on Jul 20, 2023

  1. Copy the full SHA
    ff4fe68 View commit details

Commits on Sep 5, 2023

  1. Clean output directory before extracting protos

    If the dependencies change, the old dependency's proto files can be left
    around. That is broken and causes confusion. This was noticed in #731
    when a `gradle clean` was needed.
    ejona86 committed Sep 5, 2023
    Copy the full SHA
    90c856f View commit details
  2. Start 0.9.5 development cycle

    We don't need a 0.10 at the moment.
    ejona86 committed Sep 5, 2023
    Copy the full SHA
    4ec03ff View commit details

Commits on Mar 11, 2024

  1. Copy the full SHA
    ee41e2f View commit details

Commits on Mar 14, 2024

  1. Configurable java executable (#750)

    The path of the java executable can now be configured in the ProtobufExtension and/or specific GenerateProtoTask instances.
    
    * GenerateProtoTask gains the javaExecutablePath Property,
    * ProtobufExtension gains the javaExecutablePath Property and the defaultJavaExecutablePath provider, which provides the default path using the same logic as previous versions
    * computeJavaExePath moved from GenerateProtoTask to ProtobufExtension since it is now only used in ProtobufExtension
    * isWindows moved from GenerateProtoTask to Util since it is now used in GenerateProtoTask and ProtobufExtension
    wfhartford authored Mar 14, 2024
    Copy the full SHA
    12ad318 View commit details

Commits on Nov 12, 2024

  1. Copy the full SHA
    ecc9b97 View commit details

Commits on Nov 13, 2024

  1. Align default output folder with Gradle best practices (#755)

    Use generated/sources/proto (plural) instead source.
    
    Fixes #754
    holgerstolzenberg authored Nov 13, 2024
    Copy the full SHA
    2810499 View commit details

Commits on Jan 22, 2025

  1. Fix functional tests on Windows

    Vampire authored and ejona86 committed Jan 22, 2025
    Copy the full SHA
    cbc8f03 View commit details
  2. Use sync instead of delete-then-copy

    Vampire authored and ejona86 committed Jan 22, 2025
    Copy the full SHA
    665de2f View commit details

Commits on Jan 28, 2025

  1. Copy the full SHA
    fb71f67 View commit details
Showing with 1,057 additions and 684 deletions.
  1. +2 −2 .github/workflows/gradle-wrapper-validation.yml
  2. +16 −16 .github/workflows/testing.yml
  3. +31 −85 README.md
  4. +80 −65 build.gradle
  5. +5 −0 config/codenarc/codenarc.xml
  6. +1 −1 examples/exampleKotlinDslProject/build.gradle.kts
  7. +1 −1 examples/exampleKotlinDslProject/gradle/wrapper/gradle-wrapper.properties
  8. +1 −1 examples/exampleProject/build.gradle
  9. +1 −1 examples/exampleProject/gradle/wrapper/gradle-wrapper.properties
  10. +36 −0 src/main/groovy/com/google/protobuf/gradle/CopyActionFacade.java
  11. +21 −23 src/main/groovy/com/google/protobuf/gradle/GenerateProtoTask.groovy
  12. +51 −8 src/main/groovy/com/google/protobuf/gradle/ProtobufExtension.groovy
  13. +49 −49 src/main/groovy/com/google/protobuf/gradle/ProtobufExtract.groovy
  14. +151 −155 src/main/groovy/com/google/protobuf/gradle/ProtobufPlugin.groovy
  15. +2 −3 src/main/groovy/com/google/protobuf/gradle/ToolsLocator.groovy
  16. +8 −0 src/main/groovy/com/google/protobuf/gradle/Utils.groovy
  17. +82 −0 src/main/groovy/com/google/protobuf/gradle/internal/DefaultProtoSourceSet.groovy
  18. +68 −0 src/main/groovy/com/google/protobuf/gradle/internal/ProjectExt.groovy
  19. +48 −0 src/main/groovy/com/google/protobuf/gradle/tasks/ProtoSourceSet.groovy
  20. +0 −1 src/main/resources/META-INF/gradle-plugins/com.google.protobuf.properties
  21. +5 −6 src/test/groovy/com/google/protobuf/gradle/AndroidProjectDetectionTest.groovy
  22. +14 −14 src/test/groovy/com/google/protobuf/gradle/IDESupportTest.groovy
  23. +5 −7 src/test/groovy/com/google/protobuf/gradle/ProtobufAndroidPluginKotlinTest.groovy
  24. +9 −12 src/test/groovy/com/google/protobuf/gradle/ProtobufAndroidPluginTest.groovy
  25. +267 −165 src/test/groovy/com/google/protobuf/gradle/ProtobufJavaPluginTest.groovy
  26. +7 −10 src/test/groovy/com/google/protobuf/gradle/ProtobufKotlinDslCopySpecTest.groovy
  27. +2 −4 src/test/groovy/com/google/protobuf/gradle/ProtobufKotlinDslPluginTest.groovy
  28. +44 −28 src/test/groovy/com/google/protobuf/gradle/ProtobufPluginTestHelper.groovy
  29. +0 −1 testProject/settings.gradle
  30. +0 −1 testProjectAndroid/settings.gradle
  31. +2 −2 testProjectAndroidKotlinDsl/build.gradle.kts
  32. +0 −2 testProjectAndroidKotlinDsl/settings.gradle.kts
  33. +0 −1 testProjectAndroidLibrary/settings.gradle
  34. +4 −4 testProjectBase/build_base.gradle
  35. +0 −1 testProjectBuildTimeProto/settings.gradle
  36. +25 −0 testProjectConfigureJavaExecutable/build.gradle
  37. +15 −0 testProjectConfigureJavaExecutable/src/main/proto/com/example/tutorial/sample.proto
  38. +0 −1 testProjectCustomProtoDir/settings.gradle
  39. +0 −1 testProjectDependent/settings.gradle
  40. +0 −1 testProjectDependentApp/settings.gradle
  41. +0 −1 testProjectJavaAndKotlin/settings.gradle
  42. +0 −1 testProjectJavaLibrary/settings.gradle
  43. +0 −1 testProjectKotlin/settings.gradle
  44. +4 −4 testProjectKotlinDslBase/build.gradle.kts
  45. +0 −3 testProjectKotlinDslBase/settings.gradle.kts
  46. +0 −1 testProjectKotlinDslCopySpec/settings.gradle.kts
  47. +0 −1 testProjectLite/settings.gradle
4 changes: 2 additions & 2 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
@@ -7,6 +7,6 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v3

32 changes: 16 additions & 16 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -14,15 +14,15 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- uses: gradle/gradle-build-action@v2
with:
arguments: clean assemble --stacktrace
- uses: gradle/actions/setup-gradle@v3
- name: Gradle Assemble
run: ./gradlew clean assemble --stacktrace

test:
needs: build
strategy:
@@ -32,28 +32,28 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- uses: gradle/gradle-build-action@v2
with:
arguments: test --tests ${{ matrix.tests }} --stacktrace
- uses: gradle/actions/setup-gradle@v3
- name: Gradle Test
run: ./gradlew test --tests ${{ matrix.tests }} --stacktrace

codenarc:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- uses: gradle/gradle-build-action@v2
with:
arguments: codenarcMain codenarcTest --continue
- uses: gradle/actions/setup-gradle@v3
- name: Gradle Codenarc
run: ./gradlew codenarcMain codenarcTest --continue
- name: echo codenarcMain reports
if: failure()
run: test -f build/reports/codenarc/main.txt && cat build/reports/codenarc/main.txt
116 changes: 31 additions & 85 deletions README.md
Original file line number Diff line number Diff line change
@@ -17,31 +17,34 @@ For more information about the Protobuf Compiler, please refer to
[Google Developers Site](https://developers.google.com/protocol-buffers/docs/reference/java-generated?csw=1).

## Latest Version
The latest version is ``0.9.1``. It requires at least __Gradle 5.6__ and __Java 8__.
It is available on Maven Central. To add dependency to it:
The latest version is ``0.9.4``. It requires at least __Gradle 5.6__ and __Java 8__.
To use it with Groovy DSL:
```gradle
buildscript {
repositories {
gradlePluginPortal()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.9.1'
}
plugins {
id "com.google.protobuf" version "0.9.4"
}
```

## Development Version

To try out the head version, you can download the source and build it
with ``./gradlew publishToMavenLocal -x test`` (we skip tests here because they
require Android SDK), then:
require Android SDK), then in `settings.gradle`:

```gradle
buildscript {
pluginManagement {
repositories {
gradlePluginPortal()
mavenLocal()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.9.1-SNAPSHOT'
}
}
```

And in `build.gradle`:

```gradle
plugins {
id "com.google.protobuf" version "0.9.5-SNAPSHOT"
}
```

@@ -63,30 +66,6 @@ individual projects.
This plugin must work with either the Java plugin or the Android plugin.


### Using the `apply` method
The Java plugin or the Android plugin must be applied before the Protobuf plugin:

```gradle
apply plugin: 'java'
apply plugin: 'com.google.protobuf'
```

```gradle
apply plugin: 'com.android.application' // or 'com.android.library'
apply plugin: 'com.google.protobuf'
```

### Using the Gradle plugin DSL
The order of the plugins doesn't matter:

```gradle
plugins {
id "com.google.protobuf" version "0.9.1"
id "java"
}
```


## Configuring Protobuf compilation

The Protobuf plugin assumes Protobuf files (``*.proto``) are organized in the
@@ -197,7 +176,8 @@ protobuf {
// Locate the codegen plugins
 plugins {
// Locate a plugin with name 'grpc'. This step is optional.
// If you don't locate it, protoc will try to use "protoc-gen-grpc" from
// If you leave it empty, it uses the current directory.
// If you don't specify it, protoc will try to use "protoc-gen-grpc" from
// system search path.
   grpc {
     artifact = 'io.grpc:protoc-gen-grpc-java:1.0.0-pre2'
@@ -240,7 +220,7 @@ protobuf {
...
 generateProtoTasks {
   // all() returns the collection of all protoc tasks
   all().each { task ->
   all().configureEach { task ->
// Here you can configure the task
   }
@@ -276,7 +256,7 @@ Each code generation task has two collections:
#### Configure what to generate

Code generation is done by protoc builtins and plugins. Each
builtin/plugin generate a certain type of code. To add or configure a
builtin/plugin generates a certain type of code. To add or configure a
builtin/plugin on a task, list its name followed by a braces block.
Put options in the braces if wanted. For example:

@@ -315,12 +295,10 @@ task.plugins {

```gradle
protobuf {
generatedFilesBaseDir = "$projectDir/generated"
generateProtoTasks {
all().each { task ->
all().configureEach { task ->
task.builtins {
// Generates Python code in the output folder:
// Generates Python code
python { }
// If you wish to avoid generating Java files:
@@ -365,7 +343,7 @@ protobuf {
}
}
generateProtoTasks {
all().each { task ->
all().configureEach { task ->
task.builtins {
// In most cases you don't need the full Java output
// if you use the lite output.
@@ -393,7 +371,7 @@ protobuf {
artifact = 'com.google.protobuf:protoc:3.8.0'
}
generateProtoTasks {
all().each { task ->
all().configureEach { task ->
task.builtins {
java {
option "lite"
@@ -410,7 +388,7 @@ protobuf {
```gradle
{ task ->
// If true, will generate a descriptor_set.desc file under
// $generatedFilesBaseDir/$sourceSet. Default is false.
// task.outputBaseDir. Default is false.
// See --descriptor_set_out in protoc documentation about what it is.
task.generateDescriptorSet = true
@@ -430,19 +408,11 @@ protobuf {

#### Change where files are generated

By default generated Java files are under
``$generatedFilesBaseDir/$sourceSet/$builtinPluginName``, where
``$generatedFilesBaseDir`` is ``$buildDir/generated/source/proto`` by default,
and is configurable. E.g.,

```gradle
protobuf {
...
 generatedFilesBaseDir = "$projectDir/src/generated"
}
```
Generated files are under `task.outputBaseDir` with a subdirectory per
builtin and plugin. This produces a folder structure of
``$buildDir/generated/sources/proto/$sourceSet/$builtinPluginName``.

The subdirectory name, which is by default ``$builtinPluginName``, can also be
The subdirectory name, which is by default ``$builtinPluginName``, can be
changed by setting the ``outputSubDir`` property in the ``builtins`` or
``plugins`` block of a task configuration within ``generateProtoTasks`` block
(see previous section). E.g.,
@@ -451,8 +421,7 @@ changed by setting the ``outputSubDir`` property in the ``builtins`` or
{ task ->
task.plugins {
grpc {
// Write the generated files under
// "$generatedFilesBaseDir/$sourceSet/grpcjava"
// Use subdirectory 'grpcjava' instead of the default 'grpc'
outputSubDir = 'grpcjava'
}
}
@@ -521,29 +490,6 @@ This plugin integrates with the ``idea`` plugin and automatically
registers the proto files and generated Java code as sources.


```gradle
apply plugin: 'idea'
protobuf {
...
generatedFilesBaseDir = "$projectDir/gen"
}
clean {
delete protobuf.generatedFilesBaseDir
}
idea {
module {
// proto files and generated Java files are automatically added as
// source dirs.
// If you have additional sources, add them here:
sourceDirs += file("/path/to/other/sources");
}
}
```


## Testing the plugin

``testProject*`` are testing projects that uses this plugin to compile
Loading