Skip to content

Commit

Permalink
Refactor bit pom preparer and custom build detection
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvavrik authored and jedla97 committed Nov 22, 2024
1 parent d4051a8 commit 5fe556e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ private static void propagateMavenPomProperties(Model newPomModel, MavenProject
"POM file property '" + propertyKey + "' is required but could not found");
}
newPomModel.getProperties().setProperty(propertyKey, propertyValue);
if (project.getProperties().getProperty(MAVEN_COMPILER_RELEASE) != null) {
newPomModel.getProperties().setProperty(MAVEN_COMPILER_RELEASE,
project.getProperties().getProperty(MAVEN_COMPILER_RELEASE));
} else {
newPomModel.getProperties().setProperty(MAVEN_COMPILER_RELEASE, Integer.toString(Runtime.version().feature()));
}
});
if (project.getProperties().getProperty(MAVEN_COMPILER_RELEASE) != null) {
newPomModel.getProperties().setProperty(MAVEN_COMPILER_RELEASE,
project.getProperties().getProperty(MAVEN_COMPILER_RELEASE));
} else {
newPomModel.getProperties().setProperty(MAVEN_COMPILER_RELEASE, Integer.toString(Runtime.version().feature()));
}
}

private static void addCurrentProjectPlugins(Model newPomModel, Model rawCurrentProjectModel, MavenProject project) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,6 @@ Optional<Path> buildOrReuseArtifact(Collection<String> additionalArgs) {
mavenBuildProjectRoot = prepareMavenProject(appFolder.resolve("mvn-build"));
}

final boolean isCustomBuildRequired = TestExecutionProperties.isCustomBuildRequired(resourceBuilder.getContext());
if (isCustomBuildRequired) {
return buildArtifactWithQuarkusMvnPlugin(mavenBuildProjectRoot, additionalArgs);
}
return getArtifact().or(() -> buildArtifactWithQuarkusMvnPlugin(mavenBuildProjectRoot, additionalArgs));
}

Expand Down Expand Up @@ -394,8 +390,10 @@ private Optional<Path> moveToPermanentLocation(Path tempNativeExecutablePath) {
}

private boolean isCustomBuildRequired() {
return resourceBuilder.requiresCustomBuild() || !forcedDependencies.isEmpty() || !requiredDependencies.isEmpty()
|| resourceBuilder.areApplicationPropertiesEnhanced();
boolean customBuildRequiredImplicitly = resourceBuilder.requiresCustomBuild() || !forcedDependencies.isEmpty()
|| !requiredDependencies.isEmpty() || resourceBuilder.areApplicationPropertiesEnhanced();
boolean customBuildRequiredExplicitly = TestExecutionProperties.isCustomBuildRequired(resourceBuilder.getContext());
return customBuildRequiredExplicitly || customBuildRequiredImplicitly;
}

private String[] getBuildCmd(Collection<String> additionalArgs) {
Expand Down

0 comments on commit 5fe556e

Please sign in to comment.