mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Edit custom properties/vmoptions actions: create custom files in config folder
IDEA-44583 idea.exe.vmoptions
IDEA-162100 Couldn't start IDE from .bat file if custom VM options file is created
IDEA-153020 phpstorm64.exe.vmoptions isn't migrated when updating from 11 to 2016.1
IDEA-158628 Custom properties file is not preserved when importing if config folder was customized
RUBY-18389 why is the per user .vmoptions file in "{config_folder}" rather than "{config_folder}\config" with the rest of configuration?
This commit is contained in:
@@ -158,9 +158,9 @@ VM_OPTIONS_FILE=""
|
||||
if [ -n "$@@product_uc@@_VM_OPTIONS" -a -r "$@@product_uc@@_VM_OPTIONS" ]; then
|
||||
# explicit
|
||||
VM_OPTIONS_FILE="$@@product_uc@@_VM_OPTIONS"
|
||||
elif [ -r "$HOME/.@@system_selector@@/@@vm_options@@$BITS.vmoptions" ]; then
|
||||
elif [ -r "$HOME/.@@system_selector@@/config/@@vm_options@@$BITS.vmoptions" ]; then
|
||||
# user-overridden
|
||||
VM_OPTIONS_FILE="$HOME/.@@system_selector@@/@@vm_options@@$BITS.vmoptions"
|
||||
VM_OPTIONS_FILE="$HOME/.@@system_selector@@/config/@@vm_options@@$BITS.vmoptions"
|
||||
elif [ -r "$IDE_BIN_HOME/@@vm_options@@$BITS.vmoptions" ]; then
|
||||
# default, standard installation
|
||||
VM_OPTIONS_FILE="$IDE_BIN_HOME/@@vm_options@@$BITS.vmoptions"
|
||||
|
||||
@@ -64,14 +64,14 @@ IF EXIST "%JRE%\lib\amd64" SET BITS=64
|
||||
:: ---------------------------------------------------------------------
|
||||
IF NOT "%@@product_uc@@_PROPERTIES%" == "" SET IDE_PROPERTIES_PROPERTY="-Didea.properties.file=%@@product_uc@@_PROPERTIES%"
|
||||
|
||||
SET USER_VM_OPTIONS_FILE=%USERPROFILE%\.@@system_selector@@\@@vm_options@@.vmoptions
|
||||
SET USER_VM_OPTIONS_FILE=%USERPROFILE%\.@@system_selector@@\config\@@vm_options@@.vmoptions
|
||||
SET VM_OPTIONS_FILE=%IDE_BIN_DIR%\@@vm_options@@.vmoptions
|
||||
IF EXIST "%IDE_BIN_DIR%\win\@@vm_options@@.vmoptions" SET VM_OPTIONS_FILE=%IDE_BIN_DIR%\win\@@vm_options@@.vmoptions
|
||||
IF EXIST %USER_VM_OPTIONS_FILE% SET VM_OPTIONS_FILE=%USER_VM_OPTIONS_FILE%
|
||||
IF NOT "%@@product_uc@@_VM_OPTIONS%" == "" SET VM_OPTIONS_FILE=%@@product_uc@@_VM_OPTIONS%
|
||||
|
||||
SET ACC=
|
||||
FOR /F "usebackq delims=" %%i IN ("%VM_OPTIONS_FILE%") DO CALL "%IDE_BIN_DIR%\append.bat" "%%i"
|
||||
FOR /F "eol=# usebackq delims=" %%i IN ("%VM_OPTIONS_FILE%") DO CALL "%IDE_BIN_DIR%\append.bat" "%%i"
|
||||
IF EXIST "%VM_OPTIONS_FILE%" SET ACC=%ACC% -Djb.vmOptionsFile="%VM_OPTIONS_FILE%"
|
||||
|
||||
SET COMMON_JVM_ARGS="-XX:ErrorFile=%USERPROFILE%\java_error_in_@@product_uc@@_%%p.log" "-XX:HeapDumpPath=%USERPROFILE%\java_error_in_@@product_uc@@.hprof" "-Xbootclasspath/a:%IDE_HOME%/lib/boot.jar" -Didea.paths.selector=@@system_selector@@ %IDE_PROPERTIES_PROPERTY%
|
||||
|
||||
+4
-4
@@ -82,7 +82,7 @@ class WindowsDistributionBuilder extends OsSpecificDistributionBuilder {
|
||||
void buildArtifacts(String winDistPath) {
|
||||
def arch = customizer.bundledJreArchitecture
|
||||
def jreDirectoryPath64 = arch != null ? buildContext.bundledJreManager.extractWinJre(arch) : null
|
||||
List<String> jreDirectoryPaths = [jreDirectoryPath64];
|
||||
List<String> jreDirectoryPaths = [jreDirectoryPath64]
|
||||
|
||||
if (customizer.getBaseDownloadUrlForJre() != null && arch != JvmArchitecture.x32) {
|
||||
File archive = buildContext.bundledJreManager.findWinJreArchive(JvmArchitecture.x32)
|
||||
@@ -94,7 +94,7 @@ class WindowsDistributionBuilder extends OsSpecificDistributionBuilder {
|
||||
include(name: "**/**")
|
||||
}
|
||||
}
|
||||
jreDirectoryPaths = [jreDirectoryPath64, jreDirectoryPath];
|
||||
jreDirectoryPaths = [jreDirectoryPath64, jreDirectoryPath]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,14 +178,14 @@ class WindowsDistributionBuilder extends OsSpecificDistributionBuilder {
|
||||
String vmOptions = "$buildContext.additionalJvmArguments -Didea.paths.selector=${buildContext.systemSelector}".trim()
|
||||
def productName = buildContext.applicationInfo.shortProductName
|
||||
|
||||
String jdkEnvVarSuffix = arch == JvmArchitecture.x64 && customizer.include32BitLauncher ? "_64" : "";
|
||||
String jdkEnvVarSuffix = arch == JvmArchitecture.x64 && customizer.include32BitLauncher ? "_64" : ""
|
||||
String vmOptionsEnvVarSuffix = arch == JvmArchitecture.x64 && customizer.include32BitLauncher ? "64" : ""
|
||||
def envVarBaseName = buildContext.productProperties.getEnvironmentVariableBaseName(buildContext.applicationInfo)
|
||||
new File(launcherPropertiesPath).text = """
|
||||
IDS_JDK_ONLY=$buildContext.productProperties.toolsJarRequired
|
||||
IDS_JDK_ENV_VAR=${envVarBaseName}_JDK$jdkEnvVarSuffix
|
||||
IDS_APP_TITLE=$productName Launcher
|
||||
IDS_VM_OPTIONS_PATH=%USERPROFILE%\\\\.$buildContext.systemSelector
|
||||
IDS_VM_OPTIONS_PATH=%USERPROFILE%\\\\.$buildContext.systemSelector\\\\config
|
||||
IDS_VM_OPTION_ERRORFILE=-XX:ErrorFile=%USERPROFILE%\\\\java_error_in_${lowerCaseProductName}_%p.log
|
||||
IDS_VM_OPTION_HEAPDUMPPATH=-XX:HeapDumpPath=%USERPROFILE%\\\\java_error_in_${lowerCaseProductName}.hprof
|
||||
IDC_WINLAUNCHER=${upperCaseProductName}_LAUNCHER
|
||||
|
||||
@@ -231,7 +231,7 @@ public class PathManager {
|
||||
@Nullable
|
||||
public static String getCustomOptionsDirectory() {
|
||||
// do not use getConfigPath() here - as it may be not yet defined
|
||||
return PATHS_SELECTOR != null ? platformPath(PATHS_SELECTOR, "Library/Preferences", "") : null;
|
||||
return PATHS_SELECTOR != null ? getDefaultConfigPathFor(PATHS_SELECTOR) : null;
|
||||
}
|
||||
|
||||
// runtime paths
|
||||
|
||||
Reference in New Issue
Block a user