Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit 95bd763

Browse files
committed
addressing review comments
1 parent 385e483 commit 95bd763

4 files changed

Lines changed: 20 additions & 17 deletions

File tree

boost-gradle/src/main/groovy/io/openliberty/boost/gradle/tasks/BoostPackageTask.groovy

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,22 +194,22 @@ public class BoostPackageTask extends AbstractBoostTask {
194194
}
195195

196196
protected void generateServerConfigEE() throws GradleException {
197-
String warName = null
197+
List<String> warNames = new ArrayList<String>()
198198

199199
if (project.plugins.hasPlugin('war')) {
200200

201201
if (project.war.version == null) {
202-
warName = project.war.baseName
202+
warNames.add(project.war.baseName)
203203
} else {
204-
warName = project.war.baseName + "-" + project.war.version
204+
warNames.add(project.war.baseName + "-" + project.war.version)
205205
}
206206
} else {
207-
warName = getWarNameFromBoostApps()
207+
warNames = getWarNameFromBoostApps()
208208
}
209209

210210
try {
211211

212-
BoosterConfigurator.generateLibertyServerConfig(libertyServerPath, boosterPackConfigurators, warName, BoostLogger.getInstance());
212+
BoosterConfigurator.generateLibertyServerConfig(libertyServerPath, boosterPackConfigurators, warNames, BoostLogger.getInstance());
213213

214214
} catch (Exception e) {
215215
throw new GradleException("Unable to generate server configuration for the Liberty server.", e);
@@ -300,12 +300,13 @@ public class BoostPackageTask extends AbstractBoostTask {
300300
}
301301

302302
//Runs through the dependencies in the boostApp configuration and pulls out the first war name.
303-
protected String getWarNameFromBoostApps() {
303+
protected List<String> getWarNameFromBoostApps() {
304+
List<String> warNames = new ArrayList<String>()
304305
for (def dep : project.configurations.boostApp) {
305306
if (FilenameUtils.getExtension(dep.name).equals('war')) {
306-
return dep.name.substring(0, dep.name.length() - 4)
307+
warNames.add(dep.name.substring(0, dep.name.length() - 4))
307308
}
308309
}
309-
return null
310+
return warNames
310311
}
311312
}

boost-gradle/src/main/groovy/io/openliberty/boost/gradle/utils/GradleProjectUtil.groovy

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,21 @@ public class GradleProjectUtil {
6161
}
6262

6363
//Will always have the boostApp configuration since we create it in apply()
64-
dependencies.putAll(getAllDependenciesFromConfiguration(project.configurations.boostApp, logger))
64+
//Just pulling in the transitive booster dependencies for the apps
65+
dependencies.putAll(getAllBoosterDependenciesFromConfiguration(project.configurations.boostApp, logger))
6566

6667
return dependencies
6768
}
6869

69-
public static Map<String, String> getAllDependenciesFromConfiguration(Configuration configuration, BoostLogger logger) {
70+
private static Map<String, String> getAllBoosterDependenciesFromConfiguration(Configuration configuration, BoostLogger logger) {
7071
Map<String, String> dependencies = new HashMap<String, String>()
7172
configuration.resolvedConfiguration.resolvedArtifacts.collect { it.moduleVersion.id }.each { ModuleVersionIdentifier id ->
7273
logger.debug("Found dependency while processing project: " + id.group.toString() + ":"
7374
+ id.name.toString() + ":" + id.version.toString())
7475

75-
dependencies.put(id.group.toString() + ":" + id.name.toString(), id.version.toString())
76+
if (id.group.toString().equals('io.openliberty.boosters')) {
77+
dependencies.put(id.group.toString() + ":" + id.name.toString(), id.version.toString())
78+
}
7679
}
7780
return dependencies
7881
}

boost-gradle/src/test/resources/devReleaseApp/dev/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ targetCompatibility = 1.8
3535

3636
dependencyManagement {
3737
imports {
38-
mavenBom "io.openliberty.boosters:ee8-bom:${boosterVersion}"
38+
mavenBom "io.openliberty.boosters:ee8-bom:${boosterVersion}"
3939
}
4040
}
4141

4242
dependencies {
43-
compile "io.openliberty.boosters:jaxrs"
44-
compile "io.openliberty.boosters:jdbc"
45-
compile("org.apache.httpcomponents:httpclient:4.5.6")
43+
compile "io.openliberty.boosters:jaxrs"
44+
compile "io.openliberty.boosters:jdbc"
45+
compile("org.apache.httpcomponents:httpclient:4.5.6")
4646
compile("org.apache.httpcomponents:httpcore:4.4.10")
4747
compile "javax.servlet:javax.servlet-api:4.0.0"
4848

49-
libertyRuntime "io.openliberty:openliberty-runtime:18.0.0.4"
49+
libertyRuntime "$runtimeGroup:$runtimeArtifactId:$runtimeVersion"
5050
}

boost-gradle/src/test/resources/devReleaseApp/dev/src/main/webapp/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)