Skip to content

Commit

Permalink
[Java] Add JVM opts to generator tasks.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyazelenko committed Dec 17, 2024
1 parent 6b37857 commit b848b3a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 9 deletions.
47 changes: 39 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ project(':sbe-tool') {
dependsOn 'compileJava'
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': generatedDir,
'sbe.target.language': 'Java',
Expand All @@ -335,6 +336,7 @@ project(':sbe-tool') {
dependsOn 'compileJava'
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': generatedDir,
'sbe.target.language': 'java',
Expand Down Expand Up @@ -480,7 +482,7 @@ project(':sbe-samples') {
sourceSets {
generated {
java.srcDir generatedDir
compileClasspath += project(':sbe-all').sourceSets.main.runtimeClasspath
compileClasspath += project(':sbe-tool').sourceSets.main.runtimeClasspath
}
}

Expand All @@ -489,7 +491,8 @@ project(':sbe-samples') {

tasks.register('generateCodecs', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-all').sourceSets.main.runtimeClasspath
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': generatedDir,
'sbe.target.language': 'Java',
Expand All @@ -505,20 +508,23 @@ project(':sbe-samples') {
dependsOn 'compileJava'
mainClass.set('uk.co.real_logic.sbe.examples.ExampleUsingGeneratedStub')
classpath = sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties System.getProperties()
}

tasks.register('runExampleUsingGeneratedStubExtension', JavaExec) {
dependsOn 'compileJava'
mainClass.set('uk.co.real_logic.sbe.examples.ExampleUsingGeneratedStubExtension')
classpath = sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties System.getProperties()
}

tasks.register('runOtfExample', JavaExec) {
dependsOn 'compileJava'
mainClass.set('uk.co.real_logic.sbe.examples.OtfExample')
classpath = sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
workingDir = 'src/main/resources'
}

Expand Down Expand Up @@ -596,7 +602,7 @@ project(':sbe-benchmarks') {
sourceSets {
generated {
java.srcDir 'build/generated-src'
compileClasspath += project(':sbe-all').sourceSets.main.runtimeClasspath
compileClasspath += project(':sbe-tool').sourceSets.main.runtimeClasspath
}
}

Expand All @@ -605,7 +611,8 @@ project(':sbe-benchmarks') {

tasks.register('generateCodecs', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-all').sourceSets.main.runtimeClasspath
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'build/generated-src',
'sbe.target.language': 'Java',
Expand All @@ -629,7 +636,8 @@ project(':sbe-benchmarks') {

tasks.register('generateRustExamples', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-all').sourceSets.main.runtimeClasspath
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'generated/rust',
'sbe.xinclude.aware': 'true',
Expand All @@ -644,7 +652,8 @@ tasks.register('generateRustExamples', JavaExec) {

tasks.register('generateRustTestCodecs', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-all').sourceSets.main.runtimeClasspath
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'generated/rust',
'sbe.xinclude.aware': 'true',
Expand All @@ -664,6 +673,7 @@ tasks.register('generateRustTestCodecs', JavaExec) {
tasks.register('generateCarExampleDataFile', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.examples.ExampleUsingGeneratedStub')
classpath = project(':sbe-samples').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties('sbe.encoding.filename': 'rust/car_example_baseline_data.sbe')
args = []
standardOutput = new ByteArrayOutputStream()
Expand All @@ -672,6 +682,7 @@ tasks.register('generateCarExampleDataFile', JavaExec) {
tasks.register('generateCarExampleExtensionDataFile', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.examples.ExampleUsingGeneratedStubExtension')
classpath = project(':sbe-samples').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties('sbe.encoding.filename': 'rust/car_example_extension_data.sbe')
args = []
standardOutput = new ByteArrayOutputStream()
Expand Down Expand Up @@ -702,6 +713,7 @@ tasks.register('runRustTests', Exec) {
tasks.register('generateGolangCodecTestComposite', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'gocode/struct/src',
'sbe.target.language': 'golang')
Expand All @@ -711,6 +723,7 @@ tasks.register('generateGolangCodecTestComposite', JavaExec) {
tasks.register('generateGolangCodecTestBasic', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'gocode/struct/src/basic',
'sbe.target.language': 'golang')
Expand All @@ -720,6 +733,7 @@ tasks.register('generateGolangCodecTestBasic', JavaExec) {
tasks.register('generateGolangCodecTestGroup', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'gocode/struct/src/group',
'sbe.target.language': 'golang')
Expand All @@ -728,6 +742,7 @@ tasks.register('generateGolangCodecTestGroup', JavaExec) {

tasks.register('generateGolangCodecTestVarData', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
systemProperties(
'sbe.output.dir': 'gocode/struct/src/vardata',
Expand All @@ -738,6 +753,7 @@ tasks.register('generateGolangCodecTestVarData', JavaExec) {
tasks.register('generateGolangCodecsWithXIncludes', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'gocode/struct/src',
'sbe.target.language': 'golang',
Expand All @@ -750,6 +766,7 @@ tasks.register('generateGolangCodecsWithXIncludes', JavaExec) {
tasks.register('generateGolangCodecsWithXSD', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'gocode/struct/src',
'sbe.target.language': 'golang',
Expand All @@ -776,6 +793,7 @@ tasks.register('generateGolangCodecsWithXSD', JavaExec) {
tasks.register('generateGolangFlyweightCodecTestComposite', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'gocode/flyweight/src',
'sbe.go.generate.generate.flyweights': 'true',
Expand All @@ -786,6 +804,7 @@ tasks.register('generateGolangFlyweightCodecTestComposite', JavaExec) {
tasks.register('generateGolangFlyweightCodecTestBasic', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'gocode/flyweight/src/basic',
'sbe.go.generate.generate.flyweights': 'true',
Expand All @@ -796,6 +815,7 @@ tasks.register('generateGolangFlyweightCodecTestBasic', JavaExec) {
tasks.register('generateGolangFlyweightCodecTestGroup', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'gocode/flyweight/src/group',
'sbe.go.generate.generate.flyweights': 'true',
Expand All @@ -806,6 +826,7 @@ tasks.register('generateGolangFlyweightCodecTestGroup', JavaExec) {
tasks.register('generateGolangFlyweightCodecTestVarData', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'gocode/flyweight/src/vardata',
'sbe.go.generate.generate.flyweights': 'true',
Expand All @@ -816,6 +837,7 @@ tasks.register('generateGolangFlyweightCodecTestVarData', JavaExec) {
tasks.register('generateGolangFlyweightCodecsWithXIncludes', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'gocode/flyweight/src',
'sbe.go.generate.generate.flyweights': 'true',
Expand All @@ -829,6 +851,7 @@ tasks.register('generateGolangFlyweightCodecsWithXIncludes', JavaExec) {
tasks.register('generateGolangFlyweightCodecsWithXSD', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'gocode/flyweight/src',
'sbe.go.generate.generate.flyweights': 'true',
Expand Down Expand Up @@ -880,6 +903,7 @@ tasks.register('generateGolangCodecs') {
tasks.register('generateCSharpCodecsWithXIncludes', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'csharp/sbe-generated',
'sbe.target.language': 'uk.co.real_logic.sbe.generation.csharp.CSharp',
Expand All @@ -892,6 +916,7 @@ tasks.register('generateCSharpCodecsWithXIncludes', JavaExec) {
tasks.register('generateCSharpTestCodecs', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'csharp/sbe-generated',
'sbe.target.language': 'uk.co.real_logic.sbe.generation.csharp.CSharp',
Expand All @@ -912,6 +937,7 @@ tasks.register('generateCSharpTestCodecs', JavaExec) {
tasks.register('generateCSharpTestDtos', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'csharp/sbe-generated',
'sbe.target.language': 'uk.co.real_logic.sbe.generation.csharp.CSharpDtos',
Expand All @@ -924,6 +950,7 @@ tasks.register('generateCSharpTestDtos', JavaExec) {
tasks.register('generateCSharpExplicitPackageOverrideCodecs', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'csharp/sbe-generated',
'sbe.target.language': 'uk.co.real_logic.sbe.generation.csharp.CSharp',
Expand All @@ -936,6 +963,7 @@ tasks.register('generateCSharpExplicitPackageOverrideCodecs', JavaExec) {
tasks.register('generateCSharpExplicitPackageOverrideDtos', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'csharp/sbe-generated',
'sbe.target.language': 'uk.co.real_logic.sbe.generation.csharp.CSharpDtos',
Expand All @@ -956,7 +984,8 @@ tasks.register('generateCSharpCodecs') {
tasks.register('generateJavaIrCodecs', JavaExec) {
dependsOn 'computeOriginalIrHash'
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-all').sourceSets.main.runtimeClasspath
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'sbe-tool/src/main/java',
'sbe.target.language': 'Java',
Expand All @@ -970,6 +999,7 @@ tasks.register('generateJavaIrCodecs', JavaExec) {
tasks.register('generateCppIrCodecs', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'sbe-tool/src/main/cpp',
'sbe.target.language': 'cpp',
Expand All @@ -982,6 +1012,7 @@ tasks.register('generateCppIrCodecs', JavaExec) {
tasks.register('generateGolangIrCodecs', JavaExec) {
mainClass.set('uk.co.real_logic.sbe.SbeTool')
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
jvmArgs('--add-opens', 'java.base/jdk.internal.misc=ALL-UNNAMED')
systemProperties(
'sbe.output.dir': 'sbe-tool/src/main/golang',
'sbe.target.language': 'golang',
Expand All @@ -999,7 +1030,7 @@ tasks.register('runJavaBenchmarks', Exec) {
dependsOn 'sbe-benchmarks:jar'
commandLine toolchainLauncher.get().executablePath,
'-jar', 'sbe-benchmarks/build/libs/sbe-benchmarks.jar',
'-jvmArgs', '-Dagrona.disable.bounds.checks=true -XX:+UseParallelGC',
'-jvmArgs', '-Dagrona.disable.bounds.checks=true -XX:+UseParallelGC --add-opens java.base/jdk.internal.misc=ALL-UNNAMED',
'-w', '1s', '-r', '1s', '-wi', '3', '-i', '5', '-tu', 'ns', '-f', '5'
}

Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.35.0-SNAPSHOT
1.34.0-SNAPSHOT

0 comments on commit b848b3a

Please sign in to comment.