-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
152 lines (129 loc) · 3.71 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
plugins {
id 'java'
id 'application'
id 'maven-publish'
//see https://github.com/researchgate/gradle-release
id 'net.researchgate.release' version '2.6.0'
id 'org.mikeneck.graalvm-native-image' version 'v0.8.0'
id "com.jfrog.bintray" version "1.8.4"
}
group = 'org.clyze'
sourceCompatibility = 1.8
mainClassName = 'heapdl.main.Main'
wrapper {
gradleVersion = '8.7'
}
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
gradle.rootProject.ext.clueCommonVersion='3.25.4'
dependencies {
testImplementation group: 'junit', name: 'junit', version: '4.11'
implementation "com.offbytwo:docopt:0.6.0.20150202",
"com.github.eaftan:hprof-parser:-SNAPSHOT",
"com.github.plast-lab:clue-common:${clueCommonVersion}"
runtimeOnly "com.google.guava:guava:33.0.0-jre" // needed by hprof-parser
}
compileJava {
options.compilerArgs << '-Xlint:unchecked'
}
task fatjar(type: Jar) {
manifest {
attributes 'Main-Class': mainClassName,
'Implementation-Version': version
}
archiveBaseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
from { configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
if (project.hasProperty('artifactory_user')) {
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact tasks.sourcesJar
artifact tasks.javadocJar
}
}
repositories {
maven {
credentials {
username artifactory_user
password artifactory_password
}
url "$artifactory_contextUrl/libs-public-release-local"
}
}
}
release {
failOnSnapshotDependencies = false
failOnUnversionedFiles = false
failOnCommitNeeded = false
git {
commitVersionFileOnly = true
}
/* publish before releasing
buildTasks =['build', 'publish']
*/
}
afterReleaseBuild.dependsOn publish
}
nativeImage {
graalVmHome = System.getenv('GRAALVM_HOME')
mainClass = mainClassName
executableName = 'heapdl'
outputDirectory = file("$buildDir/bin")
arguments(
'--allow-incomplete-classpath',
'--report-unsupported-elements-at-runtime',
'--no-fallback',
'--no-server',
'--enable-all-security-services',
'--report-unsupported-elements-at-runtime'
)
}
// Upload to bintray with:
// ./gradlew clean build bintrayUpload --info
// Needs properties: bintray_user, bintray_key.
if (project.hasProperty('bintray_user') && project.hasProperty('bintray_key')) {
bintray {
user = bintray_user
key = bintray_key
publications = ['mavenJava']
configurations = ['archives']
pkg {
repo = 'plast-lab'
name = 'HeapDL'
desc = 'The HeapDL tool.'
licenses = ['MIT']
labels = ['java']
vcsUrl = 'https://github.com/plast-lab/HeapDL'
version {
name = project.version
released = new Date()
vcsTag = project.version
}
}
}
}