Skip to content

Commit ddb8ec0

Browse files
committed
build logic extraction
1 parent b339be6 commit ddb8ec0

19 files changed

+162
-348
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ Some of the goals of Omar for 2018 are:
199199
- make text input and handling robust (copy/cut/undo/redo and text filters)
200200
- hunt down bugs
201201

202-
### How to get it
202+
### How to retrieve it:
203+
204+
You can find all the instructions by [mary](https://github.com/kotlin-graphics/mary)
203205

204206
ImGui does not impose any platform specific dependency. Therefor users must specify runtime dependencies themselves. This should
205207
be done with great care to ensure that the dependencies versions do not conflict.
@@ -255,7 +257,10 @@ dependencies {
255257
Please refer to the [wiki](https://github.com/kotlin-graphics/imgui/wiki/Install) for a more detailed guide and for other
256258
systems (such as Maven, Sbt or Leiningen).
257259

258-
Note: total repo size is around 24.1 MB, but there are included 22.6 MB of assets (mainly fonts), this means that the actual size is around 1.5 MB. I always thought a pairs of tens of MB is negligible, but if this is not your case, then just clone and throw away the fonts you don't need or pick up the `imgui-light` jar from the [release page](https://github.com/kotlin-graphics/imgui/releases). Thanks to [chrjen](https://github.com/chrjen) for that.
260+
Note: total repo size is around 24.1 MB, but there are included 22.6 MB of assets (mainly fonts), this means that the
261+
actual size is around 1.5 MB. I always thought a pairs of tens of MB is negligible, but if this is not your case, then
262+
just clone and throw away the fonts you don't need or pick up the `imgui-light` jar from the
263+
[release page](https://github.com/kotlin-graphics/imgui/releases). Thanks to [chrjen](https://github.com/chrjen) for that.
259264

260265
### LibGdx
261266

build.gradle.kts

Lines changed: 47 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,59 @@
1-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2-
import java.net.URL
1+
import kx.KxProject.*
2+
import kx.LwjglModules.*
3+
import kx.kxImplementation
4+
import kx.lwjglImplementation
5+
import org.gradle.internal.os.OperatingSystem.*
36

47
plugins {
5-
java
6-
kotlin("jvm") version "1.4.0"
7-
`maven-publish`
8-
id("org.jetbrains.dokka") version "1.4.0"
9-
id("com.github.johnrengelman.shadow") version "6.0.0"
10-
// idea
8+
val build = "0.7.0+100"
9+
id("kx.kotlin.11") version build
10+
id("kx.lwjgl") version build
11+
id("kx.dokka") version build
12+
id("kx.publish") version build
1113
}
1214

13-
allprojects {
14-
apply(plugin = "java")
15-
apply(plugin = "org.jetbrains.kotlin.jvm")
16-
apply(plugin = "maven-publish")
17-
apply(plugin = "org.jetbrains.dokka")
18-
apply(plugin = "com.github.johnrengelman.shadow")
15+
version = "1.79"
1916

20-
group = "com.github.kotlin_graphics"
21-
22-
java { modularity.inferModulePath.set(true) }
23-
24-
dependencies {
25-
26-
implementation(kotlin("stdlib-jdk8"))
27-
28-
implementation(platform("org.lwjgl:lwjgl-bom:${findProperty("lwjglVersion")}"))
29-
30-
testImplementation("io.kotest:kotest-runner-junit5-jvm:${findProperty("kotestVersion")}")
31-
testImplementation("io.kotest:kotest-assertions-core-jvm:${findProperty("kotestVersion")}")
32-
}
33-
34-
repositories {
35-
mavenCentral()
36-
jcenter()
37-
maven("https://jitpack.io")
38-
}
39-
40-
tasks {
41-
42-
dokkaHtml {
43-
dokkaSourceSets.configureEach {
44-
sourceLink {
45-
localDirectory.set(file("src/main/kotlin"))
46-
remoteUrl.set(URL("https://github.com/kotlin-graphics/glm/tree/master/src/main/kotlin"))
47-
remoteLineSuffix.set("#L")
48-
}
49-
}
50-
}
51-
52-
withType<KotlinCompile>().all {
53-
kotlinOptions {
54-
jvmTarget = "11"
55-
freeCompilerArgs += listOf("-Xinline-classes", "-Xopt-in=kotlin.RequiresOptIn")
56-
}
57-
sourceCompatibility = "11"
58-
}
59-
60-
withType<Test> { useJUnitPlatform() }
61-
62-
// task lightJar (type: Jar) {
63-
// archiveClassifier = 'light'
64-
// from sourceSets . main . output
65-
// exclude 'extraFonts'
66-
// inputs.property("moduleName", moduleName)
67-
// manifest {
68-
// attributes('Automatic-Module-Name': moduleName)
69-
// }
70-
// duplicatesStrategy = DuplicatesStrategy.EXCLUDE
71-
// }
72-
}
73-
74-
val dokkaJavadocJar by tasks.register<Jar>("dokkaJavadocJar") {
75-
dependsOn(tasks.dokkaJavadoc)
76-
from(tasks.dokkaJavadoc.get().outputDirectory.get())
77-
archiveClassifier.set("javadoc")
78-
}
17+
project(":core").dependencies {
18+
implementation(kotlin("reflect"))
19+
kxImplementation(unsigned, kool, glm, gli, unoCore)
20+
lwjglImplementation(jemalloc, stb)
21+
}
7922

80-
val dokkaHtmlJar by tasks.register<Jar>("dokkaHtmlJar") {
81-
dependsOn(tasks.dokkaHtml)
82-
from(tasks.dokkaHtml.get().outputDirectory.get())
83-
archiveClassifier.set("html-doc")
84-
}
23+
project(":gl").dependencies {
24+
implementation(rootProject.projects.core)
25+
implementation(rootProject.projects.glfw)
26+
implementation(kotlin("reflect"))
27+
kxImplementation(unsigned, kool, glm, gli, gln, unoCore)
28+
lwjglImplementation(jemalloc, glfw, opengl, remotery, stb)
29+
testImplementation("com.github.ajalt:mordant:1.2.1")
30+
}
8531

86-
val sourceJar = task("sourceJar", Jar::class) {
87-
dependsOn(tasks.classes)
88-
archiveClassifier.set("sources")
89-
from(sourceSets.main.get().allSource)
90-
}
32+
project(":glfw").dependencies {
33+
implementation(rootProject.projects.core)
34+
implementation(kotlin("reflect"))
35+
kxImplementation(kool, glm, uno)
36+
lwjglImplementation(glfw, opengl, remotery)
37+
}
9138

92-
artifacts {
93-
archives(dokkaJavadocJar)
94-
archives(dokkaHtmlJar)
95-
archives(sourceJar)
39+
project(":openjfx").dependencies {
40+
implementation(rootProject.projects.core)
41+
val platform = when {
42+
current().isWindows -> "win"
43+
current().isLinux -> "linux"
44+
else -> "mac"
9645
}
97-
98-
publishing {
99-
publications.create<MavenPublication>("mavenJava") {
100-
from(components["java"])
101-
artifact(sourceJar)
102-
}
103-
repositories.maven {
104-
name = "GitHubPackages"
105-
url = uri("https://maven.pkg.github.com/kotlin-graphics/imgui")
106-
credentials {
107-
username = System.getenv("GITHUB_ACTOR")
108-
password = System.getenv("GITHUB_TOKEN")
109-
}
110-
}
46+
listOf("base", "graphics").forEach {
47+
implementation("org.openjfx:javafx-$it:11:$platform")
11148
}
49+
kxImplementation(glm)
50+
lwjglImplementation() // just core
51+
}
11252

113-
// == Add access to the 'modular' variant of kotlin("stdlib"): Put this into a buildSrc plugin and reuse it in all your subprojects
114-
configurations.all { attributes.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 11) }
53+
project(":vk").dependencies {
54+
implementation(rootProject.projects.core)
55+
implementation(rootProject.projects.glfw)
56+
implementation(kotlin("reflect"))
57+
kxImplementation(kool, glm, gli, vkk, uno)
58+
lwjglImplementation(glfw, opengl, remotery, vulkan)
11559
}

core/build.gradle.kts

Lines changed: 0 additions & 35 deletions
This file was deleted.

core/src/main/java/module-info.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
module com.github.kotlin_graphics.imgui.core {
1+
module kotlin.graphics.imgui.core {
22

33
requires java.desktop;
44
requires jdk.jdi;
55

66
requires kotlin.stdlib;
77

8-
requires com.github.kotlin_graphics.uno.core;
9-
requires com.github.kotlin_graphics.gli;
10-
requires com.github.kotlin_graphics.glm;
11-
requires com.github.kotlin_graphics.kool;
12-
requires com.github.kotlin_graphics.kotlin_unsigned;
8+
requires kotlin.graphics.uno.core;
9+
requires kotlin.graphics.gli;
10+
requires kotlin.graphics.glm;
11+
requires kotlin.graphics.kool;
12+
requires kotlin.graphics.unsigned;
1313

1414
requires org.lwjgl;
1515
requires org.lwjgl.stb;

core/src/main/kotlin/imgui/helpers.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ infix fun IntBuffer.reserve(newCapacity: Int): IntBuffer {
124124
val backupLim = lim
125125
lim = 0
126126
if (cap > 0)
127-
MemoryUtil.memCopy(adr, newData.adr, remSize.L)
127+
MemoryUtil.memCopy(adr, newData.adr, remByte.L)
128128
newData.lim = backupLim
129129
free()
130130
return newData

gl/build.gradle.kts

Lines changed: 0 additions & 40 deletions
This file was deleted.

gl/src/main/java/module-info.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
module com.github.kotlin_graphics.imgui.gl {
1+
module kotlin.graphics.imgui.gl {
22

33
requires java.desktop;
44

55
requires kotlin.stdlib;
66

7-
requires com.github.kotlin_graphics.imgui.core;
8-
requires com.github.kotlin_graphics.imgui.glfw;
9-
requires com.github.kotlin_graphics.uno.core;
10-
requires com.github.kotlin_graphics.glm;
11-
requires com.github.kotlin_graphics.gln;
12-
requires com.github.kotlin_graphics.kool;
13-
requires com.github.kotlin_graphics.kotlin_unsigned;
7+
requires kotlin.graphics.imgui.core;
8+
requires kotlin.graphics.imgui.glfw;
9+
requires kotlin.graphics.uno.core;
10+
requires kotlin.graphics.glm;
11+
requires kotlin.graphics.gln;
12+
requires kotlin.graphics.kool;
13+
requires kotlin.graphics.unsigned;
1414

1515
requires org.lwjgl.opengl;
1616
requires org.lwjgl.glfw;

glfw/build.gradle.kts

Lines changed: 0 additions & 30 deletions
This file was deleted.

glfw/src/main/java/module-info.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
module com.github.kotlin_graphics.imgui.glfw {
1+
module kotlin.graphics.imgui.glfw {
22

33
requires kotlin.stdlib;
44

5-
requires com.github.kotlin_graphics.imgui.core;
6-
requires com.github.kotlin_graphics.uno.core;
7-
requires com.github.kotlin_graphics.glm;
8-
requires com.github.kotlin_graphics.kool;
5+
requires kotlin.graphics.imgui.core;
6+
requires kotlin.graphics.uno.core;
7+
requires kotlin.graphics.glm;
8+
requires kotlin.graphics.kool;
99

1010
requires org.lwjgl.glfw;
1111

gradle.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ unoVersion = f60532b7
88
lwjglVersion = 3.2.3
99
kotestVersion = 4.2.0
1010

11-
org.gradle.jvmargs=-XX:MaxMetaspaceSize=1g
11+
org.gradle.jvmargs=-XX:MaxMetaspaceSize=1g
12+
org.gradle.daemon=false
13+
platformVersion=0.2.8+46

gradle/wrapper/gradle-wrapper.jar

4.68 KB
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Tue Apr 16 10:43:51 CDT 2019
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-rc-1-bin.zip
4+
distributionSha256Sum=12b807b5d6b065f05e0e47d8d00e9d55fe26d3cfc6cdb22d6825a93940edec90
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip

0 commit comments

Comments
 (0)