Update dokka, update resource extractor, update js wrapper versions, remove js from sample as gradle cant find libs when building

This commit is contained in:
Ugljesa Jovanovic 2021-07-19 19:29:26 +02:00
parent d9a847d39d
commit d6945979a9
No known key found for this signature in database
GPG Key ID: 178E6DFCECCB0E0F
12 changed files with 74 additions and 145 deletions

View File

@ -20,11 +20,8 @@ buildscript {
repositories {
mavenCentral()
google()
maven ("https://kotlin.bintray.com/kotlinx")
maven ("https://dl.bintray.com/kotlin/kotlin-eap")
maven ("https://dl.bintray.com/kotlin/kotlin-dev")
gradlePluginPortal()
jcenter()
}
dependencies {
@ -39,10 +36,6 @@ allprojects {
repositories {
mavenCentral()
google()
maven ("https://kotlin.bintray.com/kotlinx")
maven ("https://dl.bintray.com/kotlin/kotlin-eap")
maven ("https://dl.bintray.com/kotlin/kotlin-dev")
jcenter()
maven {
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
}

View File

@ -24,9 +24,6 @@ plugins {
repositories {
mavenCentral()
maven ("https://dl.bintray.com/kotlin/kotlin-eap")
maven("https://dl.bintray.com/kotlin/kotlin-dev")
jcenter()
google()
}

View File

@ -21,7 +21,7 @@ object Versions {
val kotlinSerializationPlugin = "1.5.10"
val atomicfu = "0.14.3-M2-2-SNAPSHOT" //NOTE: my linux arm32 and arm64 build
val nodePlugin = "1.3.0"
val dokkaPlugin = "1.4.0-rc"
val dokkaPlugin = "1.5.0"
val taskTreePlugin = "1.5"
val kotlinBigNumVersion = "0.2.8"
val jna = "5.7.0"
@ -31,7 +31,7 @@ object Versions {
val timber = "4.7.1"
val kodeinVersion = "7.1.0"
val resourceLoader = "1.3.10"
val resourceLoader = "2.0.1"
@ -67,10 +67,10 @@ object Deps {
object Js {
object JsVersions {
val react = "16.13.1-pre.124-kotlin-1.4.10"
val reactNpm = "16.13.1"
val styled = "5.2.0-pre.124-kotlin-1.4.10"
val styledNpm = "1.0.0"
val react = "17.0.2-pre.218-kotlin-1.5.21"
val reactNpm = "17.0.2"
val styled = "5.3.0-pre.218-kotlin-1.5.21"
val styledNpm = "5.3.0"
}
@ -84,9 +84,9 @@ object Deps {
val ktorClientWebSockets = "io.ktor:ktor-client-websockets-js:${Versions.ktor}"
object React {
val react = "org.jetbrains:kotlin-react:${JsVersions.react}"
val reactDom = "org.jetbrains:kotlin-react-dom:${JsVersions.react}"
val styled = "org.jetbrains:kotlin-styled:${JsVersions.styled}"
val react = "org.jetbrains.kotlin-wrappers:kotlin-react:${JsVersions.react}"
val reactDom = "org.jetbrains.kotlin-wrappers:kotlin-react-dom:${JsVersions.react}"
val styled = "org.jetbrains.kotlin-wrappers:kotlin-styled:${JsVersions.styled}"
}
@ -96,7 +96,7 @@ object Deps {
val libsodiumWrappers = Pair("libsodium-wrappers-sumo", "0.7.8")
val reactPair = Pair("react", JsVersions.reactNpm)
val reactDomPair = Pair("react-dom", JsVersions.reactNpm)
val styledComponentsPair = Pair("styled-components", "5.2.0")
val styledComponentsPair = Pair("styled-components", JsVersions.styledNpm)
val inlineStylePrefixesPair = Pair("inline-style-prefixer", "6.0.0")
}
@ -114,7 +114,7 @@ object Deps {
val kotlinPoet = "com.squareup:kotlinpoet:${Versions.kotlinPoet}"
val resourceLoader = "co.libly:resource-loader:${Versions.resourceLoader}"
val resourceLoader = "com.goterl:resource-loader:${Versions.resourceLoader}"
object Delegated {
val jna = "net.java.dev.jna:jna:${Versions.jna}"

View File

@ -16,6 +16,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@ -30,8 +30,6 @@ plugins {
repositories {
mavenCentral()
jcenter()
}
group = ReleaseInfo.group
version = ReleaseInfo.version

View File

@ -47,7 +47,6 @@ val sonatypeUsernameEnv: String? = System.getenv()["SONATYPE_USERNAME"]
repositories {
mavenCentral()
jcenter()
maven {
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
}
@ -604,21 +603,19 @@ tasks {
dokkaJavadoc {
create<Jar>("javadocJar") {
dependsOn(dokkaHtml)
archiveClassifier.set("javadoc")
from(dokkaHtml.get().outputDirectory)
}
dokkaHtml {
println("Dokka !")
dokkaSourceSets {
create("commonMain") {
displayName = "common"
platform = "common"
}
}
}
create<Jar>("javadocJar") {
dependsOn(dokkaJavadoc)
archiveClassifier.set("javadoc")
from(dokkaJavadoc.get().outputDirectory)
}
if (getHostOsName() == "linux" && getHostArchitecture() == "x86-64") {
val jvmTest by getting(Test::class) {
testLogging {
@ -755,18 +752,5 @@ publishing {
}
}
//configurations.forEach {
//
// if (it.name == "linuxCompileKlibraries") {
// println("Configuration name: ${it.name}")
// it.attributes {
// this.keySet().forEach { key ->
// val attribute = getAttribute(key)
// println(" |-- Attribute $key ${attribute}")
// attribute(org.jetbrains.kotlin.gradle.plugin.ProjectLocalConfigurations.ATTRIBUTE, "publicZ")
// }
// }
// }
//}

View File

@ -1,7 +1,6 @@
package com.ionspin.kotlin.crypto
import co.libly.resourceloader.FileLoader
import co.libly.resourceloader.SharedLibraryLoader
import com.goterl.resourceloader.SharedLibraryLoader
import com.sun.jna.Native
import com.sun.jna.Platform
import java.io.File

View File

@ -32,7 +32,6 @@ plugins {
kotlin(PluginsDeps.kotlinSerializationPlugin) version Versions.kotlinSerializationPlugin
}
org.jetbrains.kotlin.gradle.targets.js.npm.NpmResolverPlugin.apply(project)
val sonatypeStaging = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
val sonatypeSnapshots = "https://oss.sonatype.org/content/repositories/snapshots/"
@ -41,8 +40,6 @@ val sonatypeSnapshots = "https://oss.sonatype.org/content/repositories/snapshots
repositories {
mavenCentral()
jcenter()
maven("https://dl.bintray.com/terl/lazysodium-maven")
maven("https://oss.sonatype.org/content/repositories/snapshots/")
}
@ -63,28 +60,28 @@ kotlin {
android()
runningOnLinuxx86_64 {
jvm()
js(IR) {
browser {
webpackTask {
}
testTask {
useKarma {
useChrome()
}
}
}
nodejs {
testTask {
useMocha() {
timeout = "10s"
}
}
}
// js(IR) {
// browser {
// webpackTask {
//
// }
// testTask {
// useKarma {
// useChrome()
// }
// }
// }
// nodejs {
// testTask {
// useMocha() {
// timeout = "10s"
// }
// }
// }
// binaries.executable()
}
// }
linuxX64("linux") {
@ -205,11 +202,7 @@ kotlin {
implementation("androidx.core:core-ktx:1.3.2")
implementation("androidx.constraintlayout:constraintlayout:2.0.2")
implementation("com.google.android.material:material:1.3.0-alpha03")
// implementation("androidx.ui:ui-tooling:$composeDevVersion")
// implementation("androidx.ui:ui-layout:$composeDevVersion")
// implementation("androidx.ui:ui-material:$composeDevVersion")
// implementation("androidx.ui:ui-foundation:$composeDevVersion")
// implementation("androidx.ui:ui-framework:$composeDevVersion")
implementation(Deps.Android.coroutines)
implementation(Deps.Android.timber)
// implementation("androidx.compose:compose-runtime:$composeDevVersion")
@ -244,7 +237,7 @@ kotlin {
val nativeMain by getting {
dependsOn(commonMain)
dependencies {
implementation(Deps.Desktop.libui)
}
}
nativeMain
@ -252,7 +245,7 @@ kotlin {
val nativeMain by creating {
dependsOn(commonMain)
dependencies {
implementation(Deps.Desktop.libui)
}
}
nativeMain
@ -291,29 +284,30 @@ kotlin {
implementation(kotlin(Deps.Jvm.reflection))
}
}
val jsMain by getting {
dependencies {
implementation(kotlin(Deps.Js.stdLib))
implementation(Deps.Js.coroutines)
// React
implementation(Deps.Js.React.react)
implementation(Deps.Js.React.reactDom)
implementation(npm(Deps.Js.Npm.reactPair.first, Deps.Js.Npm.reactPair.second))
implementation(npm(Deps.Js.Npm.reactDomPair.first, Deps.Js.Npm.reactDomPair.second))
// Styled
implementation(Deps.Js.React.styled)
implementation(npm(Deps.Js.Npm.styledComponentsPair.first, Deps.Js.Npm.styledComponentsPair.second))
implementation(npm(Deps.Js.Npm.inlineStylePrefixesPair.first, Deps.Js.Npm.inlineStylePrefixesPair.second))
}
}
val jsTest by getting {
dependencies {
implementation(kotlin(Deps.Js.test))
}
}
// val jsMain by getting {
// dependencies {
// implementation(kotlin(Deps.Js.stdLib))
// implementation(Deps.Js.coroutines)
//
//
// // React
// implementation(Deps.Js.React.react)
// implementation(Deps.Js.React.reactDom)
//// implementation(npm(Deps.Js.Npm.reactPair.first, Deps.Js.Npm.reactPair.second))
//// implementation(npm(Deps.Js.Npm.reactDomPair.first, Deps.Js.Npm.reactDomPair.second))
//
// // Styled
// implementation(Deps.Js.React.styled)
//// implementation(npm(Deps.Js.Npm.styledComponentsPair.first, Deps.Js.Npm.styledComponentsPair.second))
//// implementation(npm(Deps.Js.Npm.inlineStylePrefixesPair.first, Deps.Js.Npm.inlineStylePrefixesPair.second))
//
// }
// }
// val jsTest by getting {
// dependencies {
// implementation(kotlin(Deps.Js.test))
// }
// }
val linuxMain by getting {
dependsOn(nativeMain)
@ -481,12 +475,12 @@ tasks {
}
}
val jsNodeTest by getting(KotlinJsTest::class) {
testLogging {
events("PASSED", "FAILED", "SKIPPED")
showStandardStreams = true
}
}
// val jsNodeTest by getting(KotlinJsTest::class) {
// testLogging {
// events("PASSED", "FAILED", "SKIPPED")
// showStandardStreams = true
// }
// }
}

View File

@ -1,7 +1,6 @@
import com.ionspin.kotlin.crypto.hash.Hash
import com.ionspin.kotlin.crypto.util.encodeToUByteArray
import com.ionspin.kotlin.crypto.util.toHexString
import kotlinx.css.br
import react.RBuilder
import react.RComponent
import react.RProps

View File

@ -2,5 +2,4 @@ import com.ionspin.kotlin.crypto.sample.Sample
fun main() : Unit {
Sample.runSample()
ui()
}

View File

@ -1,30 +0,0 @@
import com.ionspin.kotlin.crypto.hash.Hash
import com.ionspin.kotlin.crypto.util.encodeToUByteArray
import com.ionspin.kotlin.crypto.util.toHexString
import libui.ktx.TextArea
import libui.ktx.appWindow
import libui.ktx.button
import libui.ktx.textarea
import libui.ktx.vbox
fun ui() = appWindow(
title = "Hello",
width = 320,
height = 240
) {
val hash = Hash.sha512("123".encodeToUByteArray())
val text = "Hash (SHA512) of 123: ${hash.toHexString()}"
vbox {
lateinit var scroll: TextArea
button("Test") {
action {
scroll.append(text.trimMargin())
}
}
scroll = textarea {
readonly = true
stretchy = true
}
}
}

View File

@ -17,11 +17,7 @@
pluginManagement {
repositories {
maven("https://dl.bintray.com/kotlin/kotlin-eap")
maven("https://dl.bintray.com/kotlin/kotlin-dev")
mavenCentral()
maven("https://plugins.gradle.org/m2/")
}