代码拉取完成,页面将自动刷新
/*
* Copyright 2014-2024 Real Logic Limited.
*
* 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
*
* https://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.
*/
plugins {
id 'java-library'
alias(libs.plugins.bnd).apply(false)
alias(libs.plugins.shadow).apply(false)
alias(libs.plugins.versions)
}
defaultTasks 'clean', 'build'
static def getBuildJavaVersion() {
def buildJavaVersion = System.getenv('BUILD_JAVA_VERSION') ?: JavaVersion.current().getMajorVersion()
if (buildJavaVersion.indexOf('.') > 0) {
buildJavaVersion = buildJavaVersion.substring(0, buildJavaVersion.indexOf('.'))
}
if (buildJavaVersion.indexOf('-') > 0) {
buildJavaVersion = buildJavaVersion.substring(0, buildJavaVersion.indexOf('-'))
}
Integer.parseInt(buildJavaVersion)
}
int buildJavaVersion = getBuildJavaVersion()
def toolchainLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(buildJavaVersion)
}
def aeronGroup = 'io.aeron'
def aeronVersion = file('version.txt').text.trim()
def gitCommitHash = io.aeron.build.GithubUtil.currentGitHash("${projectDir}")
ext {
isReleaseVersion = !aeronVersion.endsWith('-SNAPSHOT')
releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
if (!project.hasProperty('ossrhUsername')) {
ossrhUsername = ''
}
if (!project.hasProperty('ossrhPassword')) {
ossrhPassword = ''
}
if (!project.hasProperty('signingKey')) {
signingKey = null
}
if (!project.hasProperty('signingPassword')) {
signingPassword = null
}
}
def projectPom = {
name = 'aeron'
// optionally artifactId can be defined here
description = 'Efficient reliable UDP unicast, UDP multicast, and IPC transport protocol.'
url = 'https://github.com/real-logic/aeron'
scm {
connection = 'scm:git:https://github.com/real-logic/aeron.git'
developerConnection = 'scm:git:https://github.com/real-logic/aeron.git'
url = 'https://github.com/real-logic/aeron.git'
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'tmontgomery'
name = 'Todd L. Montgomery'
email = 'tmont@nard.net'
url = 'https://github.com/tmontgomery'
}
developer {
id = 'mjpt777'
name = 'Martin Thompson'
email = 'mjpt777@gmail.com'
url = 'https://github.com/mjpt777'
}
developer {
id = 'RichardWarburton'
name = 'Richard Warburton'
email = 'richard.warburton@gmail.com'
url = 'https://github.com/RichardWarburton'
}
developer {
id = 'nitsanw'
name = 'Nitsan Wakart'
email = 'nitsanw@yahoo.com'
url = 'https://github.com/nitsanw'
}
developer {
id = 'mikeb01'
name = 'Mike Barker'
email = 'mikeb01@gmail.com'
url = 'https://github.com/mikeb01'
}
developer {
id = 'vyazelenko'
name = 'Dmytro Vyazelenko'
email = 'vyazelenko@protonmail.com '
url = 'https://github.com/vyazelenko'
}
}
}
jar.enabled = false
allprojects {
repositories {
mavenLocal()
mavenCentral()
}
configurations.configureEach {
resolutionStrategy {
failOnVersionConflict()
force "org.agrona:agrona:${libs.versions.agrona.get()}",
libs.byteBuddy,
libs.byteBuddy.agent,
// patching conflicting Checkstyle dependencies
"org.codehaus.plexus:plexus-utils:3.3.0",
"org.apache.commons:commons-lang3:3.8.1",
"org.apache.httpcomponents:httpcore:4.4.14",
"commons-codec:commons-codec:1.15"
}
}
tasks.withType(JavaExec).configureEach {
javaLauncher.set(toolchainLauncher)
}
}
subprojects {
apply plugin: 'base'
apply plugin: 'java-library'
apply plugin: 'checkstyle'
dependencies {
testImplementation libs.hamcrest
testImplementation libs.mockito
testImplementation platform("org.junit:junit-bom:${libs.versions.junit.get()}")
testImplementation "org.junit.jupiter:junit-jupiter-params"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(buildJavaVersion)
}
sourceCompatibility = JavaVersion.VERSION_17
}
group = aeronGroup
version = aeronVersion
checkstyle.toolVersion = libs.versions.checkstyle.get()
tasks.withType(Sign).configureEach {
onlyIf {
isReleaseVersion && gradle.taskGraph.hasTask(tasks.publish)
}
}
tasks.withType(Jar).configureEach {
enabled = true
includeEmptyDirs = false
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.deprecation = true
options.compilerArgs.add('--release')
options.compilerArgs.add(java.sourceCompatibility.majorVersion)
options.compilerArgs.addAll(['-Xlint:all,-processing', '-Werror']) // Enable all warnings and treat them as errors
options.compilerArgs.add("-Aio.aeron.version=${aeronVersion}")
options.compilerArgs.add("-Aio.aeron.gitsha=${gitCommitHash}")
}
tasks.withType(Test).configureEach { test ->
jvmArgs('--add-opens', 'java.base/java.util.zip=ALL-UNNAMED')
if (buildJavaVersion >= 21) {
jvmArgs('-XX:+EnableDynamicAgentLoading')
}
testClassesDirs = testing.suites.test.sources.output.classesDirs
classpath = testing.suites.test.sources.runtimeClasspath
maxHeapSize("1g")
jvmArgs("-XX:MaxDirectMemorySize=1g",
"-XX:+HeapDumpOnOutOfMemoryError",
"-XX:+CrashOnOutOfMemoryError",
"-XX:HeapDumpPath=" + project.rootDir + "/heap.hprof")
useJUnitPlatform {
if (test.name != 'slowTest' && test.name != 'bindingsTest' && test.name != 'topologyTest')
{
excludeTags 'any()'
}
}
testLogging {
for (def level : LogLevel.values())
{
def testLogging = get(level)
testLogging.exceptionFormat = 'full'
testLogging.events = ["FAILED", "STANDARD_OUT", "STANDARD_ERROR"]
}
}
systemProperties(
'java.util.logging.config.class': 'io.aeron.test.DisableJavaUtilLogging',
'aeron.shared.idle.strategy': 'yield',
'aeron.conductor.idle.strategy': 'yield',
'aeron.sender.idle.strategy': 'yield',
'aeron.receiver.idle.strategy': 'yield',
'aeron.use.windows.high.res.timer': 'true',
'aeron.timer.interval': '100ms',
'aeron.dir.delete.on.start': 'true',
'aeron.term.buffer.sparse.file': 'true',
'aeron.perform.storage.checks': 'false',
'agrona.strict.alignment.checks': 'true',
'net.bytebuddy.experimental': 'true',
'io.aeron.shadow.net.bytebuddy.experimental': 'true',
'java.net.preferIPv4Stack': 'true',
'aeron.test.system.aeronmd.path': System.getProperty('aeron.test.system.aeronmd.path'),
'aeron.test.system.binding.remote.host': System.getProperty('aeron.test.system.binding.remote.host'),
'aeron.test.system.binding.local.host': System.getProperty('aeron.test.system.binding.local.host'),
'aeron.test.system.aeron.dir': System.getProperty('aeron.test.system.aeron.dir'),
'aeron.test.system.ats.path': System.getProperty('aeron.test.system.ats.path'),
'aeron.test.system.ats.conf.dir': System.getProperty('aeron.test.system.ats.conf.dir'),
'aeron.test.system.ats.conf.file': System.getProperty('aeron.test.system.ats.conf.file'),
'aeron.test.system.driver.await.counters': System.getProperty('aeron.test.system.driver.await.counters'))
javaLauncher.set(toolchainLauncher)
}
tasks.register('slowTest', Test) {
group 'verification'
dependsOn ':aeron-agent:jar'
maxParallelForks = 1
useJUnitPlatform {
includeTags 'slow'
}
ext.agentFilename = {
project.file("../aeron-agent/build/libs/aeron-agent-${aeronVersion}.jar").absolutePath
}
jvmArgs '-javaagent:' + agentFilename()
systemProperty 'aeron.event.cluster.log', 'all'
systemProperty 'aeron.event.cluster.log.disable', 'CANVASS_POSITION,APPEND_POSITION,COMMIT_POSITION'
systemProperty 'aeron.event.archive.log', 'all'
systemProperty 'aeron.event.log', 'admin'
systemProperty 'aeron.debug.timeout', '3600s'
systemProperty 'aeron.event.log.reader.classname', 'io.aeron.agent.CollectingEventLogReaderAgent'
systemProperty 'aeron.fallback.logger', 'no_op'
}
tasks.register('bindingsTest', Test) {
group 'verification'
dependsOn ':aeron-agent:jar'
maxParallelForks = 1
useJUnitPlatform {
includeTags 'bindings'
}
ext.agentFilename = {
project.file("../aeron-agent/build/libs/aeron-agent-${aeronVersion}.jar").absolutePath
}
jvmArgs '-javaagent:' + agentFilename()
systemProperty 'aeron.event.cluster.log', 'all'
systemProperty 'aeron.event.cluster.log.disable', 'CANVASS_POSITION'
systemProperty 'aeron.debug.timeout', '3600s'
systemProperty 'aeron.event.log.reader.classname', 'io.aeron.agent.CollectingEventLogReaderAgent'
}
tasks.register('topologyTest', Test) {
group 'verification'
maxParallelForks = 1
useJUnitPlatform {
includeTags 'topology'
}
}
javadoc {
failOnError false
title = '<h1>Aeron Message Transport</h1>'
options.bottom = '<i>Copyright © 2014-2024 Real Logic Limited. All Rights Reserved.</i>'
options.encoding = 'UTF-8'
options.docEncoding = 'UTF-8'
options.charSet = 'UTF-8'
options.links("https://www.javadoc.io/doc/org.agrona/agrona/${libs.versions.agrona.get()}/")
if (buildJavaVersion >= 23) { // early access JavaDoc location is different
options.links("https://download.java.net/java/early_access/jdk${buildJavaVersion}/docs/api/")
}
else {
options.links("https://docs.oracle.com/en/java/javase/${buildJavaVersion}/docs/api/")
}
exclude 'io/aeron/archive/codecs/**'
exclude 'io/aeron/cluster/codecs/**'
exclude 'io/aeron/samples/**'
exclude 'io/aeron/test/**'
options.addStringOption('-release', java.sourceCompatibility.majorVersion)
options.addBooleanOption('Werror', true)
options.addBooleanOption('Xdoclint:all', true)
}
tasks.register('testJar', Jar) {
dependsOn 'testClasses'
archiveClassifier.set("test-${base.archivesName}")
from sourceSets.test.output
}
configurations {
tests
}
artifacts {
tests testJar
}
}
project(':aeron-annotations') {
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'biz.aQute.bnd.builder'
jar {
bundle {
bnd """
Automatic-Module-Name: io.aeron.annotations
Bundle-Name: io.aeron.annotations
Bundle-SymbolicName: io.aeron.annotations
Implementation-Title: Aeron
Implementation-Vendor: Real Logic Limited
Implementation-Version: ${aeronVersion}
-exportcontents: io.aeron.version
# Suppress headers that reduce reproducibility.
-reproducible: true
-noextraheaders: true
"""
}
}
java {
withSourcesJar()
withJavadocJar()
}
publishing {
publications {
aeronAnnotations(MavenPublication) {
from components.java
pom(projectPom)
}
}
repositories {
maven {
url(!isReleaseVersion ? snapshotsRepoUrl : releasesRepoUrl)
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
signing {
if (signingKey != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
}
sign publishing.publications.aeronAnnotations
}
}
project(':aeron-client') {
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'biz.aQute.bnd.builder'
dependencies {
api libs.agrona
implementation project(':aeron-annotations')
annotationProcessor project(':aeron-annotations')
testImplementation project(':aeron-test-support')
}
jar {
bundle {
bnd """
Automatic-Module-Name: io.aeron.client
Bundle-Name: io.aeron.client
Bundle-SymbolicName: io.aeron.client
Implementation-Title: Aeron
Implementation-Vendor: Real Logic Limited
Implementation-Version: ${aeronVersion}
-exportcontents: io.aeron, io.aeron.*
# Suppress headers that reduce reproducibility.
-reproducible: true
-noextraheaders: true
"""
}
}
java {
withSourcesJar()
withJavadocJar()
}
javadoc {
source += project(':aeron-annotations').sourceSets.main.allJava
}
publishing {
publications {
aeronClient(MavenPublication) {
from components.java
pom(projectPom)
}
}
repositories {
maven {
url(!isReleaseVersion ? snapshotsRepoUrl : releasesRepoUrl)
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
signing {
if (signingKey != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
}
sign publishing.publications.aeronClient
}
def configInfoFile = "${layout.buildDirectory.get()}/generated/sources/headers/java/main/config-info.dat"
tasks.register('validateConfigExpectations', JavaExec) {
def sourceDir = 'src/main/c'
inputs.files(configInfoFile)
mainClass.set('io.aeron.config.validation.ValidateConfigExpectationsTask')
classpath project(':aeron-annotations').sourceSets.main.runtimeClasspath
args = [configInfoFile, sourceDir]
}
tasks.register('generateConfigDoc', JavaExec) {
def generatedDocFile = "${layout.buildDirectory.get()}/generated-doc/out.md"
inputs.files(configInfoFile)
outputs.files(generatedDocFile)
mainClass.set('io.aeron.config.docgen.GenerateConfigDocTask')
classpath project(':aeron-annotations').sourceSets.main.runtimeClasspath
args = [configInfoFile, generatedDocFile]
}
tasks.register('validateCounterExpectations', JavaExec) {
def counterInfoFile = "${layout.buildDirectory.get()}/generated/sources/headers/java/main/counter-info.dat"
def sourceDir = 'src/main/c'
inputs.files(counterInfoFile)
mainClass.set('io.aeron.counter.validation.ValidateCounterExpectationsTask')
classpath project(':aeron-annotations').sourceSets.main.runtimeClasspath
args = [counterInfoFile, sourceDir]
}
}
project(':aeron-driver') {
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'application'
apply plugin: 'biz.aQute.bnd.builder'
application {
mainClass.set('io.aeron.driver.MediaDriver')
}
dependencies {
api project(':aeron-client')
implementation project(':aeron-annotations')
annotationProcessor project(':aeron-annotations')
testImplementation project(':aeron-test-support')
}
jar {
bundle {
bnd """
Automatic-Module-Name: io.aeron.driver
Bundle-Name: io.aeron.driver
Bundle-SymbolicName: io.aeron.driver
Implementation-Title: Aeron
Implementation-Vendor: Real Logic Limited
Implementation-Version: ${aeronVersion}
-exportcontents: io.aeron.driver, io.aeron.driver.*
# Suppress headers that reduce reproducibility.
-reproducible: true
-noextraheaders: true
"""
}
}
jar.finalizedBy assembleDist
java {
withSourcesJar()
withJavadocJar()
}
javadoc {
source += project(':aeron-annotations').sourceSets.main.allJava
source += project(':aeron-client').sourceSets.main.allJava
}
publishing {
publications {
aeronDriver(MavenPublication) {
from components.java
artifact distZip
artifact distTar
pom(projectPom)
}
}
repositories {
maven {
url(!isReleaseVersion ? snapshotsRepoUrl : releasesRepoUrl)
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
signing {
if (signingKey != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
}
sign publishing.publications.aeronDriver
}
tasks.register('validateConfigExpectations', JavaExec) {
def configInfoFile = "${layout.buildDirectory.get()}/generated/sources/headers/java/main/config-info.dat"
def sourceDir = 'src/main/c'
inputs.files(configInfoFile)
mainClass.set('io.aeron.config.validation.ValidateConfigExpectationsTask')
classpath project(':aeron-annotations').sourceSets.main.runtimeClasspath
args = [configInfoFile, sourceDir]
}
tasks.register('generateConfigDoc', JavaExec) {
def configInfoFile = "${layout.buildDirectory.get()}/generated/sources/headers/java/main/config-info.dat"
def generatedDocFile = "${layout.buildDirectory.get()}/generated-doc/out.md"
inputs.files(configInfoFile)
outputs.files(generatedDocFile)
mainClass.set('io.aeron.config.docgen.GenerateConfigDocTask')
classpath project(':aeron-annotations').sourceSets.main.runtimeClasspath
args = [configInfoFile, generatedDocFile]
}
}
project(':aeron-archive') {
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'biz.aQute.bnd.builder'
configurations{
codecGeneration
}
dependencies {
api project(':aeron-driver')
api files('build/classes/java/generated')
codecGeneration libs.sbe
implementation project(':aeron-annotations')
annotationProcessor project(':aeron-annotations')
testImplementation project(':aeron-test-support')
testImplementation files('build/classes/java/generatedTest')
}
def generatedSrcDir = file("${layout.buildDirectory.get()}/generated-src")
def generatedTestDir = file("${layout.buildDirectory.get()}/generated-test")
sourceSets {
generated {
java.srcDir generatedSrcDir
compileClasspath += configurations.codecGeneration
}
generatedTest {
java.srcDir generatedTestDir
compileClasspath += configurations.codecGeneration
}
}
tasks.register('generateCodecs', JavaExec) {
def codecsFile = 'src/main/resources/archive/aeron-archive-codecs.xml'
def markCodecsFile = 'src/main/resources/archive/aeron-archive-mark-codecs.xml'
def sbeFile = 'src/main/resources/archive/fpl/sbe.xsd'
inputs.files(codecsFile, markCodecsFile, sbeFile)
outputs.dir generatedSrcDir
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = configurations.codecGeneration
systemProperties(
'sbe.output.dir': generatedSrcDir,
'sbe.target.language': 'Java',
'sbe.validation.xsd': sbeFile,
'sbe.validation.stop.on.error': 'true')
args = [codecsFile, markCodecsFile]
}
tasks.register('generateV6Codecs', JavaExec) {
def codecsFile = 'src/main/resources/archive/aeron-archive-codecs.xml'
def sbeFile = 'src/main/resources/archive/fpl/sbe.xsd'
inputs.files(codecsFile, sbeFile)
outputs.dir generatedTestDir
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = configurations.codecGeneration
systemProperties(
'sbe.output.dir': generatedTestDir,
'sbe.target.language': 'Java',
'sbe.validation.xsd': sbeFile,
'sbe.validation.stop.on.error': 'true',
'sbe.target.namespace': 'io.aeron.archive.codecs.v6',
'sbe.schema.transform.version': '*:6')
args = [codecsFile]
}
def generatedCppDir = file(System.getProperty('codec.target.dir') ?: "${rootDir}/cppbuild/Release/generated")
tasks.register('generateCppCodecs', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = configurations.codecGeneration
systemProperties(
'sbe.output.dir': generatedCppDir,
'sbe.target.language': 'Cpp',
'sbe.target.namespace': 'aeron.archive.client',
'sbe.validation.xsd': 'src/main/resources/archive/fpl/sbe.xsd',
'sbe.validation.stop.on.error': 'true')
args = ['src/main/resources/archive/aeron-archive-codecs.xml']
}
def generatedCDir = file(System.getProperty('codec.target.dir') ?: "${rootDir}/cppbuild/Release/generated/c")
tasks.register('generateCCodecs', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = configurations.codecGeneration
systemProperties(
'sbe.output.dir': generatedCDir,
'sbe.target.language': 'C',
'sbe.target.namespace': 'aeron.archive.client',
'sbe.validation.xsd': 'src/main/resources/archive/fpl/sbe.xsd',
'sbe.validation.stop.on.error': 'true')
args = ['src/main/resources/archive/aeron-archive-codecs.xml']
}
compileJava.dependsOn 'compileGeneratedJava'
compileGeneratedJava.dependsOn 'generateCodecs'
compileTestJava.dependsOn 'compileGeneratedTestJava'
compileGeneratedTestJava.dependsOn 'generateV6Codecs'
jar {
from sourceSets.generated.output
bundle {
bnd """
Automatic-Module-Name: io.aeron.archive
Bundle-Name: io.aeron.archive
Bundle-SymbolicName: io.aeron.archive
Implementation-Title: Aeron
Implementation-Vendor: Real Logic Limited
Implementation-Version: ${aeronVersion}
-exportcontents: io.aeron.archive, io.aeron.archive.*
# Suppress headers that reduce reproducibility.
-reproducible: true
-noextraheaders: true
"""
}
}
tasks.register('sourcesJar', Jar) {
dependsOn 'generateCodecs'
archiveClassifier.set('sources')
from sourceSets.main.allSource
from sourceSets.generated.allSource
}
javadoc {
source += sourceSets.generated.allJava
source += project(':aeron-annotations').sourceSets.main.allJava
source += project(':aeron-client').sourceSets.main.allJava
source += project(':aeron-driver').sourceSets.main.allJava
}
javadoc.dependsOn generateCodecs
java {
withSourcesJar()
withJavadocJar()
}
publishing {
publications {
aeronArchive(MavenPublication) {
from components.java
pom(projectPom)
}
}
repositories {
maven {
url(!isReleaseVersion ? snapshotsRepoUrl : releasesRepoUrl)
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
signing {
if (signingKey != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
}
sign publishing.publications.aeronArchive
}
tasks.register('generateConfigDoc', JavaExec) {
def configInfoFile = "${layout.buildDirectory.get()}/generated/sources/headers/java/main/config-info.dat"
def generatedDocFile = "${layout.buildDirectory.get()}/generated-doc/out.md"
inputs.files(configInfoFile)
outputs.files(generatedDocFile)
mainClass.set('io.aeron.config.docgen.GenerateConfigDocTask')
classpath project(':aeron-annotations').sourceSets.main.runtimeClasspath
args = [configInfoFile, generatedDocFile]
}
}
project(':aeron-cluster') {
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'biz.aQute.bnd.builder'
configurations{
codecGeneration
}
dependencies {
api project(':aeron-archive')
api files('build/classes/java/generated')
codecGeneration libs.sbe
implementation project(':aeron-annotations')
annotationProcessor project(':aeron-annotations')
testImplementation project(':aeron-test-support')
}
def generatedDir = file("${layout.buildDirectory.get()}/generated-src")
sourceSets {
generated {
java.srcDir generatedDir
compileClasspath += configurations.codecGeneration
}
}
tasks.register('generateCodecs', JavaExec) {
def codecsFile = 'src/main/resources/cluster/aeron-cluster-codecs.xml'
def markCodecsFile = 'src/main/resources/cluster/aeron-cluster-mark-codecs.xml'
def nodeStateCodecsFile = 'src/main/resources/cluster/aeron-cluster-node-state-codecs.xml'
def sbeFile = 'src/main/resources/cluster/fpl/sbe.xsd'
inputs.files(codecsFile, markCodecsFile, sbeFile)
outputs.dir generatedDir
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = configurations.codecGeneration
systemProperties(
'sbe.output.dir': generatedDir,
'sbe.target.language': 'Java',
'sbe.validation.xsd': sbeFile,
'sbe.validation.stop.on.error': 'true')
args = [codecsFile, markCodecsFile, nodeStateCodecsFile]
}
compileJava.dependsOn compileGeneratedJava
compileGeneratedJava.dependsOn generateCodecs
jar {
from sourceSets.generated.output
bundle {
bnd """
Automatic-Module-Name: io.aeron.cluster
Bundle-Name: io.aeron.cluster
Bundle-SymbolicName: io.aeron.cluster
Implementation-Title: Aeron
Implementation-Vendor: Real Logic Limited
Implementation-Version: ${aeronVersion}
-exportcontents: io.aeron.cluster, io.aeron.cluster.*
# Suppress headers that reduce reproducibility.
-reproducible: true
-noextraheaders: true
"""
}
}
tasks.register('sourcesJar', Jar) {
dependsOn 'generateCodecs'
archiveClassifier.set('sources')
from sourceSets.main.allSource
from sourceSets.generated.allSource
}
javadoc {
source += sourceSets.generated.allJava
source += project(':aeron-annotations').sourceSets.main.allJava
source += project(':aeron-client').sourceSets.main.allJava
source += project(':aeron-driver').sourceSets.main.allJava
source += project(':aeron-archive').sourceSets.main.allJava
source += project(':aeron-archive').sourceSets.generated.allJava
}
javadoc.dependsOn generateCodecs
java {
withSourcesJar()
withJavadocJar()
}
publishing {
publications {
aeronCluster(MavenPublication) {
from components.java
pom(projectPom)
}
}
repositories {
maven {
url(!isReleaseVersion ? snapshotsRepoUrl : releasesRepoUrl)
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
signing {
if (signingKey != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
}
sign publishing.publications.aeronCluster
}
tasks.register('generateConfigDoc', JavaExec) {
def configInfoFile = "${layout.buildDirectory.get()}/generated/sources/headers/java/main/config-info.dat"
def generatedDocFile = "${layout.buildDirectory.get()}/generated-doc/out.md"
inputs.files(configInfoFile)
outputs.files(generatedDocFile)
mainClass.set('io.aeron.config.docgen.GenerateConfigDocTask')
classpath project(':aeron-annotations').sourceSets.main.runtimeClasspath
args = [configInfoFile, generatedDocFile]
}
}
project(':aeron-agent') {
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'com.gradleup.shadow'
def aeronClientProject = project(':aeron-client')
def aeronDriverProject = project(':aeron-driver')
def aeronArchiveProject = project(':aeron-archive')
def aeronClusterProject = project(':aeron-cluster')
dependencies {
implementation aeronClusterProject
implementation libs.byteBuddy
implementation libs.byteBuddy.agent
compileOnly libs.findbugs
testCompileOnly libs.findbugs
testImplementation project(':aeron-test-support')
}
shadowJar {
archiveClassifier.set('')
manifest.attributes(
'Implementation-Title': 'Aeron',
'Implementation-Version': aeronVersion,
'Implementation-Vendor': 'Real Logic Limited',
"Premain-Class": "io.aeron.agent.EventLogAgent",
"Agent-Class": "io.aeron.agent.EventLogAgent",
"Can-Redefine-Classes": "true",
"Can-Retransform-Classes": "true",
'Automatic-Module-Name': 'io.aeron.agent'
)
relocate 'net.bytebuddy', 'io.aeron.shadow.net.bytebuddy'
}
jar.finalizedBy shadowJar
tasks.register('dedupJar', io.aeron.build.DeduplicateTask) {
source shadowJar.outputs.files.singleFile
}
shadowJar.finalizedBy dedupJar
tasks.register('sourcesJar', Jar) {
dependsOn ':aeron-archive:generateCodecs', ':aeron-cluster:generateCodecs'
archiveClassifier.set('sources')
from files(
aeronClientProject.sourceSets.main.allSource,
aeronDriverProject.sourceSets.main.allSource,
aeronArchiveProject.sourceSets.main.allSource,
aeronArchiveProject.sourceSets.generated.allSource,
aeronClusterProject.sourceSets.main.allSource,
aeronClusterProject.sourceSets.generated.allSource)
}
javadoc {
source += project(':aeron-annotations').sourceSets.main.allJava
source += aeronClientProject.sourceSets.main.allJava
source += aeronDriverProject.sourceSets.main.allJava
source += aeronArchiveProject.sourceSets.main.allJava
source += aeronArchiveProject.sourceSets.generated.allJava
source += aeronClusterProject.sourceSets.main.allJava
source += aeronClusterProject.sourceSets.generated.allJava
}
javadoc.dependsOn ':aeron-archive:generateCodecs', ':aeron-cluster:generateCodecs'
tasks.register('javadocJar', Jar) {
dependsOn 'javadoc'
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
publishing {
publications {
aeronAgent(MavenPublication) {
artifact shadowJar
artifact sourcesJar
artifact javadocJar
pom(projectPom)
}
}
repositories {
maven {
url(!isReleaseVersion ? snapshotsRepoUrl : releasesRepoUrl)
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
signing {
if (signingKey != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
}
sign publishing.publications.aeronAgent
}
}
project(':aeron-samples') {
apply plugin: 'maven-publish'
apply plugin: 'signing'
dependencies {
api project(':aeron-cluster')
implementation libs.hdrHistogram
testImplementation project(':aeron-test-support')
}
java {
withSourcesJar()
withJavadocJar()
}
publishing {
publications {
aeronSamples(MavenPublication) {
from components.java
pom(projectPom)
}
}
repositories {
maven {
url(!isReleaseVersion ? snapshotsRepoUrl : releasesRepoUrl)
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
javadoc {
source += project(':aeron-annotations').sourceSets.main.allJava
source += project(':aeron-client').sourceSets.main.allJava
source += project(':aeron-driver').sourceSets.main.allJava
source += project(':aeron-archive').sourceSets.main.allJava
source += project(':aeron-archive').sourceSets.generated.allJava
}
signing {
if (signingKey != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
}
sign publishing.publications.aeronSamples
}
tasks.named('test').configure {
dependsOn ':aeron-agent:jar'
ext.agentFilename = {
project.file("../aeron-agent/build/libs/aeron-agent-${aeronVersion}.jar").absolutePath
}
jvmArgs '-javaagent:' + agentFilename()
systemProperty 'aeron.event.cluster.log', 'all'
systemProperty 'aeron.event.cluster.log.disable', 'CANVASS_POSITION,APPEND_POSITION,COMMIT_POSITION'
systemProperty 'aeron.event.archive.log', 'all'
systemProperty 'aeron.event.log', 'admin'
systemProperty 'aeron.debug.timeout', '3600s'
systemProperty 'aeron.event.log.reader.classname', 'io.aeron.agent.CollectingEventLogReaderAgent'
systemProperty 'aeron.fallback.logger', 'no_op'
}
tasks.register('asciidoctorGithub', io.aeron.build.AsciidoctorPreprocessTask) {
versionText = aeronVersion
}
tasks.register('removeWikiDirectory', Delete) {
delete "${layout.buildDirectory.get()}/tmp/tutorialPublish"
}
tasks.register('tutorialPublish', io.aeron.build.TutorialPublishTask) {
dependsOn 'removeWikiDirectory', 'asciidoctorGithub'
apiKey = project.hasProperty('aeron.ci.apiKey') ? project.property('aeron.ci.apiKey') : ''
source = asciidoctorGithub.target
remoteName = project.hasProperty('aeron.ci.remoteName') ? project.property('aeron.ci.remoteName') : 'origin'
}
}
project(':aeron-system-tests') {
apply plugin: 'com.gradleup.shadow'
dependencies {
testImplementation project(':aeron-archive')
testImplementation project(':aeron-test-support')
testImplementation project(':aeron-samples')
testImplementation project(path: ':aeron-client', configuration: 'tests')
testImplementation project(path: ':aeron-archive', configuration: 'tests')
testImplementation project(path: ':aeron-cluster')
testImplementation libs.byteBuddy
testImplementation libs.byteBuddy.agent
testCompileOnly libs.findbugs
}
tasks.named('test').configure {
dependsOn ':aeron-agent:jar'
ext.agentFilename = {
project.file("../aeron-agent/build/libs/aeron-agent-${aeronVersion}.jar").absolutePath
}
jvmArgs '-javaagent:' + agentFilename()
systemProperty 'aeron.event.cluster.log', 'all'
systemProperty 'aeron.event.cluster.log.disable', 'CANVASS_POSITION,APPEND_POSITION,COMMIT_POSITION'
systemProperty 'aeron.event.archive.log', 'all'
systemProperty 'aeron.event.log', 'admin'
systemProperty 'aeron.debug.timeout', '3600s'
systemProperty 'aeron.event.log.reader.classname', 'io.aeron.agent.CollectingEventLogReaderAgent'
systemProperty 'aeron.fallback.logger', 'no_op'
}
shadowJar {
archiveClassifier.set('tests')
from sourceSets.test.output
configurations = [project.configurations.testRuntimeClasspath]
}
javadoc.enabled = false
}
project(':aeron-test-support') {
apply plugin: 'maven-publish'
apply plugin: 'signing'
dependencies {
implementation project(':aeron-client')
implementation project(':aeron-cluster')
implementation project(':aeron-samples')
implementation platform("org.junit:junit-bom:${libs.versions.junit.get()}")
implementation "org.junit.jupiter:junit-jupiter-api"
implementation "org.junit.jupiter:junit-jupiter-params"
implementation libs.mockito
}
java {
withSourcesJar()
withJavadocJar()
}
publishing {
publications {
aeronTestSupport(MavenPublication) {
from components.java
pom(projectPom)
}
}
repositories {
maven {
url(!isReleaseVersion ? snapshotsRepoUrl : releasesRepoUrl)
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
signing {
if (signingKey != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
}
sign publishing.publications.aeronTestSupport
}
}
project(':aeron-all') {
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'com.gradleup.shadow'
def aeronClientProject = project(':aeron-client')
def aeronDriverProject = project(':aeron-driver')
def aeronArchiveProject = project(':aeron-archive')
def aeronClusterProject = project(':aeron-cluster')
def aeronSamplesProject = project(':aeron-samples')
dependencies {
implementation aeronClusterProject
implementation aeronSamplesProject
}
shadowJar {
archiveClassifier.set('')
manifest.attributes(
'Implementation-Title': 'Aeron',
'Implementation-Version': aeronVersion,
'Implementation-Vendor': 'Real Logic Limited',
'Automatic-Module-Name': 'io.aeron.all')
relocate 'net.bytebuddy', 'io.aeron.shadow.net.bytebuddy'
relocate 'org.HdrHistogram', 'io.aeron.shadow.org.HdrHistogram'
}
jar.finalizedBy shadowJar
tasks.register('dedupJar', io.aeron.build.DeduplicateTask) {
source shadowJar.outputs.files.singleFile
}
shadowJar.finalizedBy dedupJar
tasks.register('sourcesJar', Jar) {
dependsOn ':aeron-archive:generateCodecs', ':aeron-cluster:generateCodecs'
archiveClassifier.set('sources')
from files(
aeronClientProject.sourceSets.main.allSource,
aeronDriverProject.sourceSets.main.allSource,
aeronArchiveProject.sourceSets.main.allSource,
aeronArchiveProject.sourceSets.generated.allSource,
aeronClusterProject.sourceSets.main.allSource,
aeronClusterProject.sourceSets.generated.allSource,
aeronSamplesProject.sourceSets.main.allSource)
}
javadoc {
source += project(':aeron-annotations').sourceSets.main.allJava
source += aeronClientProject.sourceSets.main.allJava
source += aeronDriverProject.sourceSets.main.allJava
source += aeronArchiveProject.sourceSets.main.allJava
source += aeronArchiveProject.sourceSets.generated.allJava
source += aeronClusterProject.sourceSets.main.allJava
source += aeronClusterProject.sourceSets.generated.allJava
source += aeronSamplesProject.sourceSets.main.allJava
}
javadoc.dependsOn ':aeron-archive:generateCodecs', ':aeron-cluster:generateCodecs'
tasks.register('javadocJar', Jar) {
dependsOn 'javadoc'
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
publishing {
publications {
aeronAll(MavenPublication) {
artifact shadowJar
artifact sourcesJar
artifact javadocJar
pom(projectPom)
}
}
repositories {
maven {
url(!isReleaseVersion ? snapshotsRepoUrl : releasesRepoUrl)
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
signing {
if (signingKey != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
}
sign publishing.publications.aeronAll
}
}
tasks.register('testReport', TestReport) {
destinationDirectory = file("${layout.buildDirectory.get()}/reports/allTests")
// Include the results from the `test` task in all sub-projects
testResults.setFrom(subprojects*.test)
}
tasks.register('copyTestLogs', Copy) {
from '.'
include '**/build/test-output/**'
include '**/*.hprof'
include '**/*.log'
include '**/*.tlog'
include '**/build/reports/tests/**'
include '**/build/test-results/**/*'
include 'LICENSE'
exclude 'build'
into 'build/test_logs'
includeEmptyDirs = false
}
tasks.register('tarTestLogs', Tar) {
dependsOn tasks.named('copyTestLogs')
archiveBaseName.set('test_logs')
from 'build/test_logs'
compression Compression.BZIP2
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
tasks.named('dependencyUpdates').configure {
// Reject all non stable versions
rejectVersionIf {
isNonStable(it.candidate.version)
}
}
wrapper {
gradleVersion = libs.versions.gradle.get()
distributionType = 'ALL'
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。