porcelli commented on code in PR #5536:
URL:
https://github.com/apache/incubator-kie-drools/pull/5536#discussion_r1340652575
##########
drools-model/drools-codegen-common/src/main/java/org/drools/codegen/common/AppPaths.java:
##########
@@ -35,7 +35,18 @@ public enum BuildTool {
GRADLE;
public static AppPaths.BuildTool findBuildTool() {
- return System.getProperty("org.gradle.appname") == null ? MAVEN :
GRADLE;
+ return System.getProperties()
+ .keySet()
+ .stream()
+ .map(String.class::cast)
+ .anyMatch(k -> k.contains("gradle")) ||
+ System.getProperties()
+ .values()
+ .stream()
+ .map(String.class::cast)
+ .anyMatch(v -> v.contains("gradle"))
+ ? GRADLE
Review Comment:
this code seems a bit brittle - basically scan all properties. could you
show some evidence (docs, sample code, etc) that shows this is a good option?
In a quick look in Gradle codebase, I still could find the reference to
`org.gradle.appname` property [1].
[1] -
https://github.com/gradle/gradle/blob/master/platforms/software/build-init/src/main/java/org/gradle/api/tasks/wrapper/Wrapper.java#L153
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]