elharo commented on code in PR #1062:
URL: https://github.com/apache/maven/pull/1062#discussion_r1167472442


##########
maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java:
##########
@@ -494,14 +504,51 @@ public interface MavenExecutionRequest {
 
     /**
      * @since 3.3.0
+     * @deprecated use {@link #setRootdir(Path)} instead
      */
+    @Deprecated
     void setMultiModuleProjectDirectory(File file);
 
     /**
      * @since 3.3.0
+     * @deprecated use {@link #getRootdir()} instead
      */
+    @Deprecated
     File getMultiModuleProjectDirectory();
 
+    /**
+     * Sets the top dir of the project.
+     *
+     * @since 4.0.0
+     */
+    MavenExecutionRequest setTopdir(Path topdir);

Review Comment:
   dir --> Directory, here and elsewhere
   
   That is, don't abbreviate. 



##########
maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java:
##########
@@ -494,14 +504,51 @@ public interface MavenExecutionRequest {
 
     /**
      * @since 3.3.0
+     * @deprecated use {@link #setRootdir(Path)} instead
      */
+    @Deprecated
     void setMultiModuleProjectDirectory(File file);
 
     /**
      * @since 3.3.0
+     * @deprecated use {@link #getRootdir()} instead
      */
+    @Deprecated
     File getMultiModuleProjectDirectory();
 
+    /**
+     * Sets the top dir of the project.
+     *
+     * @since 4.0.0
+     */
+    MavenExecutionRequest setTopdir(Path topdir);
+
+    /**
+     * Gets the directory of the topmost project being built, usually the 
current directory or the
+     * directory pointed at by the {@code -f/--file} command line argument.

Review Comment:
   pointed at by --> specified by 



##########
maven-core/src/main/java/org/apache/maven/execution/MavenSession.java:
##########
@@ -141,10 +142,30 @@ public List<MavenProject> getProjects() {
         return projects;
     }
 
+    /**
+     * @deprecated use {@link #getTopdir()}
+     */
+    @Deprecated
     public String getExecutionRootDirectory() {
         return request.getBaseDirectory();
     }
 
+    /**
+     * @see MavenExecutionRequest#getTopdir()
+     * @since 4.0.0
+     */
+    public Path getTopdir() {
+        return request.getTopdir();
+    }
+
+    /**
+     * @see MavenExecutionRequest#getRootdir()
+     * @since 4.0.0
+     */

Review Comment:
   RootDirectory



##########
api/maven-api-core/src/main/java/org/apache/maven/api/Project.java:
##########
@@ -86,8 +86,42 @@ default String getId() {
         return getModel().getId();
     }
 
+    /**
+     * @deprecated use {@link #isTopProject()} instead
+     */
+    @Deprecated
     boolean isExecutionRoot();
 
+    /**
+     * Returns a boolean indicating if the project is the top level project for
+     * this reactor build.  The top level project may be different from the
+     * {@code rootDirProject}, especially if a subtree of the project is being
+     * built, either because Maven has been launched in a subdirectory or using
+     * a {@code -f} option.
+     *
+     * @return {@code true} if the project is the top level project for this 
build
+     */
+    boolean isTopProject();
+
+    /**
+     * Returns a boolean indicating if the project is a root project,
+     * meaning that .

Review Comment:
   incomplete



##########
src/mdo/writer-ex.vm:
##########
@@ -210,8 +210,15 @@ public class ${className}
       #set ( $fieldCapName = $Helper.capitalise( $field.name ) )
       #if ( $field.type == "String" )
             writeAttr( "$fieldTagName", ${classLcapName}.get${fieldCapName}(), 
serializer );
+      #elseif ( $field.type == "boolean" )
+        #set ( $def = ${field.defaultValue} )
+        #if ( ${def} == "true" )
+            writeAttr( "$fieldTagName", ${classLcapName}.is${fieldCapName}() ? 
null : "false", serializer );
+        #else
+            writeAttr( "$fieldTagName", ${classLcapName}.is${fieldCapName}() ? 
"true" : null, serializer );
+        #end
       #else
-        // TODO: type=${field.type} to=${field.to} 
multiplicity=${field.multiplicity}
+            // TODO: type=${field.type} to=${field.to} 
multiplicity=${field.multiplicity}

Review Comment:
   is this TODO still relevant? Can it be removed?



##########
src/mdo/writer.vm:
##########
@@ -192,8 +192,15 @@ public class ${className}
       #set ( $fieldCapName = $Helper.capitalise( $field.name ) )
       #if ( $field.type == "String" )
             writeAttr( "$fieldTagName", ${classLcapName}.get${fieldCapName}(), 
serializer );
+      #elseif ( $field.type == "boolean" )
+        #set ( $def = ${field.defaultValue} )
+        #if ( ${def} == "true" )
+            writeAttr( "$fieldTagName", ${classLcapName}.is${fieldCapName}() ? 
null : "false", serializer );
+        #else
+            writeAttr( "$fieldTagName", ${classLcapName}.is${fieldCapName}() ? 
"true" : null, serializer );
+        #end
       #else
-        // TODO: type=${field.type} to=${field.to} 
multiplicity=${field.multiplicity}
+            // TODO: type=${field.type} to=${field.to} 
multiplicity=${field.multiplicity}

Review Comment:
   is this TODO still relevant? Can it be removed?



##########
maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java:
##########
@@ -91,8 +92,17 @@ public interface MavenExecutionRequest {
     // ----------------------------------------------------------------------
 
     // Base directory
+
+    /**
+     * @deprecated use {@link #setTopdir(Path)} instead

Review Comment:
   Are the base directory and the top directory different? if so, how? (Please 
don't answer in github comments. Instead add this info to the code.) If not, 
why this change?



-- 
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]

Reply via email to