Skip to content

Commit d145d0f

Browse files
authored
Merge pull request #81 from Bit-Quill/java/dev_lotjonat_modules
Java: Modularize wrapper
2 parents a422b24 + 9854b13 commit d145d0f

File tree

4 files changed

+40
-3
lines changed

4 files changed

+40
-3
lines changed

.github/workflows/install-shared-dependencies/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ runs:
5656
- name: Install protoc (protobuf)
5757
uses: arduino/setup-protoc@v3
5858
with:
59-
version: "25.1"
59+
version: "26.1"
6060
repo-token: ${{ inputs.github-token }}

java/client/build.gradle

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repositories {
99
}
1010

1111
dependencies {
12-
implementation group: 'com.google.protobuf', name: 'protobuf-java', version: '3.24.3'
12+
implementation group: 'com.google.protobuf', name: 'protobuf-java', version: '4.26.1'
1313
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.13.0'
1414

1515
implementation group: 'io.netty', name: 'netty-handler', version: '4.1.100.Final'
@@ -31,8 +31,29 @@ dependencies {
3131
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.12.4'
3232
}
3333

34+
ext {
35+
checkProtocVersion = { String output ->
36+
// Line in format like: libprotoc 26.1
37+
int majorVersion = Integer.parseInt(output.split(" ")[1].split("\\.")[0].trim());
38+
int minorVersion = Integer.parseInt(output.split(" ")[1].split("\\.")[1].trim());
39+
if (majorVersion < 26 || (majorVersion == 26 && minorVersion < 1)) {
40+
throw new GradleException("Use Protoc version 26.1 or later");
41+
}
42+
return output.split(" ")[1]
43+
}
44+
}
45+
3446
tasks.register('protobuf', Exec) {
3547
doFirst {
48+
new ByteArrayOutputStream().withStream { os ->
49+
exec {
50+
commandLine 'protoc', '--version'
51+
workingDir Paths.get(project.rootDir.path, '..').toFile()
52+
standardOutput = os
53+
}
54+
checkProtocVersion(os.toString())
55+
}
56+
3657
project.mkdir(Paths.get(project.projectDir.path, 'src/main/java/glide/models/protobuf').toString())
3758
}
3859
commandLine 'protoc',
@@ -127,3 +148,7 @@ tasks.withType(Test) {
127148
}
128149
jvmArgs "-Djava.library.path=${projectDir}/../target/debug"
129150
}
151+
152+
jar {
153+
archiveBaseName = "glide-client"
154+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module glide.api {
2+
exports glide.api;
3+
exports glide.api.commands;
4+
exports glide.api.models;
5+
exports glide.api.models.commands;
6+
exports glide.api.models.configuration;
7+
exports glide.api.models.exceptions;
8+
9+
requires com.google.protobuf;
10+
requires io.netty.transport;
11+
requires lombok;
12+
}

python/DEVELOPER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Software Dependencies
1616
- git
1717
- GCC
1818
- pkg-config
19-
- protoc (protobuf compiler) >= v3.20.0
19+
- protoc (protobuf compiler) >= v26.1
2020
- openssl
2121
- openssl-dev
2222
- rustup

0 commit comments

Comments
 (0)