Converted to gradle

old_release
nathan 2018-08-18 23:15:46 +02:00
parent 5f2cb654d2
commit 8fe6910fc5
9 changed files with 1018 additions and 111 deletions

130
.gitignore vendored
View File

@ -1,4 +1,126 @@
/classes/
*.crt
*.ini
*.db
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
.idea/**/codeStyles/
.idea/**/codeStyleSettings.xml
# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/shelf/
# Gradle:
.idea/**/gradle.xml
.idea/**/libraries
# CMake
cmake-build-debug/
# Mongo Explorer plugin:
.idea/**/mongoSettings.xml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
######################
# End JetBrains IDEs #
######################
# From https://github.com/github/gitignore/blob/master/Gradle.gitignore
.gradle
/build/
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Cache of project
.gradletasknamecache
# Work around https://youtrack.jetbrains.com/issue/IDEA-116898
gradle/wrapper/gradle-wrapper.properties
# From https://github.com/github/gitignore/blob/master/Java.gitignore
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
*.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
##########################################################
# Specific to this module
# iml files are generated by intellij/gradle now
**/*.iml

157
LICENSE
View File

@ -1,105 +1,120 @@
- Dorkbox Network - Apache 2.0 License
https://github.com/dorkbox
Copyright 2010, dorkbox, llc
Encrypted, high-performance, and event-driven/reactive network stack for Java 6+
- Network -
https://git.dorkbox.com/dorkbox/Network
Copyright 2018 - The Apache Software License, Version 2.0
dorkbox, llc
Encrypted, high-performance, and event-driven/reactive network stack for Java 6+
- Bennidi Iterator - MIT License
https://github.com/bennidi/mbassador
Copyright 2012, Benjamin Diedrichsen
Fast iterators from the MBassador project
- Bennidi Iterator -
https://github.com/bennidi/mbassador
Copyright 2012 - MIT License
Benjamin Diedrichsen
Fast iterators from the MBassador project
- BouncyCastle - MIT License
http://www.bouncycastle.org
Copyright 2000-2009, The Legion Of The Bouncy Castle
- BouncyCastle -
http://www.bouncycastle.org
Copyright 2009 - MIT License
The Legion Of The Bouncy Castle
- Dorkbox ObjectPool - Apache 2.0 License
https://github.com/dorkbox
Copyright 2014, dorkbox, llc
Fast, lightweight, and compatible blocking/non-blocking/soft-reference object pool for Java 6+
- Dorkbox Utils -
https://git.dorkbox.com/dorkbox/Utilities
Copyright 2018 - The Apache Software License, Version 2.0
dorkbox, llc
- Dorkbox Utils - Apache 2.0 License
https://github.com/dorkbox
Copyright 2010, dorkbox, llc
- FastThreadLocal -
https://github.com/LWJGL/lwjgl3/blob/5819c9123222f6ce51f208e022cb907091dd8023/modules/core/src/main/java/org/lwjgl/system/FastThreadLocal.java
Copyright 2014 - BSD 3-Clause License
Lightweight Java Game Library Project
Riven
- FastThreadLocal - BSD 3-clause License
https://github.com/LWJGL/lwjgl3/blob/5819c9123222f6ce51f208e022cb907091dd8023/modules/core/src/main/java/org/lwjgl/system/FastThreadLocal.java
Copyright 2012-2014, Lightweight Java Game Library Project
Riven
Optimized and Fast ThreadLocals
- Javassist -
http://www.csg.is.titech.ac.jp/~chiba/java
Copyright 1999 - BSD 3-Clause License
Shigeru Chiba
Bill Burke
Jason T. Greene
Licensed under the MPL/LGPL/Apache triple license
- Javassist - Apache 2.0 License
http://www.csg.is.titech.ac.jp/~chiba/javassist
Copyright 1999, Shigeru Chiba
Bill Burke
Jason T. Greene
Licensed under the MPL/LGPL/Apache triple license
- Kryo -
https://github.com/EsotericSoftware/kryo
Copyright 2008 - BSD 3-Clause License
Nathan Sweet
- Kryo - BSD 3-clause License
https://github.com/EsotericSoftware/kryo
Copyright 2008, Nathan Sweet
- kryo-serializers -
https://github.com/magro/kryo-serializers
Copyright 2010 - The Apache Software License, Version 2.0
Martin Grotzke
Rafael Winterhalter
- kryo-serializers - Apache 2.0 License
https://github.com/magro/kryo-serializers
Copyright 2010, Martin Grotzke
Rafael Winterhalter
- KryoNet RMI -
https://github.com/EsotericSoftware/kryonet
Copyright 2008 - BSD 3-Clause License
Nathan Sweet
- KryoNet RMI - BSD 3-clause License
https://github.com/EsotericSoftware/kryonet
Copyright 2008, Nathan Sweet
- LAN HostDiscovery from Apache Commons JCS -
https://issues.apache.org/jira/browse/JCS-40
Copyright 2014 - The Apache Software License, Version 2.0
The Apache Software Foundation
- LAN HostDiscovery from Apache Commons JCS - Apache 2.0 License
https://issues.apache.org/jira/browse/JCS-40
Copyright 2001-2014, The Apache Software Foundation
- LZ4 and XXhash -
https://github.com/jpountz/lz4-java
Copyright 2011, 2012 - The Apache Software License, Version 2.0
Yann Collet
Adrien Grand
- LZ4 and XXhash - Apache 2.0 License
https://github.com/jpountz/lz4-java
Copyright 2011, Yann Collet
Copyright 2012, Adrien Grand
- MathUtils, IntArray, IntMap -
http://github.com/libgdx/libgdx/
Copyright 2013 - The Apache Software License, Version 2.0
Mario Zechner <badlogicgames@gmail.com>
Nathan Sweet <nathan.sweet@gmail.com>
- MathUtils, IntArray, IntMap - Apache 2.0 License
http://github.com/libgdx/libgdx/
Copyright 2013
Mario Zechner <badlogicgames@gmail.com>
Nathan Sweet <nathan.sweet@gmail.com>
- MinLog-SLF4J -
https://git.dorkbox.com/dorkbox/MinLog-SLF4J
https://github.com/EsotericSoftware/minlog
Copyright 2008 - The Apache Software License, Version 2.0
dorkbox, llc
Nathan Sweet
Dan Brown
Drop-in replacement for MinLog to log through SLF4j.
- MinLogToSLF4j - BSD 3-clause License
https://github.com/dorkbox
https://github.com/EsotericSoftware/minlog
Copyright 2008, Nathan Sweet
Dan Brown
dorkbox, llc
Drop-in replacement for MinLog to log through SLF4j.
- ObjectPool -
https://git.dorkbox.com/dorkbox/ObjectPool
Copyright 2018 - The Apache Software License, Version 2.0
dorkbox, llc
- ReflectASM - BSD 3-clause License
https://github.com/EsotericSoftware/reflectasm
Copyright 2008, Nathan Sweet
- ReflectASM -
https://github.com/EsotericSoftware/reflectasm
Copyright 2008 - BSD 3-Clause License
Nathan Sweet
- SLF4J - MIT License
http://www.slf4j.org
Copyright 2004-2008, QOS.ch
- SLF4J -
http://www.slf4j.org
Copyright 2008 - MIT License
QOS.ch
- TypeTools - Apache 2.0 License
https://github.com/jhalterman/typetools/
Copyright 2002-2017, Jonathan Halterman
Tools for resolving generic types
- TypeTools -
https://github.com/jhalterman/typetools/
Copyright 2017 - The Apache Software License, Version 2.0
Jonathan Halterman
Tools for resolving generic types
- XBill DNS - BSD 3-clause License
http://www.xbill.org/dnsjava
Copyright 1999-2005, Brian Wellington
- XBill DNS -
http://www.xbill.org/dnsjava
Copyright 2005 - BSD 3-Clause License
Brian Wellington

22
LICENSE.BSD2 Normal file
View File

@ -0,0 +1,22 @@
BSD License
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <ORGANIZATION> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -1,32 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src-wip" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/resources/dnsjava-code-1726-trunk/tests" />
<excludeFolder url="file://$MODULE_DIR$/src-wip/org/handwerkszeug/dns/aaaa" />
<excludeFolder url="file://$MODULE_DIR$/src/org/handwerkszeug/dns/aaaa" />
<excludeFolder url="file://$MODULE_DIR$/src/org/xbill" />
</content>
<orderEntry type="jdk" jdkName="1.6" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="Utilities" />
<orderEntry type="library" name="logging slf4j-api" level="application" />
<orderEntry type="library" name="logging logback" level="application" />
<orderEntry type="library" name="bouncyCastle bcpkix-jdk15on" level="application" />
<orderEntry type="library" name="bouncyCastle bcprov-jdk15on" level="application" />
<orderEntry type="library" name="dorkbox object_pool" level="application" />
<orderEntry type="library" name="asm" level="application" />
<orderEntry type="library" name="lz4_xxhash" level="application" />
<orderEntry type="library" name="netty" level="application" />
<orderEntry type="library" name="reflectasm" level="application" />
<orderEntry type="library" name="objenesis" level="application" />
<orderEntry type="library" name="junit-4.12" level="application" />
<orderEntry type="library" name="dorkbox minlog_slf4j" level="application" />
<orderEntry type="library" name="kryo" level="application" />
<orderEntry type="library" name="snakeyaml-1.7" level="project" />
</component>
</module>

View File

@ -87,7 +87,7 @@ Release Notes
This project includes some utility classes that are a small subset of a much larger library. These classes are **kept in sync** with the main utilities library, so "jar hell" is not an issue, and the latest release will always include the same version of utility files as all of the other projects in the dorkbox repository at that time.
Please note that the utility source code is included in the release and on our [GitHub](https://github.com/dorkbox/Utilities) repository.
Please note that the utility source code is included in the release and on our [Git Server](https://git.dorkbox.com/dorkbox/Utilities) repository.
Maven Info
@ -103,12 +103,21 @@ Maven Info
</dependencies>
```
Gradle Info
---------
````
dependencies {
...
compile 'com.dorkbox:Network:2.11'
}
````
Or if you don't want to use Maven, you can access the files directly here:
https://oss.sonatype.org/content/repositories/releases/com/dorkbox/Network/
https://repo1.maven.org/maven2/com/dorkbox/Network/
https://oss.sonatype.org/content/repositories/releases/com/dorkbox/ObjectPool/
https://oss.sonatype.org/content/repositories/releases/com/dorkbox/MinLog-SLF4J/
https://repo1.maven.org/maven2/releases/com/dorkbox/ObjectPool/
https://repo1.maven.org/maven2/com/dorkbox/MinLog-SLF4J/
https://repo1.maven.org/maven2/org/slf4j/slf4j-api/
https://repo1.maven.org/maven2/io/netty/netty-all/ (latest 4.1)

489
build.gradle Normal file
View File

@ -0,0 +1,489 @@
/*
* Copyright 2018 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.nio.file.Paths
import java.time.Instant
buildscript {
// load properties from custom location
def propsFile = Paths.get("${projectDir}/../../gradle.properties").toAbsolutePath().normalize().toFile()
println("Loading custom property data from: ${propsFile}")
def props = new Properties()
propsFile.withInputStream {props.load(it)}
props.each {key, val -> project.ext.set(key, val)}
// for plugin publishing and license sources
repositories {
maven {url "https://plugins.gradle.org/m2/"}
}
dependencies {
// this is the only way to also get the source code for IDE auto-complete
classpath "gradle.plugin.com.dorkbox:Licensing:1.2.2"
classpath "gradle.plugin.com.dorkbox:Licensing:1.2.2:sources"
}
}
plugins {
id 'java'
id 'maven-publish'
id 'signing'
// close and release on sonatype
id 'io.codearte.nexus-staging' version '0.11.0'
id "com.dorkbox.CrossCompile" version "1.0.1"
id "com.dorkbox.VersionUpdate" version "1.2"
// setup checking for the latest version of a plugin or dependency (and updating the gradle build)
id "se.patrikerdes.use-latest-versions" version "0.2.3"
id 'com.github.ben-manes.versions' version '0.16.0'
}
// this is the only way to also get the source code for IDE auto-complete
apply plugin: "com.dorkbox.Licensing"
// give us access to api/implementation differences for building java libraries
apply plugin: 'java-library'
project.description = 'Encrypted, high-performance, and event-driven/reactive network stack for Java 6+'
project.group = 'com.dorkbox'
project.version = '2.11'
project.ext.name = 'Network'
project.ext.url = 'https://git.dorkbox.com/dorkbox/Network'
sourceCompatibility = 1.8
targetCompatibility = 1.8
licensing {
license(License.APACHE_2) {
author 'dorkbox, llc'
url project.ext.url
note project.description
}
license('Dorkbox Utils', License.APACHE_2) {
author 'dorkbox, llc'
url 'https://git.dorkbox.com/dorkbox/Utilities'
}
license('Bennidi Iterator', License.MIT) {
copyright 2012
author 'Benjamin Diedrichsen'
url 'https://github.com/bennidi/mbassador'
note 'Fast iterators from the MBassador project'
}
license('BouncyCastle', License.MIT) {
copyright 2009
author 'The Legion Of The Bouncy Castle'
url 'http://www.bouncycastle.org'
}
license('ObjectPool', License.APACHE_2) {
author 'dorkbox, llc'
url 'https://git.dorkbox.com/dorkbox/ObjectPool'
}
license('FastThreadLocal', License.BSD_3) {
copyright 2014
author 'Lightweight Java Game Library Project'
author 'Riven'
url 'https://github.com/LWJGL/lwjgl3/blob/5819c9123222f6ce51f208e022cb907091dd8023/modules/core/src/main/java/org/lwjgl/system/FastThreadLocal.java'
}
license('Javassist', License.BSD_3) {
copyright 1999
author 'Shigeru Chiba'
author 'Bill Burke'
author 'Jason T. Greene'
url 'http://www.csg.is.titech.ac.jp/~chiba/java'
note 'Licensed under the MPL/LGPL/Apache triple license'
}
license('Kryo', License.BSD_3) {
copyright 2008
author 'Nathan Sweet'
url 'https://github.com/EsotericSoftware/kryo'
}
license('kryo-serializers', License.APACHE_2) {
copyright 2010
author 'Martin Grotzke'
author 'Rafael Winterhalter'
url 'https://github.com/magro/kryo-serializers'
}
license('KryoNet RMI', License.BSD_3) {
copyright 2008
author 'Nathan Sweet'
url 'https://github.com/EsotericSoftware/kryonet'
}
license('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'
}
license('LZ4 and XXhash', License.APACHE_2) {
copyright 2011
copyright 2012
author 'Yann Collet'
author 'Adrien Grand'
url 'https://github.com/jpountz/lz4-java'
}
license('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/'
}
license('MinLog-SLF4J', License.APACHE_2) {
copyright 2008
author 'dorkbox, llc'
author 'Nathan Sweet'
author 'Dan Brown'
url 'https://git.dorkbox.com/dorkbox/MinLog-SLF4J'
url 'https://github.com/EsotericSoftware/minlog'
note 'Drop-in replacement for MinLog to log through SLF4j.'
}
license('ReflectASM', License.BSD_3) {
copyright 2008
author 'Nathan Sweet'
url 'https://github.com/EsotericSoftware/reflectasm'
}
license('SLF4J', License.MIT) {
copyright 2008
author 'QOS.ch'
url 'http://www.slf4j.org'
}
license('TypeTools', License.APACHE_2) {
copyright 2017
author 'Jonathan Halterman'
url 'https://github.com/jhalterman/typetools/'
note 'Tools for resolving generic types'
}
license('XBill DNS', License.BSD_3) {
copyright 2005
author 'Brian Wellington'
url 'http://www.xbill.org/dnsjava'
}
}
sourceSets {
main {
java {
setSrcDirs Collections.singletonList('src')
}
}
}
repositories {
mavenLocal() // this must be first!
jcenter()
}
ext {
bcVersion = '1.60'
}
dependencies {
implementation(project('Utilities')) {
// don't include any of the project dependencies for anything
transitive = false
}
// our main dependencies are ALSO the same as the limited utilities (they are not automatically pulled in from other sourceSets)
// needed by the utilities (custom since we don't want to include everything). IntelliJ includes everything, but our builds do not
api 'net.java.dev.jna:jna:4.5.2'
api 'net.java.dev.jna:jna-platform:4.5.2'
api 'io.netty:netty-all:4.1.22.Final'
api 'com.esotericsoftware:kryo:4.0.2'
api 'net.jpountz.lz4:lz4:1.3.0'
api "org.bouncycastle:bcprov-jdk15on:$bcVersion"
api "org.bouncycastle:bcpg-jdk15on:$bcVersion"
api "org.bouncycastle:bcmail-jdk15on:$bcVersion"
api "org.bouncycastle:bctls-jdk15on:$bcVersion"
api "com.dorkbox:ObjectPool:2.11"
api 'org.slf4j:slf4j-api:1.7.25'
}
project('Utilities') {
tasks.withType(Test) {
// want to remove utilities project from unit tests. It's unnecessary to run unit tests for the entire Utilities project
exclude('**/*')
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.incremental = true
// setup compile options. we specifically want to suppress usage of "Unsafe"
options.compilerArgs = ['-XDignore.symbol.file', '-Xlint:deprecation']
}
}
///////////////////////////////
////// Task defaults
///////////////////////////////
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(Jar) {
duplicatesStrategy DuplicatesStrategy.FAIL
manifest {
attributes['Implementation-Version'] = version
attributes['Build-Date'] = Instant.now().toString()
}
}
///////////////////////////////
////// UTILITIES COMPILE (for inclusion into jars)
///////////////////////////////
static String[] javaFile(String... fileNames) {
def fileList = [] as ArrayList
for (name in fileNames) {
def fixed = name.replace('.', '/') + '.java'
fileList.add(fixed)
}
return fileList
}
task compileUtils(type: JavaCompile) {
// we don't want the default include of **/*.java
getIncludes().clear()
source = Collections.singletonList('../Utilities/src')
include javaFile('dorkbox.util.OS',
'dorkbox.util.OSType',
'dorkbox.util.Property',
'dorkbox.util.NamedThreadFactory',
'dorkbox.util.DelayTimer',
'dorkbox.util.IO',
'dorkbox.util.FileUtil',
'dorkbox.util.Base64Fast',
'dorkbox.util.RandomUtil',
'dorkbox.util.Sys',
'dorkbox.util.HashUtil',
'dorkbox.util.NativeLoader',
'dorkbox.util.FastThreadLocal',
'dorkbox.util.LocationResolver',
'dorkbox.util.MathUtil',
'dorkbox.util.MersenneTwisterFast',
'dorkbox.util.NativeLoader',
'dorkbox.util.NativeLoader',
'dorkbox.util.generics.TypeResolver',
// 'dorkbox.util.generics.DefaultMethodHelper', // this class must be compiled java 8+
'dorkbox.util.generics.ClassHelper',
'dorkbox.util.bytes.BigEndian',
'dorkbox.util.bytes.UByte',
'dorkbox.util.bytes.UInteger',
'dorkbox.util.bytes.ULong',
'dorkbox.util.bytes.Unsigned',
'dorkbox.util.bytes.UNumber',
'dorkbox.util.bytes.UShort',
'dorkbox.util.bytes.ByteArrayWrapper',
'dorkbox.util.bytes.OptimizeUtilsByteArray',
'dorkbox.util.bytes.OptimizeUtilsByteBuf',
'dorkbox.util.exceptions.SecurityException',
'dorkbox.util.exceptions.InitializationException',
'dorkbox.util.collections.ObjectIntMap',
'dorkbox.util.collections.IntMap',
'dorkbox.util.collections.IntArray',
'dorkbox.util.collections.ConcurrentIterator',
'dorkbox.util.collections.ConcurrentEntry',
'dorkbox.util.collections.LockFreeHashMap',
'dorkbox.util.collections.LockFreeIntMap',
'dorkbox.util.collections.LockFreeIntBiMap',
'dorkbox.util.collections.LockFreeObjectIntBiMap',
'dorkbox.util.crypto.CryptoECC',
'dorkbox.util.crypto.CryptoAES')
// entire packages/directories
include('dorkbox.util.serialization/**/*.java')
include('dorkbox.util.entropy/**/*.java')
include('dorkbox.util.storage/**/*.java')
classpath = sourceSets.main.compileClasspath
destinationDir = file("$rootDir/build/classes_utilities")
}
///////////////////////////////
////// Compile files to different target version
///////////////////////////////
//task compileFilesToJava8(type: JavaCompile) {
// source = sourceSets.main.java.srcDirs
//
// include 'dorkbox/util/generics/DefaultMethodHelper.java'
//
// classpath = sourceSets.main.compileClasspath
// destinationDir = sourceSets.main.output.classesDir
//}
///////////////////////////////
////// Jar Tasks
///////////////////////////////
jar {
dependsOn compileUtils
// include applicable class files from subset of Utilities project
from compileUtils.destinationDir
}
/////////////////////////////
//// Maven Publishing + Release
/////////////////////////////
task sourceJar(type: Jar) {
description = "Creates a JAR that contains the source code."
from sourceSets.main.java
classifier = "sources"
}
task javaDocJar(type: Jar) {
description = "Creates a JAR that contains the javadocs."
classifier = "javadoc"
}
// for testing, we don't publish to maven central, but only to local maven
publishing {
publications {
maven(MavenPublication) {
from components.java
artifact(javaDocJar)
artifact(sourceJar)
groupId project.group
artifactId project.ext.name
version project.version
pom {
withXml {
// eliminate logback and utilities (no need in maven POMs)
def root = asNode()
root.dependencies.'*'.findAll() {
it.artifactId.text() == "Utilities"
}.each() {
it.parent().remove(it)
}
}
name = project.ext.name
url = project.ext.url
description = project.description
issueManagement {
url = "${project.ext.url}/issues".toString()
system = 'Gitea Issues'
}
organization {
name = 'dorkbox, llc'
url = 'https://dorkbox.com'
}
developers {
developer {
name = 'dorkbox, llc'
email = 'email@dorkbox.com'
}
}
scm {
url = project.ext.url
connection = "scm:${project.ext.url}.git".toString()
}
}
}
}
repositories {
maven {
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
credentials {
username sonatypeUsername
password sonatypePassword
}
}
}
}
nexusStaging {
username sonatypeUsername
password sonatypePassword
}
signing {
required {hasProperty('sonatypeUsername')}
sign publishing.publications.maven
}
// output the release URL in the console
releaseRepository.doLast {
def URL = 'https://oss.sonatype.org/content/repositories/releases/'
def projectName = project.group.toString().replaceAll('\\.', '/')
def name = project.ext.name
def version = project.version
println("Maven URL: ${URL}${projectName}/${name}/${version}/")
}
// we don't use maven with the plugin (it's uploaded separately to gradle plugins)
tasks.withType(PublishToMavenRepository) {
onlyIf {
repository == publishing.repositories.maven && publication == publishing.publications.maven
}
}
tasks.withType(PublishToMavenLocal) {
onlyIf {
publication == publishing.publications.maven
}
}

172
gradlew vendored Executable file
View File

@ -0,0 +1,172 @@
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

84
gradlew.bat vendored Normal file
View File

@ -0,0 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

26
settings.gradle Normal file
View File

@ -0,0 +1,26 @@
/*
* Copyright 2018 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.
*/
include("Utilities")
for (project in rootProject.children) {
project.projectDir = file("../$project.name")
project.buildFileName = "build.gradle"
assert (project.projectDir.directory)
assert (project.buildFile.file)
}
enableFeaturePreview('STABLE_PUBLISHING')