-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
114 lines (90 loc) · 2.52 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
import net.neoforged.gradleutils.PomUtilsExtension.License
plugins {
id 'signing'
id 'java-library'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'net.neoforged.gradleutils' version '3.0.0-alpha.10'
}
group 'net.neoforged'
base.archivesName = 'jarcompatibilitychecker'
version = gradleutils.version
println('Version: ' + version)
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
gradleutils {
setupSigning()
setupCentralPublishing()
}
ext {
CHANGELOG_TAG = '0.1'
}
repositories {
mavenCentral()
}
configurations {
testCp
}
dependencies {
api 'org.ow2.asm:asm-commons:9.7'
api 'net.sf.jopt-simple:jopt-simple:5.0.4'
api 'com.google.code.gson:gson:2.9.0'
api 'com.google.guava:guava:31.1-jre'
implementation 'org.jetbrains:annotations:23.0.0'
testImplementation 'junit:junit:4.13.2'
testCp(files(tasks.shadowJar.archiveFile))
}
jar {
from(project.rootDir) {
include 'LICENSE'
}
manifest {
attributes([
'Main-Class': 'net.neoforged.jarcompatibilitychecker.ConsoleTool',
'Implementation-Version': project.version
])
}
}
shadowJar {
from(project.rootDir) {
include 'LICENSE'
}
minimize()
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/versions/9/module-info.class'
}
assemble.dependsOn shadowJar
java {
withSourcesJar()
withJavadocJar()
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
tasks.register('runExampleTest', JavaExec) {
classpath = configurations.testCp
mainClass = 'net.neoforged.jarcompatibilitychecker.ConsoleTool'
args('--binary', '--output', 'output.json', '--base-jar', 'tests/base/build/libs/base.jar', '--input-jar', 'tests/top/build/libs/top.jar')
dependsOn(':tests:base:jar', ':tests:top:jar')
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'jarcompatibilitychecker'
from components.java
gradleutils.sign(it)
pom {
name = project.name
description = 'A Java library for finding incompatibilities between binaries'
pomUtils.neoForgedDeveloper(it)
pomUtils.license(it, License.LGPL_v2)
pomUtils.githubRepo(it, 'JarCompatibilityChecker')
}
}
}
repositories {
maven gradleutils.publishingMaven
}
}
changelog {
from CHANGELOG_TAG
}