From 16f6a3109e72a63aac291bbd9b446607f539022f Mon Sep 17 00:00:00 2001 From: Ugljesa Jovanovic Date: Mon, 29 Aug 2022 09:31:39 +0200 Subject: [PATCH] Fix dokka issues, some formatting --- build.gradle.kts | 5 -- buildSrc/build.gradle.kts | 1 + multiplatform-crypto-api/build.gradle.kts | 1 - .../build.gradle.kts | 70 ++++++++++++++----- 4 files changed, 55 insertions(+), 22 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 97f548e..2f9548b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -23,11 +23,6 @@ buildscript { gradlePluginPortal() } - - dependencies { - classpath ("gradle.plugin.org.jlleitschuh.gradle:ktlint-gradle:5.0.0") - classpath ("org.jetbrains.dokka:dokka-gradle-plugin:${Versions.dokkaPlugin}") - } } allprojects { diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 7f60d9e..a3fe200 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -30,6 +30,7 @@ repositories { dependencies { implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10") implementation("com.android.tools.build:gradle:7.2.2") + implementation ("org.jetbrains.dokka:dokka-gradle-plugin:1.7.10") } System.setProperty("PROJECT_PATH", project.projectDir.parentFile.toString()) diff --git a/multiplatform-crypto-api/build.gradle.kts b/multiplatform-crypto-api/build.gradle.kts index ec42eec..f3be8bf 100644 --- a/multiplatform-crypto-api/build.gradle.kts +++ b/multiplatform-crypto-api/build.gradle.kts @@ -25,7 +25,6 @@ plugins { kotlin(PluginsDeps.multiplatform) id(PluginsDeps.mavenPublish) id(PluginsDeps.signing) - id(PluginsDeps.dokka) } repositories { diff --git a/multiplatform-crypto-libsodium-bindings/build.gradle.kts b/multiplatform-crypto-libsodium-bindings/build.gradle.kts index 5b48107..d9d09b7 100644 --- a/multiplatform-crypto-libsodium-bindings/build.gradle.kts +++ b/multiplatform-crypto-libsodium-bindings/build.gradle.kts @@ -377,10 +377,20 @@ kotlin { } } if (linux32Bit.contains(this@withType.name)) { - defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies)) + defaultSourceSet.dependsOn( + createWorkaroundNativeMainSourceSet( + this@withType.name, + nativeDependencies + ) + ) } if (macos64Bit.contains(this@withType.name)) { - defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies)) + defaultSourceSet.dependsOn( + createWorkaroundNativeMainSourceSet( + this@withType.name, + nativeDependencies + ) + ) println("Setting macos cinterop for $this") val libsodiumCinterop by cinterops.creating { defFile(projectRef.file("src/nativeInterop/cinterop/libsodium.def")) @@ -392,7 +402,12 @@ kotlin { } //All ioses share the same static library if (iosArm.contains(this@withType.name)) { - defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies)) + defaultSourceSet.dependsOn( + createWorkaroundNativeMainSourceSet( + this@withType.name, + nativeDependencies + ) + ) println("Setting ios cinterop for $this") val libsodiumCinterop by cinterops.creating { defFile(projectRef.file("src/nativeInterop/cinterop/libsodium.def")) @@ -404,7 +419,12 @@ kotlin { } if (iosSimulator.contains(this@withType.name)) { - defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies)) + defaultSourceSet.dependsOn( + createWorkaroundNativeMainSourceSet( + this@withType.name, + nativeDependencies + ) + ) println("Setting ios cinterop for $this") val libsodiumCinterop by cinterops.creating { defFile(projectRef.file("src/nativeInterop/cinterop/libsodium.def")) @@ -416,7 +436,12 @@ kotlin { } if (tvosArm.contains(this@withType.name)) { - defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies)) + defaultSourceSet.dependsOn( + createWorkaroundNativeMainSourceSet( + this@withType.name, + nativeDependencies + ) + ) println("Setting ios cinterop for $this") val libsodiumCinterop by cinterops.creating { defFile(projectRef.file("src/nativeInterop/cinterop/libsodium.def")) @@ -428,7 +453,12 @@ kotlin { } if (tvosSimulator.contains(this@withType.name)) { - defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies)) + defaultSourceSet.dependsOn( + createWorkaroundNativeMainSourceSet( + this@withType.name, + nativeDependencies + ) + ) println("Setting ios cinterop for $this") val libsodiumCinterop by cinterops.creating { defFile(projectRef.file("src/nativeInterop/cinterop/libsodium.def")) @@ -440,7 +470,12 @@ kotlin { } if (watchosArm.contains(this@withType.name)) { - defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies)) + defaultSourceSet.dependsOn( + createWorkaroundNativeMainSourceSet( + this@withType.name, + nativeDependencies + ) + ) println("Setting ios cinterop for $this") val libsodiumCinterop by cinterops.creating { defFile(projectRef.file("src/nativeInterop/cinterop/libsodium.def")) @@ -452,19 +487,24 @@ kotlin { } if (watchosSimulator.contains(this@withType.name)) { - defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies)) + defaultSourceSet.dependsOn( + createWorkaroundNativeMainSourceSet( + this@withType.name, + nativeDependencies + ) + ) println("Setting ios cinterop for $this") val libsodiumCinterop by cinterops.creating { defFile(projectRef.file("src/nativeInterop/cinterop/libsodium.def")) compilerOpts.add("-I${projectRef.rootDir}/sodiumWrapper/static-watchos-simulators/include") } kotlinOptions.freeCompilerArgs = listOf( - "-include-binary", "${projectRef.rootDir}/sodiumWrapper/static-watchos-simulators/lib/libsodium.a" + "-include-binary", + "${projectRef.rootDir}/sodiumWrapper/static-watchos-simulators/lib/libsodium.a" ) } - } compilations.getByName("test") { println("Setting native test dep for $this@withType.name") @@ -519,7 +559,6 @@ kotlin { println("Configuring Linux 64 Bit source sets") - val jsMain by getting { dependencies { implementation(kotlin(Deps.Js.stdLib)) @@ -614,16 +653,15 @@ kotlin { } tasks.whenTaskAdded { - if("DebugUnitTest" in name || "ReleaseUnitTest" in name) { - enabled = false // https://youtrack.jetbrains.com/issue/KT-34662 otherwise common tests fail, because we require native android libs to be loaded + if ("DebugUnitTest" in name || "ReleaseUnitTest" in name) { + enabled = + false // https://youtrack.jetbrains.com/issue/KT-34662 otherwise common tests fail, because we require native android libs to be loaded } } tasks { - - create("javadocJar") { dependsOn(dokkaHtml) archiveClassifier.set("javadoc") @@ -634,6 +672,7 @@ tasks { println("Dokka !") dokkaSourceSets { } + } if (getHostOsName() == "linux" && getHostArchitecture() == "x86-64") { @@ -665,7 +704,6 @@ tasks { } - // val legacyjsNodeTest by getting(KotlinJsTest::class) { // // testLogging {