Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate website to Docusaurus #595

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
coverage:
range: 50..80
range: 70..80
round: down
precision: 2

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/.ci_test_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 11
java-version: 17

- name: Upload Artifacts
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 11
java-version: 17
- name: Run tests
run: ./gradlew check --rerun-tasks --stacktrace
- name: Upload code coverage
Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up our JDK environment
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 17
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run check with Gradle Wrapper
run: ./gradlew check

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: codecov/codecov-action@v3
with:
files: ./kover/coverage.xml
name: codecov-umbrella
verbose: true
run: ./gradlew check
12 changes: 12 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Codecov
on: [ push, pull_request ]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: codecov/codecov-action@v3
with:
files: ./kover/coverage.xml
name: codecov-umbrella
verbose: true
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ captures/
# Keystore files
*.jks

store/kover
*/kover
*.podspec
yarn.lock
23 changes: 19 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask

plugins {
id("org.jlleitschuh.gradle.ktlint") version "11.0.0"
id("org.jlleitschuh.gradle.ktlint") version libs.versions.ktlintGradle.get()
id("com.diffplug.spotless") version "6.4.1"
}

Expand Down Expand Up @@ -49,15 +53,26 @@ subprojects {
tasks {
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "11"
jvmTarget = "17"
}
}

withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_11.name
targetCompatibility = JavaVersion.VERSION_11.name
sourceCompatibility = JavaVersion.VERSION_17.name
targetCompatibility = JavaVersion.VERSION_17.name
}
}

// Workaround for https://youtrack.jetbrains.com/issue/KT-62040
tasks.getByName("wrapper")

// Workaround for https://youtrack.jetbrains.com/issue/KT-63014
plugins.withType<NodeJsRootPlugin> {
extensions.configure(NodeJsRootExtension::class) {
nodeVersion = "21.0.0-v8-canary20231019bd785be450"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to throw version in toml?

nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
}
tasks.withType<KotlinNpmInstallTask> {
args.add("--ignore-engines")
}
}
19 changes: 4 additions & 15 deletions cache/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import com.vanniktech.maven.publish.SonatypeHost.S01
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask

plugins {
kotlin("multiplatform")
Expand Down Expand Up @@ -70,7 +68,7 @@ kotlin {
}
}

jvmToolchain(11)
jvmToolchain(17)
}

android {
Expand All @@ -92,16 +90,16 @@ android {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}

tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets.configureEach {
reportUndocumented.set(false)
skipDeprecated.set(true)
jdkVersion.set(8)
jdkVersion.set(11)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why 11?

}
}

Expand All @@ -127,12 +125,3 @@ koverMerged {
onCheck.set(true)
}
}

// See https://youtrack.jetbrains.com/issue/KT-63014
rootProject.the<NodeJsRootExtension>().apply {
nodeVersion = "21.0.0-v8-canary20231024d0ddc81258"
nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
}
tasks.withType<KotlinNpmInstallTask>().configureEach {
args.add("--ignore-engines")
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ interface Cache<Key : Any, Value : Any> {
* @throws UncheckedExecutionException If an unchecked exception was thrown while loading the value.
* @throws ExecutionError If an error was thrown while loading the value.
*/
fun getOrPut(key: Key, valueProducer: () -> Value): Value
fun getOrPut(
key: Key,
valueProducer: () -> Value,
): Value

/**
* @return Map of the [Value] associated with each [Key] in [keys]. Returned map only contains entries already present in the cache.
Expand All @@ -26,7 +29,10 @@ interface Cache<Key : Any, Value : Any> {
* If the cache previously contained a value associated with [key], the old value is replaced by [value].
* Prefer [getOrPut] when using the conventional "If cached, then return. Otherwise create, cache, and then return" pattern.
*/
fun put(key: Key, value: Value)
fun put(
key: Key,
value: Value,
)

/**
* Copies all of the mappings from the specified map to the cache. The effect of this call is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,43 +19,52 @@ class CacheBuilder<Key : Any, Output : Any> {
internal var ticker: Ticker? = null
private set

fun concurrencyLevel(producer: () -> Int): CacheBuilder<Key, Output> = apply {
concurrencyLevel = producer.invoke()
}

fun maximumSize(maximumSize: Long): CacheBuilder<Key, Output> = apply {
if (maximumSize < 0) {
throw IllegalArgumentException("Maximum size must be non-negative.")
fun concurrencyLevel(producer: () -> Int): CacheBuilder<Key, Output> =
apply {
concurrencyLevel = producer.invoke()
}
this.maximumSize = maximumSize
}

fun expireAfterAccess(duration: Duration): CacheBuilder<Key, Output> = apply {
if (duration.isNegative()) {
throw IllegalArgumentException("Duration must be non-negative.")
fun maximumSize(maximumSize: Long): CacheBuilder<Key, Output> =
apply {
if (maximumSize < 0) {
throw IllegalArgumentException("Maximum size must be non-negative.")
}
this.maximumSize = maximumSize
}
expireAfterAccess = duration
}

fun expireAfterWrite(duration: Duration): CacheBuilder<Key, Output> = apply {
if (duration.isNegative()) {
throw IllegalArgumentException("Duration must be non-negative.")
fun expireAfterAccess(duration: Duration): CacheBuilder<Key, Output> =
apply {
if (duration.isNegative()) {
throw IllegalArgumentException("Duration must be non-negative.")
}
expireAfterAccess = duration
}
expireAfterWrite = duration
}

fun ticker(ticker: Ticker): CacheBuilder<Key, Output> = apply {
this.ticker = ticker
}
fun expireAfterWrite(duration: Duration): CacheBuilder<Key, Output> =
apply {
if (duration.isNegative()) {
throw IllegalArgumentException("Duration must be non-negative.")
}
expireAfterWrite = duration
}

fun weigher(maximumWeight: Long, weigher: Weigher<Key, Output>): CacheBuilder<Key, Output> = apply {
if (maximumWeight < 0) {
throw IllegalArgumentException("Maximum weight must be non-negative.")
fun ticker(ticker: Ticker): CacheBuilder<Key, Output> =
apply {
this.ticker = ticker
}

this.maximumWeight = maximumWeight
this.weigher = weigher
}
fun weigher(
maximumWeight: Long,
weigher: Weigher<Key, Output>,
): CacheBuilder<Key, Output> =
apply {
if (maximumWeight < 0) {
throw IllegalArgumentException("Maximum weight must be non-negative.")
}

this.maximumWeight = maximumWeight
this.weigher = weigher
}

fun build(): Cache<Key, Output> {
if (maximumSize != -1L && weigher != null) {
Expand Down
Loading
Loading