Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes to support variable resolution for predefined variables #932

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading