forked from AdoptOpenJDK/jitwatch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
196 lines (162 loc) · 4.68 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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'commons-io:commons-io:2.5'
}
}
import static org.apache.commons.io.output.NullOutputStream.NULL_OUTPUT_STREAM
plugins {
id 'java' // self explanatory
id 'idea' // idem
id 'eclipse' // eclipse
id 'findbugs' // findbugs plugin for static code analysis
id 'pmd' // code quality check plugin
id 'jacoco' // code coverage
id 'project-report' // project reporting plugin
id 'com.github.hierynomus.license' version '0.11.0' // license checks
id 'com.github.ben-manes.versions' version '0.15.0' // version checks
id 'com.jfrog.bintray' version '1.7.3'
id 'maven-publish'
}
// maven coordinates
group = 'org.adoptopenjdk.jitwatch'
def props = new Properties()
file("build.properties").withInputStream { props.load(it) }
version = props.getProperty("version");
allprojects {
repositories {
jcenter() // faster than mavenCentral()
}
}
//Code quality plugins configuration
findbugsMain {
reports {
xml.enabled = false
html.enabled = true
}
}
findbugs {
ignoreFailures = true
sourceSets = [sourceSets.main]
}
pmd {
ignoreFailures = true
sourceSets = [sourceSets.main]
}
jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
html.enabled true
}
}
//Code quality plugins configuration end
// we expect jdk to be any of ['jdk7', 'jdk8', 'jdk9']
// this property can specified at the command line as follows
//
// gradle -Pjdk=jdk8 <command>
//
if (!hasProperty('jdk')) {
ext.jdk = 'jdk7' // lowest
}
allprojects {
configurations {
// gradle does not have a 'system' nor 'provided' scope
system
// fix classpaths due to missing 'system' scope
sourceSets {
main {
compileClasspath += configurations.system
}
}
}
compileJava {
//add required JavaFX libs to compile classpath
sourceSets.main.compileClasspath += configurations.system
}
test {
classpath += configurations.system
}
}
apply from: "gradle/eclipse.gradle"
license {
header = rootProject.file('config/HEADER')
strictCheck = true
ignoreFailures = true
mapping {
java = 'SLASHSTAR_STYLE'
groovy = 'SLASHSTAR_STYLE'
scala = 'SLASHSTAR_STYLE'
}
ext.year = '2013, 2014'
exclude '**/*.png'
exclude '**/*.kt'
}
// do not format test resources
licenseTest {
source -= sourceSets.test.resources
}
javadoc {
classpath += configurations.system
}
idea {
module {
scopes.PROVIDED.plus += configurations.system
}
}
subprojects {
task sourceJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allJava
}
task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
}
}
bintray {
user = rootProject.hasProperty('bintrayUser') ? rootProject.property('bintrayUser') : 'FIXME'
key = rootProject.hasProperty('bintrayApiKey') ? rootProject.property('bintrayApiKey') : 'FIXME'
publications = ['bintray']
pkg {
repo = 'maven'
licenses = ['BSD 2-Clause']
vcsUrl = 'https://github.com/AdoptOpenJDK/jitwatch'
name = "${project.group}:${project.name}"
version {
name = project.version
released = new Date()
vcsTag = 'v' + project.version
}
}
}
task makeDemoLogFile(type: JavaExec) {
dependsOn classes
main = 'org.adoptopenjdk.jitwatch.demo.MakeHotSpotLog'
jvmArgs = [
// --== required switches ==--
// Unlock the HotSpot logging options
"-XX:+UnlockDiagnosticVMOptions",
// Log each time a class is loaded (how JITWatch builds the class model)
"-XX:+TraceClassLoading",
// Enable XML format HotSpot log output
"-XX:+LogCompilation",
// --== optional switches ==--
// Enable disassembly of native code into assembly language (AT&T / GNU format)
// Requires the hsdis (HotSpot disassembler) binary to be added to your JRE
// For hsdis build instructions see http://www.chrisnewland.com/building-hsdis-on-linux-amd64-on-debian-369
"-XX:+PrintAssembly",
// Change disassembly format from AT&T to Intel assembly
"-XX:PrintAssemblyOptions=intel",
// Disable tiered compilation (enabled by default on Java 8, optional on Java 7)
"-XX:-TieredCompilation",
// Enable tiered compilation
"-XX:+TieredCompilation",
// Disable compressed oops (makes assembly easier to read)
"-XX:-UseCompressedOops"
]
classpath = project.configurations.runtime
ignoreExitValue = true
standardOutput = NULL_OUTPUT_STREAM
errorOutput = NULL_OUTPUT_STREAM
}