update maven pusblish

This commit is contained in:
tursom 2021-08-13 21:23:48 +08:00
parent 57407ce8fb
commit 0362e50856
28 changed files with 82 additions and 3 deletions

3
.gitignore vendored
View File

@ -6,4 +6,5 @@
build
*/build/
#gradle.properties
local.properties
local.properties
!.idea/codeStyles

View File

@ -1,4 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.util.*
ext["netty.version"] = "4.1.59.Final"
ext["excludeTest"] = { project: Project, tasks: TaskContainer ->
@ -14,7 +15,30 @@ ext["excludeTest"] = { project: Project, tasks: TaskContainer ->
}
}
}
ext["publishRepositories"] = { project: Project, p: PublishingExtension ->
val artifactoryUser: String by rootProject
val artifactoryPassword: String by rootProject
p.repositories {
maven {
val releasesRepoUrl = uri("https://nvm.tursom.cn/repository/maven-releases/")
val snapshotRepoUrl = uri("https://nvm.tursom.cn/repository/maven-snapshots/")
url = if (project.version.toString().endsWith("SNAPSHOT")) snapshotRepoUrl else releasesRepoUrl
credentials {
username = artifactoryUser
password = artifactoryPassword
}
}
}
}
try {
val properties = Properties()
properties.load(rootProject.file("local.properties").inputStream())
properties.forEach { (k, v) ->
rootProject.ext.set(k.toString(), v)
}
} catch (e: Exception) {
}
plugins {
kotlin("jvm") version "1.5.21"
@ -23,7 +47,7 @@ plugins {
allprojects {
group = "cn.tursom"
version = "0.2"
version = "1.0"
repositories {
mavenLocal()
@ -52,7 +76,7 @@ allprojects {
}
}
@kotlin.Suppress("UNCHECKED_CAST")
@Suppress("UNCHECKED_CAST")
(rootProject.ext["excludeTest"] as (Project, TaskContainer) -> Unit)(project, tasks)
dependencies {
@ -70,6 +94,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -19,6 +19,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -32,6 +32,8 @@ artifacts {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -21,6 +21,8 @@ artifacts {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -18,6 +18,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -16,6 +16,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -16,6 +16,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -18,6 +18,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -16,6 +16,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -16,6 +16,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -18,6 +18,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -16,6 +16,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -18,6 +18,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -21,6 +21,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -16,6 +16,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -18,6 +18,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -23,6 +23,8 @@ artifacts {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -17,6 +17,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -17,6 +17,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -21,6 +21,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -20,6 +20,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -17,6 +17,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -18,6 +18,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -20,6 +20,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -19,6 +19,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -20,6 +20,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()

View File

@ -20,6 +20,8 @@ tasks.register("install") {
}
publishing {
@Suppress("UNCHECKED_CAST")
(rootProject.ext["publishRepositories"] as (Project, PublishingExtension) -> Unit)(project, this)
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()