Skip to content

Commit 75e7ee6

Browse files
committed
Add a new dependency scope for the silverpeas.gradle file in a
Silverpeas installation: custom. This scope allow to declare libs developed specifically to custom some behaviors or to provide additional custom functionalities (like workflows).
1 parent 19f9a05 commit 75e7ee6

File tree

2 files changed

+61
-30
lines changed

2 files changed

+61
-30
lines changed

src/main/groovy/org/silverpeas/setup/SoftwareBundles.groovy

Lines changed: 45 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,51 @@ import javax.inject.Inject
1313
* unpacked to a given directory in order to generate the final application.
1414
* @author mmoquillon
1515
*/
16+
@SuppressWarnings('unused')
1617
class SoftwareBundles {
1718

18-
/**
19-
* All the software bundles that made Silverpeas. Those bundles are usually downloaded from our
20-
* own Software Repository by the Silverpeas installer. They are required to assemble and build
21-
* the final Silverpeas Web Application. The Jar libraries other than the supported JDBC drivers
22-
* aren't taken in charge.
23-
*/
24-
@InputFiles
25-
final ConfigurableFileCollection silverpeas
26-
27-
/**
28-
* Any tiers bundles to add into the Silverpeas Application being built. The tiers bundles are
29-
* processed differently by the plugin: only the JAR libraries are taken in charge.
30-
*/
31-
@InputFiles
32-
final ConfigurableFileCollection tiers
33-
34-
@Inject
35-
SoftwareBundles(Project project) {
36-
silverpeas = project.files()
37-
tiers = project.files()
38-
}
39-
40-
void setSilverpeas(FileCollection bundles) {
41-
this.silverpeas.setFrom(bundles)
42-
}
43-
44-
@SuppressWarnings('unused')
45-
void setTiers(FileCollection bundles) {
46-
this.tiers.setFrom(bundles)
47-
}
19+
/**
20+
* All the software bundles that made Silverpeas. Those bundles are usually downloaded from our
21+
* own Software Repository by the Silverpeas installer. They are required to assemble and build
22+
* the final Silverpeas Web Application. The Jar libraries other than the supported JDBC drivers
23+
* aren't taken in charge.
24+
*/
25+
@InputFiles
26+
final ConfigurableFileCollection silverpeas
27+
28+
/**
29+
* Any tiers bundles to add into the Silverpeas Application being built. The tiers bundles are
30+
* processed differently by the plugin: only the JAR libraries are taken in charge.
31+
*/
32+
@InputFiles
33+
final ConfigurableFileCollection tiers
34+
35+
/**
36+
* Custom software bundles to complete or to add custom functionalities to Silverpeas. Those
37+
* bundles are usually downloaded from our own or outer Software Repositories by the
38+
* Silverpeas installer. The external repositories require to be declared. This is a way to
39+
* include libraries dedicated to implement a customer requirement (like a workflow process for
40+
* example).
41+
*/
42+
@InputFiles
43+
final ConfigurableFileCollection custom
44+
45+
@Inject
46+
SoftwareBundles(Project project) {
47+
silverpeas = project.files()
48+
tiers = project.files()
49+
custom = project.files()
50+
}
51+
52+
void setSilverpeas(FileCollection bundles) {
53+
this.silverpeas.setFrom(bundles)
54+
}
55+
56+
void setTiers(FileCollection bundles) {
57+
this.tiers.setFrom(bundles)
58+
}
59+
60+
void setCustom(FileCollection bundles) {
61+
this.custom.setFrom(bundles)
62+
}
4863
}

src/main/groovy/org/silverpeas/setup/construction/SilverpeasBuilder.groovy

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class SilverpeasBuilder {
7373
Objects.requireNonNull(silverpeasHome)
7474
Objects.requireNonNull(driversDir)
7575
final Collection<File> silverpeasBundles = bundles.silverpeas.files
76+
final Collection<File> customBundles = bundles.custom.files
7677
final Collection<File> tiersBundles = bundles.tiers.files
7778
def isAWar = { File f ->
7879
f.name.endsWith('.war') && !f.name.startsWith(CORE_WAR_BUNDLE_ID)
@@ -108,6 +109,21 @@ class SilverpeasBuilder {
108109
}
109110
}
110111

112+
// now we extract any custom(er) bundles by their type
113+
customBundles.each { bundle ->
114+
if (isAWar(bundle)) {
115+
extractWarBundle(bundle, destinationDir)
116+
} else if (isAConf(bundle)) {
117+
extractConfigurationBundle(bundle, silverpeasHome)
118+
} else if (isAJdbcDriver(bundle)) {
119+
extractJdbcDriver(bundle, driversDir)
120+
} else if (isARar(bundle)) {
121+
extractRarBundle(bundle, project.buildDir)
122+
} else if (isALib(bundle)) {
123+
extractLibBundle(bundle, Paths.get(destinationDir.path, 'WEB-INF', 'lib').toFile())
124+
}
125+
}
126+
111127
// extract now the tiers bundles to add to Silverpeas
112128
tiersBundles.each { bundle ->
113129
if (isAJdbcDriver(bundle)) {

0 commit comments

Comments
 (0)