Skip to content

Commit

Permalink
Rename jvmArgsDir to scenarioOptionsDir
Browse files Browse the repository at this point in the history
Signed-off-by: Sergey Opivalov <[email protected]>
  • Loading branch information
6hundreds committed Jul 19, 2023
1 parent fb7e6b0 commit 02badc1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ Here is an example:
android-studio-sync {
# Override default Android Studio jvm args
# studio-jvm-args = ["-Xms256m", "-Xmx4096m"]
# Pass an IDEA properties to Android Studio. This can be used to set registry values as well
# Pass an IDEA properties to Android Studio. This can be used to set a registry values as well
# idea-properties = ["gradle.tooling.models.parallel.fetch=true"]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import java.io.UncheckedIOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -66,18 +65,14 @@ private void logLauncherConfiguration(List<String> commandLine) {
System.out.println("* Start command: " + startCommand);
System.out.println("* Additional JVM args:");
additionalJvmArgs.forEach(arg -> System.out.println(" " + arg));
System.out.println("* Additional JVM args can be found at: " + studioSandbox.getJvmArgsDir().resolve("idea.vmoptions"));
System.out.println("* Additional JVM args can be found at: " + studioSandbox.getScenarioOptionsDir().resolve("idea.vmoptions"));
System.out.println("* Android Studio logs can be found at: " + studioSandbox.getLogsDir().resolve("idea.log"));
System.out.printf("* Using command line: %s%n%n", String.join(" ", commandLine));
}

private Map<String, String> writeIdeaProperties() {
if (!studioSandbox.getConfigDir().isPresent()) {
System.out.println("* idea.properties can be set only in the sandbox");
return Collections.emptyMap();
}
try {
Path ideaPropertiesFile = studioSandbox.getConfigDir().get().resolve("idea.properties").toAbsolutePath();
Path ideaPropertiesFile = studioSandbox.getScenarioOptionsDir().resolve("idea.properties").toAbsolutePath();
Files.write(ideaPropertiesFile, ideaProperties);
return ImmutableMap.<String, String>builder()
.put("STUDIO_PROPERTIES", ideaPropertiesFile.toString())
Expand All @@ -91,7 +86,7 @@ private Map<String, String> writeIdeaProperties() {

private Map<String, String> writeAdditionalJvmArgs() {
try {
Path additionJvmArgsFile = studioSandbox.getJvmArgsDir().resolve("idea.vmoptions").toAbsolutePath();
Path additionJvmArgsFile = studioSandbox.getScenarioOptionsDir().resolve("idea.vmoptions").toAbsolutePath();
Files.write(additionJvmArgsFile, additionalJvmArgs);
return ImmutableMap.<String, String>builder()
.put("STUDIO_VM_OPTIONS", additionJvmArgsFile.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ public static class StudioSandbox {
private final Path systemDir;
private final Path pluginsDir;
private final Path logsDir;
private final Path jvmArgsDir;
private final Path scenarioOptionsDir;

private StudioSandbox(@Nullable Path configDir, @Nullable Path systemDir, Path pluginsDir, Path logsDir, Path jvmArgsDir) {
private StudioSandbox(@Nullable Path configDir, @Nullable Path systemDir, Path pluginsDir, Path logsDir, Path scenarioOptionsDir) {
this.configDir = configDir;
this.systemDir = systemDir;
this.pluginsDir = pluginsDir;
this.logsDir = logsDir;
this.jvmArgsDir = jvmArgsDir;
this.scenarioOptionsDir = scenarioOptionsDir;
}

public Optional<Path> getConfigDir() {
Expand All @@ -114,8 +114,8 @@ public Path getLogsDir() {
return logsDir;
}

public Path getJvmArgsDir() {
return jvmArgsDir;
public Path getScenarioOptionsDir() {
return scenarioOptionsDir;
}

public Path getPluginsDir() {
Expand Down

0 comments on commit 02badc1

Please sign in to comment.