2018-01-27 21:20:49 -06:00
|
|
|
//
|
|
|
|
// Gradle build for Nearenough
|
|
|
|
//
|
|
|
|
// Copyright (c) 2017-2018 int08h LLC. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2019-10-19 22:07:15 -05:00
|
|
|
plugins {
|
|
|
|
id 'java'
|
|
|
|
id 'eclipse'
|
|
|
|
id 'idea'
|
|
|
|
id "org.sonarqube" version "2.8"
|
|
|
|
}
|
|
|
|
|
2020-10-29 00:27:44 +08:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
|
2017-10-14 11:12:53 -05:00
|
|
|
repositories {
|
|
|
|
jcenter()
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2019-11-03 10:32:11 -06:00
|
|
|
compile 'io.netty:netty-all:4.1.43.Final'
|
2017-10-14 11:12:53 -05:00
|
|
|
|
2019-06-22 13:00:38 +02:00
|
|
|
compile 'net.i2p.crypto:eddsa:0.3.0'
|
2019-06-22 12:53:33 +02:00
|
|
|
|
2017-10-14 11:12:53 -05:00
|
|
|
testCompile 'junit:junit:4.12'
|
|
|
|
}
|
|
|
|
|
2018-12-14 17:50:27 -06:00
|
|
|
// Suppress "Illegal reflective access" warnings on Java 9+
|
2018-01-27 21:20:49 -06:00
|
|
|
def shouldAddOpens = JavaVersion.current().java9Compatible
|
|
|
|
|
|
|
|
// Runs the NIO example
|
|
|
|
task nioExample(type: JavaExec) {
|
|
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
|
|
main = 'nearenough.examples.NioClient'
|
|
|
|
|
|
|
|
if (shouldAddOpens) {
|
|
|
|
jvmArgs = ['--add-opens', 'java.base/java.nio=ALL-UNNAMED']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-27 12:36:15 -05:00
|
|
|
// Runs the Netty example
|
2018-01-27 21:20:49 -06:00
|
|
|
task nettyExample(type: JavaExec) {
|
|
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
|
|
main = 'nearenough.examples.NettyClient'
|
|
|
|
|
|
|
|
if (shouldAddOpens) {
|
|
|
|
jvmArgs = [
|
|
|
|
'--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED',
|
|
|
|
'--add-opens', 'java.base/java.nio=ALL-UNNAMED'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|