Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate ProtobufConvention to Gradle extensions #505

Closed
liutikas opened this issue Jun 3, 2021 · 1 comment · Fixed by #577
Closed

Migrate ProtobufConvention to Gradle extensions #505

liutikas opened this issue Jun 3, 2021 · 1 comment · Fixed by #577
Labels
enhancement gradle compatibility Compatibility issues with Gradle

Comments

@liutikas
Copy link

liutikas commented Jun 3, 2021

Gradle deprecated conventions, this plugin still uses ProtobufConvention. Please migrate it to an extension.

@rougsig rougsig added the gradle compatibility Compatibility issues with Gradle label Jul 4, 2022
rougsig added a commit to rougsig/protobuf-gradle-plugin that referenced this issue Jul 6, 2022
More details can be found here: google#505
rougsig added a commit to rougsig/protobuf-gradle-plugin that referenced this issue Jul 6, 2022
More details can be found here: google#505
rougsig added a commit to rougsig/protobuf-gradle-plugin that referenced this issue Jul 6, 2022
More details can be found here: google#505
ejona86 pushed a commit that referenced this issue Jul 15, 2022
**Background**
Gradle convention does not support dsl generation. [For automatic dsl generation gradle requires extensions](https://docs.gradle.org/current/userguide/implementing_gradle_plugins.html#extensions_vs_conventions). In that reason while we use convention, we need to write dsl accessors by hand (see [ProtobufConfiguratorExts.kt](https://github.com/google/protobuf-gradle-plugin/blob/master/src/main/kotlin/com/google/protobuf/gradle/ProtobufConfiguratorExts.kt)).

**Changes**
1. Migrated from convention to extension.
2. Removed `Android/JavaGenerateProtoTaskCollection`. Now it one class named `GenerateProtoTaskCollection`.
3. Removed unnecessary kotlin dsl accessors, now it generated by gradle.

**Breaking changes**
1. In reason `Changes.1`. Now `project.protobuf.protobuf` is not valid code. User should write `project.protobuf`.
2. In reason `Changes.3`. User should remove those imports from kotlin gradle scripts:
. `com.google.protobuf.gradle.protobuf`
. `com.google.protobuf.gradle.protoc`
. `com.google.protobuf.gradle.plugins`
. `com.google.protobuf.gradle.generateProtoTasks`
. `com.google.protobuf.gradle.builtins`
. `com.google.protobuf.gradle.ofSourceSet`
. `com.google.protobuf.gradle.ofFlavor`
. `com.google.protobuf.gradle.ofBuildType`
. `com.google.protobuf.gradle.ofVariant`
. `com.google.protobuf.gradle.ofNonTest`
. `com.google.protobuf.gradle.ofTest`

References issues: #505
@ejona86 ejona86 linked a pull request Jul 15, 2022 that will close this issue
@ejona86
Copy link
Collaborator

ejona86 commented Jul 15, 2022

Fixed by #577.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement gradle compatibility Compatibility issues with Gradle
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants