forked from pietrobraione/jbse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
74 lines (61 loc) · 1.64 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
plugins {
id 'java'
id 'eclipse'
id 'ca.coglinc2.javacc' version '3.0.0'
id 'com.github.johnrengelman.shadow' version '7.0.0'
}
def javaVersion = JavaLanguageVersion.of(8)
def javaHome = javaToolchains.compilerFor { languageVersion = javaVersion }.get().metadata.installationPath.asFile.toString()
repositories {
mavenCentral()
flatDir {
dirs "${javaHome}/lib", 'libs'
}
}
java {
toolchain {
languageVersion = javaVersion
}
}
dependencies {
implementation name: 'javassist' //'org.javassist:javassist:3.26.0-GA'
implementation name: 'tools'
testImplementation 'junit:junit:4.11'
}
group = 'jbse'
version = '0.10.0-SNAPSHOT'
description = 'JBSE'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
compileJavacc {
arguments = [output_directory: compileJavacc.outputDirectory.absolutePath + '/jbse/apps/settings']
}
sourceSets {
main {
java {
srcDir compileJavacc.outputDirectory
}
}
}
task copyToLib(type: Copy) {
into "deps"
from configurations.compileClasspath
}
shadowJar {
classifier = 'shaded'
exclude 'tools.jar'
relocate 'javassist', 'jbse.javassist'
}
build.dependsOn(copyToLib)
build.dependsOn 'shadowJar'
jar {
manifest {
attributes 'Specification-Title': 'Java Virtual Machine Specification',
'Specification-Vendor': 'Oracle Corporation',
'Specification-Version': '1.8',
'Implementation-Title': description,
'Implementation-Vendor': 'University of Milano-Bicocca',
'Implementation-Version': archiveVersion
}
}