IDEA-260007 Third-party license list is empty
authorDmitriy.Panov <Dmitriy.Panov@jetbrains.com>
Thu, 21 Jan 2021 19:31:10 +0000 (22:31 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Fri, 22 Jan 2021 09:46:41 +0000 (09:46 +0000)
GitOrigin-RevId: 6c4dd811fcf15dea1b80d34803e3aad8288288dd

platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/DistributionJARsBuilder.groovy
platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/LibraryLicensesListGenerator.groovy

index 7219bd71a0068434e4bb60d60dad9756871a1b0a..e5973e33c59ce97107859c1ecc9bc224e1c02f07 100644 (file)
@@ -285,7 +285,6 @@ final class DistributionJARsBuilder {
       SVGPreBuilder.createPrebuildSvgIconsTask(),
       createBuildSearchableOptionsTask(getModulesForPluginsToPublish()),
       createBuildBrokenPluginListTask(),
-      createBuildThirdPartyLibrariesListTask(projectStructureMapping)
     ), buildContext)
 
     buildLib()
@@ -305,6 +304,7 @@ final class DistributionJARsBuilder {
     if (!isUpdateFromSources) {
       buildNonBundledPluginsBlockMaps()
     }
+    buildThirdPartyLibrariesList(projectStructureMapping)
   }
 
   static void reorderJars(@NotNull BuildContext buildContext) {
@@ -453,10 +453,8 @@ final class DistributionJARsBuilder {
     }
   }
 
-  @NotNull
-  private static BuildTaskRunnable<Void> createBuildThirdPartyLibrariesListTask(@NotNull ProjectStructureMapping projectStructureMapping) {
-    return BuildTaskRunnable.task(BuildOptions.THIRD_PARTY_LIBRARIES_LIST_STEP,
-                                    "Generate table of licenses for used third-party libraries") { buildContext ->
+  private void buildThirdPartyLibrariesList(@NotNull ProjectStructureMapping projectStructureMapping) {
+    buildContext.executeStep("Generate table of licenses for used third-party libraries", BuildOptions.THIRD_PARTY_LIBRARIES_LIST_STEP) {
       LibraryLicensesListGenerator generator = LibraryLicensesListGenerator.create(buildContext.messages,
                                                                                    buildContext.project,
                                                                                    buildContext.productProperties.allLibraryLicenses,
index da17e7d2117669852fa54fd8da0e3b0f9233e1c8..a40b83093f9530de9fef1ecc5e0ad1221f181f1d 100644 (file)
@@ -33,6 +33,9 @@ final class LibraryLicensesListGenerator {
                                              List<LibraryLicense> licensesList,
                                              Set<String> usedModulesNames) {
     Map<LibraryLicense, String> licences = generateLicenses(messages, project, licensesList, usedModulesNames)
+    if (licences.isEmpty()) {
+      messages.error("Empty licenses table for ${licensesList.size()} licenses and ${usedModulesNames.size()} used modules names")
+    }
     return new LibraryLicensesListGenerator(messages, licences)
   }