-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
166 lines (144 loc) · 4.44 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/*
Copyright (C) 2000 - 2024 Silverpeas
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
As a special exception to the terms and conditions of version 3.0 of
the GPL, you may redistribute this Program in connection with Free/Libre
Open Source Software ("FLOSS") applications as described in Silverpeas's
FLOSS exception. You should have received a copy of the text describing
the FLOSS exception, and it is also available here:
"https://www.silverpeas.org/legal/floss_exception.html"
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import org.apache.tools.ant.filters.ReplaceTokens
buildscript {
repositories {
maven {
url 'https://nexus3.silverpeas.org/repository/silverpeas'
}
mavenLocal()
}
}
plugins {
id 'java-gradle-plugin'
id 'org.ajoberstar.grgit' version '5.2.0' apply true
id 'idea'
id 'maven-publish'
id 'net.linguica.maven-settings' version '0.5'
id 'groovy'
}
description = 'The Gradle plugin to set up Silverpeas. It is used both to install or to upgrade Silverpeas.'
group = 'org.silverpeas'
version = '6.5-SNAPSHOT'
gradlePlugin {
plugins {
silversetup {
id = 'silversetup'
implementationClass = 'org.silverpeas.setup.SilverpeasSetupPlugin'
}
}
}
/* cache management
configurations {
all {
resolutionStrategy {
cacheDynamicVersionsFor 0, 'seconds'
cacheChangingModulesFor 0, 'seconds'
}
}
}*/
project.configure(project) {
if (project.version.endsWith('-SNAPSHOT')) {
project.extensions.snapshot = true
} else {
project.extensions.snapshot = false
}
}
repositories {
maven {
name 'silverpeas'
url 'https://nexus3.silverpeas.org/repository/silverpeas'
}
maven {
name 'gradle-plugins'
url 'https://plugins.gradle.org/m2/'
}
mavenLocal()
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withSourcesJar()
}
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
repositories {
maven {
if (project.snapshot) {
name 'silverpeas-snapshots'
url 'https://nexus3.silverpeas.org/repository/snapshots/'
} else {
name 'silverpeas'
url 'https://nexus3.silverpeas.org/repository/releases/'
}
}
}
}
dependencies {
api gradleApi()
api 'org.apache.commons:commons-lang3:3.12.0'
api 'commons-io:commons-io:2.11.0'
api 'org.apache.commons:commons-dbcp2:2.9.0'
api 'commons-codec:commons-codec:1.15'
api 'com.google.guava:guava:31.0.1-jre'
api 'javax.jcr:jcr:2.0'
api 'org.apache.jackrabbit:oak-jcr:1.52.0'
api 'org.apache.jackrabbit:oak-segment-tar:1.52.0'
api 'org.apache.jackrabbit:oak-store-document:1.52.0'
runtimeOnly 'org.eclipse.jetty:jetty-jndi:11.0.14'
runtimeOnly 'org.eclipse.jetty:jetty-util:11.0.14'
runtimeOnly 'com.h2database:h2:2.1.214'
runtimeOnly 'org.postgresql:postgresql:42.5.4'
runtimeOnly 'net.sourceforge.jtds:jtds:1.3.1'
runtimeOnly 'io.dropwizard.metrics:metrics-core:3.2.6'
runtimeOnly 'org.mongodb:mongo-java-driver:3.12.11'
testImplementation gradleTestKit()
testImplementation platform("org.spockframework:spock-bom:2.3-groovy-3.0")
testImplementation 'org.spockframework:spock-core'
testImplementation 'org.spockframework:spock-junit4'
testImplementation 'junit:junit:4.13.2'
}
ext {
revision = grgit.head().abbreviatedId
}
jar {
manifest {
attributes(
"Build-Version": project.version,
"Git-Commit": grgit.head().abbreviatedId)
}
}
task sourceJar(type: Jar) {
from sourceSets.main.allSource
}
processTestResources {
filesMatching('**/*.properties') {
filter(ReplaceTokens,
tokens: [buildDir: buildDir.path.replace('\\', '/')], beginToken: '${', endToken: '}')
}
filesMatching('**/*.xml') {
filter(ReplaceTokens,
tokens: [buildDir: buildDir.path.replace('\\', '/')], beginToken: '${', endToken: '}')
}
}