Skip to content

Commit 89f02cf

Browse files
authored
Resolves #1637: Stop publishing proto2 version of our artifacts (#2444)
* update minor version to 3.4 from 3.3 * Resolves #1637: Stop publishing proto2 version of our artifacts Consolidates our protobuf version to proto3. This removes the proto2 specific directories and places them into the main source directories. This also removes the `-pb3` suffix from our artifact names, so users should switch over to the un-suffixed package names This resolves #1637.
1 parent 4e6efd0 commit 89f02cf

36 files changed

+71
-1175
lines changed

.idea/compiler.xml

+10-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

+2-19
Original file line numberDiff line numberDiff line change
@@ -198,25 +198,8 @@ subprojects {
198198
}
199199

200200
ext {
201-
if (System.getenv('PROTO_VERSION') != null) {
202-
protoMajorVersion = System.getenv('PROTO_VERSION')
203-
} else {
204-
protoMajorVersion = '3'
205-
}
206-
if (protoMajorVersion == "2") {
207-
protobufVersion = protobuf2Version
208-
} else if (protoMajorVersion == "3") {
209-
protobufVersion = protobuf3Version
210-
} else {
211-
throw new GradleException("Unknown protobuf major version: ${protoMajorVersion}")
212-
}
213-
if (protoMajorVersion != "2") {
214-
coreProjectName = "fdb-record-layer-core-pb${protoMajorVersion}"
215-
shadedProjectName = "fdb-record-layer-core-pb${protoMajorVersion}-shaded"
216-
} else {
217-
coreProjectName = "fdb-record-layer-core"
218-
shadedProjectName = "fdb-record-layer-core-shaded"
219-
}
201+
coreProjectName = "fdb-record-layer-core"
202+
shadedProjectName = "fdb-record-layer-core-shaded"
220203
}
221204

222205
artifacts {

build.py

+16-53
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,10 @@ def print_with_date(text):
4343
print ('{0} {1}'.format(date_string(), text))
4444

4545
# Constructs the gradle run path given the gradle args.
46-
def run_gradle(proto_version, *args):
47-
env = dict(os.environ)
46+
def run_gradle(*args):
4847
full_args = [os.path.join(dir_path, 'gradlew'), '--console=plain', '-b', os.path.join(dir_path, 'build.gradle'), ] + list(args)
49-
print_with_date('Running gradle build: {0}; Proto version: {1}'.format(' '.join(full_args), proto_version))
50-
env['PROTO_VERSION'] = str(proto_version)
51-
proc = subprocess.Popen(full_args, env=env)
48+
print_with_date('Running gradle build: {0}'.format(' '.join(full_args)))
49+
proc = subprocess.Popen(full_args)
5250
proc.communicate()
5351

5452
if proc.returncode != 0:
@@ -114,7 +112,7 @@ def get_version(release=False):
114112
return version
115113

116114
# Move all of the publishable files to a temporary directory.
117-
def build(release=False, proto2=False, proto3=False, publish=False):
115+
def build(release=False, publish=False):
118116
print_with_date('Running build script within directory: {0}'.format(dir_path))
119117

120118
print_with_date('Clearing temporary directory.')
@@ -128,54 +126,24 @@ def build(release=False, proto2=False, proto3=False, publish=False):
128126
# Clear before.
129127
clear(os.path.join(dir_path, TEMP_ROOT))
130128

131-
if proto2:
132-
# Make with protobuf 2.
133-
success = run_gradle(2, 'clean', 'build', 'destructiveTest',
134-
'-PreleaseBuild={0}'.format('true' if release else 'false'))
135-
if not success:
136-
return False
137-
138-
if publish:
139-
success = run_gradle(2, 'artifactoryPublish', '-PpublishBuild=true',
140-
'-PreleaseBuild={0}'.format('true' if release else 'false'))
141-
if not success:
142-
return False
143-
144-
success = run_gradle(2, 'fdb-record-layer-core:clean')
145-
if not success:
146-
return False
129+
success = run_gradle('clean', 'build', 'destructiveTest',
130+
'-PreleaseBuild={0}'.format('true' if release else 'false'))
131+
if not success:
132+
return False
147133

148-
if proto3:
149-
# Make with protobuf 3.
150-
success = run_gradle(3, 'build', 'destructiveTest', '-PcoreNotStrict',
151-
'-PreleaseBuild={0}'.format('true' if release else 'false'),
152-
'-PpublishBuild={0}'.format('true' if publish else 'false'))
153-
if not success:
134+
if publish:
135+
success = run_gradle('artifactoryPublish', '-PpublishBuild=true',
136+
'-PreleaseBuild={0}'.format('true' if release else 'false'))
137+
if not success
154138
return False
155139

156-
if publish:
157-
# These are enumerated rather than just using the full project artifactoryPublish command to avoid uploading
158-
# the fdb-extensions subproject twice. (Note that as overwrite is not supported, doing so would result
159-
# in the build failing.)
160-
success = run_gradle(3, ':fdb-record-layer-core-pb3:artifactoryPublish',
161-
':fdb-record-layer-core-pb3-shaded:artifactoryPublish',
162-
':fdb-record-layer-icu-pb3:artifactoryPublish',
163-
':fdb-record-layer-spatial-pb3:artifactoryPublish',
164-
':fdb-record-layer-lucene-pb3:artifactoryPublish',
165-
'-PcoreNotStrict',
166-
'-PreleaseBuild={0}'.format('true' if release else 'false'),
167-
'-PpublishBuild=true')
168-
if not success:
169-
return False
170-
171-
172140
return True
173141

174142
usage = """
175-
Usage: python build.py <release|snapshot> [--proto2] [--proto3] [--publish]
143+
Usage: python build.py <release|snapshot> [--publish]
176144
Builds the packages for this project. You must specify release or snapshot
177-
The --proto2 flag indicates that the build should use protobuf 2.
178-
The --proto3 flag indicates that the build should use protobuf 3.
145+
The --proto2 flag is ignored (previously would use protobuf 2)
146+
The --proto3 flag is ignored (previously would use protobuf 3)
179147
The --publish flag indicates that the build should be published upon completion.
180148
"""
181149
def parse_args():
@@ -203,18 +171,13 @@ def parse_args():
203171
print ('Unrecognized argument: {0}'.format(arg))
204172
quit(3)
205173

206-
# run both proto2 and proto3 by default
207-
if not ret.proto2 and not ret.proto3:
208-
ret.proto2 = True
209-
ret.proto3 = True
210-
211174
return ret
212175

213176
if __name__ == "__main__":
214177
print_with_date('Starting build')
215178
success = True
216179
args = parse_args()
217-
success = success and build(release=args.release, proto2=args.proto2, proto3=args.proto3, publish=args.publish)
180+
success = success and build(release=args.release, publish=args.publish)
218181

219182
if not success:
220183
print_with_date('Build failed!')

docs/ReleaseNotes.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ This document contains a log of changes to the FoundationDB Record Layer. It aim
55

66
As the [versioning guide](Versioning.md) details, it cannot always be determined solely by looking at the version numbers whether one Record Layer version contains all changes included in another. In particular, bug fixes and backwards-compatible changes might be back-ported to or introduced as patches against older versions. To track when a patch version has been included in the main release train, some releases will say as a note that they contain all changes from a specific patch.
77

8-
## 3.3
8+
## 3.4
99

1010
### Breaking Changes
1111

12-
The Guava dependency version has been updated to 31.1. Projects may need to check for compatibility with their own versions of the dependency, or they may need to consider using the shaded artifact if the new version is incompatible.
12+
Support for the Protobuf 2 runtime has been removed as of this version. All artifacts now use Protobuf version 3. Note that the choice of Protobuf runtime version is distinct from the choice of Protobuf message syntax, and that users wishing to retain Protobuf 2 behavior can still achieve the same semantics (including [optional field behavior]()) as long as they specify the syntax on their Protobuf file as `proto2`. Note that the Maven artifacts using Protobuf version 3 used to be suffixed with `-pb3`. Existing Protobuf 3 users must remove that suffix from their dependency declarations (e.g., `fdb-record-layer-core-pb3` should now be `fdb-record-layer-core`).
1313

1414
<!--
1515
// begin next release
@@ -31,14 +31,21 @@ The Guava dependency version has been updated to 31.1. Projects may need to chec
3131
* **Feature** Feature 4 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
3232
* **Feature** Feature 5 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
3333
* **Breaking change** Change 1 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
34-
* **Breaking change** Change 2 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
34+
* **Breaking change** Support for the Protobuf 2 runtime has been removed from all artifacts [(Issue #1637)](https://github.com/FoundationDB/fdb-record-layer/issues/1637)
3535
* **Breaking change** Change 3 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
3636
* **Breaking change** Change 4 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
3737
* **Breaking change** Change 5 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
3838
3939
// end next release
4040
-->
4141

42+
## 3.3
43+
44+
### Breaking Changes
45+
46+
The Guava dependency version has been updated to 31.1. Projects may need to check for compatibility with their own versions of the dependency, or they may need to consider using the shaded artifact if the new version is incompatible.
47+
48+
4249
### 3.3.446.0
4350

4451

docs/Versioning.md

+6-8
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22

33
## Variants
44

5-
The Record Layer is released in several variants, depending on which version of the Protobuf API is used and whether or not Protobuf is renamed ("shaded").
5+
The Record Layer is released in two variants, depending on not Protobuf is renamed ("shaded").
66

7-
| | Protobuf 2 | Protobuf 3 |
8-
|:------------:|:------------------------------:|:----------------------------------:|
9-
| **Unshaded** | `fdb-record-layer-core` | `fdb-record-layer-core-pb3` |
10-
| **Shaded** | `fdb-record-layer-core-shaded` | `fdb-record-layer-core-pb3-shaded` |
7+
* **Unshaded**: `fdb-record-layer-core`
8+
* **Shaded**: `fdb-record-layer-core-shaded`
119

1210
In the shaded versions, `com.google` classes will be renamed to `com.apple.foundationdb.record.shaded.com.google`.
1311

14-
Code generated by one version of `protoc` is generally *not* compatible with the Protobuf runtime classes from another version.
12+
Note that code generated by one version of `protoc` is generally *not* compatible with the Protobuf runtime classes from another version. For that reason, it is suggested that the adopter keep their `protoc` version aligned with the Protobuf runtime used by the Record Layer library.
1513

1614
### Maven Dependency
1715

@@ -32,7 +30,7 @@ Then the following dependency can be added:
3230
```
3331
<groupId>org.foundationdb</groupId>
3432
<artifactId>fdb-record-layer-core</artifactId>
35-
<version>3.3.+</version>
33+
<version>3.4.+</version>
3634
```
3735

3836
Older builds are also available in the maven central repository, and newer builds will be published there upon the resolution of [Issue #1288](https://github.com/FoundationDB/fdb-record-layer/issues/1288).
@@ -53,7 +51,7 @@ repositories {
5351
Then the following dependency can be added:
5452

5553
```
56-
"org.foundationdb:fdb-record-layer-core:3.3.+"
54+
"org.foundationdb:fdb-record-layer-core:3.4.+"
5755
```
5856

5957
Older builds are also available in the `mavenCentral()` repository, and newer builds will be published there upon the resolution of [Issue #1288](https://github.com/FoundationDB/fdb-record-layer/issues/1288).

fdb-record-layer-core-shaded/fdb-record-layer-core-shaded.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ publishing {
8484
from project.shadow.component(publication)
8585
addPublishingInfo(publication) // function imported from publishing.gradle
8686
publication.pom { pom ->
87-
description = 'A record-oriented layer built for FoundationDB (shaded artifacts; proto' + project.protoMajorVersion + ').'
87+
description = 'A record-oriented layer built for FoundationDB (shaded artifacts).'
8888
pom.withXml { xml ->
8989
// Remove any existing dependencies sections
9090
def childNodes = xml.asNode().children()

fdb-record-layer-core/fdb-record-layer-core.gradle

+1-5
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,8 @@ dependencies {
5959

6060
sourceSets {
6161
main {
62-
java.srcDir "src/main/java-proto${protoMajorVersion}"
6362
java.srcDir ".out/generated/sources/annotationProcessor/java/main/"
6463
}
65-
test {
66-
java.srcDir "src/test/java-proto${protoMajorVersion}"
67-
}
6864
}
6965

7066
test {
@@ -142,7 +138,7 @@ publishing {
142138
// Normally, the variable would be included within the string using variable expansion in a Groovy
143139
// string. However, the "description" field must be a java.lang.String, hence the use of string
144140
// concatenation here.
145-
description = 'A record-oriented layer built for FoundationDB (proto' + project.protoMajorVersion + ').'
141+
description = 'A record-oriented layer built for FoundationDB.'
146142
}
147143
}
148144
}

fdb-record-layer-core/src/main/java-proto2/com/apple/foundationdb/record/metadata/MetaDataEvolutionProtoSyntaxValidator.java

-40
This file was deleted.

fdb-record-layer-core/src/main/java-proto2/com/google/protobuf/ZeroCopyByteString.java

-37
This file was deleted.

0 commit comments

Comments
 (0)