-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from Flash3388/development
Development
- Loading branch information
Showing
84 changed files
with
1,296 additions
and
709 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,21 @@ | ||
apply plugin: 'signing' | ||
|
||
allprojects { | ||
group = GROUP | ||
version = VERSION | ||
|
||
apply plugin: 'maven-publish' | ||
|
||
ext.isReleaseBuild = { | ||
return version.contains("SNAPSHOT") == false | ||
} | ||
|
||
ext.getNexusUsername = { | ||
return rootProject.hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : System.getenv('NEXUS_USERNAME') | ||
} | ||
|
||
ext.getNexusPassword = { | ||
return rootProject.hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : System.getenv('NEXUS_PASSWORD') | ||
} | ||
|
||
publishing { | ||
repositories { | ||
maven { | ||
if (isReleaseBuild()) { | ||
name = 'NexusStaging' | ||
url = NEXUS_RELEASE_REPOSITORY_URL | ||
} else { | ||
name = 'NexusSnapshot' | ||
url = NEXUS_SNAPSHOT_REPOSITORY_URL | ||
} | ||
|
||
credentials { | ||
username getNexusUsername() | ||
password getNexusPassword() | ||
} | ||
} | ||
buildscript { | ||
repositories { | ||
jcenter() | ||
maven { | ||
url "https://plugins.gradle.org/m2/" | ||
} | ||
} | ||
|
||
ext.setPropertyGlobal = { key -> | ||
if (rootProject.hasProperty(key)) { | ||
project.setProperty(key, rootProject.getProperty(key)) | ||
} | ||
dependencies { | ||
classpath "me.champeau.gradle:jmh-gradle-plugin:0.5.0" | ||
} | ||
} | ||
|
||
ext.setPropertyGlobalFile = { key -> | ||
if (rootProject.hasProperty(key)) { | ||
def file = rootProject.file(rootProject.getProperty(key)).absolutePath | ||
project.setProperty(key, file) | ||
} | ||
} | ||
allprojects { | ||
group = GROUP | ||
version = VERSION | ||
|
||
setPropertyGlobal('signing.keyId') | ||
setPropertyGlobal('signing.password') | ||
setPropertyGlobalFile('signing.secretKeyRingFile') | ||
apply from: rootProject.file('extras.gradle') | ||
} | ||
|
||
subprojects { | ||
|
@@ -67,19 +30,19 @@ subprojects.each { subproject -> evaluationDependsOn(subproject.path) } | |
|
||
|
||
task flashlibSources(type: Jar, dependsOn: subprojects.classes) { | ||
baseName = 'flashlib' | ||
destinationDir = rootProject.buildDir | ||
classifier = 'sources' | ||
archiveBaseName.set('flashlib') | ||
destinationDirectory.set(rootProject.buildDir) | ||
archiveClassifier.set('sources') | ||
|
||
from files(subprojects.collect { | ||
it.sourceSets.main.allSource | ||
}) | ||
} | ||
|
||
task flashlibJavadoc(type: Jar, dependsOn: subprojects.javadoc) { | ||
baseName = 'flashlib' | ||
destinationDir = rootProject.buildDir | ||
classifier = 'javadoc' | ||
archiveBaseName.set('flashlib') | ||
destinationDirectory.set(rootProject.buildDir) | ||
archiveClassifier.set('javadoc') | ||
|
||
from files(subprojects.collect { | ||
it.javadoc.destinationDir | ||
|
@@ -90,8 +53,8 @@ task flashlib(type: Jar, dependsOn: subprojects.assemble) { | |
dependsOn flashlibSources | ||
dependsOn flashlibJavadoc | ||
|
||
baseName = 'flashlib' | ||
destinationDir = rootProject.buildDir | ||
archiveBaseName.set('flashlib') | ||
destinationDirectory.set(rootProject.buildDir) | ||
|
||
from files(subprojects.collect { | ||
it.sourceSets.main.output | ||
|
@@ -102,8 +65,8 @@ task flashlibAll(type: Jar, dependsOn: flashlib) { | |
dependsOn flashlibSources | ||
dependsOn flashlibJavadoc | ||
|
||
archiveName = 'flashlib-all.jar' | ||
destinationDir = rootProject.buildDir | ||
archiveFileName.set('flashlib-all.jar') | ||
destinationDirectory.set(rootProject.buildDir) | ||
|
||
from files(subprojects.collect { | ||
it.sourceSets.main.output | ||
|
@@ -116,79 +79,4 @@ task flashlibAll(type: Jar, dependsOn: flashlib) { | |
}) | ||
} | ||
|
||
artifacts { | ||
archives flashlib | ||
archives flashlibSources | ||
archives flashlibJavadoc | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenFlashlib(MavenPublication) { | ||
artifactId = 'flashlib' | ||
|
||
artifact flashlib | ||
artifact flashlibJavadoc | ||
artifact flashlibSources | ||
|
||
pom { | ||
name = 'Flashlib' | ||
description = 'Robotics development framework' | ||
url = 'https://github.com/Flash3388/FlashLib' | ||
|
||
licenses { | ||
license { | ||
name = 'BSD 3-Clause License' | ||
url = 'https://opensource.org/licenses/BSD-3-Clause' | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id = 'tomtzook' | ||
name = 'Tom Tzook' | ||
email = '[email protected]' | ||
} | ||
} | ||
|
||
scm { | ||
connection = 'scm:git:git://github.com/Flash3388/FlashLib.git' | ||
developerConnection = 'scm:git:ssh://github.com/Flash3388/FlashLib.git' | ||
url = 'https://github.com/Flash3388/FlashLib' | ||
} | ||
|
||
withXml { | ||
def dependenciesNode = asNode().appendNode('dependencies') | ||
def allDependencies = [] | ||
|
||
subprojects.each { project -> | ||
allDependencies.addAll(project.configurations.compile.allDependencies.withType(ExternalDependency)) | ||
} | ||
|
||
def comparator = [ | ||
compare: { first, second -> | ||
if (first.group != second.group) | ||
return first.group.compareTo(second.group) | ||
else | ||
return first.name.compareTo(second.name) | ||
} | ||
] as Comparator | ||
|
||
allDependencies.collect().unique(comparator).each { dep -> | ||
def dependencyNode = dependenciesNode.appendNode('dependency') | ||
dependencyNode.appendNode('groupId', dep.group) | ||
dependencyNode.appendNode('artifactId', dep.name) | ||
dependencyNode.appendNode('version', dep.version) | ||
dependencyNode.appendNode('scope', 'compile') | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
if (project.hasProperty('SIGN_PUBLISH')) { | ||
signing { | ||
sign publishing.publications.mavenFlashlib | ||
} | ||
} | ||
apply from: rootProject.file('deploy.gradle') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
apply plugin: "me.champeau.gradle.jmh" | ||
|
||
ext { | ||
BENCHMARK_RESULTS_DIR = project.file("${project.buildDir}/reports/jmh") | ||
BENCHMARK_OUTPUT_DIRS = [ | ||
project.file("${project.buildDir}/jmh-generated-classes"), | ||
project.file("${project.buildDir}/jmh-generated-resources"), | ||
project.file("${project.buildDir}/jmh-generated-sources") | ||
] | ||
} | ||
|
||
jmh { | ||
iterations = 10 // Number of measurement iterations to do. | ||
batchSize = 1 // Batch size: number of benchmark method calls per operation. (some benchmark modes can ignore this setting) | ||
fork = 2 // How many times to forks a single benchmark. Use 0 to disable forking altogether | ||
failOnError = false // Should JMH fail immediately if any benchmark had experienced the unrecoverable error? | ||
forceGC = false // Should JMH force GC between iterations? | ||
humanOutputFile = new File(BENCHMARK_RESULTS_DIR, "human.txt") // human-readable output file | ||
resultsFile = new File(BENCHMARK_RESULTS_DIR, "results.txt") // results file | ||
benchmarkParameters = [:] // Benchmark parameters. | ||
profilers = ['gc', 'stack'] // Use profilers to collect additional data. Supported profilers: [cl, comp, gc, stack, perf, perfnorm, perfasm, xperf, xperfasm, hs_cl, hs_comp, hs_gc, hs_rt, hs_thr] | ||
resultFormat = 'JSON' // Result format type (one of CSV, JSON, NONE, SCSV, TEXT) | ||
synchronizeIterations = false // Synchronize iterations? | ||
threads = 4 // Number of worker threads to run with. | ||
timeUnit = 'ms' // Output time unit. Available time units are: [m, s, ms, us, ns]. | ||
verbosity = 'NORMAL' // Verbosity mode. Available modes are: [SILENT, NORMAL, EXTRA] | ||
warmup = '10s' // Time to spend at each warmup iteration. | ||
warmupBatchSize = 10 // Warmup batch size: number of benchmark method calls per operation. | ||
warmupForks = 0 // How many warmup forks to make for a single benchmark. 0 to disable warmup forks. | ||
warmupIterations = 1 // Number of warmup iterations to do. | ||
warmupMode = 'INDI' // Warmup mode for warming up selected benchmarks. Warmup modes are: [INDI, BULK, BULK_INDI]. | ||
warmupBenchmarks = ['.*Warmup'] // Warmup benchmarks to include in the run in addition to already selected. JMH will not measure these benchmarks, but only use them for the warmup. | ||
|
||
jmhVersion = '1.21' // Specifies JMH version | ||
} | ||
|
||
task clearBenchmarkResults(type: Delete) { | ||
BENCHMARK_OUTPUT_DIRS.each { | ||
delete it | ||
} | ||
} | ||
|
||
task benchmark { | ||
dependsOn project.tasks.clearBenchmarkResults, | ||
project.tasks.build, project.tasks.jmh | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,26 @@ | ||
|
||
ext.gson = { | ||
return "com.google.code.gson:gson:2.8.5" | ||
} | ||
|
||
ext.jmath = { | ||
return "com.flash3388.util:jmath:1.0" | ||
} | ||
|
||
ext.javabeans = { | ||
return "com.flash3388.util:javabeans:1.0" | ||
} | ||
|
||
ext.slf4jApi = { | ||
return "org.slf4j:slf4j-api:1.7.25" | ||
} | ||
|
||
ext.junit = { | ||
return "junit:junit:4.12" | ||
} | ||
|
||
ext.mockitoCore = { | ||
return "org.mockito:mockito-core:2.23.4" | ||
} | ||
|
||
ext.hamcrest = { | ||
return "org.hamcrest:hamcrest:2.1" | ||
} | ||
ext { | ||
gson = { | ||
return "com.google.code.gson:gson:2.8.5" | ||
} | ||
jmath = { | ||
return "com.flash3388.util:jmath:1.0" | ||
} | ||
javabeans = { | ||
return "com.flash3388.util:javabeans:1.0" | ||
} | ||
slf4jApi = { | ||
return "org.slf4j:slf4j-api:1.7.25" | ||
} | ||
junit = { | ||
return ['org.junit.jupiter:junit-jupiter-engine:5.4.2', | ||
'org.junit.platform:junit-platform-runner:1.2.0', | ||
'org.junit.jupiter:junit-jupiter-params:5.4.2'] | ||
} | ||
mockito = { | ||
return ['org.mockito:mockito-core:2.23.4', | ||
'org.mockito:mockito-junit-jupiter:2.23.0'] | ||
} | ||
hamcrest = { | ||
return "org.hamcrest:hamcrest:2.1" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.