-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
72 lines (60 loc) · 1.82 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
/*
* This file was generated by the Gradle 'init' task.
*/
plugins {
// Add support for building Java
id 'java-library'
}
defaultTasks 'clean', 'build'
sourceSets {
main.java.srcDirs = ['src/patentdata/opstools']
main.resources.srcDirs = ['config']
}
repositories {
// You can declare any Maven/Ivy/file repository here.
mavenCentral()
}
dependencies {
// https://mvnrepository.com/artifact/commons-io/commons-io
implementation 'commons-io:commons-io:2.11.0'
// https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient
implementation 'org.apache.httpcomponents:httpclient:4.5.13'
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core
implementation 'org.apache.logging.log4j:log4j-core:2.17.1'
// https://mvnrepository.com/artifact/org.json/json
implementation 'org.json:json:20210307'
}
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint:unchecked'
options.deprecation = true
}
task copyJarsToLib (type: Copy) {
def toDir = 'build/libs/third-party'
from configurations.runtimeClasspath
into toDir
}
jar {
dependsOn copyJarsToLib
duplicatesStrategy = DuplicatesStrategy.FAIL
manifest {
attributes(
'Implementation-Title': project.name,
'Main-Class': 'patentdata.opstools.PDFPatentPipeline',
'Class-Path': '. third-party/' + configurations.runtimeClasspath.collect { it.getName() }.join(' third-party/')
)
}
}
task fatJar(type: Jar) {
duplicatesStrategy = DuplicatesStrategy.FAIL
manifest {
attributes 'Main-Class': 'patentdata.opstools.PDFPatentPipeline'
}
archiveClassifier = 'all'
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
{
exclude "META-INF/*"
}
with jar
}