This repository has been archived by the owner on Jun 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
994 additions
and
1,878 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ package-lock.json | |
*.a | ||
*.o | ||
*.so | ||
cmake-build-debug/ | ||
cmake-build-*/ | ||
|
||
# C++ | ||
.cxx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#### 0.4.0 (02-11-2020) | ||
|
||
- BREAKING CHANGES | ||
* JNI for desktop JVM artifacts renamed to `kodein-db-jni-jvm`, `kodein-db-jni-jvm-linux`, `kodein-db-jni-jvm-macos` & `kodein-db-jni-jvm-windows` (added `-jvm-`). | ||
* `DB.factory` renamed to `DB.default`. Not a breaking change if you are using `DB.open` & `DB.destroy` utilities. | ||
|
||
- MODULES | ||
* new `kodein-leveldb-inmemory` and `kodein-db-inmemory` modules that contain in-memory only backend. DO NOT USE IN PRODUCTION! This is for tests only! | ||
|
||
- CORE | ||
* Kotlin `1.4.10`. | ||
|
||
- BUILD | ||
* Restored Windows build. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
jcenter() | ||
} | ||
|
||
gradlePlugin{ | ||
plugins { | ||
register("android-ndk-plugin") { | ||
id = "org.kodein.gradle.android-ndk" | ||
implementationClass = "org.kodein.gradle.androidNdkPlugin" | ||
} | ||
register("cmake-plugin") { | ||
id = "org.kodein.gradle.cmake" | ||
implementationClass = "org.kodein.gradle.cmake.CMakePlugin" | ||
} | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
buildSrc/src/main/kotlin/org/kodein/gradle/androidNdkPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.kodein.gradle | ||
|
||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import java.io.File | ||
import java.util.* | ||
import kotlin.collections.HashMap | ||
|
||
|
||
class androidNdkPlugin : Plugin<Project> { | ||
|
||
class Extension(private val rootProject: Project) { | ||
fun ndkPath(version: String): String { | ||
(rootProject.findProperty("android-ndk-$version-path") as? String)?.let { return it } | ||
|
||
val localPropsFile = rootProject.file("local.properties") | ||
check(localPropsFile.exists()) { "Please create android root local.properties" } | ||
|
||
val localProps = localPropsFile.inputStream().use { Properties().apply { load(it) } } | ||
|
||
val sdkDir = localProps.getProperty("sdk.dir")?.let { File(it) } | ||
?: throw IllegalStateException("Please set sdk.dir android sdk path in root local.properties") | ||
|
||
val ndkDir = sdkDir.resolve("ndk").resolve(version).takeIf { it.exists() } | ||
?: throw IllegalStateException("Please install Android NDK version $version") | ||
|
||
val ndkPath = ndkDir.absolutePath | ||
@Suppress("UNCHECKED_CAST") | ||
(rootProject.properties as HashMap<String, Any>).put("android-ndk-$version-path", ndkPath) | ||
|
||
return ndkPath | ||
} | ||
} | ||
|
||
override fun apply(target: Project) { | ||
target.extensions.add("androidNdk", Extension(target.rootProject)) | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
buildSrc/src/main/kotlin/org/kodein/gradle/cmake/CMakeBuildTask.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.kodein.gradle.cmake | ||
|
||
import org.gradle.api.tasks.* | ||
import java.io.File | ||
|
||
|
||
open class CMakeBuildTask : AbstractExecTask<CMakeBuildTask>(CMakeBuildTask::class.java) { | ||
|
||
private lateinit var conf: CMakeConfigureTask | ||
|
||
@get:Input | ||
var target: String = "install" | ||
|
||
@get:InputDirectory | ||
val cmakeProjectDir: File get() = conf.cmakeProjectDir | ||
|
||
@get:OutputDirectory | ||
val installDir: File | ||
get() = File(conf.installPath) | ||
|
||
init { | ||
group = "build" | ||
executable = "cmake" | ||
} | ||
|
||
internal fun initialize(conf: CMakeConfigureTask) { | ||
this.conf = conf | ||
dependsOn(conf) | ||
workingDir = conf.workingDir | ||
} | ||
|
||
override fun exec() { | ||
val a = mutableListOf("--build", ".") | ||
a.addAll(args ?: emptyList()) | ||
a.addAll(listOf("--target", target)) | ||
setArgs(a) | ||
super.exec() | ||
} | ||
|
||
} |
Oops, something went wrong.