Skip to content

Commit

Permalink
fixed kotlin plugin publishing and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
krisbitney committed Aug 14, 2023
1 parent 0e0f5dd commit 2a3ca68
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/http-plugin-kt-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Build and Test
run: ./gradlew build
- name: Build
run: ./gradlew assemble
working-directory: ./implementations/kt

- name: Publish
Expand Down
63 changes: 44 additions & 19 deletions implementations/kt/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
kotlin("jvm") version "1.9.0"
id("com.android.library") version "8.2"
kotlin("multiplatform") version "1.9.0"
kotlin("plugin.serialization") version "1.9.0"
id("org.jlleitschuh.gradle.ktlint") version "11.5.0"
id("org.jetbrains.dokka") version "1.8.20"
Expand All @@ -10,29 +11,53 @@ group = "io.polywrap"
version = "0.10.0-SNAPSHOT"

repositories {
google()
mavenCentral()
maven {
url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
}

dependencies {
implementation("io.polywrap:polywrap-client:0.10.0-SNAPSHOT")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.5.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
implementation("io.ktor:ktor-client-core:2.3.2")
implementation("io.ktor:ktor-client-android:2.3.2")
testImplementation(kotlin("test"))
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")
implementation("io.ktor:ktor-client-mock:2.3.2")
maven { url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") }
}

tasks.test {
useJUnitPlatform()
kotlin {
jvm {
jvmToolchain(17)
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
androidTarget {
publishLibraryVariants("release")
}
sourceSets {
val commonMain by getting {
dependencies {
implementation("io.polywrap:polywrap-client:0.10.0-SNAPSHOT")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.5.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
implementation("io.ktor:ktor-client-core:2.3.2")
implementation("io.ktor:ktor-client-android:2.3.2")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")
implementation("io.ktor:ktor-client-mock:2.3.2")
}
}
}
}

kotlin {
jvmToolchain(17)
android {
namespace = "io.polywrap.httpPlugin"
compileSdk = 32
defaultConfig.minSdk = 24
compileOptions {
targetCompatibility = JavaVersion.VERSION_17
}
testOptions {
unitTests.all {
it.enabled = false
}
}
}

// javadoc generation for Maven repository publication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ afterEvaluate {
}
}
}

publications.create<MavenPublication>("jvm") {
from(components["kotlin"])
artifactId = "http-plugin"
}

// Configure all publications
publications.withType<MavenPublication> {
Expand Down Expand Up @@ -102,3 +97,19 @@ signing {
)
sign(publishing.publications)
}

tasks.withType<PublishToMavenRepository> {
dependsOn(
"signJvmPublication",
"signAndroidReleasePublication",
"signKotlinMultiplatformPublication"
)
}

tasks.withType<PublishToMavenLocal> {
dependsOn(
"signJvmPublication",
"signAndroidReleasePublication",
"signKotlinMultiplatformPublication"
)
}
10 changes: 9 additions & 1 deletion implementations/kt/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
pluginManagement {
repositories {
mavenCentral()
google()
gradlePluginPortal()
mavenCentral()
}
resolutionStrategy {
eachPlugin {
if (requested.id.namespace == "com.android") {
useModule("com.android.tools.build:gradle:7.4.2")
}
}
}
}

Expand Down

0 comments on commit 2a3ca68

Please sign in to comment.