Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .arcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"phabricator.uri": "https://phabricator.rubrik.com/"
}
Comment on lines +1 to +3

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might not need this.

1 change: 1 addition & 0 deletions bom/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

plugins {
`java-platform`
`maven-publish`
}

val String.v: String get() = rootProject.extra["$this.version"] as String
Expand Down
53 changes: 51 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ plugins {
id("com.github.vlsi.crlf")
id("com.github.vlsi.gradle-extensions")
id("com.github.vlsi.license-gather") apply false
id("com.github.vlsi.stage-vote-release")
id("com.github.vlsi.stage-vote-release") version "1.90"
}

fun reportsForHumans() = !(System.getenv()["CI"]?.toBoolean() ?: props.bool("CI"))
Expand All @@ -49,6 +49,7 @@ val enableCheckerframework by props()
val skipCheckstyle by props()
val skipAutostyle by props()
val skipJavadoc by props()
val skipSources by props()
val skipForbiddenApis by props()
val enableMavenLocal by props()
val enableGradleMetadata by props()
Expand Down Expand Up @@ -83,7 +84,7 @@ val gitProps by tasks.registering(FindGitAttributes::class) {

val String.v: String get() = rootProject.extra["$this.version"] as String

val buildVersion = "pgjdbc".v + releaseParams.snapshotSuffix
val buildVersion = "pgjdbc".v + "-rubrik"

println("Building pgjdbc $buildVersion")

Expand Down Expand Up @@ -727,3 +728,51 @@ subprojects {
}
}
}

subprojects {
plugins.apply(if (project.name == "bom") "java-platform" else "java-library")

repositories {
mavenCentral()
}

plugins.withType<JavaPlugin> {
configure<JavaPluginExtension> {
if (!skipSources) withSourcesJar()
if (!skipJavadoc) withJavadocJar()
}
}

plugins.withType<JavaPlatformPlugin> {
configure<JavaPlatformExtension> {
allowDependencies()
}
}

plugins.withType<MavenPublishPlugin> {
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(
if (plugins.hasPlugin("java-platform"))
components["javaPlatform"]
else components["java"]
)

artifactId = project.name
}
}

repositories {
maven {
name = "repository.rubrik.com-releases"
url = uri("https://repository.rubrik.com:443/artifactory/rubrik-maven2-local")
credentials {
username = System.getenv("RUBRIK_MAVEN_USER")
password = System.getenv("RUBRIK_MAVEN_API_KEY")
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ private PGStream tryConnect(String user, String database,

// Set the socket timeout if the "socketTimeout" property has been set.
int socketTimeout = PGProperty.SOCKET_TIMEOUT.getInt(info);
if (socketTimeout > 0) {
newStream.getSocket().setSoTimeout(socketTimeout * 1000);
}

// Construct and send an ssl startup packet if requested.
newStream = enableSSL(newStream, sslMode, info, connectTimeout);

// Set the socket timeout for newStream again because enableSSL might return
// a PGStream different from previous newStream.
if (socketTimeout > 0) {
newStream.setNetworkTimeout(socketTimeout * 1000);
}
Expand Down
7 changes: 0 additions & 7 deletions pgjdbc/src/main/java/org/postgresql/util/StreamWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
//#if mvn.project.property.postgresql.jdbc.spec >= "JDBC4.1"
import java.nio.file.Files;
//#endif

/**
* Wrapper around a length-limited InputStream.
Expand Down Expand Up @@ -55,11 +52,7 @@ public StreamWrapper(InputStream stream) throws PSQLException {
if (memoryLength == -1) {
final int diskLength;
final File tempFile =
//#if mvn.project.property.postgresql.jdbc.spec >= "JDBC4.1"
Files.createTempFile(TEMP_FILE_PREFIX, null).toFile();
//#else
File.createTempFile(TEMP_FILE_PREFIX, null);
//#endif
FileOutputStream diskOutputStream = new FileOutputStream(tempFile);
diskOutputStream.write(rawData);
try {
Expand Down
Loading