You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by mh...@apache.org on 2023/01/12 15:45:52 UTC

[asterixdb] 04/08: [NO ISSUE] Exclude licenses that are exclusively shadowed

This is an automated email from the ASF dual-hosted git repository.

mhubail pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git

commit 667a908755391fcf07957ca2c01d9f42cb89b291
Author: Michael Blow <mb...@apache.org>
AuthorDate: Fri Dec 9 15:56:28 2022 -0500

    [NO ISSUE] Exclude licenses that are exclusively shadowed
    
    Change-Id: I19eb0000e2977e85293fd7c2e67768a218062fe9
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17302
    Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
    Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
    Reviewed-by: Michael Blow <mb...@apache.org>
---
 asterixdb/src/main/licenses/templates/asterix-license.ftl         | 8 ++++----
 .../apache/hyracks/maven/license/project/LicensedProjects.java    | 6 ++++++
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/asterixdb/src/main/licenses/templates/asterix-license.ftl b/asterixdb/src/main/licenses/templates/asterix-license.ftl
index 434ce447f6..f9c969e27c 100644
--- a/asterixdb/src/main/licenses/templates/asterix-license.ftl
+++ b/asterixdb/src/main/licenses/templates/asterix-license.ftl
@@ -34,8 +34,11 @@ ${license.content}
 <#list licenseMap as e>
    <#assign licenseUrl = e.getKey()/>
    <#assign entry = e.getValue()/>
-   <#assign projects = entry.projects/>
+   <#assign projects = entry.nonShadowedProjects/>
    <#assign license = entry.getLicense()/>
+   <#if projects?size == 0>
+     <#continue/>
+   </#if>
    <#if projects?size == 1>
    Component:
      <#assign isare = "is"/>
@@ -44,9 +47,6 @@ ${license.content}
      <#assign isare = "are"/>
    </#if>
    <#list projects as p>
-     <#if p.shadowed>
-       <#continue/>
-     </#if>
        * ${p.name} (${p.groupId}:${p.artifactId}:${p.version})
      <#list p.locations as loc>
          - ${loc}${p.jarName}
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/project/LicensedProjects.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/project/LicensedProjects.java
index f6f9f32444..31b4a86061 100644
--- a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/project/LicensedProjects.java
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/project/LicensedProjects.java
@@ -21,6 +21,7 @@ package org.apache.hyracks.maven.license.project;
 import java.util.Set;
 import java.util.SortedSet;
 import java.util.TreeSet;
+import java.util.function.Predicate;
 
 import org.apache.hyracks.maven.license.LicenseSpec;
 
@@ -51,6 +52,11 @@ public class LicensedProjects {
         return projects;
     }
 
+    public SortedSet<Project> getNonShadowedProjects() {
+        return projects.stream().filter(Predicate.not(Project::isShadowed))
+                .collect(() -> new TreeSet<>(Project.PROJECT_COMPARATOR), TreeSet::add, TreeSet::addAll);
+    }
+
     public void addProject(Project project) {
         projects.add(project);
     }