Cache dependancies, add proper path to custom libsodium npm module

This commit is contained in:
Ugljesa Jovanovic 2020-06-10 19:09:01 +02:00 committed by Ugljesa Jovanovic
parent 9255bc44fa
commit 6612d8a37b
No known key found for this signature in database
GPG Key ID: 178E6DFCECCB0E0F
4 changed files with 11 additions and 1 deletions

View File

@ -48,6 +48,7 @@ cache:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.konan/cache
- $HOME/.konan/dependencies
branches:
only:
- master

View File

@ -29,3 +29,6 @@ repositories {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4-M2")
}
System.setProperty("PROJECT_PATH", project.projectDir.parentFile.toString())
println("Path ${project.projectDir.parentFile}")

View File

@ -63,7 +63,7 @@ object Deps {
object Npm {
val libsodium = Pair("libsodium-wrappers-sumo", "0.7.6")
// val libsodiumWrappers = Pair("libsodium-wrappers-sumo", "0.7.6")
val libsodiumWrappers = Pair("libsodium-wrappers-sumo", "file:/home/ionspin/Projects/Future/kotlin-multiplatform-crypto/multiplatform-crypto-delegated/libsodium-wrappers-sumo-0.7.6.tgz")
val libsodiumWrappers = Pair("libsodium-wrappers-sumo", "file:${getProjectPath()}/multiplatform-crypto-delegated/libsodium-wrappers-sumo-0.7.6.tgz")
}
}

View File

@ -4,6 +4,7 @@ import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
import java.io.File
/**
* Created by Ugljesa Jovanovic
@ -14,6 +15,11 @@ fun isInIdea() = System.getProperty("idea.active") == "true"
fun isInTravis() = System.getenv("TRAVIS") == "true"
fun getProjectPath() : String {
val path = System.getProperty("PROJECT_PATH")
return path
}
fun getHostOsName(): String {
val target = System.getProperty("os.name")
if (target == "Linux") return "linux"