mirror of
https://github.com/aNNiMON/Own-Programming-Language-Tutorial.git
synced 2024-09-20 00:34:20 +03:00
Move socket to separate module
This commit is contained in:
parent
9111035a37
commit
f85bbdddca
@ -9,9 +9,6 @@ dependencies {
|
||||
compileOnlyApi project(":ownlang-core")
|
||||
|
||||
implementation "com.squareup.okhttp3:okhttp:${versions.okhttp}"
|
||||
implementation ("io.socket:socket.io-client:${versions.socket}") {
|
||||
exclude group: 'org.json', module: 'json'
|
||||
}
|
||||
implementation "org.json:json:${versions.json}"
|
||||
implementation "org.yaml:snakeyaml:${versions.snakeyaml}"
|
||||
|
||||
|
25
modules/socket/build.gradle
Normal file
25
modules/socket/build.gradle
Normal file
@ -0,0 +1,25 @@
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id 'com.github.johnrengelman.shadow' version '8.1.1'
|
||||
}
|
||||
|
||||
group = 'com.annimon.module'
|
||||
version = '1.0.0'
|
||||
|
||||
dependencies {
|
||||
compileOnlyApi project(":ownlang-core")
|
||||
|
||||
implementation ("io.socket:socket.io-client:${versions.socket}") {
|
||||
exclude group: 'org.json', module: 'json'
|
||||
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
|
||||
}
|
||||
compileOnly "com.squareup.okhttp3:okhttp:${versions.okhttp}"
|
||||
compileOnly "org.json:json:${versions.json}"
|
||||
|
||||
testImplementation platform("org.junit:junit-bom:${versions.junit}")
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter'
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
@ -7,6 +7,7 @@ import io.socket.client.IO;
|
||||
import io.socket.client.Socket;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Map;
|
||||
import static com.annimon.ownlang.lib.ValueUtils.getNumber;
|
||||
|
||||
/**
|
||||
* socket.io module.
|
||||
@ -180,9 +181,4 @@ public final class socket implements Module {
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
private static Number getNumber(Value value) {
|
||||
if (value.type() != Types.NUMBER) return value.asInt();
|
||||
return ((NumberValue) value).raw();
|
||||
}
|
||||
}
|
@ -6,7 +6,7 @@ include 'ownlang-desktop'
|
||||
include 'ownlang-utils'
|
||||
include 'docs'
|
||||
|
||||
final def modules = ['main', 'canvasfx', 'jdbc', 'server']
|
||||
final def modules = ['main', 'canvasfx', 'jdbc', 'server', 'socket']
|
||||
|
||||
for (final def module in modules) {
|
||||
include "modules:$module"
|
||||
|
Loading…
Reference in New Issue
Block a user