diff --git a/build.gradle b/build.gradle index b59f125..513d2e6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,114 +1,5 @@ -plugins { - id 'java-library' - id 'jacoco' - id 'maven-publish' - id 'checkstyle' - id 'signing' -} -group = 'io.github.blackspherefollower' -version = "3.0." + ("${System.env.GITHUB_RUN_NUMBER ?: 1}") + ("${System.env.GITHUB_REF_TYPE}" == "tag" ? "" : "-SNAPSHOT") - -repositories { - mavenCentral() -} - -dependencies { - api 'jakarta.websocket:jakarta.websocket-api:2.1.1' - api 'org.eclipse.jetty.websocket:websocket-javax-client:10.0.15' - api 'com.fasterxml.jackson.core:jackson-annotations:2.15.2' - api 'com.fasterxml.jackson.core:jackson-databind:2.15.2' - testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0' - testImplementation 'org.eclipse.jetty.websocket:websocket-javax-server:10.0.15' -} - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } - withJavadocJar() - withSourcesJar() -} -checkstyle { - configFile = file("${rootDir}/checkstyle.xml") - showViolations = false - ignoreFailures = true -} -test { - finalizedBy jacocoTestReport - finalizedBy check -} -jacocoTestReport { - dependsOn test -} -tasks.named('test') { - useJUnitPlatform() -} - -jacocoTestReport { - reports { - xml.required = true - csv.required = true - } -} - -publishing { - repositories { - maven { - name = "GitHubPackages" - url = uri("https://maven.pkg.github.com/${System.env.GITHUB_REPOSITORY}") - credentials { - username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR") - password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN") - } - } - maven { - name = "ossrh" - url = version.contains("-SNAPSHOT") ? - uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") : - uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") - - credentials { - username = project.findProperty("maven.user") ?:System.getenv("MAVEN_USER") - password = project.findProperty("maven.pass") ?:System.getenv("MAVEN_PASS") - } - } - } - publications { - mavenJava(MavenPublication) { - from(components.java) - pom { - name = 'Buttplug for Java' - description = 'A pure Java Buttplug Client implementation' - url = 'https://github.com/blackspherefollower/buttplug4j' - inceptionYear = '2017' - - licenses { - license { - name = 'BSDv3 License' - url = 'https://github.com/blackspherefollower/buttplug4j/' - } - } - developers { - developer { - id = 'blackspherefollower' - name = 'BlackSphereFollower' - email = 'blackspherefollower@iostindex.com' - } - } - scm { - connection='scm:git:git:github.com/blackspherefollower/buttplug4j.git' - developerConnection='scm:git:https://github.com/blackspherefollower/buttplug4j.git' - url='https://github.com/blackspherefollower/buttplug4j' - } - } - } - } -} - -signing { - def gpgKey = project.findProperty("gpg.key") ?: System.getenv("OSSRH_GPG") ?: "" - def gpgPass = project.findProperty("gpg.pass") ?: System.getenv("OSSRH_GPG_PASS") ?: "" - useInMemoryPgpKeys(gpgKey.replaceAll("\\\\n", "\n"), gpgPass) - sign publishing.publications.mavenJava -} +subprojects { + group = 'io.github.blackspherefollower' + version = "3.1." + ("${System.env.GITHUB_RUN_NUMBER ?: 1}") + ("${System.env.GITHUB_REF_TYPE}" == "tag" ? "" : "-SNAPSHOT") +} \ No newline at end of file diff --git a/client/build.gradle b/client/build.gradle new file mode 100644 index 0000000..8cdd872 --- /dev/null +++ b/client/build.gradle @@ -0,0 +1,108 @@ +plugins { + id 'java-library' + id 'jacoco' + id 'maven-publish' + id 'checkstyle' + id 'signing' +} + +repositories { + mavenCentral() +} + +dependencies { + api 'com.fasterxml.jackson.core:jackson-annotations:2.15.1' + api 'com.fasterxml.jackson.core:jackson-databind:2.15.1' + testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0' +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } + withJavadocJar() + withSourcesJar() +} +checkstyle { + configFile = file("${rootDir}/checkstyle.xml") + showViolations = false + ignoreFailures = true +} +test { + finalizedBy jacocoTestReport + finalizedBy check +} +jacocoTestReport { + dependsOn test +} +tasks.named('test') { + useJUnitPlatform() +} + +jacocoTestReport { + reports { + xml.required = true + csv.required = true + } +} + +publishing { + repositories { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/${System.env.GITHUB_REPOSITORY}") + credentials { + username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR") + password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN") + } + } + maven { + name = "ossrh" + url = version.contains("-SNAPSHOT") ? + uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") : + uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") + + credentials { + username = project.findProperty("maven.user") ?:System.getenv("MAVEN_USER") + password = project.findProperty("maven.pass") ?:System.getenv("MAVEN_PASS") + } + } + } + publications { + mavenJava(MavenPublication) { + from(components.java) + pom { + name = 'Buttplug for Java' + description = 'A pure Java Buttplug Client implementation' + url = 'https://github.com/blackspherefollower/buttplug4j' + inceptionYear = '2017' + + licenses { + license { + name = 'BSDv3 License' + url = 'https://github.com/blackspherefollower/buttplug4j/' + } + } + developers { + developer { + id = 'blackspherefollower' + name = 'BlackSphereFollower' + email = 'blackspherefollower@iostindex.com' + } + } + scm { + connection='scm:git:git:github.com/blackspherefollower/buttplug4j.git' + developerConnection='scm:git:https://github.com/blackspherefollower/buttplug4j.git' + url='https://github.com/blackspherefollower/buttplug4j' + } + } + } + } +} + +signing { + def gpgKey = project.findProperty("gpg.key") ?: System.getenv("OSSRH_GPG") ?: "" + def gpgPass = project.findProperty("gpg.pass") ?: System.getenv("OSSRH_GPG_PASS") ?: "" + useInMemoryPgpKeys(gpgKey.replaceAll("\\\\n", "\n"), gpgPass) + sign publishing.publications.mavenJava +} diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/ButtplugException.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/ButtplugException.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/ButtplugException.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/ButtplugException.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClient.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClient.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClient.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClient.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientDevice.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientDevice.java similarity index 99% rename from src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientDevice.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientDevice.java index 767562a..9de0ad1 100644 --- a/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientDevice.java +++ b/client/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientDevice.java @@ -61,7 +61,7 @@ public ButtplugClientDevice(final ButtplugClient bpClient, final DeviceAdded dev } } - public ButtplugClientDevice(final ButtplugClientWSEndpoint bpClient, final DeviceRemoved deviceRemoved) { + public ButtplugClientDevice(final ButtplugClient bpClient, final DeviceRemoved deviceRemoved) { this.client = bpClient; this.deviceIndex = deviceRemoved.getDeviceIndex(); this.name = ""; diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientException.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientException.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientException.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientException.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugDeviceException.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugDeviceException.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugDeviceException.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugDeviceException.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/client/IConnectedEvent.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/client/IConnectedEvent.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/client/IConnectedEvent.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/client/IConnectedEvent.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/client/IDeviceEvent.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/client/IDeviceEvent.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/client/IDeviceEvent.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/client/IDeviceEvent.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/client/IErrorEvent.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/client/IErrorEvent.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/client/IErrorEvent.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/client/IErrorEvent.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/client/IScanningEvent.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/client/IScanningEvent.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/client/IScanningEvent.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/client/IScanningEvent.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/client/ISensorReadingEvent.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/client/ISensorReadingEvent.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/client/ISensorReadingEvent.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/client/ISensorReadingEvent.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/client/package-info.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/client/package-info.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/client/package-info.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/client/package-info.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/package-info.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/package-info.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/package-info.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/package-info.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/ButtplugConsts.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/ButtplugConsts.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/ButtplugConsts.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/ButtplugConsts.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/ButtplugDeviceMessage.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/ButtplugDeviceMessage.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/ButtplugDeviceMessage.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/ButtplugDeviceMessage.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/ButtplugJsonMessageParser.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/ButtplugJsonMessageParser.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/ButtplugJsonMessageParser.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/ButtplugJsonMessageParser.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/ButtplugMessage.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/ButtplugMessage.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/ButtplugMessage.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/ButtplugMessage.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/ButtplugProtocolException.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/ButtplugProtocolException.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/ButtplugProtocolException.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/ButtplugProtocolException.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceAdded.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceAdded.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceAdded.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceAdded.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceList.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceList.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceList.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceList.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceRemoved.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceRemoved.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceRemoved.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceRemoved.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Error.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Error.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Error.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Error.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/LinearCmd.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/LinearCmd.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/LinearCmd.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/LinearCmd.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Ok.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Ok.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Ok.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Ok.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/DeviceMessage.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/DeviceMessage.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/DeviceMessage.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/DeviceMessage.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/DeviceMessageInfo.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/DeviceMessageInfo.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/DeviceMessageInfo.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/DeviceMessageInfo.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/DeviceMessagesDeserializer.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/DeviceMessagesDeserializer.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/DeviceMessagesDeserializer.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/DeviceMessagesDeserializer.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/DeviceMessagesSerializer.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/DeviceMessagesSerializer.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/DeviceMessagesSerializer.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/DeviceMessagesSerializer.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/EmptySerializer.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/EmptySerializer.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/EmptySerializer.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/EmptySerializer.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/GenericFeatureAttributes.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/GenericFeatureAttributes.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/GenericFeatureAttributes.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/GenericFeatureAttributes.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/GenericFeaturesSerializer.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/GenericFeaturesSerializer.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/GenericFeaturesSerializer.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/GenericFeaturesSerializer.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/GenericMessageAttributes.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/GenericMessageAttributes.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/GenericMessageAttributes.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/GenericMessageAttributes.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/MessageAttributes.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/MessageAttributes.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/MessageAttributes.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/MessageAttributes.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/NullMessageAttributes.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/NullMessageAttributes.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/NullMessageAttributes.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/NullMessageAttributes.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/RawMessageAttributes.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/RawMessageAttributes.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/RawMessageAttributes.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/RawMessageAttributes.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/SensorFeatureAttributes.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/SensorFeatureAttributes.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/SensorFeatureAttributes.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/SensorFeatureAttributes.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/SensorFeaturesSerializer.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/SensorFeaturesSerializer.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/SensorFeaturesSerializer.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/SensorFeaturesSerializer.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/SensorMessageAttributes.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/SensorMessageAttributes.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/SensorMessageAttributes.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/SensorMessageAttributes.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/package-info.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/package-info.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/package-info.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Parts/package-info.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Ping.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Ping.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Ping.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/Ping.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/RequestDeviceList.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/RequestDeviceList.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/RequestDeviceList.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/RequestDeviceList.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/RequestServerInfo.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/RequestServerInfo.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/RequestServerInfo.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/RequestServerInfo.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/RotateCmd.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/RotateCmd.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/RotateCmd.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/RotateCmd.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ScalarCmd.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ScalarCmd.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ScalarCmd.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ScalarCmd.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ScanningFinished.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ScanningFinished.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ScanningFinished.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ScanningFinished.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/SensorReadCmd.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/SensorReadCmd.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/SensorReadCmd.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/SensorReadCmd.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/SensorReading.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/SensorReading.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/SensorReading.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/SensorReading.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/SensorSubscribeCmd.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/SensorSubscribeCmd.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/SensorSubscribeCmd.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/SensorSubscribeCmd.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/SensorUnsubscribeCmd.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/SensorUnsubscribeCmd.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/SensorUnsubscribeCmd.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/SensorUnsubscribeCmd.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ServerInfo.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ServerInfo.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ServerInfo.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ServerInfo.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StartScanning.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StartScanning.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StartScanning.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StartScanning.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopAllDevices.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopAllDevices.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopAllDevices.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopAllDevices.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopDeviceCmd.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopDeviceCmd.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopDeviceCmd.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopDeviceCmd.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopScanning.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopScanning.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopScanning.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopScanning.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/package-info.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/package-info.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/package-info.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/messages/package-info.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/package-info.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/package-info.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/protocol/package-info.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/protocol/package-info.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/util/Pair.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/util/Pair.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/util/Pair.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/util/Pair.java diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/util/package-info.java b/client/src/main/java/io/github/blackspherefollower/buttplug4j/util/package-info.java similarity index 100% rename from src/main/java/io/github/blackspherefollower/buttplug4j/util/package-info.java rename to client/src/main/java/io/github/blackspherefollower/buttplug4j/util/package-info.java diff --git a/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceAddedTest.java b/client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceAddedTest.java similarity index 100% rename from src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceAddedTest.java rename to client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceAddedTest.java diff --git a/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceListTest.java b/client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceListTest.java similarity index 100% rename from src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceListTest.java rename to client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceListTest.java diff --git a/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceRemovedTest.java b/client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceRemovedTest.java similarity index 100% rename from src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceRemovedTest.java rename to client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/DeviceRemovedTest.java diff --git a/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ErrorTest.java b/client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ErrorTest.java similarity index 100% rename from src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ErrorTest.java rename to client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ErrorTest.java diff --git a/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/OkTest.java b/client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/OkTest.java similarity index 100% rename from src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/OkTest.java rename to client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/OkTest.java diff --git a/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/PingTest.java b/client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/PingTest.java similarity index 100% rename from src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/PingTest.java rename to client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/PingTest.java diff --git a/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/RequestDeviceListTest.java b/client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/RequestDeviceListTest.java similarity index 100% rename from src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/RequestDeviceListTest.java rename to client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/RequestDeviceListTest.java diff --git a/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/RequestServerInfoTest.java b/client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/RequestServerInfoTest.java similarity index 100% rename from src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/RequestServerInfoTest.java rename to client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/RequestServerInfoTest.java diff --git a/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ScanningFinishedTest.java b/client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ScanningFinishedTest.java similarity index 100% rename from src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ScanningFinishedTest.java rename to client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ScanningFinishedTest.java diff --git a/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ServerInfoTest.java b/client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ServerInfoTest.java similarity index 100% rename from src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ServerInfoTest.java rename to client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/ServerInfoTest.java diff --git a/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StartScanningTest.java b/client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StartScanningTest.java similarity index 100% rename from src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StartScanningTest.java rename to client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StartScanningTest.java diff --git a/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopAllDevicesTest.java b/client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopAllDevicesTest.java similarity index 100% rename from src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopAllDevicesTest.java rename to client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopAllDevicesTest.java diff --git a/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopDeviceCmdTest.java b/client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopDeviceCmdTest.java similarity index 100% rename from src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopDeviceCmdTest.java rename to client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopDeviceCmdTest.java diff --git a/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopScanningTest.java b/client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopScanningTest.java similarity index 100% rename from src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopScanningTest.java rename to client/src/test/java/io/github/blackspherefollower/buttplug4j/protocol/messages/StopScanningTest.java diff --git a/connectors/javax/wsclient/build.gradle b/connectors/javax/wsclient/build.gradle new file mode 100644 index 0000000..9380506 --- /dev/null +++ b/connectors/javax/wsclient/build.gradle @@ -0,0 +1,108 @@ +plugins { + id 'java-library' + id 'jacoco' + id 'maven-publish' + id 'checkstyle' + id 'signing' +} + +repositories { + mavenCentral() +} + +dependencies { + api project(':connectors:javax:wscommon') + api 'org.eclipse.jetty.websocket:websocket-javax-client:10.0.15' + testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0' +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(11) + } + withJavadocJar() + withSourcesJar() +} +checkstyle { + configFile = file("${rootDir}/checkstyle.xml") + showViolations = false + ignoreFailures = true +} +test { + finalizedBy jacocoTestReport + finalizedBy check +} +jacocoTestReport { + dependsOn test +} +tasks.named('test') { + useJUnitPlatform() +} + +jacocoTestReport { + reports { + xml.required = true + csv.required = true + } +} + +publishing { + repositories { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/${System.env.GITHUB_REPOSITORY}") + credentials { + username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR") + password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN") + } + } + maven { + name = "ossrh" + url = version.contains("-SNAPSHOT") ? + uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") : + uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") + + credentials { + username = project.findProperty("maven.user") ?:System.getenv("MAVEN_USER") + password = project.findProperty("maven.pass") ?:System.getenv("MAVEN_PASS") + } + } + } + publications { + mavenJava(MavenPublication) { + from(components.java) + pom { + name = 'Buttplug for Java' + description = 'A pure Java Buttplug Client implementation' + url = 'https://github.com/blackspherefollower/buttplug4j' + inceptionYear = '2017' + + licenses { + license { + name = 'BSDv3 License' + url = 'https://github.com/blackspherefollower/buttplug4j/' + } + } + developers { + developer { + id = 'blackspherefollower' + name = 'BlackSphereFollower' + email = 'blackspherefollower@iostindex.com' + } + } + scm { + connection='scm:git:git:github.com/blackspherefollower/buttplug4j.git' + developerConnection='scm:git:https://github.com/blackspherefollower/buttplug4j.git' + url='https://github.com/blackspherefollower/buttplug4j' + } + } + } + } +} + +signing { + def gpgKey = project.findProperty("gpg.key") ?: System.getenv("OSSRH_GPG") ?: "" + def gpgPass = project.findProperty("gpg.pass") ?: System.getenv("OSSRH_GPG_PASS") ?: "" + useInMemoryPgpKeys(gpgKey.replaceAll("\\\\n", "\n"), gpgPass) + sign publishing.publications.mavenJava +} diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientWSClient.java b/connectors/javax/wsclient/src/main/java/io/github/blackspherefollower/buttplug4j/connectors/javax/client/ButtplugClientWSClient.java similarity index 83% rename from src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientWSClient.java rename to connectors/javax/wsclient/src/main/java/io/github/blackspherefollower/buttplug4j/connectors/javax/client/ButtplugClientWSClient.java index 3c16211..95c8d42 100644 --- a/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientWSClient.java +++ b/connectors/javax/wsclient/src/main/java/io/github/blackspherefollower/buttplug4j/connectors/javax/client/ButtplugClientWSClient.java @@ -1,5 +1,7 @@ -package io.github.blackspherefollower.buttplug4j.client; +package io.github.blackspherefollower.buttplug4j.connectors.javax.client; +import io.github.blackspherefollower.buttplug4j.client.ButtplugClient; +import io.github.blackspherefollower.buttplug4j.connectors.javax.common.ButtplugClientWSEndpoint; import org.eclipse.jetty.util.component.LifeCycle; import javax.websocket.ClientEndpoint; @@ -26,7 +28,7 @@ public void connect(final URI url) throws IllegalStateException, DeploymentExcep if (client != null && getSession() != null && getSession().isOpen()) { throw new IllegalStateException("WS is already open"); } - setConnectionState(ConnectionState.CONNECTING); + setConnectionState(ButtplugClient.ConnectionState.CONNECTING); CompletableFuture promise = new CompletableFuture<>(); setOnConnected(client -> promise.complete(true)); diff --git a/src/test/java/io/github/blackspherefollower/buttplug4j/client/ButtplugWSClientMockTest.java b/connectors/javax/wsclient/src/test/java/io/github/blackspherefollower/buttplug4j/connectors/javax/client/ButtplugWSClientMockTest.java similarity index 90% rename from src/test/java/io/github/blackspherefollower/buttplug4j/client/ButtplugWSClientMockTest.java rename to connectors/javax/wsclient/src/test/java/io/github/blackspherefollower/buttplug4j/connectors/javax/client/ButtplugWSClientMockTest.java index a48d3d8..24f0979 100644 --- a/src/test/java/io/github/blackspherefollower/buttplug4j/client/ButtplugWSClientMockTest.java +++ b/connectors/javax/wsclient/src/test/java/io/github/blackspherefollower/buttplug4j/connectors/javax/client/ButtplugWSClientMockTest.java @@ -1,5 +1,6 @@ -package io.github.blackspherefollower.buttplug4j.client; +package io.github.blackspherefollower.buttplug4j.connectors.javax.client; +import io.github.blackspherefollower.buttplug4j.client.ButtplugClientDevice; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; diff --git a/connectors/javax/wscommon/build.gradle b/connectors/javax/wscommon/build.gradle new file mode 100644 index 0000000..14e020a --- /dev/null +++ b/connectors/javax/wscommon/build.gradle @@ -0,0 +1,107 @@ +plugins { + id 'java-library' + id 'jacoco' + id 'maven-publish' + id 'checkstyle' + id 'signing' +} + +repositories { + mavenCentral() +} + +dependencies { + api project(':client') + api 'javax.websocket:javax.websocket-api:1.1' +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(11) + } + withJavadocJar() + withSourcesJar() +} +checkstyle { + configFile = file("${rootDir}/checkstyle.xml") + showViolations = false + ignoreFailures = true +} +test { + finalizedBy jacocoTestReport + finalizedBy check +} +jacocoTestReport { + dependsOn test +} +tasks.named('test') { + useJUnitPlatform() +} + +jacocoTestReport { + reports { + xml.required = true + csv.required = true + } +} + +publishing { + repositories { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/${System.env.GITHUB_REPOSITORY}") + credentials { + username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR") + password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN") + } + } + maven { + name = "ossrh" + url = version.contains("-SNAPSHOT") ? + uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") : + uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") + + credentials { + username = project.findProperty("maven.user") ?:System.getenv("MAVEN_USER") + password = project.findProperty("maven.pass") ?:System.getenv("MAVEN_PASS") + } + } + } + publications { + mavenJava(MavenPublication) { + from(components.java) + pom { + name = 'Buttplug for Java' + description = 'A pure Java Buttplug Client implementation' + url = 'https://github.com/blackspherefollower/buttplug4j' + inceptionYear = '2017' + + licenses { + license { + name = 'BSDv3 License' + url = 'https://github.com/blackspherefollower/buttplug4j/' + } + } + developers { + developer { + id = 'blackspherefollower' + name = 'BlackSphereFollower' + email = 'blackspherefollower@iostindex.com' + } + } + scm { + connection='scm:git:git:github.com/blackspherefollower/buttplug4j.git' + developerConnection='scm:git:https://github.com/blackspherefollower/buttplug4j.git' + url='https://github.com/blackspherefollower/buttplug4j' + } + } + } + } +} + +signing { + def gpgKey = project.findProperty("gpg.key") ?: System.getenv("OSSRH_GPG") ?: "" + def gpgPass = project.findProperty("gpg.pass") ?: System.getenv("OSSRH_GPG_PASS") ?: "" + useInMemoryPgpKeys(gpgKey.replaceAll("\\\\n", "\n"), gpgPass) + sign publishing.publications.mavenJava +} diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientWSEndpoint.java b/connectors/javax/wscommon/src/main/java/io/github/blackspherefollower/buttplug4j/connectors/javax/common/ButtplugClientWSEndpoint.java similarity index 96% rename from src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientWSEndpoint.java rename to connectors/javax/wscommon/src/main/java/io/github/blackspherefollower/buttplug4j/connectors/javax/common/ButtplugClientWSEndpoint.java index 29e25ea..cd1970c 100644 --- a/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientWSEndpoint.java +++ b/connectors/javax/wscommon/src/main/java/io/github/blackspherefollower/buttplug4j/connectors/javax/common/ButtplugClientWSEndpoint.java @@ -1,5 +1,6 @@ -package io.github.blackspherefollower.buttplug4j.client; +package io.github.blackspherefollower.buttplug4j.connectors.javax.common; +import io.github.blackspherefollower.buttplug4j.client.ButtplugClient; import io.github.blackspherefollower.buttplug4j.protocol.ButtplugConsts; import io.github.blackspherefollower.buttplug4j.protocol.ButtplugMessage; import io.github.blackspherefollower.buttplug4j.protocol.ButtplugProtocolException; diff --git a/connectors/javax/wsserver/build.gradle b/connectors/javax/wsserver/build.gradle new file mode 100644 index 0000000..9d8d830 --- /dev/null +++ b/connectors/javax/wsserver/build.gradle @@ -0,0 +1,108 @@ +plugins { + id 'java-library' + id 'jacoco' + id 'maven-publish' + id 'checkstyle' + id 'signing' +} + +repositories { + mavenCentral() +} + +dependencies { + api project(':connectors:javax:wscommon') + testImplementation 'org.eclipse.jetty.websocket:websocket-javax-server:10.0.15' + testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0' +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(11) + } + withJavadocJar() + withSourcesJar() +} +checkstyle { + configFile = file("${rootDir}/checkstyle.xml") + showViolations = false + ignoreFailures = true +} +test { + finalizedBy jacocoTestReport + finalizedBy check +} +jacocoTestReport { + dependsOn test +} +tasks.named('test') { + useJUnitPlatform() +} + +jacocoTestReport { + reports { + xml.required = true + csv.required = true + } +} + +publishing { + repositories { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/${System.env.GITHUB_REPOSITORY}") + credentials { + username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR") + password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN") + } + } + maven { + name = "ossrh" + url = version.contains("-SNAPSHOT") ? + uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") : + uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") + + credentials { + username = project.findProperty("maven.user") ?:System.getenv("MAVEN_USER") + password = project.findProperty("maven.pass") ?:System.getenv("MAVEN_PASS") + } + } + } + publications { + mavenJava(MavenPublication) { + from(components.java) + pom { + name = 'Buttplug for Java' + description = 'A pure Java Buttplug Client implementation' + url = 'https://github.com/blackspherefollower/buttplug4j' + inceptionYear = '2017' + + licenses { + license { + name = 'BSDv3 License' + url = 'https://github.com/blackspherefollower/buttplug4j/' + } + } + developers { + developer { + id = 'blackspherefollower' + name = 'BlackSphereFollower' + email = 'blackspherefollower@iostindex.com' + } + } + scm { + connection='scm:git:git:github.com/blackspherefollower/buttplug4j.git' + developerConnection='scm:git:https://github.com/blackspherefollower/buttplug4j.git' + url='https://github.com/blackspherefollower/buttplug4j' + } + } + } + } +} + +signing { + def gpgKey = project.findProperty("gpg.key") ?: System.getenv("OSSRH_GPG") ?: "" + def gpgPass = project.findProperty("gpg.pass") ?: System.getenv("OSSRH_GPG_PASS") ?: "" + useInMemoryPgpKeys(gpgKey.replaceAll("\\\\n", "\n"), gpgPass) + sign publishing.publications.mavenJava +} diff --git a/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientWSServer.java b/connectors/javax/wsserver/src/main/java/io/github/blackspherefollower/buttplug4j/connectors/javax/server/ButtplugClientWSServer.java similarity index 78% rename from src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientWSServer.java rename to connectors/javax/wsserver/src/main/java/io/github/blackspherefollower/buttplug4j/connectors/javax/server/ButtplugClientWSServer.java index c203c30..024c241 100644 --- a/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientWSServer.java +++ b/connectors/javax/wsserver/src/main/java/io/github/blackspherefollower/buttplug4j/connectors/javax/server/ButtplugClientWSServer.java @@ -1,4 +1,6 @@ -package io.github.blackspherefollower.buttplug4j.client; +package io.github.blackspherefollower.buttplug4j.connectors.javax.server; + +import io.github.blackspherefollower.buttplug4j.connectors.javax.common.ButtplugClientWSEndpoint; import javax.websocket.server.ServerEndpoint; import java.io.IOException; diff --git a/src/test/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientWSServerMockTest.java b/connectors/javax/wsserver/src/test/java/io/github/blackspherefollower/buttplug4j/connectors/javax/client/ButtplugClientWSServerMockTest.java similarity index 92% rename from src/test/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientWSServerMockTest.java rename to connectors/javax/wsserver/src/test/java/io/github/blackspherefollower/buttplug4j/connectors/javax/client/ButtplugClientWSServerMockTest.java index e799c04..07cd84b 100644 --- a/src/test/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientWSServerMockTest.java +++ b/connectors/javax/wsserver/src/test/java/io/github/blackspherefollower/buttplug4j/connectors/javax/client/ButtplugClientWSServerMockTest.java @@ -1,5 +1,10 @@ -package io.github.blackspherefollower.buttplug4j.client; +package io.github.blackspherefollower.buttplug4j.connectors.javax.client; +import io.github.blackspherefollower.buttplug4j.client.ButtplugClient; +import io.github.blackspherefollower.buttplug4j.client.ButtplugClientDevice; +import io.github.blackspherefollower.buttplug4j.client.IConnectedEvent; +import io.github.blackspherefollower.buttplug4j.connectors.javax.common.ButtplugClientWSEndpoint; +import io.github.blackspherefollower.buttplug4j.connectors.javax.server.ButtplugClientWSServer; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.servlet.ServletContextHandler; diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..669986a --- /dev/null +++ b/settings.gradle @@ -0,0 +1,4 @@ +include 'client' +include 'connectors:javax:wscommon' +include 'connectors:javax:wsclient' +include 'connectors:javax:wsserver' \ No newline at end of file