build scripts: generate third-party libraries list when building from sources

This commit is contained in:
nik
2018-04-17 11:48:53 +03:00
parent ba45f0396e
commit 5ce376da4e
@@ -190,6 +190,7 @@ class DistributionJARsBuilder {
buildLib()
buildBundledPlugins()
buildNonBundledPlugins()
buildThirdPartyLibrariesList()
def loadingOrderFilePath = buildContext.productProperties.productLayout.classesLoadingOrderFilePath
if (loadingOrderFilePath != null) {
@@ -224,17 +225,11 @@ class DistributionJARsBuilder {
void buildAdditionalArtifacts() {
def productProperties = buildContext.productProperties
buildContext.messages.block("Generate table of licenses for used third-party libraries") {
def generator = new LibraryLicensesListGenerator(buildContext.messages, buildContext.project, productProperties.allLibraryLicenses)
String thirdPartyLibrariesFilePath = "$buildContext.paths.distAll/$THIRD_PARTY_LIBRARIES_FILE_PATH"
generator.generateLicensesTable(thirdPartyLibrariesFilePath, usedModules)
if (productProperties.generateLibrariesLicensesTable) {
String artifactNamePrefix = productProperties.getBaseArtifactName(buildContext.applicationInfo, buildContext.buildNumber)
buildContext.ant.
copy(file: thirdPartyLibrariesFilePath, tofile: "$buildContext.paths.artifacts/$artifactNamePrefix-third-party-libraries.html")
}
if (productProperties.generateLibrariesLicensesTable) {
String artifactNamePrefix = productProperties.getBaseArtifactName(buildContext.applicationInfo, buildContext.buildNumber)
buildContext.ant.copy(file: getThirdPartyLibrariesFilePath(),
tofile: "$buildContext.paths.artifacts/$artifactNamePrefix-third-party-libraries.html")
}
if (productProperties.scrambleMainJar) {
@@ -251,6 +246,17 @@ class DistributionJARsBuilder {
}
}
private void buildThirdPartyLibrariesList() {
buildContext.messages.block("Generate table of licenses for used third-party libraries") {
def generator = new LibraryLicensesListGenerator(buildContext.messages, buildContext.project, buildContext.productProperties.allLibraryLicenses)
generator.generateLicensesTable(getThirdPartyLibrariesFilePath(), usedModules)
}
}
private String getThirdPartyLibrariesFilePath() {
"$buildContext.paths.distAll/$THIRD_PARTY_LIBRARIES_FILE_PATH"
}
private void buildLib() {
def ant = buildContext.ant
def layoutBuilder = createLayoutBuilder()