-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
197 lines (167 loc) · 4.8 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
import java.text.SimpleDateFormat
plugins {
id 'groovy'
id 'java-library'
id "io.morethan.jmhreport" version "0.9.0"
id "idea"
id 'maven-publish'
id 'signing'
}
apply from: 'benchcruncher.gradle'
apply from: 'jmh.gradle'
group 'net.jnellis'
version '2.0.0'
repositories {
mavenCentral()
}
compileJava {
options.compilerArgs = ["-Xlint:unchecked",
"-Xlint:preview",
"-Xdiags:verbose",
"-Xlint:deprecation",
'--enable-preview'
]
options.release = 19
}
idea {
module {
downloadJavadoc = true
}
}
test {
useJUnitPlatform()
// set heap size for the test JVM(s)
minHeapSize = "4G"
maxHeapSize = "8G"
// set JVM arguments for the test JVM(s)
jvmArgs '-XX:MaxMetaspaceSize=512M','--enable-preview'
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.9.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0'
testImplementation platform("org.spockframework:spock-bom:2.3-groovy-3.0")
testImplementation "org.spockframework:spock-core"
}
javadoc.options{
addStringOption("Xwerror", "-Xdoclint:all")
addBooleanOption('-enable-preview', true)
addStringOption('-release', '19')
}
check.dependsOn javadoc
java{
withSourcesJar()
withJavadocJar()
}
publishing{
repositories{
maven{
name = "OSSRH"
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials{
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
// username = MAVEN_USERNAME
// password = MAVEN_PASSWORD
}
}
maven{
name = "GitHubPackages"
url = "https://maven.pkg.github.com/jnellis/interleave"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
publications{
mavenJava(MavenPublication){
from components.java
pom {
name = "interleave"
packaging = "jar"
description = "Interleave (faro shuffle) one collection with itself or two collections with each other."
url = "https://github.com/jnellis/interleave"
scm {
url = "https://github.com/jnellis/interleave.git"
}
licenses{
license{
name = "Creative Commons Zero v1.0 Universal"
url = "https://creativecommons.org/publicdomain/zero/1.0/"
}
}
developers{
developer{
id = 'jnellis'
name = 'Joseph Nellis'
email = '[email protected]'
}
}
}
}
}
}
}
signing{
sign publishing.publications.mavenJava
}
// jmhReport setting
def reportFile = file("$projectDir/docs/jmh/report.json")
jmh {
include = ["OneArray"]
iterations = 5
warmupIterations = 5
jmhVersion = '1.36'
benchmarkMode = ['thrpt']
resultFormat = 'JSON'
resultsFile = reportFile
// profilers=['jfr']
fork = 10
timeUnit = 's'
timeOnIteration = '5s'
warmup = '5s'
includeTests = false
jvmArgs = ["--enable-preview",
'-XX:MaxMetaspaceSize=512M -Xms8G -Xmx8G',
"-server",
// "-XX:+UnlockDiagnosticVMOptions",
// "-XX:+PrintCompilation",
// "-XX:PrintAssemblyOptions=intel",
// "-XX:CompileCommand=print,*ShufflePrimeInterleaver.cycleLeader*",
// "-XX:+UseLargePages",
"-Xlog:gc+init",
]
benchmarkParameters = [
'max': [ 10_000_000 ],
// 'arrayType': ["ints"],
'colType': ["Unique"],
'interleaverName':["josephus"]
]
// verbosity = 'EXTRA'
// help = true // uncomment for jmh CLI help screen, then exit
// list = true // uncomment to list benchmarks that match filter, and exit
// listp = true // uncomment to list benchmarks that match filter along with
// their parameter list, then exit
// lprof = true // uncomment to list available profilers, then exit
// lrf = true // uncomment to list available result formats, then exit
}
jmhReport {
def dateStr = new SimpleDateFormat("yy_MM_dd/HH_mm").format(new Date())
jmhResultPath = reportFile
jmhReportOutput = file("$projectDir/docs/jmh/$dateStr")
}
tasks.jmhReport.doFirst { mkdir(jmhReport.jmhReportOutput) }
tasks.register('clearJmhTmpDir',Delete) {
def files = file("$buildDir/tmp/jmh")?.listFiles()
if(files != null && files.length != 0) {
delete files
}
}
tasks.register('moveProfileResultsToJmhReportFolder', Copy) {
from "$buildDir/tmp/jmh"
include "**/profile.jfr"
into jmhReport.jmhReportOutput
}
tasks.jmh.dependsOn clearJmhTmpDir
tasks.jmh.finalizedBy tasks.jmhReport
tasks.jmhReport.finalizedBy moveProfileResultsToJmhReportFolder