Skip to content

Commit

Permalink
incorparating review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Arun Venmany <[email protected]>
  • Loading branch information
arunvenmany-ibm committed Sep 10, 2024
1 parent bfd2ea9 commit 90b7632
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

apply plugin: 'groovy'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: "com.gradle.plugin-publish"
apply plugin: 'base'

group = 'io.openliberty.tools'
version = '3.8.4-SNAPSHOT'
Expand Down Expand Up @@ -113,7 +113,7 @@ test {

try {

output = new FileOutputStream("${buildDir}/gradle.properties");
output = new FileOutputStream("${project.getLayout().getBuildDirectory().getAsFile().get()}/gradle.properties");

if (libertyRuntime == "ol") {
runtimeGroup = "io.openliberty"
Expand Down Expand Up @@ -178,7 +178,7 @@ pluginBundle {
publishing {
publications {
libertyGradle (MavenPublication) {
artifactId = 'liberty-gradle-plugin'
artifactId = base.archivesName.get()

from components.java
artifact groovydocJar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,28 @@ public class LooseEarApplication extends LooseApplication {
public void addSourceDir() throws Exception {
if (task.getProject().getPlugins().hasPlugin("ear")) {
Ear ear = (Ear) task.getProject().ear
File sourceDir = new File(task.getProject().path.replace(":","") + "/" + ear.getAppDirectory().getAsFile().get().getAbsolutePath())
File sourceDir = new File(task.getProject().path.replace(":","") + "/" + ear.getAppDirectory().getAsFile().get().getPath())
config.addDir(sourceDir, "/")
}
}

public void addApplicationXmlFile() throws Exception {
String applicationName = "/application.xml"
File applicationXmlFile;
if (task.getProject().getPlugins().hasPlugin("ear")) {
Ear ear = (Ear) task.getProject().ear
String applicationName = "/application.xml"
if (ear.getDeploymentDescriptor() != null){
if (ear.getDeploymentDescriptor() != null) {
applicationName = "/" + ear.getDeploymentDescriptor().getFileName()
}
File applicationXmlFile = new File(task.getProject().path.replace(":", "") + "/" + ear.getAppDirectory().getAsFile().get().getAbsolutePath() + "/META-INF/" + applicationName)
applicationXmlFile = new File(task.getProject().path.replace(":", "") + "/" + ear.getAppDirectory().getAsFile().get().getAbsolutePath() + "/META-INF/" + applicationName)
if (applicationXmlFile.exists()) {
config.addFile(applicationXmlFile, "/META-INF/application.xml");
} else {
applicationXmlFile = new File(task.getDestinationDirectory().get().getAsFile().getParentFile().getAbsolutePath() + "/tmp/ear" + applicationName);
config.addFile(applicationXmlFile, "/META-INF/application.xml");
}
}
else {
logger.warn("Project is expected to have EAR plugin. Application xml file may not be added correctly")
if (applicationXmlFile == null || !applicationXmlFile.exists()) {
applicationXmlFile = new File(task.getDestinationDirectory().get().getAsFile().getParentFile().getAbsolutePath() + "/tmp/ear" + applicationName);
config.addFile(applicationXmlFile, "/META-INF/application.xml");
logger.warn("Could not get the application.xml file location from the EAR plugin because it is not configured. The file may not be added correctly to the application archive.")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class LooseWarApplication extends LooseApplication {
sourceDir = new File(war.getWebAppDirectory().getAsFile().get().getAbsolutePath())
}
}else {
logger.warn("Default sourcedir path to src/main/webapp as WAR plugin does not exist. Application may not work expectedly")
logger.warn("Could not get the webAppDirectory location from the WAR plugin because it is not configured. Using the default location src/main/webapp instead. Application may not work as expected.")
}
config.addDir(sourceDir, "/")
}
Expand Down

0 comments on commit 90b7632

Please sign in to comment.