Skip to content

Commit

Permalink
Work on bringing hid-usb modules up to spec
Browse files Browse the repository at this point in the history
  • Loading branch information
whirvis committed Feb 17, 2022
1 parent 8a36cc6 commit cdf5f58
Show file tree
Hide file tree
Showing 44 changed files with 1,792 additions and 1,508 deletions.
24 changes: 8 additions & 16 deletions adapters/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import org.gradle.internal.os.OperatingSystem

def isGLFWProject() {
static def isGLFWProject(Project project) {
return project.name.toLowerCase().startsWith("glfw")
}

def glfwSetup() {
static def glfwSetup(Project project) {
/* DO NOT EDIT THIS BLOCK: it is generated by LWJGL -------------------- */
project.ext.lwjglVersion = "3.3.0"

Expand All @@ -24,7 +24,7 @@ def glfwSetup() {
/* --------------------------------------------------------------------- */
}

def isHidUsbProject() {
static def isHidUsbProject(Project project) {
return project.name.toLowerCase().startsWith("hid-usb")
}

Expand All @@ -34,13 +34,9 @@ subprojects {
dependencies {
api project(':api')

if(isGLFWProject()) {
glfwSetup()
if(isGLFWProject(project)) {
glfwSetup(project)

/*
* TODO: Find a way to add these dependencies from glfw.gradle.
* If determined to be impossible, remove this comment.
*/
/* DO NOT EDIT THIS BLOCK: it is generated by LWJGL ------------ */
implementation "org.lwjgl:lwjgl"
implementation "org.lwjgl:lwjgl-glfw"
Expand All @@ -49,18 +45,14 @@ subprojects {
runtimeOnly "org.lwjgl:lwjgl::$project.lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-glfw::$project.lwjglNatives"
/* ------------------------------------------------------------- */
} else if(isHidUsbProject()) {
/*
* TODO: Find a way to add these dependencies from hid-usb.gradle.
* If determined to be impossible, remove this comment.
*/
}

if(isHidUsbProject(project)) {
implementation 'javax.usb:usb-api:1.0.2'
implementation 'net.java.dev.jna:jna:5.9.0'
implementation 'org.hid4java:hid4java:0.7.0'
implementation 'org.usb4java:usb4java:1.3.0'
implementation 'org.usb4java:usb4java-javax:1.3.0'
}
}

archivesBaseName = "${rootProject.name}-${this.name}-${project.name}"
}
2 changes: 1 addition & 1 deletion adapters/hid-usb-api/build.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/* placeholder */
/* I'm a little teapot! */

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package io.ketill.hidusb;

public class DeviceInfo {

public final int vendorId;
public final int productId;

protected DeviceInfo(int vendorId, int productId) {
this.vendorId = vendorId;
this.productId = productId;
}

}
Loading

0 comments on commit cdf5f58

Please sign in to comment.