Make one-liners not one-liners, add newlines at EOFs, optimize imports and Kotlin extension configurations
This commit is contained in:
parent
139525e2d4
commit
5eaeb82a0f
@ -1,10 +1,12 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
|
||||
import scientifik.ScientifikPublishPlugin
|
||||
|
||||
plugins {
|
||||
id("scientifik.publish") apply false
|
||||
id("org.jetbrains.changelog") version "0.4.0"
|
||||
}
|
||||
|
||||
val kmathVersion by extra("0.1.4")
|
||||
|
||||
val bintrayRepo by extra("scientifik")
|
||||
val githubProject by extra("kmath")
|
||||
|
||||
@ -19,18 +21,15 @@ allprojects {
|
||||
version = kmathVersion
|
||||
|
||||
afterEvaluate {
|
||||
extensions.findByType<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension>()?.run {
|
||||
targets.all {
|
||||
sourceSets.all {
|
||||
languageSettings.useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts")
|
||||
}
|
||||
extensions.findByType<KotlinProjectExtension>()?.run {
|
||||
sourceSets.all {
|
||||
languageSettings.useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
if (name.startsWith("kmath")) {
|
||||
apply(plugin = "scientifik.publish")
|
||||
}
|
||||
if (name.startsWith("kmath"))
|
||||
apply<ScientifikPublishPlugin>()
|
||||
}
|
@ -7,11 +7,9 @@ import scientifik.kmath.commons.linear.toCM
|
||||
import scientifik.kmath.operations.RealField
|
||||
import scientifik.kmath.operations.invoke
|
||||
import scientifik.kmath.structures.Matrix
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.random.Random
|
||||
import kotlin.system.measureTimeMillis
|
||||
|
||||
@ExperimentalContracts
|
||||
fun main() {
|
||||
val random = Random(1224)
|
||||
val dim = 100
|
||||
|
@ -3,7 +3,6 @@ package scientifik.kmath.structures
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import scientifik.kmath.operations.RealField
|
||||
import scientifik.kmath.operations.invoke
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.InvocationKind
|
||||
import kotlin.contracts.contract
|
||||
import kotlin.system.measureTimeMillis
|
||||
|
@ -1,8 +1,8 @@
|
||||
plugins { id("scientifik.mpp") }
|
||||
plugins {
|
||||
id("scientifik.mpp")
|
||||
}
|
||||
|
||||
kotlin.sourceSets {
|
||||
all { languageSettings.useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts") }
|
||||
|
||||
commonMain {
|
||||
dependencies {
|
||||
api(project(":kmath-core"))
|
||||
|
@ -2,7 +2,6 @@ package scientifik.kmath.ast
|
||||
|
||||
import scientifik.kmath.expressions.*
|
||||
import scientifik.kmath.operations.*
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.InvocationKind
|
||||
import kotlin.contracts.contract
|
||||
|
||||
|
@ -7,7 +7,6 @@ import scientifik.kmath.ast.MST
|
||||
import scientifik.kmath.expressions.Expression
|
||||
import scientifik.kmath.operations.Algebra
|
||||
import java.lang.reflect.Method
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.InvocationKind
|
||||
import kotlin.contracts.contract
|
||||
import kotlin.reflect.KClass
|
||||
|
@ -1,4 +1,7 @@
|
||||
plugins { id("scientifik.jvm") }
|
||||
plugins {
|
||||
id("scientifik.jvm")
|
||||
}
|
||||
|
||||
description = "Commons math binding for kmath"
|
||||
|
||||
dependencies {
|
||||
@ -8,5 +11,3 @@ dependencies {
|
||||
api(project(":kmath-functions"))
|
||||
api("org.apache.commons:commons-math3:3.6.1")
|
||||
}
|
||||
|
||||
kotlin.sourceSets.all { languageSettings.useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts") }
|
||||
|
@ -2,10 +2,8 @@ plugins {
|
||||
id("scientifik.mpp")
|
||||
}
|
||||
|
||||
kotlin.sourceSets {
|
||||
commonMain {
|
||||
dependencies {
|
||||
api(project(":kmath-memory"))
|
||||
}
|
||||
kotlin.sourceSets.commonMain {
|
||||
dependencies {
|
||||
api(project(":kmath-memory"))
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ import scientifik.kmath.operations.ExtendedField
|
||||
import scientifik.kmath.operations.Field
|
||||
import scientifik.kmath.operations.Ring
|
||||
import scientifik.kmath.operations.Space
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.InvocationKind
|
||||
import kotlin.contracts.contract
|
||||
|
||||
|
@ -4,7 +4,6 @@ import scientifik.kmath.operations.Ring
|
||||
import scientifik.kmath.structures.Matrix
|
||||
import scientifik.kmath.structures.Structure2D
|
||||
import scientifik.kmath.structures.asBuffer
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.contract
|
||||
import kotlin.math.sqrt
|
||||
|
||||
|
@ -6,7 +6,6 @@ import scientifik.kmath.operations.Field
|
||||
import scientifik.kmath.operations.invoke
|
||||
import scientifik.kmath.operations.sum
|
||||
import scientifik.kmath.structures.asBuffer
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.InvocationKind
|
||||
import kotlin.contracts.contract
|
||||
|
||||
|
@ -2,7 +2,6 @@ package scientifik.kmath.misc
|
||||
|
||||
import scientifik.kmath.operations.Space
|
||||
import scientifik.kmath.operations.invoke
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.contract
|
||||
import kotlin.jvm.JvmName
|
||||
|
||||
|
@ -3,7 +3,6 @@ package scientifik.kmath.operations
|
||||
import scientifik.kmath.operations.BigInt.Companion.BASE
|
||||
import scientifik.kmath.operations.BigInt.Companion.BASE_SIZE
|
||||
import scientifik.kmath.structures.*
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.contract
|
||||
import kotlin.math.log2
|
||||
import kotlin.math.max
|
||||
|
@ -6,7 +6,6 @@ import scientifik.kmath.structures.MutableBuffer
|
||||
import scientifik.memory.MemoryReader
|
||||
import scientifik.memory.MemorySpec
|
||||
import scientifik.memory.MemoryWriter
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.contract
|
||||
import kotlin.math.*
|
||||
|
||||
|
@ -2,7 +2,6 @@ package scientifik.kmath.structures
|
||||
|
||||
import scientifik.kmath.operations.Complex
|
||||
import scientifik.kmath.operations.complex
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.contract
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
|
@ -4,7 +4,6 @@ import scientifik.kmath.operations.Complex
|
||||
import scientifik.kmath.operations.ComplexField
|
||||
import scientifik.kmath.operations.FieldElement
|
||||
import scientifik.kmath.operations.complex
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.InvocationKind
|
||||
import kotlin.contracts.contract
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package scientifik.kmath.structures
|
||||
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.contract
|
||||
import kotlin.experimental.and
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package scientifik.kmath.structures
|
||||
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.contract
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,5 @@
|
||||
package scientifik.kmath.structures
|
||||
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.InvocationKind
|
||||
import kotlin.contracts.contract
|
||||
|
||||
/**
|
||||
@ -31,10 +29,7 @@ inline class IntBuffer(val array: IntArray) : MutableBuffer<Int> {
|
||||
* The function [init] is called for each array element sequentially starting from the first one.
|
||||
* It should return the value for an buffer element given its index.
|
||||
*/
|
||||
inline fun IntBuffer(size: Int, init: (Int) -> Int): IntBuffer {
|
||||
contract { callsInPlace(init) }
|
||||
return IntBuffer(IntArray(size) { init(it) })
|
||||
}
|
||||
inline fun IntBuffer(size: Int, init: (Int) -> Int): IntBuffer = IntBuffer(IntArray(size) { init(it) })
|
||||
|
||||
/**
|
||||
* Returns a new [IntBuffer] of given elements.
|
||||
|
@ -1,6 +1,5 @@
|
||||
package scientifik.kmath.structures
|
||||
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.contract
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,5 @@
|
||||
package scientifik.kmath.structures
|
||||
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.contract
|
||||
import kotlin.jvm.JvmName
|
||||
import kotlin.reflect.KClass
|
||||
|
@ -1,6 +1,5 @@
|
||||
package scientifik.kmath.structures
|
||||
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.contract
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,5 @@
|
||||
package scientifik.kmath.structures
|
||||
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.contract
|
||||
|
||||
/**
|
||||
|
@ -1,11 +1,9 @@
|
||||
package scientifik.kmath.linear
|
||||
|
||||
import scientifik.kmath.structures.Matrix
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
@ExperimentalContracts
|
||||
class RealLUSolverTest {
|
||||
|
||||
@Test
|
||||
|
@ -6,7 +6,6 @@ plugins {
|
||||
kotlin.sourceSets {
|
||||
all {
|
||||
with(languageSettings) {
|
||||
useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts")
|
||||
useExperimentalAnnotation("kotlinx.coroutines.InternalCoroutinesApi")
|
||||
useExperimentalAnnotation("kotlinx.coroutines.ExperimentalCoroutinesApi")
|
||||
useExperimentalAnnotation("kotlinx.coroutines.FlowPreview")
|
||||
|
@ -11,9 +11,9 @@ kotlin.sourceSets {
|
||||
}
|
||||
}
|
||||
|
||||
jvmMain{
|
||||
dependencies{
|
||||
jvmMain {
|
||||
dependencies {
|
||||
api(kotlin("reflect"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,9 @@
|
||||
plugins { id("scientifik.mpp") }
|
||||
|
||||
kotlin.sourceSets {
|
||||
all { languageSettings.useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts") }
|
||||
commonMain { dependencies { api(project(":kmath-core")) } }
|
||||
plugins {
|
||||
id("scientifik.mpp")
|
||||
}
|
||||
|
||||
kotlin.sourceSets.commonMain {
|
||||
dependencies {
|
||||
api(project(":kmath-core"))
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ import scientifik.kmath.structures.Buffer
|
||||
import scientifik.kmath.structures.Matrix
|
||||
import scientifik.kmath.structures.RealBuffer
|
||||
import scientifik.kmath.structures.asIterable
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.contract
|
||||
import kotlin.math.pow
|
||||
|
||||
|
@ -1,6 +1,9 @@
|
||||
plugins { id("scientifik.mpp") }
|
||||
|
||||
kotlin.sourceSets {
|
||||
all { languageSettings.useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts") }
|
||||
commonMain { dependencies { api(project(":kmath-core")) } }
|
||||
plugins {
|
||||
id("scientifik.mpp")
|
||||
}
|
||||
|
||||
kotlin.sourceSets.commonMain {
|
||||
dependencies {
|
||||
api(project(":kmath-core"))
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package scientifik.kmath.functions
|
||||
import scientifik.kmath.operations.Ring
|
||||
import scientifik.kmath.operations.Space
|
||||
import scientifik.kmath.operations.invoke
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.InvocationKind
|
||||
import kotlin.contracts.contract
|
||||
import kotlin.math.max
|
||||
|
@ -4,9 +4,6 @@ import scientifik.kmath.domains.Domain
|
||||
import scientifik.kmath.linear.Point
|
||||
import scientifik.kmath.structures.ArrayBuffer
|
||||
import scientifik.kmath.structures.RealBuffer
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.InvocationKind
|
||||
import kotlin.contracts.contract
|
||||
|
||||
/**
|
||||
* The bin in the histogram. The histogram is by definition always done in the real space
|
||||
|
@ -1,3 +1,3 @@
|
||||
plugins {
|
||||
id("scientifik.mpp")
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ import java.nio.channels.FileChannel
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
import java.nio.file.StandardOpenOption
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.InvocationKind
|
||||
import kotlin.contracts.contract
|
||||
|
||||
|
@ -14,4 +14,4 @@ kotlin.sourceSets {
|
||||
api("org.apache.commons:commons-rng-simple:1.3")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,4 +7,4 @@ description = "Binding for https://github.com/JetBrains-Research/viktor"
|
||||
dependencies {
|
||||
api(project(":kmath-core"))
|
||||
api("org.jetbrains.bio:viktor:1.0.1")
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user