slawekjaranowski commented on code in PR #1208:
URL: https://github.com/apache/maven/pull/1208#discussion_r1321550991


##########
maven-model-builder/src/main/java/org/apache/maven/utils/Os.java:
##########
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.utils;
+
+import java.util.Locale;
+import java.util.stream.Stream;
+
+/**
+ * OS support
+ */
+public class Os {
+
+    /**
+     * The OS Name.
+     */
+    public static final String OS_NAME = 
System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
+
+    /**
+     * The OA architecture.
+     */
+    public static final String OS_ARCH = 
System.getProperty("os.arch").toLowerCase(Locale.ENGLISH);
+
+    /**
+     * The OS version.
+     */
+    public static final String OS_VERSION = 
System.getProperty("os.version").toLowerCase(Locale.ENGLISH);
+
+    /**
+     * OS Family
+     */
+    public static final String OS_FAMILY;
+
+    public static final boolean IS_WINDOWS;
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_WINDOWS = "windows";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_WIN9X = "win9x";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_NT = "winnt";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_OS2 = "os/2";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_NETWARE = "netware";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_DOS = "dos";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_MAC = "mac";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_TANDEM = "tandem";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_UNIX = "unix";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_OPENVMS = "openvms";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_ZOS = "z/os";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_OS400 = "os/400";
+
+    /**
+     * OpenJDK is reported to call MacOS X "Darwin"
+     *
+     * @see <a 
href="https://issues.apache.org/bugzilla/show_bug.cgi?id=44889";>bugzilla 
issue</a>
+     * @see <a 
href="https://issues.apache.org/jira/browse/HADOOP-3318";>HADOOP-3318</a>
+     */
+    private static final String DARWIN = "darwin";
+
+    /**
+     * The path separator.
+     */
+    private static final String PATH_SEP = 
System.getProperty("path.separator");
+
+    static {
+        OS_FAMILY = getOsFamily();
+        IS_WINDOWS = isWindowsFamily();
+    }
+
+    private Os() {}
+
+    /**
+     * Determines if the OS on which Maven is executing matches the
+     * given OS family.
+     *
+     * @param family the family to check for
+     * @return true if the OS matches
+     *
+     */
+    public static boolean isFamily(String family) {

Review Comment:
   Enforcer rule `requireOS` use `plexus.Os` ... so we need check or improve 
also enfrcer rule in such cases



-- 
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: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to