Skip to content

Commit

Permalink
Merge pull request #932 from arunvenmany-ibm/variable_resolution_fix
Browse files Browse the repository at this point in the history
changes to support variable resolution for predefined variables
  • Loading branch information
arunvenmany-ibm authored Feb 19, 2025
2 parents 654425f + 48c3990 commit f98d729
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ abstract class AbstractServerTask extends AbstractLibertyTask {

if (scd == null || !scd.getOriginalServerXMLFile().getCanonicalPath().equals(serverXML.getCanonicalPath())) {
try {
scd = new ServerConfigDocument(log, serverXML, getInstallDir(project), getUserDir(project), getServerDir(project));
scd = new ServerConfigDocument(log, serverXML, getInstallDir(project), getUserDir(project), getServerDir(project), new File(getOutputDir(project), server.name));
} catch (PluginExecutionException e) {
throw new GradleException(e.getMessage());
}
Expand Down Expand Up @@ -1149,8 +1149,9 @@ abstract class AbstractServerTask extends AbstractLibertyTask {
}
File wlpInstallDir = getInstallDir(project)
File wlpUserDir = getUserDir(project, wlpInstallDir)
File serverOutputDir= new File(getOutputDir(project), server.name)

return LibertyPropFilesUtility.getLibertyDirectoryPropertyFiles(new CommonLogger(project), wlpInstallDir, wlpUserDir, serverConfigDir)
return LibertyPropFilesUtility.getLibertyDirectoryPropertyFiles(new CommonLogger(project), wlpInstallDir, wlpUserDir, serverConfigDir, serverOutputDir)
}

// Return the loose application configuration xml file
Expand Down
10 changes: 5 additions & 5 deletions src/main/groovy/io/openliberty/tools/gradle/tasks/DevTask.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ class DevTask extends AbstractFeatureTask {
boolean libertyDebug, boolean pollingTest, boolean container, File containerfile, File containerBuildContext,
String containerRunOpts, int containerBuildTimeout, boolean skipDefaultPorts, boolean keepTempContainerfile,
String mavenCacheLocation, String packagingType, File buildFile, boolean generateFeatures, List<Path> webResourceDirs,
List<ProjectModule> projectModuleList, Map<String, List<String>> parentBuildGradle
List<ProjectModule> projectModuleList, Map<String, List<String>> parentBuildGradle, File serverOutputDir
) throws IOException, PluginExecutionException {
super(buildDir, serverDirectory, sourceDirectory, testSourceDirectory, configDirectory, projectDirectory, /* multi module project directory */ projectDirectory,
resourceDirs, changeOnDemandTestsAction, hotTests, skipTests, false /* skipUTs */, false /* skipITs */, skipInstallFeature, artifactId, serverStartTimeout,
Expand All @@ -388,7 +388,7 @@ class DevTask extends AbstractFeatureTask {
null /* compileOptions not needed since useBuildRecompile is true */, keepTempContainerfile, mavenCacheLocation, projectModuleList /* multi module upstream projects */,
projectModuleList.size() > 0 /* recompileDependencies as true for multi module */, packagingType, buildFile, parentBuildGradle /* parent build files */, generateFeatures, null /* compileArtifactPaths */, null /* testArtifactPaths */, webResourceDirs /* webResources */
);
this.libertyDirPropertyFiles = LibertyPropFilesUtility.getLibertyDirectoryPropertyFiles(new CommonLogger(project), installDirectory, userDirectory, serverDirectory);
this.libertyDirPropertyFiles = LibertyPropFilesUtility.getLibertyDirectoryPropertyFiles(new CommonLogger(project), installDirectory, userDirectory, serverDirectory, serverOutputDir);
ServerFeatureUtil servUtil = getServerFeatureUtil(true, libertyDirPropertyFiles);
FeaturesPlatforms fp = servUtil.getServerFeatures(serverDirectory, libertyDirPropertyFiles);

Expand Down Expand Up @@ -1246,11 +1246,11 @@ class DevTask extends AbstractFeatureTask {
initializeConfigDirectory();
File configDirectory = server.configDirectory;
// getOutputDir returns a string
File serverOutputDir = new File(getOutputDir(project));
File outputDir = new File(getOutputDir(project));

if (!container) {
if (serverDirectory.exists()) {
if (ServerStatusUtil.isServerRunning(serverInstallDir, serverOutputDir, serverName)) {
if (ServerStatusUtil.isServerRunning(serverInstallDir, outputDir, serverName)) {
throw new Exception("The server " + serverName
+ " is already running. Terminate all instances of the server before starting dev mode."
+ " You can stop a server instance with the command 'gradle libertyStop'.");
Expand Down Expand Up @@ -1292,7 +1292,7 @@ class DevTask extends AbstractFeatureTask {
verifyAppStartTimeout.intValue(), verifyAppStartTimeout.intValue(), compileWait.doubleValue(),
libertyDebug.booleanValue(), pollingTest.booleanValue(), container.booleanValue(), containerfile, containerBuildContext, containerRunOpts,
containerBuildTimeout, skipDefaultPorts.booleanValue(), keepTempContainerfile.booleanValue(), localMavenRepoForFeatureUtility,
DevTaskHelper.getPackagingType(project), buildFile, generateFeatures.booleanValue(), webResourceDirs, projectModules, parentBuildGradle
DevTaskHelper.getPackagingType(project), buildFile, generateFeatures.booleanValue(), webResourceDirs, projectModules, parentBuildGradle, new File(outputDir, serverName)
);
} catch (IOException | PluginExecutionException e) {
throw new GradleException("Error initializing dev mode.", e)
Expand Down

0 comments on commit f98d729

Please sign in to comment.