-
Notifications
You must be signed in to change notification settings - Fork 275
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 from convention to extension #577
Conversation
More details can be found here: google#505
src/main/kotlin/com/google/protobuf/gradle/ProtobufConfiguratorExts.kt
Outdated
Show resolved
Hide resolved
Do you think we use separate extensions for Android vs non-Android? That would mean they'd have to have different names, like |
DSL for android is not the same as for java/kotlin. Maybe protobuf configuration for android should be inside android Block. It's open question how to separate configuration for java/kotlin, android, kmm, any_other_lang |
protobuf.protobuf property was removed
For now, I've merged them into one. As it was with kotlin. i.e. for android selectors (ofFlavour, etc.) inside a java project, will be returned an empty list of tasks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fair. Just a few comments.
src/main/groovy/com/google/protobuf/gradle/ProtobufPlugin.groovy
Outdated
Show resolved
Hide resolved
8500641
to
20f56ca
Compare
20f56ca
to
81fed13
Compare
Any updates? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. I had looked over the changes after the update but had forgotten to approve.
…from the org.gradle.util package * #21839 For some members of `org.gradle.util.*` deprecation logging could not be added because smoke tested plugins and other third parties don't offer a version that is free of their use: * **Kotlin Gradle Plugin** * `WrapUtil.toDomainObjectSet()` * [KT-53882 - Kotlin Gradle Plugin should not use the deprecated WrapUtil.toDomainObjectSet() function](https://youtrack.jetbrains.com/issue/KT-53882/Kotlin-Gradle-Plugin-should-not-use-the-deprecated-WrapUtiltoDomainObjectSet-function) * #21882 * **Android Gradle Plugin** * `GUtil.toWords(string)` * [ANDROID-245405989 - Android Gradle Plugin should not use the deprecated GUtil.toWords(string) function](https://issuetracker.google.com/issues/245405989) * #21899 * `ConfigureUtil.configure(closure, target)` * [ANDROID-245405989 - Android Gradle Plugin should not use the deprecated ConfigureUtil.configure(closure, target) function](https://issuetracker.google.com/issues/245405994) * #21901 * **Spring Dependency Management Plugin** * `GradleVersion.getNextMajor()` * spring-gradle-plugins/dependency-management-plugin#338 * #21898 * **Google Protobuf Gradle Plugin** * `GUtil.toCamelCase(string)` * google/protobuf-gradle-plugin#604 * #21900 * `ConfigureUtil.configure(closure, target)` * google/protobuf-gradle-plugin#577 * #21901 * **OSDetector Gradle Plugin (via the Protobuf plugin)** * `VersionNumber.*` * google/osdetector-gradle-plugin#24 * #21902 * **Asciidoctor Gradle Plugin / Grolifant** * `CollectionUtils.stringize(collection)` * [GROLIFANT-85 - Grolifant should not use the deprecated CollectionUtils](https://gitlab.com/ysb33rOrg/grolifant/-/issues/85) * #21903 * **Nebula Lint Plugin** * `GUtil.loadProperties(inputStream)` * nebula-plugins/gradle-lint-plugin#378 * #21912 * **Nebula Dependency Lock Plugin** * `NameMatcher` * nebula-plugins/gradle-dependency-lock-plugin#243 * #21913 * **IntelliJ IDEA** * `GUtil.toCamelCase(string)` * `GUtil.toLowerCamelCase(string)` * `GUtil.loadProperties(inputStream)` * `ConfigureUtil.configureByMap(properties, delegate)` * [IDEA-301430 - IntelliJ IDEA should not use deprecated types from the org.gradle.util package](https://youtrack.jetbrains.com/issue/IDEA-301430/IntelliJ-IDEA-should-not-use-deprecated-types-from-the-orggradleutil-package) * #21912 * #21900 * #21914 Co-authored-by: Bo Zhang <[email protected]>
Background
Gradle convention does not support dsl generation. For automatic dsl generation gradle requires extensions. In that reason while we use convention, we need to write dsl accessors by hand (see ProtobufConfiguratorExts.kt).
Changes
Android/JavaGenerateProtoTaskCollection
. Now it one class namedGenerateProtoTaskCollection
.Breaking changes
Changes.1
. Nowproject.protobuf.protobuf
is not valid code. User should writeproject.protobuf
.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
Test plan
Green pipelines. Production code was changed. Changes does not affect any plugin logic.
References issues: #505