Skip to content

Commit

Permalink
chore: Merge master (#854)
Browse files Browse the repository at this point in the history
* feat: enable self signed jwt for gapic clients (#794)

* feat: enable self signed jwt for gapic clients

* resolve comments

* update gax version

* update goldens

* update golden files

* chore: release 2.1.0 (#827)

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>

* feat: REGAPIC initial implementation (#824)

This includes:
1) Proper GRPC transcoding
2) Mimimal REST Operations (go make it compilable)
3) Rely on resource names for tests values generation (to not fail http url path validation)
4) Empty Server Streaming method implementation

* feat: REGAPIC Multitransport implementation (grpc+rest) (#833)

1) Fully backward compatible with grpc-only GAPIC
2) Strictly speaking not fully backward compatible with rest-only REGAPIC (but is compatible for practical cases). See below for details.
3) Introduces the concept of default transport (is necessary to preserve backward-compabitility). The default behavior assumes grpc transport.

Needed to unblock DIREGAPIC LRO. To be reviewed after submission

* fix: [bazel] fix rest transport handling in assembly rule (#835)

* Portable String <--> bytes conversion (#841)

* Fix development doc (#837)

* Fix dev doc
* Clarify BUILD.bazel location

* Remove warnings (unused vars, dead code, missing annotations, missing generic reference, etc) (#840)

* Remove warnings for test code (#842)

* Remove extraneous call (#844)

* Fix preserving sorted order of a collection (#845)

* feat: Add REST AIP-151 LRO suport

Depends on googleapis/gax-java#1484

* chore(deps): update dependency gradle to v7 (#713)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [gradle](https://gradle.org) ([source](https://github.com/gradle/gradle)) | major | `4.10.3` -> `7.0.2` |

---

### Release Notes

<details>
<summary>gradle/gradle</summary>

### [`v7.0.2`](https://github.com/gradle/gradle/releases/v7.0.2)

This is a patch release for Gradle 7.0.

[This fixes an issue with files system watching on certain Linux distributions](https://github.com/gradle/gradle/milestone/177?closed=1).

We recommend users upgrade to 7.0.2 instead of 7.0.

#### Upgrade Instructions

Switch your build to use Gradle 7.0.2 by updating your wrapper:

    ./gradlew wrapper --gradle-version=7.0.2

See the [Gradle 6.x upgrade guide](https://docs.gradle.org/7.0.1/userguide/upgrading_version\_6.html#changes\_7.0) to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 7.0.1.

#### Reporting Problems

If you find a problem with this release, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines.
If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v7.0.1`](https://github.com/gradle/gradle/releases/v7.0.1)

This is a patch release for Gradle 7.0.

[This fixes several issues reported against 7.0](https://github.com/gradle/gradle/milestone/173?closed=1).

We recommend users upgrade to 7.0.1 instead of 7.0.

#### Upgrade Instructions

Switch your build to use Gradle 7.0.1 by updating your wrapper:

    ./gradlew wrapper --gradle-version=7.0.1

See the [Gradle 6.x upgrade guide](https://docs.gradle.org/7.0.1/userguide/upgrading_version\_6.html#changes\_7.0) to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 7.0.1.

#### Reporting Problems

If you find a problem with this release, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines.
If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v7.0`](https://github.com/gradle/gradle/compare/v6.9.0...v7.0.0)

### [`v6.9`](https://github.com/gradle/gradle/compare/v6.8.3...v6.9.0)

### [`v6.8.3`](https://github.com/gradle/gradle/releases/v6.8.3)

This is a patch release for Gradle 6.8.

This fixes [a critical bug](https://github.com/gradle/gradle/issues/16144) present in Gradle 6.8, 6.8.1 and 6.8.2.

[All issues fixed in this patch release](https://github.com/gradle/gradle/milestone/171?closed=1)

Please don’t use the original 6.8 release or previous patch releases, and instead upgrade to 6.8.3.

##### Upgrade Instructions

Switch your build to use Gradle 6.8.3 by updating your wrapper:

    ./gradlew wrapper --gradle-version=6.8.3 --gradle-distribution-sha256-sum 7faa7198769f872826c8ef4f1450f839ec27f0b4d5d1e51bade63667cbccd205

See the [Gradle 6.x upgrade guide](https://docs.gradle.org/6.8.3/userguide/upgrading_version\_6.html#changes\_6.8) to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 6.8.3.

##### Reporting Problems

If you find a problem with this release, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines.
If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v6.8.2`](https://github.com/gradle/gradle/releases/v6.8.2)

This is a patch release for Gradle 6.8.

This fixes several bugs in Gradle 6.8.1.

[All issues fixed in this patch release](https://github.com/gradle/gradle/milestone/170?closed=1)

Please don’t use the original 6.8 release or the 6.8.1, and instead upgrade to 6.8.2.

##### Upgrade Instructions

Switch your build to use Gradle 6.8.2 by updating your wrapper:

`./gradlew wrapper --gradle-version=6.8.2`

See the [Gradle 6.x upgrade guide](https://docs.gradle.org/6.8.2/userguide/upgrading_version\_6.html#changes\_6.8) to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 6.8.2.

##### Reporting Problems

If you find a problem with this release, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines.
If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v6.8.1`](https://github.com/gradle/gradle/releases/v6.8.1)

This is a patch release for Gradle 6.8.

This fixes several critical bugs in Gradle 6.8.

[All issues fixed in this patch release](https://github.com/gradle/gradle/milestone/168?closed=1)

We recommend that you use Gradle 6.8.1 over the initial release of Gradle 6.8.

#### Upgrade Instructions

Switch your build to use Gradle 6.8.1 by updating your wrapper:

`./gradlew wrapper --gradle-version=6.8.1`

See the [Gradle 6.x upgrade guide](https://docs.gradle.org/6.8.1/userguide/upgrading_version\_6.html#changes\_6.8) to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 6.8.1.

#### Reporting Problems

If you find a problem with this release, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines.
If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v6.8`](https://github.com/gradle/gradle/compare/v6.7.1...v6.8.0)

### [`v6.7.1`](https://github.com/gradle/gradle/releases/v6.7.1)

This is a patch release for Gradle 6.7.

This fixes several critical bugs in Gradle 6.7.

[All issues fixed in this patch release](https://github.com/gradle/gradle/milestone/160?closed=1)

We recommend that you use Gradle 6.7.1 over the initial release of Gradle 6.7.

#### Upgrade Instructions

Switch your build to use Gradle 6.7.1 by updating your wrapper:

`./gradlew wrapper --gradle-version=6.7.1`

See the [Gradle 6.x upgrade guide](https://docs.gradle.org/6.7.1/userguide/upgrading_version\_6.html#changes\_6.7) to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 6.7.1.

#### Reporting Problems

If you find a problem with this release, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines.
If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v6.7`](https://github.com/gradle/gradle/compare/v6.6.1...v6.7.0)

### [`v6.6.1`](https://github.com/gradle/gradle/releases/v6.6.1)

This is a patch release for Gradle 6.6.

This fixes several critical bugs in Gradle 6.6.

[All issues fixed in this patch release](https://github.com/gradle/gradle/milestone/155?closed=1)

We recommend that you use Gradle 6.6.1 over the initial release of Gradle 6.6.

#### Upgrade Instructions

Switch your build to use Gradle 6.6.1 by updating your wrapper:

`./gradlew wrapper --gradle-version=6.6.1`

See the [Gradle 6.x upgrade guide](https://docs.gradle.org/6.6.1/userguide/upgrading_version\_6.html#changes\_6.6) to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 6.6.1.

#### Reporting Problems

If you find a problem with this release, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines.
If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v6.6`](https://github.com/gradle/gradle/compare/v6.5.1...v6.6.0)

### [`v6.5.1`](https://github.com/gradle/gradle/releases/v6.5.1)

This is a patch release for Gradle 6.5.

This fixes several critical bugs in Gradle 6.5:

-   Regression: Gradle 6.5 cached builds cause IllegalStateException [#&#8203;13367](https://github.com/gradle/gradle/issues/13367)
-   Regression: Compile classpath configuration is not deterministic [#&#8203;13555](https://github.com/gradle/gradle/issues/13555)
-   Regression: Class cast exception when GStrings are used with System.getProperty [#&#8203;13569](https://github.com/gradle/gradle/issues/13569)
-   And a number of dependency graph resolution errors ([#&#8203;13251](https://github.com/gradle/gradle/issues/13251), [#&#8203;13316](https://github.com/gradle/gradle/issues/13316), [#&#8203;13329](https://github.com/gradle/gradle/issues/13329), [#&#8203;13551](https://github.com/gradle/gradle/issues/13551))

[All issues fixed in this patch release](https://github.com/gradle/gradle/milestone/147?closed=1)

We recommend that you use Gradle 6.5.1 over the initial release of Gradle 6.5.

#### Upgrade Instructions

Switch your build to use Gradle 6.5.1 by updating your wrapper:

`./gradlew wrapper --gradle-version=6.5.1`

See the [Gradle 6.x upgrade guide](https://docs.gradle.org/6.5.1/userguide/upgrading_version\_6.html#changes\_6.5) to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 6.5.1.

#### Reporting Problems

If you find a problem with this release, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines.
If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v6.5`](https://github.com/gradle/gradle/compare/v6.4.1...v6.5.0)

### [`v6.4.1`](https://github.com/gradle/gradle/releases/v6.4.1)

This is a patch release for Gradle 6.4.

This fixes several critical bugs in Gradle 6.4:

-   Regression: Different daemons are used between IDE and CLI builds for the same project [#&#8203;13069](https://github.com/gradle/gradle/issues/13069)
-   Regression: Main-Class attribute always added to jar manifest when using application plugin [#&#8203;13057](https://github.com/gradle/gradle/issues/13057)

[All issues fixed in this patch release](https://github.com/gradle/gradle/milestone/145?closed=1)

We recommend that you use Gradle 6.4.1 over the initial release of Gradle 6.4.

#### Upgrade Instructions

Switch your build to use Gradle 6.4.1 by updating your wrapper:

`./gradlew wrapper --gradle-version=6.4.1`

See the [Gradle 6.x upgrade guide](https://docs.gradle.org/6.4.1/userguide/upgrading_version\_6.html#changes\_6.4) to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 6.4.1.

#### Reporting Problems

If you find a problem with this release, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines.
If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v6.4`](https://github.com/gradle/gradle/compare/v6.3.0...v6.4.0)

### [`v6.3`](https://github.com/gradle/gradle/compare/v6.2.2...v6.3.0)

### [`v6.2.2`](https://github.com/gradle/gradle/releases/v6.2.2)

This is a patch release for Gradle 6.2.

This fixes a critical bug in Gradle 6.2:

-   Multi-project build use the properties of the rootProject for all included builds. [#&#8203;12381](https://github.com/gradle/gradle/issues/12381)

[All issues fixed](https://github.com/gradle/gradle/milestone/134?closed=1)

We recommend that you use Gradle 6.2.2 over the initial release of Gradle 6.2.

[Read the full release notes](https://docs.gradle.org/6.2.2/release-notes.html)

#### Upgrade Instructions

Switch your build to use Gradle 6.2.2 by updating your wrapper:

`./gradlew wrapper --gradle-version=6.2.2`

See the [Gradle 6.x upgrade guide](https://docs.gradle.org/6.2.2/userguide/upgrading_version\_6.html#changes\_6.2) to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 6.2.2.

#### Reporting Problems

If you find a problem with this release, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines.
If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v6.2.1`](https://github.com/gradle/gradle/releases/v6.2.1)

This is a patch release for Gradle 6.2.

This fixes several critical bugs in Gradle 6.2:

-   Project name disambiguation causes project / external dependency conflicts to be missed. [#&#8203;12315](https://github.com/gradle/gradle/issues/12315)
-   IdeaModelBuilder does not provide groovy-all as compile dep for buildSrc [#&#8203;12274](https://github.com/gradle/gradle/issues/12274)
-   Gradle crashes if GRADLE_RO_DEP_CACHE is set and it cannot create modules-2 directory within it [#&#8203;12293](https://github.com/gradle/gradle/issues/12293)

[All issues fixed](https://github.com/gradle/gradle/milestone/133?closed=1)

We recommend that you use Gradle 6.2.1 over the initial release of Gradle 6.2.

[Read the full release notes](https://docs.gradle.org/6.2.1/release-notes.html)

#### Upgrade Instructions

Switch your build to use Gradle 6.2.1 by updating your wrapper:

`./gradlew wrapper --gradle-version=6.2.1`

See the [Gradle 6.x upgrade guide](https://docs.gradle.org/6.2.1/userguide/upgrading_version\_6.html#changes\_6.2) to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 6.2.1.

#### Reporting Problems

If you find a problem with this release, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines.
If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v6.2`](https://github.com/gradle/gradle/compare/v6.1.1...v6.2.0)

### [`v6.1.1`](https://github.com/gradle/gradle/releases/v6.1.1)

This is a patch release for Gradle 6.1.

This fixes several critical bugs in Gradle 6.1:

-   Plugins using kotlin-dsl and compiled with 6.1 are incompatible with Gradle 6.0 [#&#8203;11947](https://github.com/gradle/gradle/issues/11947)
-   Missing fixed issues from Gradle 6.1 release notes [#&#8203;11954](https://github.com/gradle/gradle/issues/11954)
-   Memory regression when resolving large artifacts while computing checksums [#&#8203;11966](https://github.com/gradle/gradle/issues/11966)
-   Gradle 6.1 generates an empty .gradle and gradle directories on each execution in subproject directories [#&#8203;11971](https://github.com/gradle/gradle/issues/11971)

[All issues fixed](https://github.com/gradle/gradle/issues?q=is%3Aclosed+milestone%3A6.1.1)

We recommend that you use Gradle 6.1.1 over the initial release of Gradle 6.1.

[Read the full release notes](https://docs.gradle.org/6.1.1/release-notes.html)

#### Upgrade Instructions

Switch your build to use Gradle 6.1.1 by updating your wrapper:

`./gradlew wrapper --gradle-version=6.1.1`

See the [Gradle 6.x upgrade guide](https://docs.gradle.org/6.1.1/userguide/upgrading_version\_6.html#changes\_6.1) to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 6.1.x.

#### Reporting Problems

If you find a problem with this release, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines.
If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v6.1`](https://github.com/gradle/gradle/compare/v6.0.1...v6.1.0)

### [`v6.0.1`](https://github.com/gradle/gradle/releases/v6.0.1)

This is a patch release for Gradle 6.0.

This fixes several critical bugs in Gradle 6.0:

-   Incremental Java compilation is broken with Android 3.5.1 and Gradle 6.0 [#&#8203;11330](https://github.com/gradle/gradle/issues/11330)
-   Unable to use a Provider as an artifact for the maven-publish plugin [#&#8203;11054](https://github.com/gradle/gradle/issues/11054)
-   Implicit capabilities not always applied/detected [#&#8203;11300](https://github.com/gradle/gradle/issues/11300)
-   maven-metadata.xml SHA256 and SHA512 checksums prevent publishing to Nexus [#&#8203;11308](https://github.com/gradle/gradle/issues/11308)
-   Unable to properly resolve dynamic dependencies from mavenLocal() repo [#&#8203;11321](https://github.com/gradle/gradle/issues/11321)
-   Kotlin DSL: `fileTree(mapOf(...))` has unexpected behavior [#&#8203;11335](https://github.com/gradle/gradle/issues/11335)
-   Attribute disambiguation rule for 'org.gradle.category' can cause unexpected type exception [#&#8203;11365](https://github.com/gradle/gradle/issues/11365)

[All issues fixed](https://github.com/gradle/gradle/issues?q=is%3Aclosed+milestone%3A6.0.1)

We recommend that you use Gradle 6.0.1 over the initial release of Gradle 6.0.

#### Upgrade Instructions

Switch your build to use Gradle 6.0.1 by updating your wrapper properties:

`./gradlew wrapper --gradle-version=6.0.1`

Standalone downloads are available at https://gradle.org/install.

#### Reporting Problems

If you find a problem with Gradle, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines. If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v5.6.4`](https://github.com/gradle/gradle/releases/v5.6.4)

This bug-fix release contains all changes from 5.6.1 through 5.6.3 as well as:

-   Can't configure kotlinOptions after upgrade to gradle 5.6.3 using kotlin-dsl [#&#8203;11083](https://github.com/gradle/gradle/issues/11083)
-   Slow localhost look-up on macOS [#&#8203;11134](https://github.com/gradle/gradle/issues/11134)

We recommend that you use Gradle 5.6.4 over any other 5.6.x release.

#### Upgrade Instructions

Switch your build to use Gradle 5.6.4 by updating your wrapper properties:

`./gradlew wrapper --gradle-version=5.6.4`

Standalone downloads are available at https://gradle.org/install.

#### Reporting Problems

If you find a problem with Gradle, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines. If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v5.6.3`](https://github.com/gradle/gradle/releases/v5.6.3)

This bug-fix release contains all changes from 5.6.1 and 5.6.2 as well as:

-   Let Kotlin DSL gracefully handle lambdas registered as extensions (5.6.3) [#&#8203;11014](https://github.com/gradle/gradle/issues/11014)
-   Gradle Module Metadata compatibility for unique snapshots [#&#8203;11050](https://github.com/gradle/gradle/issues/11050)
-   maven-publish publishes jars with wrong extension for known jar packagings like 'ejb' in 5.6 [#&#8203;10555](https://github.com/gradle/gradle/issues/10555)
-   Regression in 5.5 when using dependency constraints for non-jar dependencies without a POM [#&#8203;10948](https://github.com/gradle/gradle/issues/10948)
-   resolution failure when dependency locks and kotlin-dsl plugin are present [#&#8203;10697](https://github.com/gradle/gradle/issues/10697)
-   Non-Kotlin extensions crash the build when using Kotlin DSL + Kotlin plugins [#&#8203;10729](https://github.com/gradle/gradle/issues/10729)
-   Sporadic build failures with build-scan due to an overlapping ID assignment gradle/gradle#10286
-   Prevent StackOverflowException caused by excessive 'or' via PatternMatcher [#&#8203;10330](https://github.com/gradle/gradle/issues/10330)

We recommend that you use Gradle 5.6.3 over any other 5.6.x release.

#### Upgrade Instructions

Switch your build to use Gradle 5.6.3 by updating your wrapper properties:

`./gradlew wrapper --gradle-version=5.6.3`

Standalone downloads are available at https://gradle.org/install.

#### Reporting Problems

If you find a problem with Gradle, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines. If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v5.6.2`](https://github.com/gradle/gradle/releases/v5.6.2)

This bug-fix release contains changes to Gradle 5.6.1:

-   Duplicate entry in generated .classpath file in Gradle >= 5.6 ([#&#8203;10393](https://github.com/gradle/gradle/issues/10393))
-   Memory leak when using tasks that use Worker API and process isolation ([#&#8203;10411](https://github.com/gradle/gradle/issues/10411))

We recommend that you use Gradle 5.6.2 over 5.6.1.

#### Upgrade Instructions

Switch your build to use Gradle 5.6.2 by updating your wrapper properties:

`./gradlew wrapper --gradle-version=5.6.2`

Standalone downloads are available at https://gradle.org/install.

#### Reporting Problems

If you find a problem with Gradle, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines. If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v5.6.1`](https://github.com/gradle/gradle/releases/v5.6.1)

This bug-fix release contains changes to Gradle 5.6:

-   Unable to publish artifacts with custom classifier/extension from java project with Gradle 5.6 (gradle/gradle#10287)
-   Regression in 5.6 signArchives (Duplicate key) (gradle/gradle#10302)
-   Regression setting version for ArchiveTasks in 5.6 (gradle/gradle#10311)
-   A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork (gradle/gradle#10317)
-   DirectoryFileTree breaks SourceTask since 5.6 (gradle/gradle#10322)
-   Regression: Unable to pass java.util.Properties object using Worker API in Gradle 5.6 (gradle/gradle#10323)
-   Unable to publish multiple publications with same coordinates (gradle/gradle#10333)
-   Gradle 5.6 - Resolving resources from buildSrc or plugins (gradle/gradle#10347)

We recommend that you use Gradle 5.6.1 over 5.6.

#### Upgrade Instructions

Switch your build to use Gradle 5.6.1 by updating your wrapper properties:

`./gradlew wrapper --gradle-version=5.6.1`

Standalone downloads are available at https://gradle.org/install.

#### Reporting Problems

If you find a problem with Gradle, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines. If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v5.5.1`](https://github.com/gradle/gradle/releases/v5.5.1)

This bug-fix release contains three changes to Gradle 5.5:

-   Combination of errorprone-gradle-plugin and options.fork = true causes Java compilation to fail in Gradle 5.5 [#&#8203;9897](https://github.com/gradle/gradle/issues/9897)
-   Using dependency declaration `gradleKotlinDsl()` fails with 5.5 [#&#8203;9919](https://github.com/gradle/gradle/issues/9919)
-   Chain of transitives aligned by same platform can lead to broken resolution [#&#8203;9882](https://github.com/gradle/gradle/issues/9882)

We recommend that you use Gradle 5.5.1 over 5.5.

#### Upgrade Instructions

Switch your build to use Gradle 5.5.1 by updating your wrapper properties:

`./gradlew wrapper --gradle-version=5.5.1`

Standalone downloads are available at https://gradle.org/install.

#### Reporting Problems

If you find a problem with Gradle, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines. If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v5.4.1`](https://github.com/gradle/gradle/releases/v5.4.1)

This bug-fix release contains two changes to Gradle 5.4:

-   Fix inconsistent classpath ordering when dependencies have lots of excludes - gradle/gradle#9197
-   Kotlin DSL IDEA script editor can't find JDK classes with Gradle 5.4 if *Gradle JVM* != *Project SDK* - gradle/gradle#9195

We recommend that you use Gradle 5.4.1 over 5.4.

#### Upgrade Instructions

Switch your build to use Gradle 5.4.1 by updating your wrapper properties:

`./gradlew wrapper --gradle-version=5.4.1`

Standalone downloads are available at https://gradle.org/install.

#### Reporting Problems

If you find a problem with Gradle, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines. If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v5.3.1`](https://github.com/gradle/gradle/releases/v5.3.1)

This bug-fix release contains several changes to Gradle 5.3, notably:

-   Unable to use `java-platform` and `maven-publish` in multi-project: gradle/gradle#8845
-   Unexpected exception when adding a plugin on `buildSrc` compile classpath: gradle/kotlin-dsl-samples#1363

We recommend that you use Gradle 5.3.1 over 5.3.

#### Upgrade Instructions

Switch your build to use Gradle 5.3.1 by updating your wrapper properties:

`./gradlew wrapper --gradle-version=5.3.1`

Standalone downloads are available at https://gradle.org/install.

#### Reporting Problems

If you find a problem with Gradle, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines. If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v5.2.1`](https://github.com/gradle/gradle/releases/v5.2.1)

This bug-fix release contains several changes to Gradle 5.2, notably:

-   Checkstyle issues with a single source file: gradle/gradle#8394
-   BOM support conflicts: gradle/gradle#8420

We recommend that you use Gradle 5.2.1 over 5.2.

#### Upgrade Instructions

Switch your build to use Gradle 5.2.1 by updating your wrapper properties:

`./gradlew wrapper --gradle-version=5.2.1`

Standalone downloads are available at https://gradle.org/install.

#### Reporting Problems

If you find a problem with Gradle, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines. If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v5.1.1`](https://github.com/gradle/gradle/releases/v5.1.1)

This bug-fix release contains several changes to Gradle 5.1, notably:

-   A daemon memory leak affecting all projects gradle/gradle#8142
-   Incremental Java compilation gradle/gradle#8194
-   A fix to Gradle's generated Javadoc in 5.1 gradle/gradle#8183

We recommend that you use Gradle 5.1.1 over 5.1.

#### Upgrade Instructions

Switch your build to use Gradle 5.1.1 by updating your wrapper properties:

`./gradlew wrapper --gradle-version=5.1.1`

Standalone downloads are available at https://gradle.org/install.

#### Reporting Problems

If you find a problem with Gradle, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines. If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻️ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/gapic-generator-java).

* chore(deps): update dependency bazel_skylib to v1.0.3 (#722)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [bazel_skylib](https://github.com/bazelbuild/bazel-skylib) | http_archive | patch | `1.0.2` -> `1.0.3` |

---

### Release Notes

<details>
<summary>bazelbuild/bazel-skylib</summary>

### [`v1.0.3`](https://github.com/bazelbuild/bazel-skylib/releases/1.0.3)

[Compare Source](https://github.com/bazelbuild/bazel-skylib/compare/1.0.2...1.0.3)

**New Features**

-   copy_file: Add parameter to allow symlinks ([#&#8203;252](https://github.com/bazelbuild/bazel-skylib/issues/252))
-   Create Gazelle language for Starlark ([#&#8203;251](https://github.com/bazelbuild/bazel-skylib/issues/251))
-   Create a helper rule (`select_file`) for selecting a file from outputs of another rule ([#&#8203;233](https://github.com/bazelbuild/bazel-skylib/issues/233))

**Significant Changes**

-   Move Gazelle extension to //gazelle/bzl and change package name
-   Stop depending on rules_pkg through the federation. ([#&#8203;259](https://github.com/bazelbuild/bazel-skylib/issues/259))

**Incompatible Changes**

-   Remove links to maprules ([#&#8203;213](https://github.com/bazelbuild/bazel-skylib/issues/213))
-   Remove old_sets.bzl ([#&#8203;231](https://github.com/bazelbuild/bazel-skylib/issues/231))
    It has been deprecated for a while, the code is not really compatible with Bazel depset-related changes.

**Contributors**
Andrew Z Allen, Bocete, Bor Kae Hwang, irengrig, Jay Conrod, Jonathan B Coe, Marc Plano-Lesay, Robbert van Ginkel, Thomas Van Lenten, Yannic, and the Bazel team.

**WORKSPACE setup**

```
load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "bazel_skylib",
    urls = [
        "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
    ],
    sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c",
)
load("@&#8203;bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()

```

**Using the rules**

See [the source](https://github.com/bazelbuild/bazel-skylib/tree/1.0.3).

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻️ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/gapic-generator-java).

* chore(deps): update dependency bazel_skylib to v1.1.1 (#849)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [bazel_skylib](https://github.com/bazelbuild/bazel-skylib) | http_archive | minor | `1.0.3` -> `1.1.1` |

---

### Release Notes

<details>
<summary>bazelbuild/bazel-skylib</summary>

### [`v1.1.1`](https://github.com/bazelbuild/bazel-skylib/releases/1.1.1)

[Compare Source](https://github.com/bazelbuild/bazel-skylib/compare/1.0.3...1.1.1)

Release 1.1.1 (initially tagged as 1.1.0)

**New Features**

-   Gazelle: support relative imports ([#&#8203;271](https://github.com/bazelbuild/bazel-skylib/issues/271)) and imports from `@bazel_tools`
    ([#&#8203;273](https://github.com/bazelbuild/bazel-skylib/issues/273))
-   Add partial.is_instance() ([#&#8203;276](https://github.com/bazelbuild/bazel-skylib/issues/276))
-   Allow unittest.suite() to accept partial calls of test rules ([#&#8203;276](https://github.com/bazelbuild/bazel-skylib/issues/276))
-   Allow specifying additional aspects to target under test in
    analysistest.make() ([#&#8203;299](https://github.com/bazelbuild/bazel-skylib/issues/299))
-   Add Windows support for build_test ([#&#8203;302](https://github.com/bazelbuild/bazel-skylib/issues/302))

**Incompatible Changes**

-   structs.to_dict() ignores deprecated to_json()/to_proto() methods ([#&#8203;295](https://github.com/bazelbuild/bazel-skylib/issues/295))

**Contributors**

aiuto, alandonovan, Alex Eagle, Alexandre Rostovtsev, Andrew Z Allen, c-parsons,
Christopher Sauer, Daniel Wagner-Hall, David Sanderson, dmaclach, Laurent Le
Brun, Mansur, Olek Wojnar, Philipp Wollermann, River, Samuel Giddins, Thaler
Benedek

**WORKSPACE setup**

```
load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "bazel_skylib",
    urls = [
        "https://github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz",
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz",
    ],
    sha256 = "c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d",
)
load("@&#8203;bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()

```

**Using the rules**

See [the source](https://github.com/bazelbuild/bazel-skylib/tree/1.1.1).

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/gapic-generator-java).

* chore(deps): update dependency gradle to v7.2 (#848)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [gradle](https://gradle.org) ([source](https://github.com/gradle/gradle)) | minor | `7.0.2` -> `7.2` |

---

### Release Notes

<details>
<summary>gradle/gradle</summary>

### [`v7.2`](https://github.com/gradle/gradle/compare/v7.1.1...v7.2.0)

### [`v7.1.1`](https://github.com/gradle/gradle/releases/v7.1.1)

This is a patch release for Gradle 7.1.

It fixes the following issues:

-   [#&#8203;17488](https://github.com/gradle/gradle/issues/17488) Many Micronaut builds failing with NPE with Gradle 7.1 & JDK 8
-   [#&#8203;17548](https://github.com/gradle/gradle/issues/17548) \[Configuration cache] Task not up-to-date for SantaTracker
-   [#&#8203;17542](https://github.com/gradle/gradle/issues/17542) \[Configuration cache] Filtered FC with mapped elements stored incorrectly

We recommend users upgrade to 7.1.1 instead of 7.1.

#### Upgrade Instructions

Switch your build to use Gradle 7.1.1 by updating your wrapper:

    ./gradlew wrapper --gradle-version=7.1.1

See the [Gradle 7.x upgrade guide](https://docs.gradle.org/7.1.1/userguide/upgrading_version\_7.html#changes\_7.1) to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 7.1.1.

#### Reporting Problems

If you find a problem with this release, please file a bug on [GitHub Issues](https://github.com/gradle/gradle/issues) adhering to our issue guidelines.
If you're not sure you're encountering a bug, please use the [forum](https://discuss.gradle.org/c/help-discuss).

### [`v7.1`](https://github.com/gradle/gradle/compare/v7.0.2...v7.1.0)

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/gapic-generator-java).

* chore: rename default branch to main (#851)

* chore: merge changes from master

Co-authored-by: arithmetic1728 <58957152+arithmetic1728@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Chanseok Oh <chanseok@google.com>
Co-authored-by: WhiteSource Renovate <bot@renovateapp.com>
Co-authored-by: Neenu Shaji <Neenu1995@users.noreply.github.com>
  • Loading branch information
6 people authored Oct 6, 2021
1 parent c4c9dfa commit ce5da94
Show file tree
Hide file tree
Showing 104 changed files with 256 additions and 405 deletions.
2 changes: 1 addition & 1 deletion .github/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
releaseType: simple
handleGHRelease: true
primaryBranch: master
primaryBranch: main
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
on:
push:
branches:
- master
- main
pull_request:
name: ci
jobs:
build:
runs-on: ubuntu-latest
container: gcr.io/gapic-images/googleapis-bazel:20210105
# Dockerfile for this image: https://github.com/googleapis/googleapis-discovery/blob/master/Dockerfile
# Dockerfile for this image: https://github.com/googleapis/googleapis-discovery/blob/main/Dockerfile
# If you update its version, please also update it below in
# 'Cache Bazel files' - unfortunately it cannot accept variables at this
# time.
Expand Down
26 changes: 21 additions & 5 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,40 @@
## Running the Plugin

1. Clone [googleapis](https://github.com/googleapis/googleapis) and
[gapic-showcase](https://github.com/googleapis/gapic-showcase/) and install
protoc.
[gapic-showcase](https://github.com/googleapis/gapic-showcase/).

2. Copy the protos from Showcase into googleapis/google/showcase.

```sh
cp gapic-showcase/schema/google/showcase/v1beta1 googleapis/google/showcase/v1beta
mkdir googleapis/google/showcase
cp -r gapic-showcase/schema/google/showcase/v1beta1 googleapis/google/showcase/v1beta1
```

3. Add the new microgenerator rules to the protobuf directory's `BUILD.bazel`
file as follows:
3. Add the new microgenerator rules to
`googleapis/google/showcase/v1beta1/BUILD.bazel` file as follows:

```python
load(
"@com_google_googleapis_imports//:imports.bzl",
# Existing rules here.
"java_gapic_assembly_gradle_pkg",
"java_gapic_library",
"java_proto_library",
"proto_library_with_info",
)
proto_library_with_info(
name = "showcase_proto_with_info",
deps = [
":showcase_proto",
],
)
java_proto_library(
name = "showcase_java_proto",
deps = [
"showcase_proto",
],
)
# This should either replace the existing monolith target or have a unique name
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![codecov](https://codecov.io/gh/googleapis/gapic-generator-java/branch/master/graph/badge.svg?token=3RUU37GX9U)](https://codecov.io/gh/googleapis/gapic-generator-java)
[![codecov](https://codecov.io/gh/googleapis/gapic-generator-java/branch/main/graph/badge.svg?token=3RUU37GX9U)](https://codecov.io/gh/googleapis/gapic-generator-java)
# API Client Generator for Java

Generates a Java client library from protocol buffers.
Expand Down
6 changes: 3 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external")
# like protobuf will build.
http_archive(
name = "bazel_skylib",
sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44",
sha256 = "c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz",
],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public abstract class AnnotationNode implements AstNode {
public static AnnotationNode DEPRECATED =
AnnotationNode.builder().setType(annotationType(Deprecated.class)).build();

private static TypeNode annotationType(Class clazz) {
private static TypeNode annotationType(Class<?> clazz) {
return TypeNode.withReference(ConcreteReference.withClazz(clazz));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ public abstract class ArithmeticOperationExpr implements OperationExpr {

public abstract Expr rhsExpr();

@Override
public abstract OperatorKind operatorKind();

@Override
public abstract TypeNode type();

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public abstract class AssignmentOperationExpr implements OperationExpr {

public abstract Expr valueExpr();

@Override
public abstract OperatorKind operatorKind();

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

@AutoValue
public abstract class BlockComment implements Comment {
@Override
public abstract String comment();

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ public abstract class ConcreteReference implements Reference {
private static final String RIGHT_ANGLE = ">";
private static final String QUESTION_MARK = "?";

private static final Class WILDCARD_CLAZZ = ReferenceWildcard.class;
private static final Class<?> WILDCARD_CLAZZ = ReferenceWildcard.class;

// Private.
abstract Class clazz();
abstract Class<?> clazz();

@Override
public void accept(AstNodeVisitor visitor) {
Expand Down Expand Up @@ -105,7 +105,7 @@ public ImmutableList<String> enclosingClassNames() {
}
// The innermost type will be the last element in the list.
ImmutableList.Builder<String> listBuilder = new ImmutableList.Builder<>();
Class currentClz = clazz();
Class<?> currentClz = clazz();
while (currentClz.getEnclosingClass() != null) {
listBuilder.add(currentClz.getEnclosingClass().getSimpleName());
currentClz = currentClz.getEnclosingClass();
Expand Down Expand Up @@ -198,7 +198,7 @@ public Reference copyAndSetGenerics(List<Reference> generics) {
return toBuilder().setGenerics(generics).build();
}

public static ConcreteReference withClazz(Class clazz) {
public static ConcreteReference withClazz(Class<?> clazz) {
return builder().setClazz(clazz).build();
}

Expand All @@ -222,7 +222,7 @@ public static Builder builder() {

@AutoValue.Builder
public abstract static class Builder {
public abstract Builder setClazz(Class clazz);
public abstract Builder setClazz(Class<?> clazz);

public abstract Builder setUseFullName(boolean useFullName);

Expand All @@ -239,7 +239,7 @@ public Builder setGenerics(Reference... references) {
public abstract ConcreteReference autoBuild();

// Private.
abstract Class clazz();
abstract Class<?> clazz();

abstract ImmutableList<Reference> generics();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
public abstract class EnumRefExpr implements Expr {
public abstract IdentifierNode identifier();

@Override
public abstract TypeNode type();

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
public interface Expr extends AstNode {
TypeNode type();

@Override
void accept(AstNodeVisitor visitor);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public abstract class LogicalOperationExpr implements OperationExpr {

public abstract Expr rhsExpr();

@Override
public abstract OperatorKind operatorKind();

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,20 +244,18 @@ public MethodDefinition build() {
"Abstract methods cannot be static, final, or private");
}

// If this method overrides another, ensure that the Override annotaiton is the last one.
// If this method overrides another, ensure that the Override annotation is the last one.
ImmutableList<AnnotationNode> processedAnnotations = annotations();
if (isOverride()) {
processedAnnotations =
annotations()
.<AnnotationNode>builder()
ImmutableList.<AnnotationNode>builder()
.addAll(annotations())
.add(AnnotationNode.OVERRIDE)
.build();
}
// Remove duplicates while maintaining insertion order.
setAnnotations(
new LinkedHashSet<AnnotationNode>(processedAnnotations)
.stream().collect(Collectors.toList()));
new LinkedHashSet<>(processedAnnotations).stream().collect(Collectors.toList()));

MethodDefinition method = autoBuild();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

@AutoValue
public abstract class NewObjectExpr implements Expr {
@Override
public abstract TypeNode type();

public abstract ImmutableList<Expr> arguments();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
package com.google.api.generator.engine.ast;

public interface ObjectValue extends Value {
@Override
TypeNode type();

@Override
String value();
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ public interface OperationExpr extends Expr {

OperatorKind operatorKind();

@Override
TypeNode type();

@Override
void accept(AstNodeVisitor visitor);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import javax.annotation.Nullable;

public interface Reference extends AstNode {
@Override
void accept(AstNodeVisitor visitor);

ImmutableList<Reference> generics();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public enum KeywordKind {
SUPER
}

@Override
public abstract TypeNode type();

public abstract KeywordKind keywordKind();
Expand Down Expand Up @@ -73,7 +74,7 @@ public Builder setArguments(Expr... arguments) {
public ReferenceConstructorExpr build() {
ReferenceConstructorExpr referenceConstructorExpr = autoBuild();
Preconditions.checkState(
referenceConstructorExpr.type().isReferenceType(referenceConstructorExpr.type()),
TypeNode.isReferenceType(referenceConstructorExpr.type()),
"A this/super constructor must have a reference type.");

NodeValidator.checkNoNullElements(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public abstract class RelationalOperationExpr implements OperationExpr {

public abstract Expr rhsExpr();

@Override
public abstract OperatorKind operatorKind();

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
package com.google.api.generator.engine.ast;

public interface Statement extends AstNode {
@Override
void accept(AstNodeVisitor visitor);
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

@AutoValue
public abstract class StringObjectValue implements ObjectValue {
@Override
public abstract String value();

@Override
Expand Down
22 changes: 4 additions & 18 deletions src/main/java/com/google/api/generator/engine/ast/TypeNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public int compareTo(TypeNode other) {
return -1;
}

if (this.equals(TypeNode.NULL)) {
if (equals(TypeNode.NULL)) {
// Can't self-compare, so we don't need to check whether the other one is TypeNode.NULL.
return other.isPrimitiveType() ? 1 : -1;
}
Expand Down Expand Up @@ -161,7 +161,7 @@ public static TypeNode withReference(Reference reference) {
return TypeNode.builder().setTypeKind(TypeKind.OBJECT).setReference(reference).build();
}

public static TypeNode withExceptionClazz(Class clazz) {
public static TypeNode withExceptionClazz(Class<?> clazz) {
Preconditions.checkState(Exception.class.isAssignableFrom(clazz));
return withReference(ConcreteReference.withClazz(clazz));
}
Expand Down Expand Up @@ -200,11 +200,11 @@ public boolean isPrimitiveType() {
}

public boolean isProtoPrimitiveType() {
return isPrimitiveType() || this.equals(TypeNode.STRING) || this.equals(TypeNode.BYTESTRING);
return isPrimitiveType() || equals(TypeNode.STRING) || equals(TypeNode.BYTESTRING);
}

public boolean isSupertypeOrEquals(TypeNode other) {
boolean oneTypeIsNull = this.equals(TypeNode.NULL) ^ other.equals(TypeNode.NULL);
boolean oneTypeIsNull = equals(TypeNode.NULL) ^ other.equals(TypeNode.NULL);
return !isPrimitiveType()
&& !other.isPrimitiveType()
&& isArray() == other.isArray()
Expand Down Expand Up @@ -256,20 +256,6 @@ boolean isBoxedTypeEquals(TypeNode other) {
return Objects.equals(other, BOXED_TYPE_MAP.get(this));
}

private static TypeNode createPrimitiveType(TypeKind typeKind) {
if (!isPrimitiveType(typeKind)) {
throw new IllegalArgumentException("Object is not a primitive type.");
}
return TypeNode.builder().setTypeKind(typeKind).build();
}

private static TypeNode createPrimitiveArrayType(TypeKind typeKind) {
if (typeKind.equals(TypeKind.OBJECT)) {
throw new IllegalArgumentException("Object is not a primitive type.");
}
return TypeNode.builder().setTypeKind(typeKind).setIsArray(true).build();
}

private static boolean isPrimitiveType(TypeKind typeKind) {
return !typeKind.equals(TypeKind.OBJECT);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ public abstract class UnaryOperationExpr implements OperationExpr {

public abstract Expr expr();

@Override
public abstract OperatorKind operatorKind();

@Override
public abstract TypeNode type();

@Override
public void accept(AstNodeVisitor visitor) {
visitor.visit(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@

public class ImportWriterVisitor implements AstNodeVisitor {
private static final String DOT = ".";
private static final String NEWLINE = "\n";
private static final String PKG_JAVA_LANG = "java.lang";

private final Set<String> staticImports = new TreeSet<>();
Expand All @@ -94,7 +93,7 @@ public void clear() {

public void initialize(@Nonnull String currentPackage) {
this.currentPackage = currentPackage;
this.currentClassName = null;
currentClassName = null;
}

public void initialize(@Nonnull String currentPackage, @Nonnull String currentClassName) {
Expand Down
Loading

0 comments on commit ce5da94

Please sign in to comment.