Skip to content

Commit

Permalink
The library has shown limitation for kotlin classes with fields
Browse files Browse the repository at this point in the history
  • Loading branch information
oldergod committed Jun 16, 2023
1 parent 92e6e9f commit e03b817
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 46 deletions.
1 change: 0 additions & 1 deletion android-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ dependencies {
coreLibraryDesugaring(libs.android.desugar.jdk.libs)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.androidx.test.runner)
androidTestImplementation(libs.animalSniffer.annotations)
androidTestImplementation(libs.kotlin.test)
androidTestImplementation(libs.kotlin.time)
androidTestImplementation(libs.test.assertj)
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ plugins {
buildscript {
dependencies {
classpath(libs.android.gradle.plugin)
classpath(libs.animalSniffer.gradle.plugin)
classpath(libs.japicmp)
classpath(libs.dokka)
classpath(libs.shadow)
Expand Down
4 changes: 0 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ kotlin-time = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version = "0.
jmh-gradle-plugin = { module = "me.champeau.gradle:jmh-gradle-plugin", version = "0.5.3" }
jmh-core = { module = "org.openjdk.jmh:jmh-core", version.ref = "jmh" }
jmh-generator = { module = "org.openjdk.jmh:jmh-generator-annprocess", version.ref = "jmh" }
animalSniffer-gradle-plugin = { module = "ru.vyarus:gradle-animalsniffer-plugin", version = "1.7.0" }
animalSniffer-annotations = { module = "org.codehaus.mojo:animal-sniffer-annotations", version = "1.22" }
animalSniffer-android = { module = "net.sf.androidscents.signature:android-api-level-15", version = "4.0.3_r5" }
animalSniffer-java = { module = "org.codehaus.mojo.signature:java17", version = "1.0" }
japicmp = { module = "me.champeau.gradle:japicmp-gradle-plugin", version = "0.4.1" }
dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version = "1.8.20" }
shadow = { module = "gradle.plugin.com.github.johnrengelman:shadow", version = "7.1.2" }
Expand Down
13 changes: 0 additions & 13 deletions okio-fakefilesystem/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import com.vanniktech.maven.publish.JavadocJar.Dokka
import com.vanniktech.maven.publish.KotlinMultiplatform
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import ru.vyarus.gradle.plugin.animalsniffer.AnimalSnifferExtension

plugins {
kotlin("multiplatform")
id("ru.vyarus.animalsniffer")
id("org.jetbrains.dokka")
id("com.vanniktech.maven.publish.base")
id("build-support")
Expand Down Expand Up @@ -65,17 +63,6 @@ tasks {
}
}

configure<AnimalSnifferExtension> {
sourceSets = listOf(project.sourceSets.getByName("main"))
}

val signature: Configuration by configurations

dependencies {
signature(variantOf(libs.animalSniffer.android) { artifactType("signature") })
signature(variantOf(libs.animalSniffer.java) { artifactType("signature") })
}

configure<MavenPublishBaseExtension> {
configure(
KotlinMultiplatform(javadocJar = Dokka("dokkaGfm"))
Expand Down
16 changes: 0 additions & 16 deletions okio/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import com.vanniktech.maven.publish.MavenPublishBaseExtension
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithTests
import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType
import org.jetbrains.kotlin.gradle.plugin.mpp.TestExecutable
import ru.vyarus.gradle.plugin.animalsniffer.AnimalSnifferExtension

plugins {
kotlin("multiplatform")
id("ru.vyarus.animalsniffer")
id("org.jetbrains.dokka")
id("com.vanniktech.maven.publish.base")
id("build-support")
Expand Down Expand Up @@ -101,9 +99,6 @@ kotlin {
}

val jvmMain by getting {
dependencies {
compileOnly(libs.animalSniffer.annotations)
}
}
val jvmTest by getting {
kotlin.srcDir("src/jvmTest/hashFunctions")
Expand Down Expand Up @@ -178,17 +173,6 @@ tasks {
}
}

configure<AnimalSnifferExtension> {
sourceSets = listOf(project.sourceSets.getByName("main"))
}

val signature: Configuration by configurations

dependencies {
signature(variantOf(libs.animalSniffer.android) { artifactType("signature") })
signature(variantOf(libs.animalSniffer.java) { artifactType("signature") })
}

configure<MavenPublishBaseExtension> {
configure(
KotlinMultiplatform(javadocJar = Dokka("dokkaGfm"))
Expand Down
2 changes: 0 additions & 2 deletions okio/src/jvmMain/kotlin/okio/DeflaterSink.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package okio

import java.io.IOException
import java.util.zip.Deflater
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement

/**
* A sink that uses [DEFLATE](http://tools.ietf.org/html/rfc1951) to
Expand Down Expand Up @@ -75,7 +74,6 @@ internal constructor(private val sink: BufferedSink, private val deflater: Defla
}
}

@IgnoreJRERequirement
private fun deflate(syncFlush: Boolean) {
val buffer = sink.buffer
while (true) {
Expand Down
3 changes: 0 additions & 3 deletions okio/src/jvmMain/kotlin/okio/JvmOkio.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import java.util.logging.Logger
import javax.crypto.Cipher
import javax.crypto.Mac
import okio.internal.ResourceFileSystem
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement

/** Returns a sink that writes to `out`. */
fun OutputStream.sink(): Sink = OutputStreamSink(this, Timeout())
Expand Down Expand Up @@ -183,13 +182,11 @@ fun File.source(): Source = InputStreamSource(inputStream(), Timeout.NONE)

/** Returns a source that reads from `path`. */
@Throws(IOException::class)
@IgnoreJRERequirement // Can only be invoked on Java 7+.
fun NioPath.sink(vararg options: OpenOption): Sink =
Files.newOutputStream(this, *options).sink()

/** Returns a sink that writes to `path`. */
@Throws(IOException::class)
@IgnoreJRERequirement // Can only be invoked on Java 7+.
fun NioPath.source(vararg options: OpenOption): Source =
Files.newInputStream(this, *options).source()

Expand Down
2 changes: 0 additions & 2 deletions okio/src/jvmMain/kotlin/okio/NioSystemFileSystem.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ import java.nio.file.StandardCopyOption.REPLACE_EXISTING
import java.nio.file.attribute.BasicFileAttributes
import java.nio.file.attribute.FileTime
import okio.Path.Companion.toOkioPath
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement

/**
* Extends [JvmSystemFileSystem] for platforms that support `java.nio.files` first introduced in
* Java 7 and Android 8.0 (API level 26).
*/
@IgnoreJRERequirement // Only used on platforms that support java.nio.file.
internal class NioSystemFileSystem : JvmSystemFileSystem() {
override fun metadataOrNull(path: Path): FileMetadata? {
val nioPath = path.toNioPath()
Expand Down
5 changes: 1 addition & 4 deletions okio/src/jvmMain/kotlin/okio/Path.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import okio.internal.commonSegmentsBytes
import okio.internal.commonToPath
import okio.internal.commonToString
import okio.internal.commonVolumeLetter
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement

actual class Path internal actual constructor(
internal actual val bytes: ByteString,
Expand Down Expand Up @@ -98,8 +97,7 @@ actual class Path internal actual constructor(
actual fun normalized(): Path = commonNormalized()

fun toFile(): File = File(toString())

@IgnoreJRERequirement // Can only be invoked on platforms that have java.nio.file.
// Can only be invoked on platforms that have java.nio.file.
fun toNioPath(): NioPath = Paths.get(toString())

actual override fun compareTo(other: Path): Int = commonCompareTo(other)
Expand Down Expand Up @@ -127,7 +125,6 @@ actual class Path internal actual constructor(
@JvmName("get")
@JvmStatic
@JvmOverloads
@IgnoreJRERequirement // Can only be invoked on platforms that have java.nio.file.
fun NioPath.toOkioPath(normalize: Boolean = false): Path = toString().toPath(normalize)
}
}

0 comments on commit e03b817

Please sign in to comment.