Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into arrow-2
Browse files Browse the repository at this point in the history
  • Loading branch information
nomisRev committed Oct 18, 2023
2 parents 6a613fd + 68938d3 commit 8051d2c
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/githubpages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
timeout-minutes: 20

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
timeout-minutes: 90
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -42,7 +42,7 @@ jobs:
- name: assemble
uses: gradle/gradle-build-action@v2
with:
arguments: assemble -Psemver.stage=snapshot -Psemver.scope=major
arguments: assemble -Pversion=${{ inputs.version }}

- name: Upload reports
if: failure()
Expand All @@ -54,4 +54,4 @@ jobs:
- name: Publish next major SNAPSHOT version
uses: gradle/gradle-build-action@v2
with:
arguments: -Psemver.stage=snapshot -Psemver.scope=major publishToSonatype
arguments: -Pversion=${{ inputs.version }} publishToSonatype closeSonatypeStagingRepository
29 changes: 13 additions & 16 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
timeout-minutes: 60

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -42,7 +42,7 @@ jobs:
timeout-minutes: 60

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -69,7 +69,7 @@ jobs:
timeout-minutes: 60

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -96,7 +96,7 @@ jobs:
timeout-minutes: 60

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -123,7 +123,7 @@ jobs:
timeout-minutes: 60

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down Expand Up @@ -165,11 +165,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60

env:
KOTLIN_OVERRIDE: 1.9.30-dev-1098

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -182,7 +179,7 @@ jobs:
- name: jvmTest (K2 enabled)
uses: gradle/gradle-build-action@v2
with:
arguments: jvmTest -Pkotlin.experimental.tryK2=true
arguments: "jvmTest -Pkotlin_version=1.9.30-dev-2548 -Pkotlin_repo_url=https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap -Pkotlin_language_version=2.0"

- name: Upload reports
if: failure()
Expand All @@ -196,7 +193,7 @@ jobs:
timeout-minutes: 60

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down Expand Up @@ -228,7 +225,7 @@ jobs:
timeout-minutes: 60

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -255,7 +252,7 @@ jobs:
timeout-minutes: 30

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -271,7 +268,7 @@ jobs:
arguments: apiDump

- name: "Commit new API files"
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update API files
file_pattern: arrow-libs/**/api/*.api
Expand All @@ -281,7 +278,7 @@ jobs:
timeout-minutes: 60

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -297,7 +294,7 @@ jobs:
arguments: spotlessApply

- name: "Commit newly formatted files"
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply
file_pattern: arrow-libs/**/*.kt
Expand Down
9 changes: 9 additions & 0 deletions arrow-libs/core/arrow-atomic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@file:Suppress("DSL_SCOPE_VIOLATION")

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile


plugins {
id(libs.plugins.kotlin.multiplatform.get().pluginId)
alias(libs.plugins.arrowGradleConfig.kotlin)
Expand Down Expand Up @@ -77,3 +80,9 @@ kotlin {
}
}
}

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + "-Xexpect-actual-classes"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,6 @@ public value class NonEmptyList<out A> @PublishedApi internal constructor(
public override inline fun <B> mapIndexed(transform: (index: Int, A) -> B): NonEmptyList<B> =
NonEmptyList(transform(0, head), tail.mapIndexed { ix, e -> transform(ix + 1, e) })

@Suppress("OVERRIDE_BY_INLINE")
public override inline fun <B> flatMap(transform: (A) -> NonEmptyCollection<B>): NonEmptyList<B> =
transform(head).toNonEmptyList() + tail.flatMap(transform)

@Suppress("OVERRIDE_BY_INLINE")
public override inline fun <K> distinctBy(selector: (A) -> K): NonEmptyList<A> =
all.distinctBy(selector).toNonEmptyListOrNull()!!

public operator fun plus(l: NonEmptyList<@UnsafeVariance A>): NonEmptyList<A> =
this + l.all

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,6 @@ public value class NonEmptySet<out A> private constructor(

override fun lastOrNull(): A = elements.last()

@Suppress("OVERRIDE_BY_INLINE")
public override inline fun <B> map(transform: (A) -> B): NonEmptyList<B> =
elements.map(transform).toNonEmptyListOrNull()!!

@Suppress("OVERRIDE_BY_INLINE")
public override inline fun <B> mapIndexed(transform: (index: Int, A) -> B): NonEmptyList<B> =
elements.mapIndexed(transform).toNonEmptyListOrNull()!!

@Suppress("OVERRIDE_BY_INLINE")
public override inline fun <B> flatMap(transform: (A) -> NonEmptyCollection<B>): NonEmptyList<B> =
elements.flatMap(transform).toNonEmptyListOrNull()!!

override fun distinct(): NonEmptyList<A> =
toNonEmptyList()

@Suppress("OVERRIDE_BY_INLINE")
public override inline fun <K> distinctBy(selector: (A) -> K): NonEmptyList<A> =
elements.distinctBy(selector).toNonEmptyListOrNull()!!

override fun toString(): String = "NonEmptySet(${this.joinToString()})"

@Suppress("RESERVED_MEMBER_INSIDE_VALUE_CLASS")
Expand Down
16 changes: 11 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import kotlinx.knit.KnitPluginExtension
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
import org.jetbrains.dokka.gradle.DokkaTaskPartial
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

buildscript {
repositories {
Expand All @@ -21,7 +22,16 @@ allprojects {
repositories {
mavenCentral()
maven(url = "https://oss.sonatype.org/content/repositories/snapshots/")
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap")
(project.rootProject.properties["kotlin_repo_url"] as? String)?.also { maven(it) }
}

tasks {
withType<KotlinCompile> {
kotlinOptions {
(project.rootProject.properties["kotlin_language_version"] as? String)?.also { languageVersion = it }
(project.rootProject.properties["kotlin_api_version"] as? String)?.also { apiVersion = it }
}
}
}
}

Expand Down Expand Up @@ -69,10 +79,6 @@ allprojects {
group = property("projects.group").toString()
}

val enableCompatibilityMetadataVariant =
providers.gradleProperty("kotlin.mpp.enableCompatibilityMetadataVariant")
.orNull?.toBoolean() == true

subprojects {
this@subprojects.tasks.withType<DokkaTaskPartial>().configureEach {
this@subprojects.extensions.findByType<KotlinProjectExtension>()?.sourceSets?.forEach { kotlinSourceSet ->
Expand Down
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[versions]
animalSniffer = "1.7.1"
arrowGradleConfig = "0.12.0-rc.5"
arrowGradleConfig = "0.12.0-rc.6"
assertj = "3.24.2"
coroutines = "1.7.3"
classgraph = "4.8.162"
dokka = "1.8.20"
dokka = "1.9.0"
jUnit = "4.13.2"
jUnitJupiter = "5.10.0"
jUnitVintage = "5.10.0"
kotest = "5.6.2"
kotestGradle = "5.6.2"
kotest = "5.7.2"
kotestGradle = "5.7.2"
kover = "0.7.3"
kotlin = "1.9.10"
kotlinxSerializationPlugin = "1.9.10"
Expand Down
16 changes: 10 additions & 6 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,35 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
rootProject.name = "arrow"

pluginManagement {
@Suppress("LocalVariableName") val kotlin_repo_url: String? by settings
repositories {
gradlePluginPortal()
mavenCentral()
mavenLocal()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap")
kotlin_repo_url?.also { maven(it) }
}
}

plugins {
id("com.gradle.enterprise") version "3.14.1"
id("com.gradle.enterprise") version "3.15"
id("org.gradle.toolchains.foojay-resolver-convention") version("0.7.0")
}

dependencyResolutionManagement {
@Suppress("LocalVariableName") val kotlin_repo_url: String? by settings
@Suppress("LocalVariableName") val kotlin_version: String? by settings

repositories {
mavenCentral()
gradlePluginPortal()
mavenLocal()
kotlin_repo_url?.also { maven(it) }
}
versionCatalogs {
create("libs") {
val kotlinOverride = System.getenv("KOTLIN_OVERRIDE")
if (!kotlinOverride.isNullOrBlank()) {
println("Overriding Kotlin version with $kotlinOverride")
version("kotlin", kotlinOverride)
if (!kotlin_version.isNullOrBlank()) {
println("Overriding Kotlin version with $kotlin_version")
version("kotlin", kotlin_version!!)
}
}
}
Expand Down

0 comments on commit 8051d2c

Please sign in to comment.