Skip to content

Commit

Permalink
Initial native implementation for Linux and Windows x64
Browse files Browse the repository at this point in the history
  • Loading branch information
gergelydaniel committed Dec 10, 2021
1 parent 3c8de1b commit 86973a8
Show file tree
Hide file tree
Showing 16 changed files with 783 additions and 84 deletions.
111 changes: 102 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,49 @@
.idea/*

# Created by https://www.toptal.com/developers/gitignore/api/gradle,jetbrains
# Edit at https://www.toptal.com/developers/gitignore?templates=gradle,jetbrains

### JetBrains ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/
Expand Down Expand Up @@ -33,15 +78,63 @@ fabric.properties
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

local.properties
### JetBrains Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

# Sonarlint plugin
# https://plugins.jetbrains.com/plugin/7973-sonarlint
.idea/**/sonarlint/

*.iml
# SonarQube Plugin
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
.idea/**/sonarIssues.xml

.gradle/*
# Markdown Navigator plugin
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator-enh.xml
.idea/**/markdown-navigator/

build/*
# Cache file creation bug
# See https://youtrack.jetbrains.com/issue/JBR-2257
.idea/$CACHE_FILE$

kgl/build/*
kgl-android/build/*
kgl-jogl/build/*
kgl-lwjgl/build/*
# CodeStream plugin
# https://plugins.jetbrains.com/plugin/12206-codestream
.idea/codestream.xml

### Gradle ###
.gradle
build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties

### Gradle Patch ###
**/build/

# Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath

# End of https://www.toptal.com/developers/gitignore/api/gradle,jetbrains

.idea/artifacts
.idea/modules
local.properties
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
ext {
kotlin_version = '1.6.0'
currentVersion = '0.4'
currentVersion = '0.5-nativetest6'
}
repositories {
maven {
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
kotlin.code.style=official
org.gradle.jvmargs=-Xmx4096M
75 changes: 75 additions & 0 deletions kgl-glfw/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import java.io.FileInputStream
import java.util.*

plugins {
id("org.jetbrains.kotlin.multiplatform")
id("maven-publish")
}

//artifactId = "kgl-glfw"
group = "com.danielgergely.kgl"
version = rootProject.ext["currentVersion"] as String

repositories {
mavenCentral()

maven(url = "https://maven.pkg.github.com/Dominaezzz/kgl") {
credentials {
username = getLocalProperty("GITHUB_USER")
password = getLocalProperty("GITHUB_TOKEN")
}
}
}

val kglVersion = "0.1.11"

kotlin {
/* Targets configuration omitted.
* To find out how to configure the targets, please follow the link:
* https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#setting-up-targets */

linuxX64()
mingwX64()

sourceSets {
val commonMain by getting {
dependencies {
implementation(kotlin("stdlib-common"))
implementation(project(":kgl"))

implementation("com.kgl:kgl-core:$kglVersion")
implementation("com.kgl:kgl-glfw:$kglVersion")
implementation("com.kgl:kgl-glfw-static:$kglVersion") // For GLFW static binaries
implementation("com.kgl:kgl-opengl:$kglVersion")
implementation("com.kgl:kgl-vulkan:$kglVersion")
implementation("com.kgl:kgl-glfw-vulkan:$kglVersion")
implementation("com.kgl:kgl-stb:$kglVersion")
}
}
val linuxX64Main by getting { }
val mingwX64Main by getting { }
val nativeMain by sourceSets.creating {
dependsOn(commonMain)
linuxX64Main.dependsOn(this)
mingwX64Main.dependsOn(this)

dependencies {

}
}
}
}

fun getLocalProperty(key: String): String? =
rootDir.resolve("local.properties")
.let { file ->
if (file.exists()) {
FileInputStream(file)
} else {
null
}
}?.use { fileInputStream ->
val prop = Properties()
prop.load(fileInputStream)
prop.getProperty(key)
} ?: System.getenv(key)
Loading

0 comments on commit 86973a8

Please sign in to comment.