Commit graph

195 commits

Author SHA1 Message Date
Samuel Benzaquen
e6ee74af87 Updating version.json and repo version numbers to: 36.0-dev (#26991)
NOTE: This should be reviewed and imported via Copybara per the normal PR review process.

Closes #26991

PiperOrigin-RevId: 902788011
2026-04-20 13:14:04 -07:00
Protobuf Team Bot
8227cf1630 Updating version.json and repo version numbers to: 35-dev 2026-01-22 07:25:02 -08:00
Sandy Zhang
7beda33399 Clean up dead dist_files targets.
PiperOrigin-RevId: 851412528
2026-01-02 12:19:11 -08:00
Kurt Alfred Kluever
4cfa68115a Automated Code Change
PiperOrigin-RevId: 840238785
2025-12-04 07:53:47 -08:00
honglooker
6d00d87830 Updating version.json and repo version numbers to: 34.0-dev (#23738)
NOTE: This should be reviewed and imported via Copybara per the normal PR review process.

Closes #23738

PiperOrigin-RevId: 814297739
2025-10-02 10:51:16 -07:00
Protobuf Team Bot
c497523cb4 Add annotation to Hide Kotlin DSL factory functions from Objective-C
Introduces a new annotation that can be used specifically for hiding Kotlin generated functions that cause name collisions in Objective-C.

PiperOrigin-RevId: 814251585
2025-10-02 08:57:08 -07:00
Adam Cozzette
00c3c30cbc Updating version.json and repo version numbers to: 33.0-dev (#22710)
NOTE: This should be reviewed and imported via Copybara per the normal PR review process.

Closes #22710

PiperOrigin-RevId: 785626334
2025-07-21 17:02:17 -07:00
Mike Kruskal
7c6fdcaab4 Internal changes
PiperOrigin-RevId: 753361198
2025-04-30 16:45:16 -07:00
jparachoniak
9af06d300a Internal change
PiperOrigin-RevId: 753317654
2025-04-30 14:43:23 -07:00
Jason Lunn
452984bf81 Updating version.json and repo version numbers to: 32.0-dev (#21351)
NOTE: This should be reviewed and imported via Copybara per the normal PR review process.

Closes #21351

PiperOrigin-RevId: 751446098
2025-04-25 09:22:00 -07:00
Deanna Garcia
73401b08e8 Make java builds bazel 8 compatible.
The other java tests are blocked on figuring out how to make compatibility tests work with bazel 8 so they will follow. This PR unblocks other bazel 8 tests that are breaking on these issues.

PiperOrigin-RevId: 744076994
2025-04-04 14:52:57 -07:00
Sandy Zhang
4c7b7a971c Restore custom protobuf maven namespaces to avoid polluting main maven namespace for non-dev dependencies as well.
Fixes #20674

PiperOrigin-RevId: 738081837
2025-03-18 11:31:17 -07:00
Mike Kruskal
079be27925 Remove Java runtime classes from kotlin release.
Because we build lite and core totally separately, they can't both be depended on without producing conflicts.  Our kotlin setup has been doing exactly this for a long time though, in order to share code between kotlin and kotlin-lite.  Even *with* this change, it's invalid to depend on both lite and core, because they contain different builds of our boostrapped protos.  However, they now share the internal `lite_runtime_only` target, which kotlin can reuse to share code.

This prevents `lite` from getting linked into kotlin, allowing kt_jvm_export to properly strip out all classes from the Java runtime.

Fixes #20566

PiperOrigin-RevId: 734387194
2025-03-06 20:39:03 -08:00
Protobuf Team Bot
28de0ebcdd Run buildifier
Adds missing loads for Java rules.
Remove unused loads.
Some other minor fixes.

PiperOrigin-RevId: 728701378
2025-02-19 09:27:02 -08:00
deannagarcia
92db7e2c04 Updating version.json and repo version numbers to: 31.0-dev (#20237)
NOTE: This should be reviewed and imported via Copybara per the normal PR review process.

Closes #20237

PiperOrigin-RevId: 723968086
2025-02-06 09:41:40 -08:00
Adam Cozzette
0d42a969e3 Replace protobuf_unittest package with proto2_unittest
For historical reasons, our internal copy of the codebase uses
`proto2_unittest` while the open source one uses `protobuf_unittest`. This adds
a lot of friction to syncing between the two, and there's no great reason to
keep maintaining this difference, so let's just go with `proto2_unittest`.

PiperOrigin-RevId: 721951543
2025-01-31 17:06:33 -08:00
deannagarcia
27ddb9ce34 Give Kotlin jars an OSGi Manifest (#18812)
Extend our Java OSGi library to have a version that works for Kotlin. Add a `protobuf_versioned_kt_jvm_library` that creates a bundle with the OSGi manifest and call that instead of `kt_jvm_library` for all our kotlin maven release targets.

Closes #18812

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/18812 from deannagarcia:kotlinOSGi 81bab06f61
PiperOrigin-RevId: 686220820
2024-10-15 13:36:19 -07:00
Joe Schafer
44660b306a Rename maven to protobuf_maven in MODULE.bazel (#18641)
The default name for the rules_jvm_external.maven rule is "maven". When not set, it defaults to "maven". For root modules also using rules_jvm_external, the name clash causes a warning:

```
DEBUG: $TMP/external/rules_jvm_external~/private/extensions/maven.bzl:154:14:
The maven repository 'maven' is used in two different bazel modules,
originally in '<my_workspace>' and now in 'protobuf'
```

Summarizing @shs96c in [1]:

> The common maven repo name allows rulesets to contribute to the user's JARs.
> However, this implies that maven is for the end user, not for transitive
> dependencies. If a ruleset needs private dependencies, it should use a custom
> namespace rather than the maven namespace.

Since protobuf is not contributing to user's JARs, we'll use a custom namespace. There's precedent for using a custom namespace for library modules:

- rules_jvm_external uses `rules_jvm_external_deps` instead of `maven`.
- rules_kotlin uses `kotlin_rules_maven` instead of `maven`.

[1]: https://github.com/bazel-contrib/rules_jvm_external/issues/916#issuecomment-1645527584

Fixes #16839.

Closes #18641

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/18641 from jschaf:joe/protobuf-maven bd2c62f311
PiperOrigin-RevId: 684625084
2024-10-10 17:02:43 -07:00
Mike Kruskal
1fe26cf0c1 Updating version.json and repo version numbers to: 30.0-dev (#18567)
NOTE: This should be reviewed and imported via Copybara per the normal PR review process.

Closes #18567

PiperOrigin-RevId: 680760252
2024-09-30 16:36:48 -07:00
Zoey Greer
5d9deab879 Replace deprecated use of toBytes() with Character property .code (#18236)
Addresses the warning which is otherwise output during build asking that we do this.

Closes #18236

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/18236 from tempoz:tempoz-fix-deprecated-use-of-to-bytes bb2398c45d
PiperOrigin-RevId: 673844589
2024-09-12 07:55:55 -07:00
Protobuf Team Bot
673a892bd9 Internal change
PiperOrigin-RevId: 667664794
2024-08-26 12:05:17 -07:00
Deanna Garcia
501fb26927 Add kotlin deprecation to messageOrNull extension properties in the generated code when the corresponding message is deprecated.
Additionally adds tests to ensure deprecated fields are properly annotated as such.

Fixes https://github.com/protocolbuffers/protobuf/issues/17084.

PiperOrigin-RevId: 653731276
2024-07-18 13:18:10 -07:00
Protobuf Team Bot
507ba36e29 Support building //java with bzlmod
Create WORKSPACE.bzlmod. Before building with Bzlmod resulted in use of full WORKSPACE.
Some repos are still there, but the file should eventually be empty.

Add dep to rules_kotlin 1.9.0. This was the first version available on BCR. It pushed upgrade of
rules_jvm_external to 6.0 and rules_java to 6.5.2 (keep 6.0.0 on Bazel 6.3.0).

Add missing maven and other deps to MODULE.bazel

CI changes:
Disable Bazel 6.4.0 with bzlmod. rules_jvm_external 6.0 use use_repo_rule, which is not supported by Bazel 6.
Add C++ build "Bazel7 with Bzlmod" enabled.
Add Java builds with "Bazel 7 with/without Bzlmod".

Fixes: https://github.com/protocolbuffers/protobuf/issues/17176
PiperOrigin-RevId: 652773197
2024-07-16 03:42:04 -07:00
zhangskz
8e60d9f166 Updating version.json and repo version numbers to: 29.0-dev (#17432)
NOTE: This should be reviewed and imported via Copybara per the normal PR review process.

Closes #17432

PiperOrigin-RevId: 652511521
2024-07-15 09:50:38 -07:00
Éamonn McManus
39a1c6a46e In the Kotlin DSL, reference builder methods with property syntax.
Instead of _builder.getFoo() and _builder.setFoo(value), the generated code now uses _builder.foo and _builder.foo = value. When compiling against the Java Proto API, this makes no difference, since the Kotlin compiler treats Java methods getFoo/setFoo as defining a Kotlin property foo. But if a compatible proto API is implemented in Kotlin then there is no such equivalence. Such an implementation would have to define either both forms or just the one that the DSL uses. For a Kotlin API it is more natural to use properties.

Similarly, the generated Java methods getFoosList(), getFoosCount(), getFoosMap(), and getEnumValue() are accessed via property names (foosList, foosCount, foosMap, enumValue).

(This is the second application of this change. The first had to be rolled back because it didn't handle conflict-resolution names correctly.)

PiperOrigin-RevId: 629807104
2024-05-01 12:49:52 -07:00
Éamonn McManus
c24e7529eb Automated rollback of commit e9c9970eb4.
PiperOrigin-RevId: 629405086
2024-04-30 07:32:38 -07:00
Éamonn McManus
e9c9970eb4 In the Kotlin DSL, reference builder methods with property syntax.
Instead of `_builder.getFoo()` and `_builder.setFoo(value)`, the generated code now uses `_builder.foo` and `_builder.foo = value`. When compiling against the Java Proto API, this makes no difference, since the Kotlin compiler treats Java methods `getFoo`/`setFoo` as defining a Kotlin property `foo`. But if a compatible proto API is implemented in Kotlin then there is no such equivalence. Such an implementation would have to define either both forms or just the one that the DSL uses. For a Kotlin API it is more natural to use properties.

Similarly, the generated Java methods `getFoosList()`, `getFoosCount()`, `getFoosMap()`, and `getEnumValue()` are accessed via property names (`foosList`, `foosCount`, `foosMap`, `enumValue`).

PiperOrigin-RevId: 629220383
2024-04-29 16:30:52 -07:00
Mike Kruskal
95877d8569 Updating version.json and repo version numbers to: 28-dev (#16555)
Closes #16555

PiperOrigin-RevId: 626081638
2024-04-18 10:47:14 -07:00
Mike Kruskal
ea81024ddf Refactor editions infrastructure to a top-level directory.
The only public target here is the edition defaults helper macro, which can be used by external runtimes and plugins.  None of this code is C++-specific though, and should be organized higher up.  Appropriate aliases are also placed at the top level for public targets

PiperOrigin-RevId: 625392504
2024-04-16 11:13:19 -07:00
Protobuf Team Bot
21d75f861c Remove references to rules_proto
They are not needed after the rules are move into protobuf repo.
Except for the reference to toolchain type, which is currently in rules_proto and can be moved after the implementation is moved into protobuf repo.

PiperOrigin-RevId: 622176865
2024-04-05 07:50:25 -07:00
Protobuf Team Bot
83ec410d30 Internal change
PiperOrigin-RevId: 619377672
2024-03-27 05:50:55 -07:00
Sandy Zhang
369732a581 Add java_features.proto to kotlin_mvn release
PiperOrigin-RevId: 618295219
2024-03-22 15:11:06 -07:00
aiuto
3ab1276bbb Update Bazel references to rules_pkg to the supported file locations. (#15780)
WIP:  I want to see this pass CI first.

Fixes: #15779

3 scripted transforms:
```
  -load("@rules_pkg//:mappings.bzl", ...)
  +load("@rules_pkg//pkg:mappings.bzl", ...)
```
```
  -load("@rules_pkg//:pkg.bzl", "pkg_tar")
  +load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
```
```
  -load("@rules_pkg//:pkg.bzl", "pkg_zip")
  +load("@rules_pkg//pkg:zip.bzl", "pkg_zip")
```

Closes #15780

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/15780 from aiuto:rules_pkg a630276341
PiperOrigin-RevId: 606641398
2024-02-13 09:08:42 -08:00
Dennis Shao
9146ce6ddb Updating version.json and repo version numbers to: 27-dev (#15590)
Closes #15590

PiperOrigin-RevId: 601468713
2024-01-25 09:18:51 -08:00
Joshua Haberman
9188b39fb7 Shorten our license headers into an abbreviated form that references LICENSE instead of including it in full.
PiperOrigin-RevId: 599218886
2024-01-17 10:35:42 -08:00
Protobuf Team Bot
5df0387224 Breaking Change: The base class for generated messages will be
GeneratedMessage, not GeneratedMessageV3.

Please rerun protoc on your .proto files to regenerate the binding code.
https://protobuf.dev/news/2023-12-05/
https://protobuf.dev/support/cross-version-runtime-guarantee/

To fix source compatibility with surrounding code make these replacements:
GeneratedMessageV3 --> GeneratedMessage
SingleFieldBuilderV3 --> SingleFieldBuilder
RepeatedFieldBuilderV3 --> RepeatedFieldBuilder

PiperOrigin-RevId: 597642289
2024-01-11 13:46:48 -08:00
Jie Luo
1231af10c7 merge 25.x to main (#14617)
Closes #14617

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/14617 from anandolee:25.x ac86c5ef32
PiperOrigin-RevId: 578996979
2023-11-02 15:29:36 -07:00
Protobuf Team Bot
3ea774370a Internal change
PiperOrigin-RevId: 578944754
2023-11-02 13:34:12 -07:00
Protobuf Team Bot
6b5d8db01f Updating version.json and repo version numbers to: 25.0 2023-11-01 13:03:44 -07:00
Protobuf Team Bot
ba1aab2baf Updating version.json and repo version numbers to: 25.0-rc2 2023-10-18 09:57:30 -07:00
Protobuf Team Bot
896f3d8ced Updating version.json and repo version numbers to: 25.0-rc1 2023-10-16 12:36:52 -07:00
Adam Cozzette
501ececd39 Reorganize upb file structure
This change moves almost everything in the `upb/` directory up one level, so
that for example `upb/upb/generated_code_support.h` becomes just
`upb/generated_code_support.h`. The only exceptions I made to this were that I
left `upb/cmake` and `upb/BUILD` where they are, mostly because that avoids
conflict with other files and the current locations seem reasonable for now.

The `python/` directory is a little bit of a challenge because we had to merge
the existing directory there with `upb/python/`. I made `upb/python/BUILD` into
the BUILD file for the merged directory, and it effectively loads the contents
of the other BUILD file via `python/build_targets.bzl`, but I plan to clean
this up soon.

PiperOrigin-RevId: 568651768
2023-09-26 14:38:35 -07:00
Sandy Zhang
81068e8e8c Internal change
PiperOrigin-RevId: 566426899
2023-09-18 15:17:56 -07:00
Joshua Haberman
2bea492185 Fixed pre-existing formatting problems.
The presubmit complains about these if you try to modify any of these files.

PiperOrigin-RevId: 564506598
2023-09-11 14:44:52 -07:00
ericsalo
843b74e601 Main 202308091812 (#13489)
Closes #13489

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/13489 from protocolbuffers:main-202308091812 e729f0bf5a
PiperOrigin-RevId: 555301642
2023-08-09 16:02:04 -07:00
Protobuf Team Bot
aba9a7f1a3 Internal change
PiperOrigin-RevId: 555251853
2023-08-09 13:09:58 -07:00
Eric Salo
e729f0bf5a Merge release branch 24.x into main 2023-08-09 11:18:18 -07:00
Protobuf Team Bot
093e258a71 Updating version.json and repo version numbers to: 24.0 2023-08-08 10:26:14 -07:00
Protobuf Team Bot
3487ae0c01 Updating version.json and repo version numbers to: 24.0-rc3 2023-08-01 10:27:01 -07:00
Protobuf Team Bot
961779e164 Add ByteString.isNotEmpty Kotlin extension function.
PiperOrigin-RevId: 552833973
2023-08-01 09:58:28 -07:00