2020-05-08 12:27:58 +02:00
|
|
|
/*
|
2020-06-04 23:24:24 +02:00
|
|
|
* Copyright 2020 dorkbox, llc
|
2020-05-08 12:27:58 +02:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2020-07-03 01:45:18 +02:00
|
|
|
import dorkbox.gradle.kotlin
|
2020-05-08 12:27:58 +02:00
|
|
|
import java.time.Instant
|
|
|
|
|
|
|
|
///////////////////////////////
|
|
|
|
////// PUBLISH TO SONATYPE / MAVEN CENTRAL
|
2020-06-04 23:24:24 +02:00
|
|
|
////// TESTING : (to local maven repo) <'publish and release' - 'publishToMavenLocal'>
|
|
|
|
////// RELEASE : (to sonatype/maven central), <'publish and release' - 'publishToSonatypeAndRelease'>
|
2020-05-08 12:27:58 +02:00
|
|
|
///////////////////////////////
|
|
|
|
|
2020-08-31 14:53:10 +02:00
|
|
|
gradle.startParameter.showStacktrace = ShowStacktrace.ALWAYS // always show the stacktrace!
|
|
|
|
gradle.startParameter.warningMode = WarningMode.All
|
|
|
|
|
2020-05-08 12:27:58 +02:00
|
|
|
plugins {
|
|
|
|
java
|
|
|
|
|
2020-08-31 14:53:10 +02:00
|
|
|
id("com.dorkbox.GradleUtils") version "1.12"
|
|
|
|
id("com.dorkbox.Licensing") version "2.5"
|
2020-08-22 22:58:03 +02:00
|
|
|
id("com.dorkbox.VersionUpdate") version "2.0"
|
2020-08-31 14:53:10 +02:00
|
|
|
id("com.dorkbox.GradlePublish") version "1.7"
|
|
|
|
id("com.dorkbox.GradleModuleInfo") version "1.1"
|
2020-05-08 12:27:58 +02:00
|
|
|
|
2020-08-22 22:58:03 +02:00
|
|
|
kotlin("jvm") version "1.4.0"
|
2020-05-08 12:27:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
object Extras {
|
|
|
|
// set for the project
|
|
|
|
const val description = "Encrypted, high-performance, and event-driven/reactive network stack for Java 11+"
|
|
|
|
const val group = "com.dorkbox"
|
2020-08-31 14:53:10 +02:00
|
|
|
const val version = "5.0-alpha9"
|
2020-05-08 12:27:58 +02:00
|
|
|
|
|
|
|
// set as project.ext
|
|
|
|
const val name = "Network"
|
|
|
|
const val id = "Network"
|
|
|
|
const val vendor = "Dorkbox LLC"
|
2020-06-04 23:24:24 +02:00
|
|
|
const val vendorUrl = "https://dorkbox.com"
|
2020-05-08 12:27:58 +02:00
|
|
|
const val url = "https://git.dorkbox.com/dorkbox/Network"
|
|
|
|
|
2020-08-22 22:58:03 +02:00
|
|
|
val buildDate = Instant.now().toString()
|
2020-05-08 12:27:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
///////////////////////////////
|
|
|
|
///// assign 'Extras'
|
|
|
|
///////////////////////////////
|
|
|
|
GradleUtils.load("$projectDir/../../gradle.properties", Extras)
|
2020-07-03 01:45:18 +02:00
|
|
|
GradleUtils.fixIntellijPaths()
|
2020-08-22 22:58:03 +02:00
|
|
|
GradleUtils.defaultResolutionStrategy()
|
|
|
|
GradleUtils.compileConfiguration(JavaVersion.VERSION_11) { kotlinOptions ->
|
|
|
|
// see: https://kotlinlang.org/docs/reference/using-gradle.html
|
|
|
|
kotlinOptions.apply {
|
|
|
|
// enable the use of inline classes. see https://kotlinlang.org/docs/reference/inline-classes.html
|
|
|
|
freeCompilerArgs += "-Xinline-classes"
|
|
|
|
}
|
|
|
|
}
|
2020-05-08 12:27:58 +02:00
|
|
|
|
2020-08-22 22:58:03 +02:00
|
|
|
// ratelimiter, "other" package
|
|
|
|
// ping, rest of unit tests
|
|
|
|
// getConnectionUpgradeType
|
2020-06-04 23:24:24 +02:00
|
|
|
|
2020-08-22 22:58:03 +02:00
|
|
|
// 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)
|
2020-06-04 23:24:24 +02:00
|
|
|
// using netty IP filters for connections
|
|
|
|
// /*
|
|
|
|
// * Copyright 2014 The Netty Project
|
|
|
|
// *
|
|
|
|
// * The Netty Project licenses this file to you 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.
|
|
|
|
// */
|
|
|
|
//package dorkbox.network.ipFilter;
|
|
|
|
|
|
|
|
|
|
|
|
// 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();
|
|
|
|
// }
|
|
|
|
// }
|
2020-05-08 12:27:58 +02:00
|
|
|
|
2020-07-03 01:45:18 +02:00
|
|
|
|
2020-05-08 12:27:58 +02:00
|
|
|
licensing {
|
|
|
|
license(License.APACHE_2) {
|
2020-08-22 22:58:03 +02:00
|
|
|
description(Extras.description)
|
2020-05-08 12:27:58 +02:00
|
|
|
url(Extras.url)
|
|
|
|
author(Extras.vendor)
|
|
|
|
|
2020-08-22 22:58:03 +02:00
|
|
|
extra("KryoNet RMI", License.BSD_3) {
|
|
|
|
it.copyright(2008)
|
|
|
|
it.author("Nathan Sweet")
|
|
|
|
it.url("https://github.com/EsotericSoftware/kryonet")
|
|
|
|
}
|
|
|
|
extra("LAN HostDiscovery from Apache Commons JCS", License.APACHE_2) {
|
|
|
|
it.copyright(2014)
|
|
|
|
it.author("The Apache Software Foundation")
|
|
|
|
it.url("https://issues.apache.org/jira/browse/JCS-40")
|
|
|
|
}
|
|
|
|
extra("MathUtils, IntArray, IntMap", License.APACHE_2) {
|
|
|
|
it.copyright(2013)
|
|
|
|
it.author("Mario Zechner <badlogicgames@gmail.com>")
|
|
|
|
it.author("Nathan Sweet <nathan.sweet@gmail.com>")
|
|
|
|
it.url("http://github.com/libgdx/libgdx")
|
|
|
|
}
|
|
|
|
extra("Netty (Various network + platform utilities)", License.APACHE_2) {
|
|
|
|
it.copyright(2014)
|
|
|
|
it.description("An event-driven asynchronous network application framework")
|
|
|
|
it.author("The Netty Project")
|
|
|
|
it.author("Contributors. See source NOTICE")
|
|
|
|
it.url("https://netty.io")
|
|
|
|
}
|
2020-05-08 12:27:58 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
java {
|
|
|
|
setSrcDirs(listOf("src"))
|
|
|
|
|
|
|
|
// want to include java files for the source. 'setSrcDirs' resets includes...
|
|
|
|
include("**/*.java")
|
|
|
|
}
|
2020-07-03 01:45:18 +02:00
|
|
|
|
|
|
|
kotlin {
|
|
|
|
setSrcDirs(listOf("src"))
|
|
|
|
|
|
|
|
// want to include java files for the source. 'setSrcDirs' resets includes...
|
|
|
|
include("**/*.java", "**/*.kt")
|
|
|
|
}
|
2020-05-08 12:27:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
test {
|
|
|
|
java {
|
|
|
|
setSrcDirs(listOf("test"))
|
|
|
|
|
|
|
|
// want to include java files for the source. 'setSrcDirs' resets includes...
|
|
|
|
include("**/*.java")
|
|
|
|
}
|
2020-07-03 01:45:18 +02:00
|
|
|
|
|
|
|
kotlin {
|
2020-08-22 22:58:03 +02:00
|
|
|
setSrcDirs(listOf("test"))
|
2020-07-03 01:45:18 +02:00
|
|
|
|
|
|
|
// want to include java files for the source. 'setSrcDirs' resets includes...
|
|
|
|
include("**/*.java", "**/*.kt")
|
|
|
|
}
|
2020-05-08 12:27:58 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenLocal() // this must be first!
|
|
|
|
jcenter()
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
attributes["Automatic-Module-Name"] = Extras.id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2020-08-22 22:58:03 +02:00
|
|
|
implementation("org.jetbrains.kotlinx:atomicfu:0.14.4")
|
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9")
|
2020-07-03 01:45:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
// https://github.com/real-logic/aeron
|
2020-08-22 22:58:03 +02:00
|
|
|
val aeronVer = "1.29.0"
|
2020-07-03 01:45:18 +02:00
|
|
|
implementation("io.aeron:aeron-client:$aeronVer")
|
|
|
|
implementation("io.aeron:aeron-driver:$aeronVer")
|
|
|
|
|
2020-08-31 14:53:10 +02:00
|
|
|
// https://github.com/EsotericSoftware/kryo
|
2020-08-22 22:58:03 +02:00
|
|
|
implementation("com.esotericsoftware:kryo:5.0.0-RC8")
|
2020-08-31 14:53:10 +02:00
|
|
|
|
|
|
|
// https://github.com/magro/kryo-serializers
|
2020-08-22 22:58:03 +02:00
|
|
|
implementation("de.javakaffee:kryo-serializers:0.45")
|
|
|
|
|
2020-08-31 14:53:10 +02:00
|
|
|
// https://github.com/jpountz/lz4-java
|
2020-05-08 12:27:58 +02:00
|
|
|
implementation("net.jpountz.lz4:lz4:1.3.0")
|
|
|
|
|
2020-07-03 01:45:18 +02:00
|
|
|
// this is NOT the same thing as LMAX disruptor.
|
|
|
|
// This is just a really fast queue (where LMAX is a fast queue + other things w/ a difficult DSL)
|
|
|
|
// https://github.com/conversant/disruptor_benchmark
|
|
|
|
// https://www.youtube.com/watch?v=jVMOgQgYzWU
|
2020-08-22 22:58:03 +02:00
|
|
|
implementation("com.conversantmedia:disruptor:1.2.17")
|
2020-07-03 01:45:18 +02:00
|
|
|
|
2020-08-31 14:53:10 +02:00
|
|
|
// https://github.com/jhalterman/typetools
|
2020-05-08 12:27:58 +02:00
|
|
|
implementation("net.jodah:typetools:0.6.2")
|
|
|
|
|
2020-08-31 14:53:10 +02:00
|
|
|
// https://github.com/dorkbox
|
|
|
|
implementation("com.dorkbox:Annotations:3.1")
|
|
|
|
implementation("com.dorkbox:MinLog-SLF4J:2.0")
|
|
|
|
implementation("com.dorkbox:Utilities:1.8")
|
2020-08-23 11:36:02 +02:00
|
|
|
implementation("com.dorkbox:NetworkUtils:1.3")
|
2020-05-08 12:27:58 +02:00
|
|
|
|
2020-09-02 03:20:42 +02:00
|
|
|
// Caffeine High-throughput Timeout Cache
|
|
|
|
// https://github.com/ben-manes/caffeine
|
|
|
|
implementation("com.github.ben-manes.caffeine:caffeine:2.8.5") {
|
|
|
|
exclude("org.checkerframework", "checker-qual")
|
|
|
|
exclude("com.google.errorprone", "error_prone_annotations")
|
|
|
|
}
|
|
|
|
|
2020-07-06 16:36:56 +02:00
|
|
|
|
|
|
|
// https://github.com/MicroUtils/kotlin-logging
|
2020-08-31 14:53:10 +02:00
|
|
|
implementation("io.github.microutils:kotlin-logging:1.8.3")
|
2020-05-08 12:27:58 +02:00
|
|
|
implementation("org.slf4j:slf4j-api:1.7.30")
|
|
|
|
|
|
|
|
testImplementation("junit:junit:4.13")
|
|
|
|
testImplementation("ch.qos.logback:logback-classic:1.2.3")
|
|
|
|
}
|
|
|
|
|
2020-06-04 23:24:24 +02:00
|
|
|
publishToSonatype {
|
|
|
|
groupId = Extras.group
|
|
|
|
artifactId = Extras.id
|
|
|
|
version = Extras.version
|
2020-05-08 12:27:58 +02:00
|
|
|
|
2020-06-04 23:24:24 +02:00
|
|
|
name = Extras.name
|
|
|
|
description = Extras.description
|
|
|
|
url = Extras.url
|
2020-05-08 12:27:58 +02:00
|
|
|
|
2020-06-04 23:24:24 +02:00
|
|
|
vendor = Extras.vendor
|
|
|
|
vendorUrl = Extras.vendorUrl
|
2020-05-08 12:27:58 +02:00
|
|
|
|
2020-06-04 23:24:24 +02:00
|
|
|
issueManagement {
|
|
|
|
url = "${Extras.url}/issues"
|
|
|
|
nickname = "Gitea Issues"
|
2020-05-08 12:27:58 +02:00
|
|
|
}
|
|
|
|
|
2020-06-04 23:24:24 +02:00
|
|
|
developer {
|
|
|
|
id = "dorkbox"
|
|
|
|
name = Extras.vendor
|
|
|
|
email = "email@dorkbox.com"
|
2020-05-08 12:27:58 +02:00
|
|
|
}
|
|
|
|
}
|