@@ -122,60 +122,64 @@ def scala_toolchains(
122
122
if specs2 :
123
123
junit = True
124
124
125
- artifact_ids = []
126
- fetch_sources_by_id = {}
125
+ artifact_ids_to_fetch_sources = {}
127
126
128
127
if scalatest :
129
- scalatest_artifacts = scalatest_artifact_ids ()
130
- artifact_ids .extend (scalatest_artifacts )
131
- fetch_sources_by_id .update ({id : True for id in scalatest_artifacts })
128
+ artifact_ids_to_fetch_sources .update ({
129
+ id : True
130
+ for id in scalatest_artifact_ids ()
131
+ })
132
132
if junit :
133
- junit_artifacts = junit_artifact_ids ()
134
- artifact_ids .extend (junit_artifacts )
135
- fetch_sources_by_id .update ({id : True for id in junit_artifacts })
133
+ artifact_ids_to_fetch_sources .update ({
134
+ id : True
135
+ for id in junit_artifact_ids ()
136
+ })
136
137
if specs2 :
137
- specs2_artifacts = specs2_artifact_ids () + specs2_junit_artifact_ids ()
138
- artifact_ids .extend (specs2_artifacts )
139
- fetch_sources_by_id .update ({id : True for id in specs2_artifacts })
138
+ artifact_ids_to_fetch_sources .update ({
139
+ id : True
140
+ for id in specs2_artifact_ids () + specs2_junit_artifact_ids ()
141
+ })
140
142
if jmh :
141
- jmh_artifacts = jmh_artifact_ids ()
142
- artifact_ids .extend (jmh_artifacts )
143
- fetch_sources_by_id .update ({id : False for id in jmh_artifacts })
143
+ artifact_ids_to_fetch_sources .update ({
144
+ id : False
145
+ for id in jmh_artifact_ids ()
146
+ })
144
147
if twitter_scrooge :
145
- scrooge_artifacts = twitter_scrooge_artifact_ids (
146
- libthrift = libthrift ,
147
- scrooge_core = scrooge_core ,
148
- scrooge_generator = scrooge_generator ,
149
- util_core = util_core ,
150
- util_logging = util_logging ,
151
- )
152
- artifact_ids .extend (scrooge_artifacts )
153
- fetch_sources_by_id .update ({id : False for id in scrooge_artifacts })
148
+ artifact_ids_to_fetch_sources .update ({
149
+ id : False
150
+ for id in twitter_scrooge_artifact_ids (
151
+ libthrift = libthrift ,
152
+ scrooge_core = scrooge_core ,
153
+ scrooge_generator = scrooge_generator ,
154
+ util_core = util_core ,
155
+ util_logging = util_logging ,
156
+ )
157
+ })
154
158
155
159
for scala_version in SCALA_VERSIONS :
156
- version_specific_artifact_ids = []
160
+ version_specific_artifact_ids = {}
157
161
158
162
if scala_proto :
159
- scala_proto_artifacts = scala_proto_artifact_ids (scala_version )
160
- version_specific_artifact_ids .extend (scala_proto_artifacts )
161
- fetch_sources_by_id .update ({
163
+ version_specific_artifact_ids .update ({
162
164
id : True
163
- for id in scala_proto_artifacts
165
+ for id in scala_proto_artifact_ids ( scala_version )
164
166
})
165
167
if scalafmt :
166
- version_specific_artifact_ids .extend (
167
- scalafmt_artifact_ids (scala_version ),
168
- )
168
+ version_specific_artifact_ids .update ({
169
+ id : fetch_sources
170
+ for id in scalafmt_artifact_ids (scala_version )
171
+ })
172
+
173
+ all_artifacts = (
174
+ artifact_ids_to_fetch_sources | version_specific_artifact_ids
175
+ )
169
176
170
177
repositories (
171
178
scala_version = scala_version ,
172
- for_artifact_ids = {
173
- id : True
174
- for id in (artifact_ids + version_specific_artifact_ids )
175
- }.keys (),
179
+ for_artifact_ids = all_artifacts .keys (),
176
180
maven_servers = maven_servers ,
177
181
fetch_sources = fetch_sources ,
178
- fetch_sources_by_id = fetch_sources_by_id ,
182
+ fetch_sources_by_id = all_artifacts ,
179
183
overriden_artifacts = overridden_artifacts ,
180
184
validate_scala_version = validate_scala_version ,
181
185
)
0 commit comments