1- import org.gradle.api.attributes.java.TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE
2- import org.gradle.internal.os.OperatingSystem .*
3- import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
4- import java.net.URL
1+ import kx.LwjglModules.*
2+ import kx.KxProject .*
3+ import kx.kxImplementation
4+ import kx.lwjglImplementation
55
66plugins {
7+ val build = " 0.6.1"
8+ id(" kx.kotlin.11" ) version build
9+ id(" kx.lwjgl" ) version build
10+ id(" kx.dokka" ) version build
711 java
8- kotlin(" jvm" ) version " 1.4.10"
912 `maven- publish`
10- id(" org.jetbrains.dokka" ) version " 1.4.10"
11- id(" com.github.johnrengelman.shadow" ).version(" 6.1.0" )
1213}
1314
14- group = " com.github.kotlin_graphics"
15- val moduleName = " $group .gli"
16-
17- val kotestVersion = " 4.2.5"
18- val kx = " com.github.kotlin-graphics"
19- val unsignedVersion: String by project
20- val koolVersion: String by project
21- val glmVersion: String by project
22- val lwjglVersion = " 3.2.3"
23- val lwjglNatives = " natives-" + when (current()) {
24- WINDOWS -> " windows"
25- LINUX -> " linux"
26- else -> " macos"
27- }
15+ group = " com.github.kotlin.graphics"
16+ version = " 0.8.3.0-17"
2817
2918repositories {
30- mavenCentral()
31- jcenter()
19+ maven(" https://repo.repsy.io/mvn/elect/kx" )
3220 maven(" https://jitpack.io" )
3321}
3422
3523dependencies {
36- implementation(kotlin(" stdlib-jdk8" ))
3724
38- implementation(platform(" $kx .glm:bom:$glmVersion " ))
39-
40- implementation(" $kx :kotlin-unsigned" )
41- implementation(" $kx :kool" )
42- implementation(" $kx :glm:$glmVersion " )
25+ kxImplementation(unsigned, kool, glm)
4326
4427 // https://mvnrepository.com/artifact/com.twelvemonkeys.imageio/imageio-core
4528 listOf (/* "-batik",*/ " -bmp" , " -core" , " -icns" , " -iff" , " -jpeg" , " -metadata" , " -pcx" , " -pdf" , " -pict" , " -pnm" ,
@@ -49,82 +32,11 @@ dependencies {
4932 // https://mvnrepository.com/artifact/org.apache.xmlgraphics/batik-transcoder
5033 // implementation "org.apache.xmlgraphics:batik-transcoder:1.12"
5134
52- implementation(platform(" org.lwjgl:lwjgl-bom:$lwjglVersion " ))
53- listOf (" " , " -jemalloc" , " -opengl" ).forEach {
54- implementation(" org.lwjgl" , " lwjgl$it " )
55- runtimeOnly(" org.lwjgl" , " lwjgl$it " , classifier = lwjglNatives)
56- }
57-
58- testImplementation(" io.kotest:kotest-runner-junit5-jvm:$kotestVersion " )
59- testImplementation(" io.kotest:kotest-assertions-core-jvm:$kotestVersion " )
60- }
61-
62- java { modularity.inferModulePath.set(true ) }
63-
64- tasks {
65- dokkaHtml {
66- dokkaSourceSets.configureEach {
67- sourceLink {
68- localDirectory.set(file(" src/main/kotlin" ))
69- remoteUrl.set(URL (" https://github.com/kotlin-graphics/gli/tree/master/src/main/kotlin" ))
70- remoteLineSuffix.set(" #L" )
71- }
72- }
73- }
74-
75- withType<KotlinCompile >().all {
76- kotlinOptions {
77- jvmTarget = " 11"
78- freeCompilerArgs + = listOf (" -Xinline-classes" , " -Xopt-in=kotlin.RequiresOptIn" )
79- }
80- sourceCompatibility = " 11"
81- }
82-
83- compileJava { // this is needed because we have a separate compile step in this example with the 'module-info.java' is in 'main/java' and the Kotlin code is in 'main/kotlin'
84- options.compilerArgs = listOf (" --patch-module" , " $moduleName =${sourceSets.main.get().output.asPath} " )
85- }
86-
87- withType<Test > { useJUnitPlatform() }
88- }
89-
90- val dokkaJavadocJar by tasks.register<Jar >(" dokkaJavadocJar" ) {
91- dependsOn(tasks.dokkaJavadoc)
92- from(tasks.dokkaJavadoc.get().outputDirectory.get())
93- archiveClassifier.set(" javadoc" )
94- }
95-
96- val dokkaHtmlJar by tasks.register<Jar >(" dokkaHtmlJar" ) {
97- dependsOn(tasks.dokkaHtml)
98- from(tasks.dokkaHtml.get().outputDirectory.get())
99- archiveClassifier.set(" html-doc" )
100- }
101-
102- val sourceJar = task(" sourceJar" , Jar ::class ) {
103- dependsOn(tasks.classes)
104- archiveClassifier.set(" sources" )
105- from(sourceSets.main.get().allSource)
106- }
107-
108- artifacts {
109- archives(dokkaJavadocJar)
110- archives(dokkaHtmlJar)
111- archives(sourceJar)
35+ lwjglImplementation(jemalloc, opengl)
11236}
11337
11438publishing {
11539 publications.create<MavenPublication >(" mavenJava" ) {
11640 from(components[" java" ])
117- artifact(sourceJar)
11841 }
119- repositories.maven {
120- name = " GitHubPackages"
121- url = uri(" https://maven.pkg.github.com/kotlin-graphics/gli" )
122- credentials {
123- username = System .getenv(" GITHUB_ACTOR" )
124- password = System .getenv(" GITHUB_TOKEN" )
125- }
126- }
127- }
128-
129- // == Add access to the 'modular' variant of kotlin("stdlib"): Put this into a buildSrc plugin and reuse it in all your subprojects
130- configurations.all { attributes.attribute(TARGET_JVM_VERSION_ATTRIBUTE , 11 ) }
42+ }
0 commit comments