-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
139 lines (124 loc) · 3.69 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
/*
* build.gradle of jsmud-analysis.
*
* -PapplyJsmudShadow=true: Build with asm included (.class and source!) as shadow-dependency.
*/
buildscript {
repositories {
mavenLocal()
}
}
plugins {
id 'java'
id 'maven-publish'
id 'signing'
}
def isApplyJsmudShadow = (hasProperty('applyJsmudShadow') && applyJsmudShadow == 'true');
if (isApplyJsmudShadow) {
apply plugin: 'JsmudShadowPlugin'
JsmudShadowPlugin {
depPackage = 'org.objectweb.asm'
depPackageShadow = 'org.rogmann.jsmud.shadow.asm'
}
}
else {
println "JsmudShadowPlugin is not applied."
}
java {
withJavadocJar()
withSourcesJar()
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
if (isApplyJsmudShadow) {
compileOnly 'org.ow2.asm:asm:9.2'
compileOnly 'org.ow2.asm:asm-tree:9.2'
compileOnly 'org.ow2.asm:asm-analysis:9.2'
} else {
implementation 'org.ow2.asm:asm:9.2'
implementation 'org.ow2.asm:asm-tree:9.2'
implementation 'org.ow2.asm:asm-analysis:9.2'
}
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2'
}
group = 'org.rogmann.jsmud'
def snapshotSuffix = rootProject.hasProperty('release') ? '' : '-SNAPSHOT'
version = '0.6.2' + snapshotSuffix
def descriptionSuffix = isApplyJsmudShadow ? ' (asm included)' : ''
description = "Java simulator and multi-user debugger in order to analyze execution of bytecode${descriptionSuffix}"
java.sourceCompatibility = JavaVersion.VERSION_1_8
java.targetCompatibility = JavaVersion.VERSION_1_8
def resLicense = isApplyJsmudShadow ? "res_license_all" : "res_license"
sourceSets {
main {
resources {
srcDirs = ["src/main/resources", "src/main/${resLicense}"]
}
}
}
java {
withJavadocJar()
withSourcesJar()
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
apply plugin: 'maven-publish'
apply plugin: 'signing'
publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
pom {
name = jar.archiveBaseName
description = project.description
inceptionYear = '2021'
licenses {
license {
name = 'Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
if (isApplyJsmudShadow) {
license {
name = 'BSD License 2.0'
url = 'https://asm.ow2.io/license.html'
}
}
}
url = 'https://github.com/srogmann/jsmud-analysis/'
issueManagement {
url = 'https://github.com/srogmann/jsmud-analysis/issues'
}
scm {
connection = 'scm:git:git://github.com/srogmann/jsmud-analysis.git'
developerConnection = 'scm:git:ssh://github.com:srogmann/jsmud-analysis.git'
url = 'https://github.com/srogmann/jsmud-analysis/tree/master'
}
developers {
developer {
name = 'Sascha Rogmann'
id = 'srogmann'
roles = ['Creator', 'Java Developer']
}
if (isApplyJsmudShadow) {
developer {
name = 'OW2'
id = 'ASM'
roles = ['Dependency', 'Java Developer of org.objectweb.asm shadowed to org.rogmann.jsmud.shadow.asm']
}
}
}
}
}
}
}
signing {
required rootProject.hasProperty('releaseMaven')
sign publishing.publications.mavenJava
}