Skip to content

Commit 9eb68c7

Browse files
authored
Rework Gradle setup + Add SuspendApp to the main repo (#3577)
1 parent 3195967 commit 9eb68c7

File tree

56 files changed

+973
-1049
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+973
-1049
lines changed

.github/workflows/pull_request.yml

+53-23
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ jobs:
4141
name: 'reports-check'
4242
path: '**/build/reports/**'
4343

44-
ios_watchos:
45-
runs-on: macos-14
44+
update_api:
45+
runs-on: ubuntu-latest
4646
timeout-minutes: 60
4747

4848
steps:
@@ -61,17 +61,16 @@ jobs:
6161
with:
6262
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
6363

64-
- name: iOS and watchOS tests
65-
run: ./gradlew iosSimulatorArm64Test iosX64Test watchosSimulatorArm64Test watchosX64Test --parallel --scan
64+
- name: Update API files
65+
run: ./gradlew apiDump
6666

67-
- name: Upload reports
68-
if: failure()
69-
uses: actions/upload-artifact@v4
67+
- name: Commit updated API files
68+
uses: stefanzweifel/git-auto-commit-action@v5
7069
with:
71-
name: 'reports-ios_watchos'
72-
path: '**/build/reports/**'
70+
commit_message: Auto-update API files
71+
file_pattern: arrow-libs/**/api/*.api
7372

74-
update_api:
73+
spotless:
7574
runs-on: ubuntu-latest
7675
timeout-minutes: 60
7776

@@ -91,17 +90,17 @@ jobs:
9190
with:
9291
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
9392

94-
- name: Update API files
95-
run: ./gradlew apiDump
93+
- name: Apply Spotless rules
94+
run: ./gradlew spotlessApply
9695

97-
- name: Commit updated API files
96+
- name: Commit newly formatted files
9897
uses: stefanzweifel/git-auto-commit-action@v5
9998
with:
100-
commit_message: Auto-update API files
101-
file_pattern: arrow-libs/**/api/*.api
99+
commit_message: Auto-apply Spotless rules
100+
file_pattern: arrow-libs/**/*.kt
102101

103-
spotless:
104-
runs-on: ubuntu-latest
102+
ios_watchos:
103+
runs-on: macos-14
105104
timeout-minutes: 60
106105

107106
steps:
@@ -120,14 +119,15 @@ jobs:
120119
with:
121120
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
122121

123-
- name: Apply Spotless rules
124-
run: ./gradlew spotlessApply
122+
- name: iOS and watchOS tests
123+
run: ./gradlew iosSimulatorArm64Test iosX64Test watchosSimulatorArm64Test watchosX64Test --parallel --scan
125124

126-
- name: Commit newly formatted files
127-
uses: stefanzweifel/git-auto-commit-action@v5
125+
- name: Upload reports
126+
if: failure()
127+
uses: actions/upload-artifact@v4
128128
with:
129-
commit_message: Auto-apply Spotless rules
130-
file_pattern: arrow-libs/**/*.kt
129+
name: 'reports-ios_watchos'
130+
path: '**/build/reports/**'
131131

132132
macos_tvos:
133133
runs-on: macos-14
@@ -326,3 +326,33 @@ jobs:
326326
with:
327327
name: 'reports-wasm'
328328
path: '**/build/reports/**'
329+
330+
android:
331+
runs-on: ubuntu-latest
332+
timeout-minutes: 60
333+
334+
steps:
335+
- uses: actions/checkout@v4
336+
with:
337+
fetch-depth: 0
338+
339+
- name: Set up Java
340+
uses: actions/setup-java@v4
341+
with:
342+
distribution: 'temurin'
343+
java-version: 17
344+
345+
- name: Setup Gradle
346+
uses: gradle/actions/setup-gradle@v4
347+
with:
348+
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
349+
350+
- name: Android (release) tests
351+
run: ./gradlew testReleaseUnitTest
352+
353+
- name: Upload reports
354+
if: failure()
355+
uses: actions/upload-artifact@v4
356+
with:
357+
name: 'reports-wasm'
358+
path: '**/build/reports/**'
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,3 @@
1-
@file:Suppress("DSL_SCOPE_VIOLATION")
2-
31
plugins {
4-
id(libs.plugins.kotlin.multiplatform.get().pluginId)
5-
id(libs.plugins.android.library.get().pluginId)
62
id("arrow.kotlin")
7-
alias(libs.plugins.publish)
8-
alias(libs.plugins.spotless)
9-
alias(libs.plugins.dokka)
10-
}
11-
12-
spotless {
13-
kotlin {
14-
ktlint().editorConfigOverride(mapOf("ktlint_standard_filename" to "disabled"))
15-
}
16-
}
17-
18-
apply(from = property("ANIMALSNIFFER_MPP"))
19-
20-
kotlin {
21-
sourceSets {
22-
commonMain {
23-
dependencies {
24-
implementation(libs.kotlin.stdlib)
25-
}
26-
}
27-
}
28-
29-
jvm {
30-
tasks.jvmJar {
31-
manifest {
32-
attributes["Automatic-Module-Name"] = "arrow.annotations"
33-
}
34-
}
35-
}
36-
}
37-
38-
android {
39-
namespace = "arrow.annotations"
40-
compileSdk = libs.versions.android.compileSdk.get().toInt()
413
}
+1-39
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,20 @@
1-
@file:Suppress("DSL_SCOPE_VIOLATION")
2-
31
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
42

53
plugins {
6-
id(libs.plugins.kotlin.multiplatform.get().pluginId)
7-
id(libs.plugins.android.library.get().pluginId)
84
id("arrow.kotlin")
9-
alias(libs.plugins.publish)
10-
alias(libs.plugins.kotlinx.kover)
11-
alias(libs.plugins.spotless)
12-
alias(libs.plugins.dokka)
13-
}
14-
15-
spotless {
16-
kotlin {
17-
ktlint().editorConfigOverride(mapOf("ktlint_standard_filename" to "disabled"))
18-
}
195
}
206

21-
apply(from = property("ANIMALSNIFFER_MPP"))
22-
237
kotlin {
248
@OptIn(ExperimentalKotlinGradlePluginApi::class)
259
compilerOptions.freeCompilerArgs.add("-Xexpect-actual-classes")
2610

2711
sourceSets {
28-
commonMain {
29-
dependencies {
30-
api(libs.kotlin.stdlib)
31-
}
32-
}
33-
3412
commonTest {
3513
dependencies {
3614
implementation(projects.arrowFxCoroutines)
3715
implementation(projects.arrowPlatform)
38-
implementation(libs.kotlin.test)
39-
implementation(libs.coroutines.test)
40-
implementation(libs.kotest.assertionsCore)
41-
implementation(libs.kotest.property)
16+
implementation(libs.bundles.testing)
4217
}
4318
}
4419
}
45-
46-
jvm {
47-
tasks.jvmJar {
48-
manifest {
49-
attributes["Automatic-Module-Name"] = "arrow.atomic"
50-
}
51-
}
52-
}
53-
}
54-
55-
android {
56-
namespace = "arrow.atomic"
57-
compileSdk = libs.versions.android.compileSdk.get().toInt()
5820
}
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,18 @@
1-
@file:Suppress("DSL_SCOPE_VIOLATION")
2-
31
plugins {
4-
id(libs.plugins.kotlin.multiplatform.get().pluginId)
5-
id(libs.plugins.android.library.get().pluginId)
62
id("arrow.kotlin")
7-
alias(libs.plugins.publish)
8-
alias(libs.plugins.kotlinx.kover)
9-
alias(libs.plugins.spotless)
10-
alias(libs.plugins.dokka)
11-
}
12-
13-
spotless {
14-
kotlin {
15-
ktlint().editorConfigOverride(mapOf("ktlint_standard_filename" to "disabled"))
16-
}
173
}
184

19-
apply(from = property("ANIMALSNIFFER_MPP"))
20-
215
kotlin {
226
sourceSets {
237
commonMain {
248
dependencies {
25-
implementation(libs.kotlin.stdlib)
269
implementation(projects.arrowAtomic)
2710
}
2811
}
2912
commonTest {
3013
dependencies {
31-
implementation(libs.kotlin.test)
32-
implementation(libs.kotest.assertionsCore)
33-
implementation(libs.coroutines.test)
14+
implementation(libs.bundles.testing)
3415
}
3516
}
3617
}
37-
38-
jvm {
39-
tasks.jvmJar {
40-
manifest {
41-
attributes["Automatic-Module-Name"] = "arrow.autocloseable"
42-
}
43-
}
44-
}
45-
}
46-
47-
android {
48-
namespace = "arrow.autoclose"
49-
compileSdk = libs.versions.android.compileSdk.get().toInt()
5018
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
public final class arrow/core/Cache4kKt {
2+
public static final fun buildCache4K (Lkotlin/jvm/functions/Function1;)Lio/github/reactivecircus/cache4k/Cache;
3+
}
4+
5+
public final class arrow/core/Cache4kMemoizationCache : arrow/core/MemoizationCache {
6+
public static final synthetic fun box-impl (Lio/github/reactivecircus/cache4k/Cache;)Larrow/core/Cache4kMemoizationCache;
7+
public static fun constructor-impl (Lio/github/reactivecircus/cache4k/Cache;)Lio/github/reactivecircus/cache4k/Cache;
8+
public fun equals (Ljava/lang/Object;)Z
9+
public static fun equals-impl (Lio/github/reactivecircus/cache4k/Cache;Ljava/lang/Object;)Z
10+
public static final fun equals-impl0 (Lio/github/reactivecircus/cache4k/Cache;Lio/github/reactivecircus/cache4k/Cache;)Z
11+
public fun get (Ljava/lang/Object;)Ljava/lang/Object;
12+
public static fun get-impl (Lio/github/reactivecircus/cache4k/Cache;Ljava/lang/Object;)Ljava/lang/Object;
13+
public fun hashCode ()I
14+
public static fun hashCode-impl (Lio/github/reactivecircus/cache4k/Cache;)I
15+
public fun set (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
16+
public static fun set-impl (Lio/github/reactivecircus/cache4k/Cache;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
17+
public fun toString ()Ljava/lang/String;
18+
public static fun toString-impl (Lio/github/reactivecircus/cache4k/Cache;)Ljava/lang/String;
19+
public final synthetic fun unbox-impl ()Lio/github/reactivecircus/cache4k/Cache;
20+
}
21+
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,8 @@
1-
@file:Suppress("DSL_SCOPE_VIOLATION")
2-
3-
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
4-
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
5-
61
plugins {
7-
id(libs.plugins.kotlin.multiplatform.get().pluginId)
8-
alias(libs.plugins.publish)
9-
alias(libs.plugins.kotlinx.kover)
10-
alias(libs.plugins.spotless)
11-
alias(libs.plugins.dokka)
12-
}
13-
14-
apply(from = property("ANIMALSNIFFER_MPP"))
15-
16-
java {
17-
toolchain {
18-
languageVersion.set(JavaLanguageVersion.of(17))
19-
}
2+
id("arrow.kotlin")
203
}
214

225
kotlin {
23-
explicitApi()
24-
256
sourceSets {
267
commonMain {
278
dependencies {
@@ -31,55 +12,8 @@ kotlin {
3112
}
3213
commonTest {
3314
dependencies {
34-
implementation(libs.kotlin.test)
35-
implementation(libs.kotest.assertionsCore)
36-
implementation(libs.coroutines.test)
15+
implementation(libs.bundles.testing)
3716
}
3817
}
3918
}
40-
41-
jvm()
42-
js(IR) {
43-
browser()
44-
nodejs()
45-
}
46-
@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class) wasmJs {
47-
browser()
48-
nodejs()
49-
d8()
50-
}
51-
// Native: https://kotlinlang.org/docs/native-target-support.html
52-
// -- Tier 1 --
53-
linuxX64()
54-
macosX64()
55-
macosArm64()
56-
iosSimulatorArm64()
57-
iosX64()
58-
// -- Tier 2 --
59-
linuxArm64()
60-
watchosSimulatorArm64()
61-
watchosX64()
62-
watchosArm64()
63-
tvosSimulatorArm64()
64-
tvosX64()
65-
tvosArm64()
66-
iosArm64()
67-
// -- Tier 3 --
68-
mingwX64()
69-
// Android and watchOS not included
70-
// -- Deprecated as of 1.8.20 --
71-
// iosArm32() // deprecated as of 1.8.20
72-
// watchosX86()
73-
74-
@OptIn(ExperimentalKotlinGradlePluginApi::class)
75-
compilerOptions {
76-
(project.rootProject.properties["kotlin_language_version"] as? String)?.also { languageVersion = KotlinVersion.fromVersion(it) }
77-
(project.rootProject.properties["kotlin_api_version"] as? String)?.also { apiVersion = KotlinVersion.fromVersion(it) }
78-
}
79-
}
80-
81-
tasks.named<Jar>("jvmJar").configure {
82-
manifest {
83-
attributes["Automatic-Module-Name"] = "arrow.cache4k"
84-
}
8519
}

0 commit comments

Comments
 (0)