2021-08-23 08:52:16 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2020 dorkbox, llc
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import java.time.Instant
|
|
|
|
|
|
|
|
///////////////////////////////
|
|
|
|
////// PUBLISH TO SONATYPE / MAVEN CENTRAL
|
|
|
|
////// TESTING : (to local maven repo) <'publish and release' - 'publishToMavenLocal'>
|
|
|
|
////// RELEASE : (to sonatype/maven central), <'publish and release' - 'publishToSonatypeAndRelease'>
|
|
|
|
///////////////////////////////
|
|
|
|
|
|
|
|
gradle.startParameter.showStacktrace = ShowStacktrace.ALWAYS // always show the stacktrace!
|
|
|
|
|
|
|
|
plugins {
|
2022-06-14 12:22:53 +02:00
|
|
|
id("com.dorkbox.GradleUtils") version "2.17"
|
2022-03-03 01:25:32 +01:00
|
|
|
id("com.dorkbox.Licensing") version "2.12"
|
2022-06-14 12:22:53 +02:00
|
|
|
id("com.dorkbox.VersionUpdate") version "2.5"
|
2022-03-03 01:25:32 +01:00
|
|
|
id("com.dorkbox.GradlePublish") version "1.12"
|
2021-08-23 08:52:16 +02:00
|
|
|
|
2022-08-19 00:49:42 +02:00
|
|
|
id("com.github.johnrengelman.shadow") version "7.1.2"
|
|
|
|
|
2022-03-03 01:25:32 +01:00
|
|
|
kotlin("jvm") version "1.6.10"
|
2021-08-23 08:52:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
object Extras {
|
|
|
|
// set for the project
|
2022-05-30 02:12:36 +02:00
|
|
|
const val description = "High-performance, event-driven/reactive network stack for Java 11+"
|
2021-08-23 08:52:16 +02:00
|
|
|
const val group = "com.dorkbox"
|
2022-11-11 23:00:07 +01:00
|
|
|
const val version = "6.0"
|
2021-08-23 08:52:16 +02:00
|
|
|
|
|
|
|
// set as project.ext
|
|
|
|
const val name = "Network"
|
|
|
|
const val id = "Network"
|
|
|
|
const val vendor = "Dorkbox LLC"
|
|
|
|
const val vendorUrl = "https://dorkbox.com"
|
|
|
|
const val url = "https://git.dorkbox.com/dorkbox/Network"
|
|
|
|
|
|
|
|
val buildDate = Instant.now().toString()
|
|
|
|
}
|
|
|
|
|
|
|
|
///////////////////////////////
|
|
|
|
///// assign 'Extras'
|
|
|
|
///////////////////////////////
|
|
|
|
GradleUtils.load("$projectDir/../../gradle.properties", Extras)
|
|
|
|
GradleUtils.defaults()
|
|
|
|
// because of the api changes for stacktrace stuff, it's best for us to ONLY support 11+
|
2022-05-30 02:12:36 +02:00
|
|
|
GradleUtils.compileConfiguration(JavaVersion.VERSION_11) {
|
2021-08-23 08:52:16 +02:00
|
|
|
// see: https://kotlinlang.org/docs/reference/using-gradle.html
|
|
|
|
// enable the use of inline classes. see https://kotlinlang.org/docs/reference/inline-classes.html
|
|
|
|
freeCompilerArgs = listOf("-Xinline-classes")
|
|
|
|
}
|
2022-05-30 02:12:36 +02:00
|
|
|
//NOTE: we do not support JPMS yet, as there are some libraries missing support for it still
|
2021-08-23 08:52:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
// ratelimiter, "other" package
|
|
|
|
// rest of unit tests
|
|
|
|
// getConnectionUpgradeType
|
|
|
|
// ability to send with a function callback (using RMI waiter type stuff for callbacks)
|
|
|
|
// use conscrypt?!
|
|
|
|
|
|
|
|
// java 14 is faster with aeron!
|
|
|
|
// NOTE: now using aeron instead of netty
|
|
|
|
// todo: remove BC! use conscrypt instead, or native java? (if possible. we are java 11 now, instead of 1.6)
|
|
|
|
|
|
|
|
|
|
|
|
// also, NOT using bouncastle, but instead the google one
|
|
|
|
// better SSL library
|
|
|
|
// implementation("org.conscrypt:conscrypt-openjdk-uber:2.2.1")
|
|
|
|
// init {
|
|
|
|
// try {
|
|
|
|
// Security.insertProviderAt(Conscrypt.newProvider(), 1);
|
|
|
|
// }
|
|
|
|
// catch (e: Throwable) {
|
|
|
|
// e.printStackTrace();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
licensing {
|
|
|
|
license(License.APACHE_2) {
|
|
|
|
description(Extras.description)
|
|
|
|
url(Extras.url)
|
|
|
|
author(Extras.vendor)
|
|
|
|
|
|
|
|
extra("KryoNet RMI", License.BSD_3) {
|
|
|
|
copyright(2008)
|
|
|
|
author("Nathan Sweet")
|
|
|
|
url("https://github.com/EsotericSoftware/kryonet")
|
|
|
|
}
|
|
|
|
extra("Kryo Serialization", License.BSD_3) {
|
|
|
|
copyright(2020)
|
|
|
|
author("Nathan Sweet")
|
|
|
|
url("https://github.com/EsotericSoftware/kryo")
|
|
|
|
}
|
|
|
|
extra("LAN HostDiscovery from Apache Commons JCS", License.APACHE_2) {
|
|
|
|
copyright(2014)
|
|
|
|
author("The Apache Software Foundation")
|
|
|
|
url("https://issues.apache.org/jira/browse/JCS-40")
|
|
|
|
}
|
|
|
|
extra("MathUtils, IntArray, IntMap", License.APACHE_2) {
|
|
|
|
copyright(2013)
|
|
|
|
author("Mario Zechner <badlogicgames@gmail.com>")
|
|
|
|
author("Nathan Sweet <nathan.sweet@gmail.com>")
|
|
|
|
url("http://github.com/libgdx/libgdx")
|
|
|
|
}
|
|
|
|
extra("Netty (Various network + platform utilities)", License.APACHE_2) {
|
|
|
|
copyright(2014)
|
|
|
|
description("An event-driven asynchronous network application framework")
|
|
|
|
author("The Netty Project")
|
|
|
|
author("Contributors. See source NOTICE")
|
|
|
|
url("https://netty.io")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.jar.get().apply {
|
|
|
|
manifest {
|
|
|
|
// https://docs.oracle.com/javase/tutorial/deployment/jar/packageman.html
|
|
|
|
attributes["Name"] = Extras.name
|
|
|
|
|
|
|
|
attributes["Specification-Title"] = Extras.name
|
|
|
|
attributes["Specification-Version"] = Extras.version
|
|
|
|
attributes["Specification-Vendor"] = Extras.vendor
|
|
|
|
|
|
|
|
attributes["Implementation-Title"] = "${Extras.group}.${Extras.id}"
|
|
|
|
attributes["Implementation-Version"] = Extras.buildDate
|
|
|
|
attributes["Implementation-Vendor"] = Extras.vendor
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-08-19 00:49:42 +02:00
|
|
|
|
|
|
|
val shadowJar: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar by tasks
|
|
|
|
shadowJar.apply {
|
|
|
|
manifest.inheritFrom(tasks.jar.get().manifest)
|
|
|
|
|
|
|
|
manifest.attributes.apply {
|
|
|
|
put("Main-Class", "dorkboxTest.network.AeronClientServer")
|
|
|
|
}
|
|
|
|
|
|
|
|
mergeServiceFiles()
|
|
|
|
|
|
|
|
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
|
|
|
|
|
|
|
from(sourceSets.test.get().output)
|
|
|
|
configurations = listOf(project.configurations.testRuntimeClasspath.get())
|
|
|
|
|
|
|
|
archiveBaseName.set(project.name + "-all")
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-08-23 08:52:16 +02:00
|
|
|
dependencies {
|
2022-06-11 23:54:48 +02:00
|
|
|
api("org.jetbrains.kotlinx:atomicfu:0.17.3")
|
2022-05-30 02:12:36 +02:00
|
|
|
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.2")
|
2021-08-23 08:52:16 +02:00
|
|
|
|
|
|
|
// https://github.com/dorkbox
|
2022-03-03 01:25:32 +01:00
|
|
|
api("com.dorkbox:ByteUtilities:1.5")
|
2022-05-30 02:12:36 +02:00
|
|
|
api("com.dorkbox:Collections:1.1")
|
2022-03-03 01:25:32 +01:00
|
|
|
api("com.dorkbox:MinLog:2.4")
|
2022-07-27 00:20:34 +02:00
|
|
|
api("com.dorkbox:NetworkDNS:2.7.1")
|
2022-08-19 23:32:25 +02:00
|
|
|
api("com.dorkbox:NetworkUtils:2.19")
|
2022-06-29 16:37:47 +02:00
|
|
|
api("com.dorkbox:ObjectPool:4.0")
|
2022-03-27 21:15:23 +02:00
|
|
|
api("com.dorkbox:OS:1.0")
|
2022-03-15 15:00:26 +01:00
|
|
|
api("com.dorkbox:Serializers:2.7")
|
2022-03-03 01:44:55 +01:00
|
|
|
api("com.dorkbox:Storage:1.1")
|
2022-03-27 21:15:23 +02:00
|
|
|
api("com.dorkbox:Updates:1.1")
|
2022-08-19 23:39:30 +02:00
|
|
|
api("com.dorkbox:Utilities:1.30")
|
2021-08-23 08:52:16 +02:00
|
|
|
|
|
|
|
|
2022-05-30 02:12:36 +02:00
|
|
|
// we include ALL of aeron, in case we need to debug aeron behavior
|
2021-08-23 08:52:16 +02:00
|
|
|
// https://github.com/real-logic/aeron
|
2022-08-04 03:49:42 +02:00
|
|
|
val aeronVer = "1.39.0"
|
2022-05-30 02:12:36 +02:00
|
|
|
api("io.aeron:aeron-all:$aeronVer")
|
2022-08-04 03:41:42 +02:00
|
|
|
// api("org.agrona:agrona:1.16.0") // sources for this isn't included in aeron-all!
|
2021-08-23 08:52:16 +02:00
|
|
|
|
|
|
|
// https://github.com/EsotericSoftware/kryo
|
2022-03-03 01:25:32 +01:00
|
|
|
api("com.esotericsoftware:kryo:5.3.0") {
|
2021-08-23 08:52:16 +02:00
|
|
|
exclude("com.esotericsoftware", "minlog") // we use our own minlog, that logs to SLF4j instead
|
|
|
|
}
|
|
|
|
|
|
|
|
// https://github.com/jpountz/lz4-java
|
|
|
|
// implementation("net.jpountz.lz4:lz4:1.3.0")
|
|
|
|
|
|
|
|
// this is NOT the same thing as LMAX disruptor.
|
2022-04-04 23:24:42 +02:00
|
|
|
// This is just a slightly faster queue than LMAX. (LMAX is a fast queue + other things w/ a difficult DSL)
|
2021-08-23 08:52:16 +02:00
|
|
|
// https://github.com/conversant/disruptor_benchmark
|
|
|
|
// https://www.youtube.com/watch?v=jVMOgQgYzWU
|
2022-04-04 23:24:42 +02:00
|
|
|
//api("com.conversantmedia:disruptor:1.2.19")
|
2021-08-23 08:52:16 +02:00
|
|
|
|
|
|
|
// https://github.com/jhalterman/typetools
|
2022-03-03 01:25:32 +01:00
|
|
|
api("net.jodah:typetools:0.6.3")
|
2021-08-23 08:52:16 +02:00
|
|
|
|
2022-05-30 02:12:36 +02:00
|
|
|
// Expiring Map (A high performance thread-safe map that expires entries)
|
2021-08-23 08:52:16 +02:00
|
|
|
// https://github.com/jhalterman/expiringmap
|
2022-03-03 01:25:32 +01:00
|
|
|
api("net.jodah:expiringmap:0.5.10")
|
2021-08-23 08:52:16 +02:00
|
|
|
|
|
|
|
// https://github.com/MicroUtils/kotlin-logging
|
2022-05-30 02:12:36 +02:00
|
|
|
api("io.github.microutils:kotlin-logging:2.1.23")
|
2022-03-03 01:25:32 +01:00
|
|
|
api("org.slf4j:slf4j-api:1.8.0-beta4")
|
2021-08-23 08:52:16 +02:00
|
|
|
|
|
|
|
|
2022-05-30 02:12:36 +02:00
|
|
|
|
2021-08-23 08:52:16 +02:00
|
|
|
|
2021-10-01 11:28:47 +02:00
|
|
|
testImplementation("junit:junit:4.13.2")
|
2021-08-23 08:52:16 +02:00
|
|
|
testImplementation("ch.qos.logback:logback-classic:1.3.0-alpha4")
|
|
|
|
}
|
|
|
|
|
|
|
|
publishToSonatype {
|
|
|
|
groupId = Extras.group
|
|
|
|
artifactId = Extras.id
|
|
|
|
version = Extras.version
|
|
|
|
|
|
|
|
name = Extras.name
|
|
|
|
description = Extras.description
|
|
|
|
url = Extras.url
|
|
|
|
|
|
|
|
vendor = Extras.vendor
|
|
|
|
vendorUrl = Extras.vendorUrl
|
|
|
|
|
|
|
|
issueManagement {
|
|
|
|
url = "${Extras.url}/issues"
|
|
|
|
nickname = "Gitea Issues"
|
|
|
|
}
|
|
|
|
|
|
|
|
developer {
|
|
|
|
id = "dorkbox"
|
|
|
|
name = Extras.vendor
|
|
|
|
email = "email@dorkbox.com"
|
|
|
|
}
|
|
|
|
}
|