Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial refactor for javax isolation #32

Merged
merged 4 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
id: jacoco
uses: madrapps/jacoco-report@v1.3
with:
paths: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml
paths: ${{ github.workspace }}/client/build/reports/jacoco/test/jacocoTestReport.xml,${{ github.workspace }}/connectors/javax/wsserver/build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name == 'pull_request'

Expand Down
117 changes: 4 additions & 113 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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")
}
108 changes: 108 additions & 0 deletions client/build.gradle
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ public void run() {
}, 0, Math.round(((double) ((ServerInfo) res).getMaxPingTime()) / 2));
}

// Populate already connected devices
requestDeviceList();

} else if (res instanceof Error) {
throw new ButtplugClientException(((Error) res).getErrorMessage());
} else {
Expand All @@ -149,6 +152,7 @@ public void run() {
if (getOnConnected() != null) {
getOnConnected().onConnected(this);
}

}

private void onPingTimer() throws ButtplugClientException, ExecutionException, InterruptedException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.blackspherefollower.buttplug4j.client;

import io.github.blackspherefollower.buttplug4j.Util.Pair;
import io.github.blackspherefollower.buttplug4j.util.Pair;
import io.github.blackspherefollower.buttplug4j.protocol.ButtplugMessage;
import io.github.blackspherefollower.buttplug4j.protocol.messages.DeviceAdded;
import io.github.blackspherefollower.buttplug4j.protocol.messages.DeviceRemoved;
Expand Down Expand Up @@ -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 = "";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.blackspherefollower.buttplug4j.protocol.messages;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.github.blackspherefollower.buttplug4j.Util.Pair;
import io.github.blackspherefollower.buttplug4j.util.Pair;
import io.github.blackspherefollower.buttplug4j.protocol.ButtplugConsts;
import io.github.blackspherefollower.buttplug4j.protocol.ButtplugDeviceMessage;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.blackspherefollower.buttplug4j.Util;
package io.github.blackspherefollower.buttplug4j.util;

public final class Pair<A, B> {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package io.github.blackspherefollower.buttplug4j.util;
108 changes: 108 additions & 0 deletions connectors/javax/wsclient/build.gradle
Original file line number Diff line number Diff line change
@@ -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
}
Loading
Loading