diff --git a/.github/workflows/install-shared-dependencies/action.yml b/.github/workflows/install-shared-dependencies/action.yml index 42747ac0be..00f5481d8a 100644 --- a/.github/workflows/install-shared-dependencies/action.yml +++ b/.github/workflows/install-shared-dependencies/action.yml @@ -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 }} diff --git a/java/client/build.gradle b/java/client/build.gradle index 07962a8b02..44315cd843 100644 --- a/java/client/build.gradle +++ b/java/client/build.gradle @@ -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' @@ -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', @@ -127,3 +148,7 @@ tasks.withType(Test) { } jvmArgs "-Djava.library.path=${projectDir}/../target/debug" } + +jar { + archiveBaseName = "glide-client" +} diff --git a/java/client/src/main/java/module-info.java b/java/client/src/main/java/module-info.java new file mode 100644 index 0000000000..4d96d95958 --- /dev/null +++ b/java/client/src/main/java/module-info.java @@ -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; +} diff --git a/python/DEVELOPER.md b/python/DEVELOPER.md index 3368616b69..736d1c2ba6 100644 --- a/python/DEVELOPER.md +++ b/python/DEVELOPER.md @@ -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