solara 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a5686de4e3afa52cdec8223d3e990d10b3056c4a72d2332a4c376b674966aac
|
4
|
+
data.tar.gz: 740cbc01a18278920f9722b94f0987c10c55602ee727badb945db19866ee741a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 706950176d1fd66f1e10efa9b83d991f444e018bd9cb0282eb74d133a2181fa081a606c91db12f2f9d7e6ce9ae1829e147481949b94acd79d5930263339c9399
|
7
|
+
data.tar.gz: '08f25956658174869cc3a71223c842a58323448177dce4c5dbb07f6808f2e76105eaec0d3120e6dfe16865c08f4ada4bf11465c2732dd2351e1eec60c11d8af4'
|
@@ -53,6 +53,28 @@ project.ext {
|
|
53
53
|
|
54
54
|
private
|
55
55
|
|
56
|
+
def write_if_needed(file_path, new_content)
|
57
|
+
return unless File.exist?(file_path)
|
58
|
+
|
59
|
+
current_content = File.read(file_path)
|
60
|
+
if normalize_content(new_content) != normalize_content(current_content)
|
61
|
+
File.write(file_path, new_content)
|
62
|
+
Solara.logger.debug("Updated #{file_path}")
|
63
|
+
return true
|
64
|
+
end
|
65
|
+
|
66
|
+
Solara.logger.debug("No changes needed for #{file_path}")
|
67
|
+
false
|
68
|
+
end
|
69
|
+
|
70
|
+
def normalize_content(content)
|
71
|
+
# Remove empty lines and normalize whitespace
|
72
|
+
content.lines
|
73
|
+
.map(&:strip)
|
74
|
+
.reject(&:empty?)
|
75
|
+
.join("\n")
|
76
|
+
end
|
77
|
+
|
56
78
|
def update_gradle(gradle_file, gradle_content)
|
57
79
|
properties_loader = @is_kotlin_gradle ? KOTLIN_PROPERTIES_LOADER : GROOVY_PROPERTIES_LOADER
|
58
80
|
original_content = gradle_content.dup
|
@@ -93,23 +115,11 @@ project.ext {
|
|
93
115
|
|
94
116
|
gradle_content.sub!(android_block_regex, updated_android_block)
|
95
117
|
|
96
|
-
|
97
|
-
if normalize_content(gradle_content) != normalize_content(original_content)
|
98
|
-
File.write(gradle_file, gradle_content)
|
118
|
+
if write_if_needed(gradle_file, gradle_content)
|
99
119
|
Solara.logger.debug("Updated #{gradle_file} (#{@is_kotlin_gradle ? 'Kotlin' : 'Groovy'}) to use brand.properties")
|
100
|
-
else
|
101
|
-
Solara.logger.debug("No changes needed for #{gradle_file}")
|
102
120
|
end
|
103
121
|
end
|
104
122
|
|
105
|
-
def normalize_content(content)
|
106
|
-
# Remove empty lines and normalize whitespace
|
107
|
-
content.lines
|
108
|
-
.map(&:strip)
|
109
|
-
.reject(&:empty?)
|
110
|
-
.join("\n")
|
111
|
-
end
|
112
|
-
|
113
123
|
def add_source_sets(gradle_file)
|
114
124
|
content = File.read(gradle_file)
|
115
125
|
|
@@ -139,8 +149,7 @@ project.ext {
|
|
139
149
|
end
|
140
150
|
end
|
141
151
|
|
142
|
-
|
143
|
-
Solara.logger.debug("Source sets configuration updated successfully.")
|
152
|
+
write_if_needed(gradle_file, modified_content)
|
144
153
|
end
|
145
154
|
|
146
155
|
def generate_source_sets(source_sets_string)
|
@@ -197,12 +206,7 @@ project.ext {
|
|
197
206
|
modified_content.sub!(/(\s*android\s*\{)/) { "#{$1}\n #{new_config.strip}" }
|
198
207
|
end
|
199
208
|
|
200
|
-
|
201
|
-
File.write(gradle_file, modified_content)
|
202
|
-
Solara.logger.debug("Keystore configuration updated successfully.")
|
203
|
-
else
|
204
|
-
Solara.logger.debug("No changes were necessary for keystore configuration.")
|
205
|
-
end
|
209
|
+
write_if_needed(gradle_file, modified_content)
|
206
210
|
end
|
207
211
|
|
208
212
|
def generate_keystore_config
|