Skip to content

Commit

Permalink
Apply 9
Browse files Browse the repository at this point in the history
  • Loading branch information
alancai98 committed Jul 18, 2024
1 parent 40261ef commit eaf90ac
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 31 deletions.
30 changes: 30 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import io.github.gradlenexus.publishplugin.NexusPublishExtension
import java.time.Duration

plugins {
id("io.github.gradle-nexus.publish-plugin")
}

rootProject.run {

plugins.apply("io.github.gradle-nexus.publish-plugin")

extensions.getByType(NexusPublishExtension::class.java).run {

// Documentation for this plugin, see https://github.com/gradle-nexus/publish-plugin/blob/v1.3.0/README.md
this.repositories {
sonatype {
nexusUrl.set(uri("https://aws.oss.sonatype.org/service/local/"))
// For CI environments, the username and password should be stored in
// ORG_GRADLE_PROJECT_sonatypeUsername and ORG_GRADLE_PROJECT_sonatypePassword respectively.
username.set(properties["ossrhUsername"].toString())
password.set(properties["ossrhPassword"].toString())
}
}

// these are not strictly required. The default timeouts are set to 1 minute. But Sonatype can be really slow.
// If you get the error "java.net.SocketTimeoutException: timeout", these lines will help.
connectTimeout.set(Duration.ofMinutes(3))
clientTimeout.set(Duration.ofMinutes(3))
}
}
12 changes: 0 additions & 12 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,3 @@ dependencies {
implementation(Plugins.shadow)
implementation(Plugins.nexus)
}

rootProject.run {
buildscript {
repositories {
gradlePluginPortal()
}
}
apply(plugin = "io.github.gradle-nexus.publish-plugin")
group = rootProject.properties["group"] as String
version = rootProject.properties["version"] as String
}

Original file line number Diff line number Diff line change
Expand Up @@ -164,25 +164,6 @@ abstract class PublishPlugin : Plugin<Project> {
}
}

extensions.getByType(NexusPublishExtension::class.java).run {

// Documentation for this plugin, see https://github.com/gradle-nexus/publish-plugin/blob/v1.3.0/README.md
this.repositories {
sonatype {
nexusUrl.set(uri("https://aws.oss.sonatype.org/service/local/"))
// For CI environments, the username and password should be stored in
// ORG_GRADLE_PROJECT_sonatypeUsername and ORG_GRADLE_PROJECT_sonatypePassword respectively.
username.set(properties["ossrhUsername"].toString())
password.set(properties["ossrhPassword"].toString())
}
}

// these are not strictly required. The default timeouts are set to 1 minute. But Sonatype can be really slow.
// If you get the error "java.net.SocketTimeoutException: timeout", these lines will help.
connectTimeout.set(Duration.ofMinutes(3))
clientTimeout.set(Duration.ofMinutes(3))
}

// Sign only if publishing to Maven Central
extensions.getByType(SigningExtension::class.java).run {
setRequired {
Expand Down
6 changes: 6 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@

rootProject.name = "partiql"

pluginManagement {
repositories {
gradlePluginPortal()
}
}

include(
":custom-ktlint-rules",
"partiql-ast",
Expand Down

0 comments on commit eaf90ac

Please sign in to comment.