Skip to content

Commit

Permalink
Merge pull request #744 from splendo/master
Browse files Browse the repository at this point in the history
Track master
  • Loading branch information
Daeda88 authored Nov 13, 2023
2 parents b452a95 + 9220673 commit affcc46
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ jobs:
if: ${{ github.ref_name == 'master' }}
env:
MAVEN_CENTRAL_RELEASE: "true"
run: ./gradlew publishAllPublicationsToSonatypeRepository --stacktrace
run: ./gradlew publishAllPublicationsToSonatypeRepository --stacktrace --no-parallel
8 changes: 4 additions & 4 deletions example/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ kotlin.native.ignoreIncorrectDependencies=true
kotlin.mpp.import.enableKgpDependencyResolution=true

# Kaluga
kaluga.androidGradlePluginVersion=8.1.1
kaluga.kotlinVersion=1.9.10
kaluga.googleServicesGradlePluginVersion=4.3.15
kaluga.kotlinterGradlePluginVersion=3.16.0
kaluga.androidGradlePluginVersion=8.1.3
kaluga.kotlinVersion=1.9.20
kaluga.googleServicesGradlePluginVersion=4.4.0
kaluga.kotlinterGradlePluginVersion=4.0.0
kaluga.atomicFuGradlePluginVersion=0.22.0
2 changes: 1 addition & 1 deletion example/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Nov 04 13:12:48 CET 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ kotlin.native.ignoreIncorrectDependencies=true
kotlin.mpp.import.enableKgpDependencyResolution=true

# Kaluga
kaluga.androidGradlePluginVersion=8.1.2
kaluga.androidGradlePluginVersion=8.1.3
kaluga.kotlinVersion=1.9.20
kaluga.googleServicesGradlePluginVersion=4.4.0
kaluga.kotlinterGradlePluginVersion=4.0.0
Expand Down
2 changes: 1 addition & 1 deletion gradle/copyReports.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tasks.register<Copy>("copyReports") {
group = "publishing"
into(layout.buildDirectory.dir("allReports"))
subprojects.forEach { module ->
from(module.buildDir) {
from(module.layout.buildDirectory.get().asFile) {
include("reports/**")
into(module.name)
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Oct 10 09:58:47 CEST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
19 changes: 11 additions & 8 deletions kaluga-library-components/src/main/kotlin/Component.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Project
import org.gradle.api.tasks.Copy
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.plugin.KotlinJsCompilerType
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree
import org.jetbrains.kotlin.gradle.plugin.mpp.DefaultCInteropSettings
import org.jetbrains.kotlin.gradle.plugin.mpp.Framework
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
Expand Down Expand Up @@ -60,7 +62,7 @@ fun Project.commonComponent(

// output all reports to a single location
tasks.withType<LintTask>().configureEach {
reports.set(mapOf("plain" to rootProject.buildDir.resolve("reports/ktlint/${project.path}-${this.name}.txt")))
reports.set(mapOf("plain" to rootProject.layout.buildDirectory.get().asFile.resolve("reports/ktlint/${project.path}-${this.name}.txt")))
}

afterEvaluate {
Expand All @@ -70,7 +72,7 @@ fun Project.commonComponent(
// creating copy task for the target
val copyTask = tasks.create("copy${targetName.replaceFirstChar { it.titlecase() } }TestResources", Copy::class.java) {
from("src/iosTest/resources/.")
into("$buildDir/bin/$targetName/debugTest")
into("${layout.buildDirectory.get().asFile}/bin/$targetName/debugTest")
}

// apply copy task to the target
Expand All @@ -94,6 +96,7 @@ fun Project.commonComponent(
}
}

@OptIn(ExperimentalKotlinGradlePluginApi::class)
fun KotlinMultiplatformExtension.commonMultiplatformComponent(
currentProject: Project,
iosMainInterop: (NamedDomainObjectContainer<DefaultCInteropSettings>.() -> Unit)? = null,
Expand All @@ -107,7 +110,11 @@ fun KotlinMultiplatformExtension.commonMultiplatformComponent(
}
}

androidTarget("androidLib").publishAllLibraryVariants()
androidTarget("androidLib") {
instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
unitTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
publishAllLibraryVariants()
}
val target: KotlinNativeTarget.() -> Unit =
{
iosMainInterop?.let { mainInterop ->
Expand Down Expand Up @@ -158,7 +165,7 @@ fun KotlinMultiplatformExtension.commonMultiplatformComponent(
}
}

val commonTest = sourceSets.getByName("commonTest").apply {
sourceSets.getByName("commonTest").apply {
dependencies {
implementation(kotlin("test"))
implementation(kotlin("test-common"))
Expand Down Expand Up @@ -193,10 +200,6 @@ fun KotlinMultiplatformExtension.commonMultiplatformComponent(
}
}

sourceSets.maybeCreate("androidLibInstrumentedTest").apply {
dependsOn(commonTest)
}

sourceSets.all {
languageSettings {
optIn("kotlinx.coroutines.DelicateCoroutinesApi")
Expand Down

0 comments on commit affcc46

Please sign in to comment.