Skip to content

Commit

Permalink
github packages publish. update kotlin and gradle wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
TheEvilRoot committed Jul 31, 2021
1 parent d8d74a1 commit 555a325
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.gradle/
build/
out/
local.properties
27 changes: 25 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.konan.properties.Properties

plugins {
`maven-publish`
kotlin("jvm") version "1.4.10"
kotlin("jvm") version "1.5.21"
}

group = "me.theevilroot"
Expand All @@ -14,7 +15,7 @@ repositories {
}

dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1")
testImplementation("junit:junit:4.13")
}

Expand All @@ -24,13 +25,35 @@ val sourcesJar by tasks.registering(Jar::class) {
}

publishing {
repositories {
maven {
val localProps = Properties()
if (rootProject.file("local.properties").exists())
localProps.load(rootProject.file("local.properties").reader())
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/TheEvilRoot/async-coroutines-socket")
credentials {
username = localProps.getOrDefault("gpr.user",
System.getenv("USERNAME")) as? String?
password = localProps.getOrDefault("gpr.key",
System.getenv("TOKEN")) as? String?
}
}
}
publications {
create<MavenPublication>("maven") {
groupId = "me.theevilroot"
artifactId = "coroutine-async-socket"
version = version
from(components["java"])
}
register<MavenPublication>("gpr") {
groupId = "me.theevilroot"
artifactId = "coroutine-async-socket"
version = version
from(components["java"])
artifact(sourcesJar.get())
}
register("mavenJava", MavenPublication::class) {
from(components["java"])
artifact(sourcesJar.get())
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 555a325

Please sign in to comment.