mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
[build scripts] packaging x86 JRE for Linux (IDEA-229379)
Extracting common code into JRE manager; reusing base URL from *ApplicationInfo.xml files; dropping obsolete "second JRE" stuff (we're not going to provide distributions with alternative JREs). GitOrigin-RevId: e7106c0fed492c106fbf15c8651678b08bd36de0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
951113ab03
commit
3f56f2012c
@@ -1,3 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
import org.gradle.internal.os.OperatingSystem
|
||||
|
||||
import java.util.concurrent.TimeUnit
|
||||
@@ -10,11 +11,6 @@ def jreBuild = System.getProperty("intellij.build.bundled.jre.build", jdkBuild)
|
||||
def jrePrefix = System.getProperty("intellij.build.bundled.jre.prefix")
|
||||
createJbreTasks(jreBuild, jreVersion, targetOs, jrePrefix)
|
||||
|
||||
if (System.getProperty('intellij.build.bundle.second.jre', 'false').toBoolean()) {
|
||||
def secondJreBuild = System.getProperty("intellij.build.bundled.second.jre.build", secondJreBuild)
|
||||
createJbreTasks(secondJreBuild, 8, targetOs)
|
||||
}
|
||||
|
||||
/**
|
||||
* Update this method together with:
|
||||
* `setupJdk.gradle`
|
||||
@@ -180,5 +176,5 @@ static def jrePlatformsToDownload(targetOs) {
|
||||
}
|
||||
|
||||
static def archToDownload(platform, is32BitArchSupported) {
|
||||
is32BitArchSupported && platform == 'windows' ? ['x86', 'x64'] : ['x64']
|
||||
is32BitArchSupported && platform != 'osx' ? ['x86', 'x64'] : ['x64']
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.intellij.build
|
||||
|
||||
import groovy.transform.CompileDynamic
|
||||
@@ -82,9 +82,6 @@ class IdeaCommunityProperties extends BaseIdeaProperties {
|
||||
String getUninstallFeedbackPageUrl(ApplicationInfoProperties applicationInfo) {
|
||||
"https://www.jetbrains.com/idea/uninstall/?edition=IC-${applicationInfo.majorVersion}.${applicationInfo.minorVersion}"
|
||||
}
|
||||
|
||||
@Override
|
||||
String getBaseDownloadUrlForJre() { "https://download.jetbrains.com/idea" }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.intellij.build
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil
|
||||
@@ -25,13 +11,14 @@ class ApplicationInfoProperties {
|
||||
final String microVersion
|
||||
final String patchVersion
|
||||
final String fullVersionFormat
|
||||
final boolean isEAP
|
||||
final String versionSuffix
|
||||
final String shortProductName
|
||||
/**
|
||||
* The first number from 'minor' part of the version. This property is temporary added because some products specify composite number (like '1.3')
|
||||
* in 'minor version' attribute instead of using 'micro version' (i.e. set minor='1' micro='3').
|
||||
*/
|
||||
final String minorVersionMainPart
|
||||
final String shortProductName
|
||||
String productCode
|
||||
final String productName
|
||||
final String edition
|
||||
@@ -39,12 +26,13 @@ class ApplicationInfoProperties {
|
||||
final String companyName
|
||||
final String shortCompanyName
|
||||
final String svgRelativePath
|
||||
final boolean isEAP
|
||||
final List<String> svgProductIcons
|
||||
final String patchesUrl
|
||||
|
||||
@SuppressWarnings(["GrUnresolvedAccess", "GroovyAssignabilityCheck"])
|
||||
ApplicationInfoProperties(String appInfoXmlPath) {
|
||||
def root = new XmlParser().parse(new File(appInfoXmlPath))
|
||||
|
||||
def versionTag = root.version.first()
|
||||
majorVersion = versionTag.@major
|
||||
minorVersion = versionTag.@minor ?: "0"
|
||||
@@ -53,23 +41,28 @@ class ApplicationInfoProperties {
|
||||
fullVersionFormat = versionTag.@full ?: "{0}.{1}"
|
||||
isEAP = Boolean.parseBoolean(versionTag.@eap)
|
||||
versionSuffix = versionTag.@suffix ?: isEAP ? "EAP" : null
|
||||
minorVersionMainPart = minorVersion.takeWhile { it != '.' }
|
||||
|
||||
shortProductName = root.names.first().@product
|
||||
def namesTag = root.names.first()
|
||||
shortProductName = namesTag.@product
|
||||
String buildNumber = root.build.first().@number
|
||||
int productCodeSeparator = buildNumber.indexOf('-')
|
||||
if (productCodeSeparator != -1) {
|
||||
productCode = buildNumber.substring(0, productCodeSeparator)
|
||||
}
|
||||
productName = root.names.first().@fullname ?: shortProductName
|
||||
edition = root.names.first().@edition
|
||||
motto = root.names.first().@motto
|
||||
companyName = root.company.first().@name
|
||||
minorVersionMainPart = minorVersion.takeWhile { it != '.' }
|
||||
shortCompanyName = root.company.first().@shortName ?: shortenCompanyName(companyName)
|
||||
productName = namesTag.@fullname ?: shortProductName
|
||||
edition = namesTag.@edition
|
||||
motto = namesTag.@motto
|
||||
|
||||
def companyTag = root.company.first()
|
||||
companyName = companyTag.@name
|
||||
shortCompanyName = companyTag.@shortName ?: shortenCompanyName(companyName)
|
||||
|
||||
def svgPath = root.icon.first().@svg
|
||||
svgRelativePath = isEAP && !root."icon-eap".isEmpty() ? (root."icon-eap".first().@svg ?: svgPath) : svgPath
|
||||
|
||||
svgProductIcons = (root.icon + root."icon-eap").collectMany { [it?.@"svg", it?.@"svg-small"] }.findAll { it != null }
|
||||
|
||||
patchesUrl = root."update-urls".first()?.@"patches"
|
||||
}
|
||||
|
||||
String getUpperCaseProductName() { shortProductName.toUpperCase() }
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.intellij.build
|
||||
|
||||
import groovy.transform.CompileStatic
|
||||
@@ -34,6 +20,11 @@ abstract class LinuxDistributionCustomizer {
|
||||
*/
|
||||
List<String> extraExecutables = []
|
||||
|
||||
/**
|
||||
* When {@code true}, the launcher script will suggest downloading an x86 JRE when launched on a corresponding OS.
|
||||
*/
|
||||
boolean includeX86Files = true
|
||||
|
||||
/**
|
||||
* If {@code true} a separate *-no-jdk.tar.gz artifact without JRE will be produced
|
||||
*/
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.intellij.build
|
||||
|
||||
import groovy.transform.CompileStatic
|
||||
@@ -35,7 +21,8 @@ abstract class WindowsDistributionCustomizer {
|
||||
boolean includeBatchLaunchers = true
|
||||
|
||||
/**
|
||||
* If {@code false} only 64-bit *64.exe launcher and *64.exe.vmoptions files will be created.
|
||||
* When {@code false}, only 64-bit *64.exe launcher and *64.exe.vmoptions files will be created,
|
||||
* and no 32-bit JRE will be uploaded for the installer to suggest.
|
||||
*/
|
||||
boolean include32BitLauncher = true
|
||||
|
||||
@@ -101,12 +88,4 @@ abstract class WindowsDistributionCustomizer {
|
||||
String getUninstallFeedbackPageUrl(ApplicationInfoProperties applicationInfo) {
|
||||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned string is base part of a Url to tar.gz archive of JetBrains JRE x86 for windows.
|
||||
* The URL composed from two parts. The described base part and archive name (is generated by BundledJreManager.archiveNameJre).
|
||||
* The Url is used by windows installer to download and install JRE x86.
|
||||
* If the option is chosen by user JRE 64-bit and x86 will be installed together.
|
||||
*/
|
||||
String getBaseDownloadUrlForJre() { return null }
|
||||
}
|
||||
}
|
||||
@@ -436,14 +436,6 @@ idea.fatal.error.notification=disabled
|
||||
if (buildContext.options.bundledJreBuild != null) {
|
||||
args += "-Dintellij.build.bundled.jre.build=$buildContext.options.bundledJreBuild"
|
||||
}
|
||||
[
|
||||
'intellij.build.bundle.second.jre',
|
||||
'intellij.build.bundled.second.jre.build'
|
||||
].each { prop ->
|
||||
System.getProperty(prop)?.with {
|
||||
args += "-D$prop=$it"
|
||||
}
|
||||
}
|
||||
buildContext.gradle.run('Setting up JetBrains JREs', args)
|
||||
logFreeDiskSpace("after downloading JREs")
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.intellij.build.impl
|
||||
|
||||
import com.intellij.openapi.util.SystemInfo
|
||||
@@ -22,18 +22,6 @@ class BundledJreManager {
|
||||
this.baseDirectoryForJre = baseDirectoryForJre
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract JRE for Linux distribution of the product
|
||||
* @return path to the directory containing 'jre' subdirectory with extracted JRE
|
||||
*/
|
||||
String extractSecondBundledJreForLinux() {
|
||||
return extractSecondBundledJre(OsFamily.LINUX)
|
||||
}
|
||||
|
||||
boolean doBundleSecondJre() {
|
||||
return System.getProperty('intellij.build.bundle.second.jre', 'false').toBoolean()
|
||||
}
|
||||
|
||||
private String getJreBuild(OsFamily os) {
|
||||
loadDependencyVersions()
|
||||
return dependencyVersions.get("jreBuild_${os.jbrArchiveSuffix}" as String, buildContext.options.bundledJreBuild ?: dependencyVersions.get("jdkBuild", ""))
|
||||
@@ -43,11 +31,7 @@ class BundledJreManager {
|
||||
return buildContext.options.bundledJreVersion
|
||||
}
|
||||
|
||||
private int getSecondBundledJreVersion() {
|
||||
return 8
|
||||
}
|
||||
|
||||
/** @deprecated use {@link #extractJre(org.jetbrains.intellij.build.OsFamily)} instead to avoid hardcoding osName */
|
||||
/** @deprecated use {@link #extractJre(org.jetbrains.intellij.build.OsFamily)} instead to avoid hard-coding OS name */
|
||||
@Deprecated
|
||||
String extractJre(String osName) {
|
||||
return extractJre(OsFamily.ALL.find { it.jbrArchiveSuffix == osName })
|
||||
@@ -59,55 +43,20 @@ class BundledJreManager {
|
||||
buildContext.messages.info("JRE is already extracted to $targetDir")
|
||||
return targetDir
|
||||
}
|
||||
|
||||
File archive = findArchive(os, getJreBuild(os), getJreVersion(), jrePrefix(), arch)
|
||||
if (archive == null) {
|
||||
return null
|
||||
}
|
||||
buildContext.messages.block("Extract $archive.absolutePath JRE") {
|
||||
String destination = "$targetDir/jbr"
|
||||
if (archive == null) return null
|
||||
|
||||
String destination = "${targetDir}/${arch == JvmArchitecture.x32 ? "jre32" : "jbr"}"
|
||||
buildContext.messages.block("Extracting ${archive} into ${destination}") {
|
||||
def destinationDir = new File(destination)
|
||||
if (destinationDir.exists()) destinationDir.deleteDir()
|
||||
untar(archive, destination, isBundledJreModular())
|
||||
}
|
||||
|
||||
if (arch == JvmArchitecture.x32) {
|
||||
File archiveX32 = findArchive(os, getJreBuild(os), getJreVersion(), jrePrefix(), JvmArchitecture.x32)
|
||||
if (archiveX32.exists()) {
|
||||
buildContext.messages.block("Extract $archiveX32.name jre32") {
|
||||
String destination = "$targetDir/jbr"
|
||||
if (os == OsFamily.WINDOWS) {
|
||||
destination = "$targetDir/jre32"
|
||||
}
|
||||
buildContext.messages.progress("Extracting JRE from '$archiveX32.name' archive to $destination")
|
||||
untar(archiveX32, destination, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
return targetDir
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract JRE for Windows distribution of the product
|
||||
* @return path to the directory containing 'jre' subdirectory with extracted JRE
|
||||
*/
|
||||
String extractSecondBundledJreForWin(JvmArchitecture arch) {
|
||||
return extractSecondBundledJre(OsFamily.WINDOWS, arch)
|
||||
}
|
||||
|
||||
/**
|
||||
* Return path to a .tar.gz archive containing distribution of JRE for macOS which will be bundled with the product
|
||||
*/
|
||||
String findSecondBundledJreArchiveForMac() {
|
||||
return findSecondBundledJreArchive(OsFamily.MACOS)?.absolutePath
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a .tar.gz archive containing distribution of JRE for Win OS which will be bundled with the product
|
||||
*/
|
||||
File findSecondBundledJreArchiveForWin(JvmArchitecture arch) {
|
||||
return findSecondBundledJreArchive(OsFamily.WINDOWS, arch)
|
||||
}
|
||||
|
||||
/** @deprecated use {@link #findJreArchive(org.jetbrains.intellij.build.OsFamily, org.jetbrains.intellij.build.JvmArchitecture)} instead */
|
||||
@Deprecated
|
||||
File findJreArchive(String osName, JvmArchitecture arch = JvmArchitecture.x64) {
|
||||
@@ -118,33 +67,12 @@ class BundledJreManager {
|
||||
return findArchive(os, getJreBuild(os), getJreVersion(), jrePrefix(), arch)
|
||||
}
|
||||
|
||||
String archiveNameJre(BuildContext buildContext) {
|
||||
return "jre-for-${buildContext.buildNumber}.tar.gz"
|
||||
String x86JreDownloadUrl(OsFamily os) {
|
||||
def patchesUrl = buildContext.applicationInfo.patchesUrl
|
||||
return patchesUrl != null ? "${patchesUrl}${x86JreArchiveName(os)}" : null
|
||||
}
|
||||
|
||||
private String extractSecondBundledJre(OsFamily os, JvmArchitecture arch = JvmArchitecture.x64) {
|
||||
String targetDir = arch == JvmArchitecture.x64 ?
|
||||
"$baseDirectoryForJre/jre.$os.jbrArchiveSuffix$arch.fileSuffix" :
|
||||
"$baseDirectoryForJre/jre.${os.jbrArchiveSuffix}32"
|
||||
if (new File(targetDir).exists()) {
|
||||
buildContext.messages.info("JRE is already extracted to $targetDir")
|
||||
return targetDir
|
||||
}
|
||||
|
||||
File archive = findSecondBundledJreArchive(os, arch)
|
||||
if (archive == null) {
|
||||
return null
|
||||
}
|
||||
buildContext.messages.block("Extract $archive.name JRE") {
|
||||
String destination = "$targetDir/jbr"
|
||||
if (os == OsFamily.WINDOWS && arch == JvmArchitecture.x32) {
|
||||
destination = "$targetDir/jre32"
|
||||
}
|
||||
buildContext.messages.progress("Extracting JRE from '$archive.name' archive")
|
||||
untar(archive, destination, isSecondBundledJreModular())
|
||||
}
|
||||
return targetDir
|
||||
}
|
||||
private String x86JreArchiveName(OsFamily os) { "jre-for-${buildContext.buildNumber}-${os.jbrArchiveSuffix}-x86.tar.gz" }
|
||||
|
||||
/**
|
||||
* @param archive linux or windows JRE archive
|
||||
@@ -213,10 +141,6 @@ class BundledJreManager {
|
||||
"${update}-${os.jbrArchiveSuffix}-${arch == JvmArchitecture.x32 ? 'x86' : 'x64'}-${build}.tar.gz"
|
||||
}
|
||||
|
||||
private File findSecondBundledJreArchive(OsFamily os, JvmArchitecture arch = JvmArchitecture.x64) {
|
||||
return findArchive(os, secondBundledJreBuild, secondBundledJreVersion, null, arch)
|
||||
}
|
||||
|
||||
private File findArchive(OsFamily os, String jreBuild,
|
||||
int jreVersion, String jrePrefix,
|
||||
JvmArchitecture arch) {
|
||||
@@ -226,7 +150,7 @@ class BundledJreManager {
|
||||
jrePrefix = jreVersion < 9 && buildContext.productProperties.toolsJarRequired ? "jbrx-" : "jbr-"
|
||||
}
|
||||
def jreArchive = new File(jreDir, "$jrePrefix$suffix")
|
||||
if (!jreArchive.file || !jreArchive.exists()) {
|
||||
if (!jreArchive.file) {
|
||||
def errorMessage = "Cannot extract $os.osName JRE: file $jreArchive is not found (${jreDir.listFiles()})"
|
||||
if (buildContext.options.isInDevelopmentMode) {
|
||||
buildContext.messages.warning(errorMessage)
|
||||
@@ -256,26 +180,10 @@ class BundledJreManager {
|
||||
}
|
||||
}
|
||||
|
||||
private String getSecondBundledJreBuild() {
|
||||
if (!doBundleSecondJre()) {
|
||||
throw new IllegalArgumentException("Second JBR won't be bundled, unable to determine build")
|
||||
}
|
||||
def build = System.getProperty("intellij.build.bundled.second.jre.build")
|
||||
if (build == null) {
|
||||
loadDependencyVersions()
|
||||
build = dependencyVersions.get('secondJreBuild')
|
||||
}
|
||||
return build
|
||||
}
|
||||
|
||||
String jrePrefix() {
|
||||
return System.getProperty("intellij.build.bundled.jre.prefix")
|
||||
}
|
||||
|
||||
String secondJreSuffix() {
|
||||
return "-jbr8"
|
||||
}
|
||||
|
||||
/**
|
||||
* If {@code true} then bundled JRE version is 9+
|
||||
*/
|
||||
@@ -283,17 +191,6 @@ class BundledJreManager {
|
||||
return buildContext.options.bundledJreVersion >= 9
|
||||
}
|
||||
|
||||
boolean is32JreSupported() {
|
||||
return buildContext.options.bundledJreVersion <= 11
|
||||
}
|
||||
|
||||
/**
|
||||
* If {@code true} then second bundled JRE version is 9+
|
||||
*/
|
||||
boolean isSecondBundledJreModular() {
|
||||
return secondBundledJreVersion.toInteger() >= 9
|
||||
}
|
||||
|
||||
private final Map<File, String> jbrArchiveInspectionCache = new ConcurrentHashMap<>()
|
||||
|
||||
/**
|
||||
@@ -317,4 +214,28 @@ class BundledJreManager {
|
||||
String jbrRootDir(File archive) {
|
||||
hasJbrRootDir(archive) ? jbrArchiveInspectionCache[archive] : null
|
||||
}
|
||||
|
||||
@CompileDynamic
|
||||
void repackageX86Jre(OsFamily osFamily) {
|
||||
buildContext.messages.info("Packaging x86 JRE for ${osFamily}")
|
||||
|
||||
if (x86JreDownloadUrl(osFamily) == null) {
|
||||
buildContext.messages.warning("... skipped: download URL is unknown")
|
||||
return
|
||||
}
|
||||
|
||||
def jreDirectoryPath = extractJre(osFamily, JvmArchitecture.x32)
|
||||
if (jreDirectoryPath == null) {
|
||||
buildContext.messages.warning("... skipped: JRE archive not found")
|
||||
return
|
||||
}
|
||||
|
||||
def artifactPath = "${buildContext.paths.artifacts}/${x86JreArchiveName(osFamily)}"
|
||||
buildContext.ant.tar(tarfile: artifactPath, longfile: "gnu", compression: "gzip") {
|
||||
tarfileset(dir: "${jreDirectoryPath}/jre32") {
|
||||
include(name: "**/**")
|
||||
}
|
||||
}
|
||||
buildContext.notifyArtifactBuilt(artifactPath)
|
||||
}
|
||||
}
|
||||
@@ -52,16 +52,11 @@ class LinuxDistributionBuilder extends OsSpecificDistributionBuilder {
|
||||
buildTarGz(null, osSpecificDistPath, "-no-jbr")
|
||||
}
|
||||
}
|
||||
if (buildContext.bundledJreManager.doBundleSecondJre()) {
|
||||
String jreDirectoryPath = buildContext.bundledJreManager.extractSecondBundledJreForLinux()
|
||||
if (jreDirectoryPath != null) {
|
||||
buildTarGz(jreDirectoryPath, osSpecificDistPath, buildContext.bundledJreManager.secondJreSuffix())
|
||||
}
|
||||
else {
|
||||
buildContext.messages.info("Skipping building Linux distribution with bundled JRE because JRE archive is missing")
|
||||
}
|
||||
|
||||
if (customizer.includeX86Files) {
|
||||
buildContext.bundledJreManager.repackageX86Jre(OsFamily.LINUX)
|
||||
}
|
||||
// Used for Snap packages
|
||||
|
||||
String jreDirectoryPath = buildContext.bundledJreManager.extractJre(OsFamily.LINUX)
|
||||
buildTarGz(jreDirectoryPath, osSpecificDistPath, "")
|
||||
|
||||
|
||||
@@ -99,15 +99,8 @@ class MacDistributionBuilder extends OsSpecificDistributionBuilder {
|
||||
buildContext.executeStep("Build .dmg artifact for macOS", BuildOptions.MAC_DMG_STEP) {
|
||||
boolean notarize = SystemProperties.getBooleanProperty("intellij.build.mac.notarize", true) &&
|
||||
!SystemProperties.getBooleanProperty("build.is.personal", false)
|
||||
// With second JRE
|
||||
def jreManager = buildContext.bundledJreManager
|
||||
if (jreManager.doBundleSecondJre()) {
|
||||
MacDmgBuilder.signAndBuildDmg(buildContext, customizer, buildContext.proprietaryBuildTools.macHostProperties, macZipPath,
|
||||
jreManager.findSecondBundledJreArchiveForMac(), jreManager.isSecondBundledJreModular(),
|
||||
jreManager.secondJreSuffix(),
|
||||
false) // Disabled because JBR 8 cannot be notarized successfully
|
||||
}
|
||||
// With first aka main JRE
|
||||
// With JRE
|
||||
File jreArchive = jreManager.findJreArchive(OsFamily.MACOS)
|
||||
if (jreArchive.file) {
|
||||
MacDmgBuilder.signAndBuildDmg(buildContext, customizer, buildContext.proprietaryBuildTools.macHostProperties, macZipPath,
|
||||
|
||||
@@ -4,7 +4,7 @@ package org.jetbrains.intellij.build.impl
|
||||
import com.intellij.openapi.util.SystemInfo
|
||||
import org.jetbrains.annotations.Nullable
|
||||
import org.jetbrains.intellij.build.BuildContext
|
||||
import org.jetbrains.intellij.build.JvmArchitecture
|
||||
import org.jetbrains.intellij.build.OsFamily
|
||||
import org.jetbrains.intellij.build.WindowsDistributionCustomizer
|
||||
|
||||
import static com.intellij.openapi.util.io.FileUtil.toSystemDependentName
|
||||
@@ -59,7 +59,6 @@ class WinExeInstallerBuilder {
|
||||
}
|
||||
|
||||
void buildInstaller(String winDistPath, String additionalDirectoryToInclude, String suffix, boolean jre32BitVersionSupported) {
|
||||
|
||||
if (!SystemInfo.isWindows && !SystemInfo.isLinux) {
|
||||
buildContext.messages.warning("Windows installer can be built only under Windows or Linux")
|
||||
return
|
||||
@@ -101,13 +100,6 @@ class WinExeInstallerBuilder {
|
||||
|
||||
generator.generateInstallerFile(new File(box, "nsiconf/idea_win.nsh"))
|
||||
|
||||
if (buildContext.bundledJreManager.doBundleSecondJre()) {
|
||||
String jre32Dir = buildContext.bundledJreManager.extractSecondBundledJreForWin(JvmArchitecture.x32)
|
||||
if (jre32Dir != null) {
|
||||
generator.addDirectory(jre32Dir)
|
||||
}
|
||||
}
|
||||
|
||||
generator.generateUninstallerFile(new File(box, "nsiconf/unidea_win.nsh"))
|
||||
}
|
||||
catch (IOException e) {
|
||||
@@ -178,8 +170,7 @@ class WinExeInstallerBuilder {
|
||||
|
||||
def extensionsList = getFileAssociations()
|
||||
def fileAssociations = extensionsList.isEmpty() ? "NoAssociation" : extensionsList.join(",")
|
||||
def linkToJre = customizer.getBaseDownloadUrlForJre() != null ?
|
||||
"${customizer.getBaseDownloadUrlForJre()}/${buildContext.bundledJreManager.archiveNameJre(buildContext)}" : null
|
||||
def linkToX86Jre = customizer.include32BitLauncher ? buildContext.bundledJreManager.x86JreDownloadUrl(OsFamily.WINDOWS) : null
|
||||
new File(box, "nsiconf/strings.nsi").text = """
|
||||
!define MANUFACTURER "${buildContext.applicationInfo.shortCompanyName}"
|
||||
!define MUI_PRODUCT "${customizer.getFullNameIncludingEdition(buildContext.applicationInfo)}"
|
||||
@@ -192,7 +183,7 @@ class WinExeInstallerBuilder {
|
||||
!define PRODUCT_HEADER_FILE "headerlogo.bmp"
|
||||
!define ASSOCIATION "$fileAssociations"
|
||||
!define UNINSTALL_WEB_PAGE "${customizer.getUninstallFeedbackPageUrl(buildContext.applicationInfo) ?: "feedback_web_page"}"
|
||||
!define LINK_TO_JRE "$linkToJre"
|
||||
!define LINK_TO_JRE "$linkToX86Jre"
|
||||
!define JRE_32BIT_VERSION_SUPPORTED "${jre32BitVersionSupported ? 1 : 0 }"
|
||||
|
||||
; if SHOULD_SET_DEFAULT_INSTDIR != 0 then default installation directory will be directory where highest-numbered IDE build has been installed
|
||||
|
||||
@@ -67,51 +67,21 @@ class WindowsDistributionBuilder extends OsSpecificDistributionBuilder {
|
||||
|
||||
@Override
|
||||
void buildArtifacts(String winDistPath) {
|
||||
def jreSuffix = buildContext.bundledJreManager.secondJreSuffix()
|
||||
String jreDirectoryPath64 = null
|
||||
//do not include win32 launcher into winzip with 9+ jbr bundled
|
||||
List<String> excludeList = ["bin/${buildContext.productProperties.baseFileName}.exe", "bin/${buildContext.productProperties.baseFileName}.exe.vmoptions"]
|
||||
if (buildContext.bundledJreManager.doBundleSecondJre()) {
|
||||
jreDirectoryPath64 = buildContext.bundledJreManager.extractSecondBundledJreForWin(JvmArchitecture.x64)
|
||||
List<String> jreDirectoryPaths = [jreDirectoryPath64]
|
||||
|
||||
if (customizer.buildZipArchive) {
|
||||
buildWinZip(jreDirectoryPaths.findAll { it != null }, "${jreSuffix}.win", winDistPath, [])
|
||||
}
|
||||
}
|
||||
|
||||
if (customizer.getBaseDownloadUrlForJre() != null) {
|
||||
File archive = buildContext.bundledJreManager.findJreArchive(OsFamily.WINDOWS,JvmArchitecture.x32)
|
||||
if (archive != null && archive.exists()) {
|
||||
//prepare folder with jre x86 for win archive
|
||||
def jreDirectoryPath = buildContext.bundledJreManager.extractJre(OsFamily.WINDOWS, JvmArchitecture.x32)
|
||||
buildContext.ant.tar(tarfile: "${buildContext.paths.artifacts}/${buildContext.bundledJreManager.archiveNameJre(buildContext)}", longfile: "gnu", compression: "gzip") {
|
||||
tarfileset(dir: "${jreDirectoryPath}/jre32") {
|
||||
include(name: "**/**")
|
||||
}
|
||||
}
|
||||
}
|
||||
if (customizer.include32BitLauncher) {
|
||||
buildContext.bundledJreManager.repackageX86Jre(OsFamily.WINDOWS)
|
||||
}
|
||||
|
||||
def jreDirectoryPath = buildContext.bundledJreManager.extractJre(OsFamily.WINDOWS)
|
||||
if (customizer.buildZipArchive) {
|
||||
buildWinZip([jreDirectoryPath], ".win", winDistPath, excludeList)
|
||||
buildWinZip([jreDirectoryPath], ".win", winDistPath)
|
||||
}
|
||||
|
||||
buildContext.executeStep("Build Windows Exe Installer", BuildOptions.WINDOWS_EXE_INSTALLER_STEP) {
|
||||
def productJsonDir = new File(buildContext.paths.temp, "win.dist.product-info.json.exe").absolutePath
|
||||
if (buildContext.bundledJreManager.doBundleSecondJre()) {
|
||||
generateProductJson(productJsonDir, jreDirectoryPath64 != null)
|
||||
new ProductInfoValidator(buildContext).validateInDirectory(productJsonDir, "", [winDistPath, jreDirectoryPath64], [])
|
||||
new WinExeInstallerBuilder(buildContext, customizer, jreDirectoryPath64)
|
||||
.buildInstaller(winDistPath, productJsonDir,
|
||||
buildContext.bundledJreManager.secondJreSuffix(),
|
||||
!buildContext.bundledJreManager.secondBundledJreModular)
|
||||
}
|
||||
generateProductJson(productJsonDir, jreDirectoryPath != null)
|
||||
new ProductInfoValidator(buildContext).validateInDirectory(productJsonDir, "", [winDistPath, jreDirectoryPath], [])
|
||||
new WinExeInstallerBuilder(buildContext, customizer, jreDirectoryPath)
|
||||
.buildInstaller(winDistPath, productJsonDir, '', buildContext.bundledJreManager.is32JreSupported())
|
||||
.buildInstaller(winDistPath, productJsonDir, '', buildContext.windowsDistributionCustomizer.include32BitLauncher)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,7 +215,7 @@ IDS_VM_OPTIONS=$vmOptions
|
||||
return patchedFile
|
||||
}
|
||||
|
||||
private void buildWinZip(List<String> jreDirectoryPaths, String zipNameSuffix, String winDistPath, List<String> excludeList = [] ) {
|
||||
private void buildWinZip(List<String> jreDirectoryPaths, String zipNameSuffix, String winDistPath) {
|
||||
buildContext.messages.block("Build Windows ${zipNameSuffix}.zip distribution") {
|
||||
def baseName = buildContext.productProperties.getBaseArtifactName(buildContext.applicationInfo, buildContext.buildNumber)
|
||||
def targetPath = "${buildContext.paths.artifacts}/${baseName}${zipNameSuffix}.zip"
|
||||
@@ -257,11 +227,7 @@ IDS_VM_OPTIONS=$vmOptions
|
||||
dirs += [productJsonDir]
|
||||
buildContext.ant.zip(zipfile: targetPath) {
|
||||
dirs.each {
|
||||
zipfileset(dir: it, prefix: zipPrefix) {
|
||||
excludeList.each {
|
||||
exclude(name: it)
|
||||
}
|
||||
}
|
||||
zipfileset(dir: it, prefix: zipPrefix)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed 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.
|
||||
*/
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.intellij.build.pycharm
|
||||
|
||||
import org.jetbrains.intellij.build.BuildContext
|
||||
@@ -29,7 +15,4 @@ class PyCharmWindowsDistributionCustomizer extends WindowsDistributionCustomizer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
String getBaseDownloadUrlForJre() { "https://download.jetbrains.com/python" }
|
||||
}
|
||||
Reference in New Issue
Block a user