-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
126 lines (107 loc) · 2.96 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
buildscript {
repositories {
jcenter()
mavenCentral()
}
}
plugins {
id 'com.coditory.manifest' version '0.1.14'
}
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'application'
group = 'com.avast.server'
// remove 'v' and git ref prefix from version when defined from cmd line (github actions)
version = version ? version.replaceFirst('refs/tags/', '').replaceFirst('v', '') : version
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
mainClassName = "com.server.avast.verisign.utils.RpmVerifier"
}
jar {
exclude("verisign*")
//we create jar file without version suffix, it's easier to overwrite older lib file (otherwise force.delete has to be used)
archiveVersion.set("")
}
compileJava {
options.compilerArgs.addAll([
"--add-exports",
"java.base/sun.security.timestamp=ALL-UNNAMED"
])
options.compilerArgs.addAll([
"--add-exports",
"java.base/sun.security.pkcs=ALL-UNNAMED"
])
options.compilerArgs.addAll([
"--add-exports",
"java.base/sun.security.tools=ALL-UNNAMED"
])
options.compilerArgs.addAll([
"--add-exports",
"java.base/sun.security.validator=ALL-UNNAMED"
])
options.compilerArgs.addAll([
"--add-exports",
"java.base/sun.security.x509=ALL-UNNAMED"
])
options.compilerArgs.addAll([
"--add-exports",
"java.base/sun.security.util=ALL-UNNAMED"
])
options.compilerArgs.addAll([
"--add-exports",
"jdk.jartool/sun.security.tools.jarsigner=ALL-UNNAMED"
])
}
def libsToCopy = copySpec {
from "build/libs"
include "*.jar"
}
def groovyToCopy = copySpec {
from "src/main/groovy"
include "*.groovy"
}
def propertiesToCopy = copySpec {
from "etc"
include "*.yaml"
}
task deploy (dependsOn: build, type: Copy) {
into findProperty("artifactoryPath")
into('plugins/lib') {
with libsToCopy
}
into('plugins') {
with groovyToCopy
}
into('plugins') {
with propertiesToCopy
}
}
tasks.register('copyResult', Copy) {
into "$buildDir/toArchive"
into('var/etc/artifactory/plugins/lib') {
with libsToCopy
}
into('var/etc/artifactory/plugins') {
with groovyToCopy
}
into('var/etc/artifactory/plugins') {
with propertiesToCopy
}
}
tasks.register('packageDistribution', Zip) {
dependsOn tasks.named("copyResult")
archiveFileName = "jfrog-verisign.zip"
destinationDirectory = layout.buildDirectory.dir('dist')
from layout.buildDirectory.dir("toArchive")
}
repositories {
jcenter()
mavenCentral()
}
dependencies {
implementation 'org.artifactory:artifactory-api:7.12.5'
implementation 'org.spockframework:spock-core:1.1-groovy-2.4'
implementation 'org.jfrog.artifactory.client:artifactory-java-client-services:2.5.1'
}