Skip to content

Commit

Permalink
[OpenGL] Updated extensions and compability constants
Browse files Browse the repository at this point in the history
  • Loading branch information
squid233 committed Nov 4, 2023
1 parent b1a5da6 commit 9a0856d
Show file tree
Hide file tree
Showing 67 changed files with 3,244 additions and 41 deletions.
28 changes: 9 additions & 19 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ val orgName: String by project
val orgUrl: String by project
val developers: String by project

val jdkEABuildDoc: String? = null
val targetJavaVersion = 21
val enablePreview = true
rootProject.ext["enablePreview"] = enablePreview
val jdkVersion: String by rootProject
val jdkEnablePreview: String by rootProject
val jdkEarlyAccessDoc: String? by rootProject

val targetJavaVersion = jdkVersion.toInt()

group = projGroupId
version = projVersion
Expand Down Expand Up @@ -149,12 +150,12 @@ subprojects {

tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
if (enablePreview) options.compilerArgs.add("--enable-preview")
if (jdkEnablePreview.toBoolean()) options.compilerArgs.add("--enable-preview")
options.release.set(targetJavaVersion)
}

tasks.withType<Test> {
if (enablePreview) jvmArgs("--enable-preview")
if (jdkEnablePreview.toBoolean()) jvmArgs("--enable-preview")
}

extensions.configure<JavaPluginExtension>("java") {
Expand Down Expand Up @@ -247,10 +248,10 @@ allprojects {
charSet = "UTF-8"
docEncoding = "UTF-8"
isAuthor = true
if (jdkEABuildDoc == null) {
if (jdkEarlyAccessDoc == null) {
links("https://docs.oracle.com/en/java/javase/$targetJavaVersion/docs/api/")
} else {
links("https://download.java.net/java/early_access/$jdkEABuildDoc/docs/api/")
links("https://download.java.net/java/early_access/$jdkEarlyAccessDoc/docs/api/")
}

tags(
Expand Down Expand Up @@ -294,17 +295,6 @@ publishing.publications {
name.set(orgName)
url.set(orgUrl)
}
developers {
developers.split(',')
.map { it.split(':', limit = 3) }
.forEach { (id1, name1, email1) ->
developer {
id.set(id1)
name.set(name1)
email.set(email1)
}
}
}
scm {
connection.set("scm:git:https://github.com/${projVcs}.git")
developerConnection.set("scm:git:https://github.com/${projVcs}.git")
Expand Down
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ projBranch=main
orgName=Overrun Organization
orgUrl=https://over-run.github.io/

# Developers
developers=squid233:squid233:[email protected]
jdkVersion=21
jdkEnablePreview=true
#jdkEarlyAccessDoc=jdk22

projModules=core, glfw, nfd, joml, opengl, stb
9 changes: 5 additions & 4 deletions modules/overrungl.opengl/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
val enablePreview: Boolean by rootProject.ext
val jdkVersion: String by rootProject
val jdkEnablePreview: String by rootProject

sourceSets {
create("generator")
Expand All @@ -7,16 +8,16 @@ sourceSets {
tasks.named<JavaCompile>("compileGeneratorJava") {
javaCompiler.set(javaToolchains.compilerFor {
targetCompatibility = "20"
languageVersion.set(JavaLanguageVersion.of(21))
languageVersion.set(JavaLanguageVersion.of(jdkVersion))
})
}

tasks.register<JavaExec>("generate") {
classpath(sourceSets["generator"].runtimeClasspath)
javaLauncher.set(javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(21))
languageVersion.set(JavaLanguageVersion.of(jdkVersion))
})
if (enablePreview) jvmArgs("--enable-preview")
if (jdkEnablePreview.toBoolean()) jvmArgs("--enable-preview")
mainClass.set("overrungl.opengl.OpenGLGeneratorKt")
workingDir = File("src/main/java/overrungl/opengl")
}
Loading

0 comments on commit 9a0856d

Please sign in to comment.