разделение mc.protocol и mc.server на подмодули
This commit is contained in:
10
README.MD
10
README.MD
@@ -6,4 +6,12 @@
|
||||
|
||||
---
|
||||
|
||||
* Java 11
|
||||
* Java 11
|
||||
|
||||
---
|
||||
|
||||
## Запуск
|
||||
|
||||
```shell
|
||||
gradle :server:run
|
||||
```
|
||||
@@ -1,5 +1,6 @@
|
||||
//file:noinspection GroovyAssignabilityCheck
|
||||
//file:noinspection GrUnresolvedAccess
|
||||
//file:noinspection GroovyConstructorNamedArguments
|
||||
|
||||
def slf4j_version = '1.7.30'
|
||||
def logback_version = '1.2.3'
|
||||
@@ -26,7 +27,11 @@ ext {
|
||||
annotationProcessor: "com.google.dagger:dagger-compiler:${dagger2_version}"
|
||||
]
|
||||
|
||||
libs.junit5 = [
|
||||
libs.test = [
|
||||
logger: "org.slf4j:slf4j-simple:${slf4j_version}"
|
||||
]
|
||||
|
||||
libs.test.junit5 = [
|
||||
api : "org.junit.jupiter:junit-jupiter-api:${junit_version}",
|
||||
//runtime only
|
||||
engine: "org.junit.jupiter:junit-jupiter-engine:${junit_version}",
|
||||
|
||||
27
logic.gradle
27
logic.gradle
@@ -1,4 +1,6 @@
|
||||
//file:noinspection GrUnresolvedAccess
|
||||
apply plugin: 'java'
|
||||
apply from: rootDir.toPath().resolve('libs.gradle').toFile()
|
||||
|
||||
String getProperty1(String propertyName1, String propertyName2) {
|
||||
return (String) (project.hasProperty(propertyName1) ? project.property(propertyName1) : project.property(propertyName2))
|
||||
@@ -6,7 +8,7 @@ String getProperty1(String propertyName1, String propertyName2) {
|
||||
|
||||
project.group = getProperty1('module.group', 'project.group')
|
||||
project.version = getProperty1('module.version', 'project.version')
|
||||
project.jar.archiveBaseName.set(getProperty1('module.name', 'project.name'))
|
||||
jar.archiveBaseName.set(getProperty1('module.name', 'project.name'))
|
||||
|
||||
compileJava {
|
||||
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_11
|
||||
@@ -16,4 +18,25 @@ compileJava {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
annotationProcessor libs.lombok
|
||||
compileOnly libs.lombok
|
||||
compileOnly libs.annotations
|
||||
|
||||
implementation libs.logger.slf4j
|
||||
|
||||
implementation libs.dagger2.implementation
|
||||
annotationProcessor libs.dagger2.annotationProcessor
|
||||
|
||||
testImplementation libs.test.junit5.api
|
||||
testImplementation libs.test.junit5.params
|
||||
testRuntimeOnly libs.test.junit5.engine
|
||||
|
||||
testRuntimeOnly libs.test.logger
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
8
protocol/build.gradle
Normal file
8
protocol/build.gradle
Normal file
@@ -0,0 +1,8 @@
|
||||
apply from: rootDir.toPath().resolve('logic.gradle').toFile()
|
||||
|
||||
dependencies {
|
||||
implementation 'io.netty:netty-all:4.1.22.Final'
|
||||
implementation libs.guava
|
||||
|
||||
testImplementation libs.lang3
|
||||
}
|
||||
3
protocol/gradle.properties
Normal file
3
protocol/gradle.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
# suppress inspection "UnusedProperty" for whole file
|
||||
module.name=protocol
|
||||
module.version=1.0-SNAPSHOT
|
||||
@@ -1,6 +1,5 @@
|
||||
package mc.protocol.io;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -1,41 +1,23 @@
|
||||
/*
|
||||
Запуск
|
||||
gradle run
|
||||
gradle :server:run
|
||||
*/
|
||||
|
||||
apply from: rootDir.toPath().resolve('logic.gradle').toFile()
|
||||
apply from: rootDir.toPath().resolve('libs.gradle').toFile()
|
||||
|
||||
apply plugin: 'application'
|
||||
|
||||
application {
|
||||
mainClassName = 'mc.server.Main'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
annotationProcessor libs.lombok
|
||||
compileOnly libs.lombok
|
||||
compileOnly libs.annotations
|
||||
implementation project(':protocol')
|
||||
|
||||
implementation libs.logger.slf4j
|
||||
implementation libs.logger.logback
|
||||
|
||||
implementation libs.dagger2.implementation
|
||||
annotationProcessor libs.dagger2.annotationProcessor
|
||||
|
||||
implementation platform('io.projectreactor:reactor-bom:2020.0.6')
|
||||
implementation 'io.projectreactor:reactor-core'
|
||||
|
||||
implementation 'io.netty:netty-all:4.1.22.Final'
|
||||
implementation libs.guava
|
||||
|
||||
testImplementation libs.junit5.api
|
||||
testImplementation libs.junit5.params
|
||||
testRuntimeOnly libs.junit5.engine
|
||||
|
||||
testImplementation libs.lang3
|
||||
}
|
||||
|
||||
application {
|
||||
mainClassName = 'mc.server.Main'
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
@@ -10,4 +10,5 @@ rootProject.projectDir.toPath().resolve('gradle.properties').readLines().forEach
|
||||
|
||||
rootProject.name = map.get('project.name')
|
||||
|
||||
include('protocol')
|
||||
include('server')
|
||||
Reference in New Issue
Block a user