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

Move clientserver package into a new subproject #4751

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
59 changes: 12 additions & 47 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,23 @@ plugins {
id "base"
id "java"
id "org.ajoberstar.grgit" version "5.2.1"
id "com.diffplug.spotless" version "6.25.0"
id 'org.openjfx.javafxplugin' version '0.0.13'
id 'org.beryx.runtime' version '1.13.0'
id "com.google.protobuf" version "0.9.4"
id 'com.github.johnrengelman.shadow' version '8.1.1'

id "com.diffplug.spotless" version "6.25.0" apply false
}

allprojects {
apply plugin: "com.diffplug.spotless"
}

apply from: rootProject.file('buildSrc/shared.gradle')

// Definitions
defaultTasks 'clean', 'build'

java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

def javaArgs = [
"-Xss8M", "-Dsun.java2d.d3d=false", "-Dsentry.environment=Production", "-Dfile.encoding=UTF-8",
"-Dpolyglot.engine.WarnInterpreterOnly=false",
Expand Down Expand Up @@ -112,32 +114,18 @@ ext {
println "OS Detected: " + osdetector.os
}


spotless {
java {
target project.fileTree(project.rootDir) {
target project.fileTree(project.projectDir) {
include 'src/**/*.java'
exclude '**/JTextAreaAppender.java'
exclude 'src/main/java/net/rptools/maptool/client/ui/themes/Flat*ContrastIJTheme.java'
exclude 'src/main/java/net/rptools/maptool/client/ui/themes/Utils.java'
}
licenseHeaderFile 'spotless.license.java'
toggleOffOn()

// Now using the Google Java style guide
googleJavaFormat("1.17.0")
}

format 'misc', {
target '**/*.gradle', '**/.gitignore'

// spotless has built-in rules for most basic formatting tasks
trimTrailingWhitespace()
// or spaces. Takes an integer argument if you don't like 4
indentWithSpaces(4)
}
}


// org.openjfx.javafxplugin
javafx {
version = '22'
Expand Down Expand Up @@ -325,23 +313,13 @@ runtime {
}
}
}
// In this section you declare where to find the dependencies of your project
repositories {
// Use 'jcenter' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenLocal()
mavenCentral()
maven { url = 'https://maptool.craigs-stuff.net/repo/' }
maven { url = 'https://jitpack.io' }
maven { url "https://www.jetbrains.com/intellij-repository/releases" }
maven { url "https://cache-redirector.jetbrains.com/intellij-dependencies" }
}


// In this section you declare the dependencies for your production and test code
dependencies {
forms group: 'com.jetbrains.intellij.java', name: 'java-compiler-ant-tasks', version: '233.14475.56'

implementation project(':clientserver')

implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.22.1'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.22.1'
implementation group: 'org.apache.logging.log4j', name: 'log4j-1.2-api', version: '2.20.0' // Bridges v1 to v2 for other code in other libs
Expand Down Expand Up @@ -492,16 +470,6 @@ dependencies {
// Noise Generator
implementation 'com.github.cwisniew:NoiseLib:1.0.0' // The most recent version, 1.0.0 is build for a later java version: major version 55 is newer than 54, the highest major version supported by this compiler

// webrtc
implementation group: 'org.java-websocket', name: 'Java-WebSocket', version: '1.5.6'
implementation 'dev.onvoid.webrtc:webrtc-java:0.8.0'
if (osdetector.os.is('windows'))
implementation 'dev.onvoid.webrtc:webrtc-java:0.8.0:windows-x86_64'
else if (osdetector.os.is('osx'))
implementation 'dev.onvoid.webrtc:webrtc-java:0.8.0:macos-x86_64'
else if (osdetector.os.is('linux'))
implementation 'dev.onvoid.webrtc:webrtc-java:0.8.0:linux-x86_64'

// protobuf
implementation "io.grpc:grpc-protobuf:1.61.1"
implementation "com.google.protobuf:protobuf-java-util:3.25.2"
Expand All @@ -516,9 +484,6 @@ dependencies {
implementation 'org.jsoup:jsoup:1.17.2'
// eventbus
implementation 'com.google.guava:guava:33.0.0-jre'
// compression of messages between client and server
implementation 'org.apache.commons:commons-compress:1.26.0'
implementation 'com.github.luben:zstd-jni:1.5.5-11'
// intellij forms runtime
implementation 'com.jetbrains.intellij.java:java-gui-forms-rt:241.12019'
// layout for forms created in code
Expand Down
35 changes: 35 additions & 0 deletions buildSrc/shared.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// In this section you declare where to find the dependencies of your project
repositories {
mavenLocal()
mavenCentral()
maven { url = 'https://maptool.craigs-stuff.net/repo/' }
maven { url = 'https://jitpack.io' }
maven { url "https://www.jetbrains.com/intellij-repository/releases" }
maven { url "https://cache-redirector.jetbrains.com/intellij-dependencies" }
}

java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

spotless {
java {
target project.fileTree(project.projectDir) {
include 'src/**/*.java'
}
licenseHeaderFile rootProject.file('spotless.license.java')
toggleOffOn()
// Now using the Google Java style guide
googleJavaFormat("1.17.0")
}

format 'misc', {
target '**/*.gradle', '**/.gitignore'

// spotless has built-in rules for most basic formatting tasks
trimTrailingWhitespace()
// or spaces. Takes an integer argument if you don't like 4
indentWithSpaces(4)
}
}
33 changes: 33 additions & 0 deletions clientserver/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
plugins {
id "base"
id "java-library"
}

apply from: rootProject.file('buildSrc/shared.gradle')

// In this section you declare the dependencies for your production and test code
dependencies {
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.22.1'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.22.1'
implementation group: 'org.apache.logging.log4j', name: 'log4j-1.2-api', version: '2.20.0' // Bridges v1 to v2 for other code in other libs
implementation group: 'org.slf4j', name: 'slf4j-simple', version: '2.0.12'
implementation group: 'commons-logging', name: 'commons-logging', version: '1.3.0'

// Better JSON functions...
implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1' // https://mvnrepository.com/artifact/com.google.code.gson/gson

// webrtc
implementation group: 'org.java-websocket', name: 'Java-WebSocket', version: '1.5.6'
// Needs to be API since WebRTCConnection implements PeerConnectionObserver and RTCDataChannelObserver.
implementation 'dev.onvoid.webrtc:webrtc-java:0.8.0'
if (osdetector.os.is('windows'))
implementation 'dev.onvoid.webrtc:webrtc-java:0.8.0:windows-x86_64'
else if (osdetector.os.is('osx'))
implementation 'dev.onvoid.webrtc:webrtc-java:0.8.0:macos-x86_64'
else if (osdetector.os.is('linux'))
implementation 'dev.onvoid.webrtc:webrtc-java:0.8.0:linux-x86_64'

// compression of messages between client and server
implementation 'org.apache.commons:commons-compress:1.26.0'
implementation 'com.github.luben:zstd-jni:1.5.5-11'
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
* <http://www.gnu.org/licenses/> and specifically the Affero license
* text at <http://www.gnu.org/licenses/agpl.html>.
*/
package net.rptools.maptool.server;
package net.rptools.clientserver.simple;

import java.util.concurrent.ExecutionException;
import net.rptools.clientserver.simple.MessageHandler;
import net.rptools.clientserver.simple.connection.Connection;
import net.rptools.maptool.model.player.Player;

public interface Handshake extends MessageHandler {
public interface Handshake {

/**
* Returns if the handshake has been successful or not.
Expand Down Expand Up @@ -50,13 +48,6 @@ public interface Handshake extends MessageHandler {
*/
Exception getException();

/**
* Returns the player associated with the handshake.
*
* @return the player associated with the handshake.
*/
Player getPlayer();

/**
* Adds an observer to the handshake process.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* <http://www.gnu.org/licenses/> and specifically the Affero license
* text at <http://www.gnu.org/licenses/agpl.html>.
*/
package net.rptools.maptool.server;
package net.rptools.clientserver.simple;

public interface HandshakeObserver {

Expand Down
Loading
Loading