Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditionally save project.properties #3348

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,17 @@ public void storeProjectSettings(String userId, long projectId, String projectSe
YoungAndroidSettingsBuilder oldProperties = new YoungAndroidSettingsBuilder(properties);


// Project settings do not include the name and package (main). So we add them
// here so the comparison below is accurate. Before this change, we always write out the
// project properties file, even when there are no changes to it.
String projectName = properties.getProperty("name");
String qualifiedName = properties.getProperty("main");
newProperties.setProjectName(projectName)
.setQualifiedFormName(qualifiedName);

if (!oldProperties.equals(newProperties)) {
// Recreate the project.properties and upload it to storageIo.
String projectName = properties.getProperty("name");
String qualifiedName = properties.getProperty("main");
String newContent = newProperties.setProjectName(projectName)
.setQualifiedFormName(qualifiedName).toProperties();
String newContent = newProperties.toProperties();
storageIo.uploadFileForce(projectId, PROJECT_PROPERTIES_FILE_NAME, userId,
newContent, StorageUtil.DEFAULT_CHARSET);
}
Expand Down