Skip to content

Commit

Permalink
Merge pull request #81 from Bit-Quill/java/dev_lotjonat_modules
Browse files Browse the repository at this point in the history
Java: Modularize wrapper
  • Loading branch information
jonathanl-bq authored Apr 5, 2024
2 parents a422b24 + 9854b13 commit d145d0f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/install-shared-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ runs:
- name: Install protoc (protobuf)
uses: arduino/setup-protoc@v3
with:
version: "25.1"
version: "26.1"
repo-token: ${{ inputs.github-token }}
27 changes: 26 additions & 1 deletion java/client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repositories {
}

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

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

ext {
checkProtocVersion = { String output ->
// Line in format like: libprotoc 26.1
int majorVersion = Integer.parseInt(output.split(" ")[1].split("\\.")[0].trim());
int minorVersion = Integer.parseInt(output.split(" ")[1].split("\\.")[1].trim());
if (majorVersion < 26 || (majorVersion == 26 && minorVersion < 1)) {
throw new GradleException("Use Protoc version 26.1 or later");
}
return output.split(" ")[1]
}
}

tasks.register('protobuf', Exec) {
doFirst {
new ByteArrayOutputStream().withStream { os ->
exec {
commandLine 'protoc', '--version'
workingDir Paths.get(project.rootDir.path, '..').toFile()
standardOutput = os
}
checkProtocVersion(os.toString())
}

project.mkdir(Paths.get(project.projectDir.path, 'src/main/java/glide/models/protobuf').toString())
}
commandLine 'protoc',
Expand Down Expand Up @@ -127,3 +148,7 @@ tasks.withType(Test) {
}
jvmArgs "-Djava.library.path=${projectDir}/../target/debug"
}

jar {
archiveBaseName = "glide-client"
}
12 changes: 12 additions & 0 deletions java/client/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module glide.api {
exports glide.api;
exports glide.api.commands;
exports glide.api.models;
exports glide.api.models.commands;
exports glide.api.models.configuration;
exports glide.api.models.exceptions;

requires com.google.protobuf;
requires io.netty.transport;
requires lombok;
}
2 changes: 1 addition & 1 deletion python/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Software Dependencies
- git
- GCC
- pkg-config
- protoc (protobuf compiler) >= v3.20.0
- protoc (protobuf compiler) >= v26.1
- openssl
- openssl-dev
- rustup
Expand Down

0 comments on commit d145d0f

Please sign in to comment.