Skip to content

Commit

Permalink
Update build.gradle.kts
Browse files Browse the repository at this point in the history
  • Loading branch information
squid233 committed Dec 18, 2023
1 parent dc5de83 commit 9854bc9
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,6 @@ plugins {
//application
}

data class PublicationRepo(
val name: String,
val usernameFrom: List<String>,
val passwordFrom: List<String>,
val snapshotRepo: String,
val releaseRepo: String,
val snapshotPredicate: (String) -> Boolean = { it.endsWith("-SNAPSHOT") }
)

val hasPublication: String by rootProject
val publicationSigning: String by rootProject
val publicationRepo: PublicationRepo? = if (hasPublication.toBoolean()) PublicationRepo(
name = "OSSRH",
usernameFrom = listOf("OSSRH_USERNAME", "ossrhUsername"),
passwordFrom = listOf("OSSRH_PASSWORD", "ossrhPassword"),
snapshotRepo = "https://s01.oss.sonatype.org/content/repositories/snapshots/",
releaseRepo = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
) else null

data class Organization(
val name: String,
val url: String
)

data class Developer(
val id: String,
val name: String? = null,
val email: String? = null,
val url: String? = null,
val organization: Organization? = projOrg,
val roles: Set<String>? = null,
val timezone: String? = null,
val properties: Map<String, String?>? = null
)

val projDevelopers = arrayOf(
Developer("example")
)

val hasJavadocJar: String by rootProject
val hasSourcesJar: String by rootProject

Expand All @@ -69,6 +30,45 @@ val jdkEarlyAccessDoc: String? by rootProject

val targetJavaVersion = jdkVersion.toInt()

val projDevelopers = arrayOf(
Developer("example")
)

data class Organization(
val name: String,
val url: String
)

data class Developer(
val id: String,
val name: String? = null,
val email: String? = null,
val url: String? = null,
val organization: Organization? = projOrg,
val roles: Set<String>? = null,
val timezone: String? = null,
val properties: Map<String, String?>? = null
)

data class PublicationRepo(
val name: String,
val usernameFrom: List<String>,
val passwordFrom: List<String>,
val snapshotRepo: String,
val releaseRepo: String,
val snapshotPredicate: (String) -> Boolean = { it.endsWith("-SNAPSHOT") }
)

val hasPublication: String by rootProject
val publicationSigning: String by rootProject
val publicationRepo: PublicationRepo? = if (hasPublication.toBoolean()) PublicationRepo(
name = "OSSRH",
usernameFrom = listOf("OSSRH_USERNAME", "ossrhUsername"),
passwordFrom = listOf("OSSRH_PASSWORD", "ossrhPassword"),
snapshotRepo = "https://s01.oss.sonatype.org/content/repositories/snapshots/",
releaseRepo = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
) else null

group = projGroupId
version = projVersion

Expand Down

0 comments on commit 9854bc9

Please sign in to comment.