-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
125 lines (100 loc) · 3.07 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
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '7.0.0'
id 'com.github.sherter.google-java-format' version '0.9'
}
verifyGoogleJavaFormat.dependsOn(tasks.googleJavaFormat)
dependencies {
implementation "com.google.code.gson:gson:${gson_version}"
implementation "org.pytorch:torchserve-plugins-sdk:${torchserve_sdk_version}"
implementation "software.amazon.awssdk:s3:${awssdk_s3_version}"
implementation "com.aliyun.oss:aliyun-sdk-oss:${aliyun_sdk_oss_version}"
implementation "com.google.cloud:google-cloud-storage:${google_cloud_storage_version}"
implementation "com.azure:azure-storage-blob:${azure_storage_blob_version}"
implementation ("io.github.gaius-qi:server:${torchserve_version}"){
exclude group: 'frontend', module: 'archive'
}
implementation "io.github.gaius-qi:archive:${torchserve_version}"
}
project.ext{
sagemaker = true
}
repositories {
mavenCentral()
}
jar {
includeEmptyDirs = false
exclude "META-INF/maven/**"
exclude "META-INF/INDEX.LIST"
exclude "META-INF/MANIFEST*"
exclude "META-INF//LICENSE*"
exclude "META-INF//NOTICE*"
}
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java Library project to get you started.
* For more details take a look at the Java Libraries chapter in the Gradle
* User Manual available at https://docs.gradle.org/5.4.1/userguide/java_library_plugin.html
*/
allprojects {
apply plugin: 'idea'
apply plugin: 'java'
version = '1.0'
repositories {
jcenter()
mavenCentral()
}
idea {
module {
outputDir = file('build/classes/java/main')
testOutputDir = file('build/classes/java/test')
}
}
task buildSagemaker("type": Jar) {
doFirst{ task ->
println "building $task.project.name"
}
with project.jar
doLast {
copy {
def fromDir = project.jar
def intoDir = "${rootProject.projectDir}/build/plugins"
from fromDir
into intoDir
println "Copying files from" + fromDir + " into " + intoDir
}
}
}
buildSagemaker.onlyIf {project.hasProperty("sagemaker")}
}
def javaProjects() {
return subprojects.findAll()
}
configure(javaProjects()) {
sourceCompatibility = 1.8
targetCompatibility = 1.8
defaultTasks 'jar'
test {
useTestNG() {
// suiteXmlFiles << new File(rootDir, "testng.xml") //This is how to add custom testng.xml
}
testLogging {
showStandardStreams = true
events "passed", "skipped", "failed", "standardOut", "standardError"
}
}
test.finalizedBy(project.tasks.jacocoTestReport)
compileJava {
options.compilerArgs << "-Xlint:all,-options,-static" << "-Werror"
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.75
}
}
}
}
}