Skip to content

Commit

Permalink
feat: lowercase LWJGL in class names
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMrMilchmann committed Sep 9, 2024
1 parent f3db453 commit 64ab47b
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 59 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ libraries. Modules can be added to a target as follows:
```kotlin
lwjgl3 {
targets.named("main") {
modules.add(LWJGL.Core)
modules.add(Lwjgl.Core)
}
}
```
Expand Down
40 changes: 21 additions & 19 deletions api/gradle-lwjgl3.api
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public final class com/osmerion/gradle/lwjgl3/ArchitectureKt {
public static final fun Architecture (Ljava/util/function/Predicate;)Lcom/osmerion/gradle/lwjgl3/Architecture;
}

public final class com/osmerion/gradle/lwjgl3/LWJGL {
public static final field INSTANCE Lcom/osmerion/gradle/lwjgl3/LWJGL;
public final class com/osmerion/gradle/lwjgl3/Lwjgl {
public static final field INSTANCE Lcom/osmerion/gradle/lwjgl3/Lwjgl;
public static final fun getAssimp ()Ljava/lang/CharSequence;
public static final fun getBGFX ()Ljava/lang/CharSequence;
public static final fun getCUDA ()Ljava/lang/CharSequence;
Expand Down Expand Up @@ -80,21 +80,23 @@ public final class com/osmerion/gradle/lwjgl3/LWJGL {
public static final fun getZstd ()Ljava/lang/CharSequence;
}

public final class com/osmerion/gradle/lwjgl3/LWJGLConstants {
public static final field INSTANCE Lcom/osmerion/gradle/lwjgl3/LWJGLConstants;
public final class com/osmerion/gradle/lwjgl3/LwjglConstants {
public static final field INSTANCE Lcom/osmerion/gradle/lwjgl3/LwjglConstants;
public final fun getDEFAULT_GROUP_NAME ()Ljava/lang/String;
public final fun getDEFAULT_VERSION ()Ljava/lang/String;
public final fun getPROPERTY_IMPLICIT_TARGET ()Ljava/lang/String;
}

public class com/osmerion/gradle/lwjgl3/LWJGLExtension {
public class com/osmerion/gradle/lwjgl3/LwjglExtension {
public final fun getGroup ()Lorg/gradle/api/provider/Property;
public final fun getTargets ()Lorg/gradle/api/NamedDomainObjectContainer;
public final fun getVersion ()Lorg/gradle/api/provider/Property;
}

public abstract class com/osmerion/gradle/lwjgl3/LWJGLTarget {
public fun <init> (Ljava/lang/String;Lorg/gradle/api/model/ObjectFactory;Lorg/gradle/api/artifacts/ConfigurationContainer;)V
public abstract class com/osmerion/gradle/lwjgl3/LwjglTarget {
public fun <init> (Ljava/lang/String;Lcom/osmerion/gradle/lwjgl3/LwjglExtension;Lorg/gradle/api/model/ObjectFactory;Lorg/gradle/api/artifacts/ConfigurationContainer;)V
public final fun freebsdX64 (Ljava/lang/String;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun freebsdX64$default (Lcom/osmerion/gradle/lwjgl3/LWJGLTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun freebsdX64$default (Lcom/osmerion/gradle/lwjgl3/LwjglTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public final fun getGroup ()Lorg/gradle/api/provider/Property;
public final fun getLibConfiguration ()Lorg/gradle/api/NamedDomainObjectProvider;
public final fun getModules ()Lorg/gradle/api/provider/SetProperty;
Expand All @@ -104,35 +106,35 @@ public abstract class com/osmerion/gradle/lwjgl3/LWJGLTarget {
public final fun getVersion ()Lorg/gradle/api/provider/Property;
public final fun linuxARM32 ()Lorg/gradle/api/NamedDomainObjectProvider;
public final fun linuxARM32 (Ljava/lang/String;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun linuxARM32$default (Lcom/osmerion/gradle/lwjgl3/LWJGLTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun linuxARM32$default (Lcom/osmerion/gradle/lwjgl3/LwjglTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public final fun linuxARM64 ()Lorg/gradle/api/NamedDomainObjectProvider;
public final fun linuxARM64 (Ljava/lang/String;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun linuxARM64$default (Lcom/osmerion/gradle/lwjgl3/LWJGLTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun linuxARM64$default (Lcom/osmerion/gradle/lwjgl3/LwjglTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public final fun linuxPPC64LE ()Lorg/gradle/api/NamedDomainObjectProvider;
public final fun linuxPPC64LE (Ljava/lang/String;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun linuxPPC64LE$default (Lcom/osmerion/gradle/lwjgl3/LWJGLTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun linuxPPC64LE$default (Lcom/osmerion/gradle/lwjgl3/LwjglTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public final fun linuxRISCV64 ()Lorg/gradle/api/NamedDomainObjectProvider;
public final fun linuxRISCV64 (Ljava/lang/String;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun linuxRISCV64$default (Lcom/osmerion/gradle/lwjgl3/LWJGLTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun linuxRISCV64$default (Lcom/osmerion/gradle/lwjgl3/LwjglTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public final fun linuxX64 ()Lorg/gradle/api/NamedDomainObjectProvider;
public final fun linuxX64 (Ljava/lang/String;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun linuxX64$default (Lcom/osmerion/gradle/lwjgl3/LWJGLTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun linuxX64$default (Lcom/osmerion/gradle/lwjgl3/LwjglTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public final fun macosARM64 ()Lorg/gradle/api/NamedDomainObjectProvider;
public final fun macosARM64 (Ljava/lang/String;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun macosARM64$default (Lcom/osmerion/gradle/lwjgl3/LWJGLTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun macosARM64$default (Lcom/osmerion/gradle/lwjgl3/LwjglTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public final fun macosX64 ()Lorg/gradle/api/NamedDomainObjectProvider;
public final fun macosX64 (Ljava/lang/String;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun macosX64$default (Lcom/osmerion/gradle/lwjgl3/LWJGLTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun macosX64$default (Lcom/osmerion/gradle/lwjgl3/LwjglTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public final fun platform (Ljava/lang/String;Lorg/gradle/api/Action;)Lorg/gradle/api/NamedDomainObjectProvider;
public final fun windowsARM64 ()Lorg/gradle/api/NamedDomainObjectProvider;
public final fun windowsARM64 (Ljava/lang/String;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun windowsARM64$default (Lcom/osmerion/gradle/lwjgl3/LWJGLTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun windowsARM64$default (Lcom/osmerion/gradle/lwjgl3/LwjglTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public final fun windowsX64 ()Lorg/gradle/api/NamedDomainObjectProvider;
public final fun windowsX64 (Ljava/lang/String;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun windowsX64$default (Lcom/osmerion/gradle/lwjgl3/LWJGLTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun windowsX64$default (Lcom/osmerion/gradle/lwjgl3/LwjglTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public final fun windowsX86 ()Lorg/gradle/api/NamedDomainObjectProvider;
public final fun windowsX86 (Ljava/lang/String;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun windowsX86$default (Lcom/osmerion/gradle/lwjgl3/LWJGLTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
public static synthetic fun windowsX86$default (Lcom/osmerion/gradle/lwjgl3/LwjglTarget;Ljava/lang/String;ILjava/lang/Object;)Lorg/gradle/api/NamedDomainObjectProvider;
}

public class com/osmerion/gradle/lwjgl3/NativePlatform {
Expand Down Expand Up @@ -171,7 +173,7 @@ public class com/osmerion/gradle/lwjgl3/PlatformMatcher {
public final fun getOs ()Lorg/gradle/api/provider/Property;
}

public final class com/osmerion/gradle/lwjgl3/plugins/LWJGLPlugin : org/gradle/api/Plugin {
public final class com/osmerion/gradle/lwjgl3/plugins/LwjglPlugin : org/gradle/api/Plugin {
public fun <init> ()V
public synthetic fun apply (Ljava/lang/Object;)V
public fun apply (Lorg/gradle/api/Project;)V
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ gradlePlugin {
description = "A Gradle plugin to simplify working with LWJGL 3."
tags.addAll("dependency-management", "lwjgl", "lwjgl3")

implementationClass = "com.osmerion.gradle.lwjgl3.plugins.LWJGLPlugin"
implementationClass = "com.osmerion.gradle.lwjgl3.plugins.LwjglPlugin"
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion docs/changelog/0.4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ _Not Released Yet_

#### Breaking Changes

- Updated the minimum required Gradle version to 8.0 (from 7.6).
- Updated the minimum required Gradle version to 8.0 (from 7.6).
- `LWJGL` has been replaced with `Lwjgl` in class names to follow Kotlin naming
conventions.
6 changes: 3 additions & 3 deletions samples/groovy-dsl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ java {
lwjgl3 {
targets {
named("main") {
modules.add(LWJGL.Core)
modules.add(LWJGL.GLFW)
modules.add(LWJGL.OpenGL)
modules.add(Lwjgl.Core)
modules.add(Lwjgl.GLFW)
modules.add(Lwjgl.OpenGL)

linuxX64()
macosARM64()
Expand Down
6 changes: 3 additions & 3 deletions samples/kotlin-dsl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ java {
lwjgl3 {
targets {
named("main") {
modules.add(LWJGL.Core)
modules.add(LWJGL.GLFW)
modules.add(LWJGL.OpenGL)
modules.add(Lwjgl.Core)
modules.add(Lwjgl.GLFW)
modules.add(Lwjgl.OpenGL)

linuxX64()
macosARM64()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import java.nio.file.Paths
import kotlin.io.path.ExperimentalPathApi
import kotlin.io.path.copyToRecursively

class LWJGLPluginTest {
class LwjglPluginTest {

private companion object {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ package com.osmerion.gradle.lwjgl3
*
* @since 0.1.0
*/
public object LWJGL {
public object Lwjgl {

private data class LWJGLModule(
val artifactName: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ package com.osmerion.gradle.lwjgl3
* necessarily constant across versions of the plugin.
*/
@Suppress("MayBeConstant")
public object LWJGLConstants {
public object LwjglConstants {

/**
* The default group name of the coordinates for LWJGL artifacts.
*
* @see LWJGLTarget.group
* @see LwjglTarget.group
*
* @since 0.1.0
*/
Expand All @@ -54,7 +54,7 @@ public object LWJGLConstants {
/**
* The default LWJGL version.
*
* @see LWJGLTarget.version
* @see LwjglTarget.version
*
* @since 0.1.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ import javax.inject.Inject
*
* @since 0.1.0
*/
public open class LWJGLExtension @Inject internal constructor(
public open class LwjglExtension @Inject internal constructor(
objectFactory: ObjectFactory
) {

/**
* The group name of the GAV coordinates for the LWJGL artifacts.
*
* Defaults to [LWJGLConstants.DEFAULT_GROUP_NAME].
* Defaults to [LwjglConstants.DEFAULT_GROUP_NAME].
*
* @since 0.4.0
*/
Expand All @@ -56,7 +56,7 @@ public open class LWJGLExtension @Inject internal constructor(
/**
* The version of the GAV coordinates for the LWJGL artifacts.
*
* Defaults to [LWJGLConstants.DEFAULT_VERSION].
* Defaults to [LwjglConstants.DEFAULT_VERSION].
*
* @since 0.4.0
*/
Expand All @@ -67,16 +67,16 @@ public open class LWJGLExtension @Inject internal constructor(
*
* @since 0.1.0
*/
public val targets: NamedDomainObjectContainer<LWJGLTarget> = objectFactory.domainObjectContainer(LWJGLTarget::class.java) {
objectFactory.newInstance(LWJGLTarget::class.java, it)
public val targets: NamedDomainObjectContainer<LwjglTarget> = objectFactory.domainObjectContainer(LwjglTarget::class.java) {
objectFactory.newInstance(LwjglTarget::class.java, it, this)
}

init {
group.finalizeValueOnRead()
group.convention(LWJGLConstants.DEFAULT_GROUP_NAME)
group.convention(LwjglConstants.DEFAULT_GROUP_NAME)

version.finalizeValueOnRead()
version.convention(LWJGLConstants.DEFAULT_VERSION)
version.convention(LwjglConstants.DEFAULT_VERSION)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,21 @@ import javax.inject.Inject
* A _target_ serves as abstraction to handle multiple LWJGL setups (for
* example, in different source sets) in a single Gradle project.
*
* @see LWJGLExtension.targets
* @see LwjglExtension.targets
*
* @since 0.1.0
*/
public abstract class LWJGLTarget @Inject constructor(
public abstract class LwjglTarget @Inject constructor(
public val name: String,
lwjglExtension: LWJGLExtension,
lwjglExtension: LwjglExtension,
objectFactory: ObjectFactory,
configurations: ConfigurationContainer
) {

/**
* The group name of the GAV coordinates for the LWJGL artifacts.
*
* Defaults to [LWJGLExtension.group].
* Defaults to [LwjglExtension.group].
*
* @since 0.1.0
*/
Expand All @@ -68,7 +68,7 @@ public abstract class LWJGLTarget @Inject constructor(
/**
* The version of the GAV coordinates for the LWJGL artifacts.
*
* Defaults to [LWJGLExtension.version].
* Defaults to [LwjglExtension.version].
*
* @since 0.1.0
*/
Expand Down Expand Up @@ -112,7 +112,7 @@ public abstract class LWJGLTarget @Inject constructor(
* @since 0.1.0
*/
public val platforms: NamedDomainObjectContainer<NativePlatform> = objectFactory.domainObjectContainer(NativePlatform::class.java) { name ->
objectFactory.newInstance(NativePlatform::class.java, name, this@LWJGLTarget.name)
objectFactory.newInstance(NativePlatform::class.java, name, this@LwjglTarget.name)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
*/
package com.osmerion.gradle.lwjgl3.plugins

import com.osmerion.gradle.lwjgl3.LWJGLConstants
import com.osmerion.gradle.lwjgl3.LWJGLExtension
import com.osmerion.gradle.lwjgl3.LwjglConstants
import com.osmerion.gradle.lwjgl3.LwjglExtension
import com.osmerion.gradle.lwjgl3.internal.applyTo
import org.gradle.api.Plugin
import org.gradle.api.Project
Expand All @@ -42,10 +42,10 @@ import org.gradle.api.plugins.JavaPlugin
*
* @since 0.1.0
*/
public class LWJGLPlugin : Plugin<Project> {
public class LwjglPlugin : Plugin<Project> {

override fun apply(target: Project): Unit = applyTo(target) {
val lwjgl3 = extensions.create("lwjgl3", LWJGLExtension::class.java)
val lwjgl3 = extensions.create("lwjgl3", LwjglExtension::class.java)

lwjgl3.targets.all target@{
libConfiguration.get().dependencies.addAllLater(provider {
Expand Down Expand Up @@ -97,7 +97,7 @@ public class LWJGLPlugin : Plugin<Project> {
}
}

val implicitTarget = providers.gradleProperty(LWJGLConstants.PROPERTY_IMPLICIT_TARGET)
val implicitTarget = providers.gradleProperty(LwjglConstants.PROPERTY_IMPLICIT_TARGET)

pluginManager.withPlugin("org.gradle.java") {
if (implicitTarget.map(String::toBoolean).orNull != false) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
*/
package com.osmerion.gradle.lwjgl3.plugins

import com.osmerion.gradle.lwjgl3.LWJGLExtension
import com.osmerion.gradle.lwjgl3.LwjglExtension
import org.gradle.api.plugins.JavaPlugin
import org.gradle.testfixtures.ProjectBuilder
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test

class LWJGLPluginUnitTest {
class LwjglPluginUnitTest {

/*
* Disabled for now because there is no way to set Gradle properties when
Expand All @@ -52,8 +52,8 @@ class LWJGLPluginUnitTest {
// TODO set com.osmerion.lwjgl3.implicit-target
val project = ProjectBuilder.builder().build()

project.pluginManager.apply(LWJGLPlugin::class.java)
val lwjgl3 = project.extensions.getByType(LWJGLExtension::class.java)
project.pluginManager.apply(LwjglPlugin::class.java)
val lwjgl3 = project.extensions.getByType(LwjglExtension::class.java)

assertEquals(0, lwjgl3.targets.asMap.size)
project.pluginManager.apply(JavaPlugin::class.java)
Expand All @@ -66,8 +66,8 @@ class LWJGLPluginUnitTest {
// TODO set com.osmerion.lwjgl3.implicit-target
val project = ProjectBuilder.builder().build()

project.pluginManager.apply(LWJGLPlugin::class.java)
val lwjgl3 = project.extensions.getByType(LWJGLExtension::class.java)
project.pluginManager.apply(LwjglPlugin::class.java)
val lwjgl3 = project.extensions.getByType(LwjglExtension::class.java)

assertEquals(0, lwjgl3.targets.asMap.size)
project.pluginManager.apply(JavaPlugin::class.java)
Expand All @@ -77,9 +77,9 @@ class LWJGLPluginUnitTest {
@Test
fun `Test implicit main target enabled by default`() {
val project = ProjectBuilder.builder().build()
project.pluginManager.apply(LWJGLPlugin::class.java)
project.pluginManager.apply(LwjglPlugin::class.java)

val lwjgl3 = project.extensions.getByType(LWJGLExtension::class.java)
val lwjgl3 = project.extensions.getByType(LwjglExtension::class.java)

assertEquals(0, lwjgl3.targets.asMap.size)
project.pluginManager.apply(JavaPlugin::class.java)
Expand Down

0 comments on commit 64ab47b

Please sign in to comment.