1use std::collections::{BTreeMap, BTreeSet};
7use std::path::Path;
8
9use regex::Regex;
10use serde::Serialize;
11use serde_json::Value;
12use toml_edit::DocumentMut;
13
14use crate::analyze::{Report, Status, crate_for};
15use crate::lang::Lang;
16use crate::ts::deps::Fit;
17
18#[derive(Debug, Serialize)]
19pub struct WholeApp {
20 pub shape: &'static str,
22 pub entry_points: Vec<EntryPoint>,
23 pub dependencies: Vec<Dependency>,
25 pub pieces: Vec<Piece>,
27 pub decisions: Vec<Decision>,
29}
30
31#[derive(Debug, Clone, Serialize)]
32pub struct EntryPoint {
33 pub kind: &'static str,
35 pub path: String,
36 #[serde(skip_serializing_if = "Option::is_none")]
37 pub name: Option<String>,
38 pub evidence: String,
40}
41
42#[derive(Debug, Serialize)]
43pub struct Dependency {
44 pub name: String,
46 pub names: Vec<String>,
49 pub declared: bool,
52 pub used_by: usize,
54 pub crates: Option<&'static str>,
55 pub fit: &'static str,
57 pub note: &'static str,
58}
59
60#[derive(Debug, Serialize)]
61pub struct Piece {
62 pub wave: usize,
63 pub units: Vec<String>,
64 pub loc: usize,
65 pub tangled: bool,
67}
68
69#[derive(Debug, Serialize)]
70pub struct Decision {
71 pub id: String,
72 pub topic: String,
73 pub question: String,
74 pub recommendation: String,
75}
76
77const SERVER: &str = r#"WebApplication\.Create(?:Slim)?Builder|\bHttpListener\(|\.UseKestrel\(|\$_SERVER\[\s*['"]REQUEST_(?:METHOD|URI)|\$_(?:GET|POST)\[|\.listen\(|createServer\(|ListenAndServe|HTTPServer\(|HttpServer\.create|uvicorn\.run|\bapp\.run\(|SpringApplication\.run|TCPServer\.new|WEBrick::HTTPServer|Sinatra::Base|FastAPI\(|Flask\(|\bexpress\(\)|\blisten\(\s*\w+\s*,\s*\w+\s*\)|\bserve\(\s*listener"#;
78
79fn main_pattern(lang: Lang) -> Option<&'static str> {
80 Some(match lang {
81 Lang::Ts => r"^#!.*\bnode\b",
82 Lang::Python => r#"if\s+__name__\s*==\s*['"]__main__['"]"#,
83 Lang::Go => r"^func\s+main\s*\(\s*\)",
84 Lang::C => r"\bint\s+main\s*\(",
85 Lang::Ruby => r"^#!.*\bruby\b|\bARGV\b|__FILE__\s*==\s*\$0",
86 Lang::Java => r"public\s+static\s+void\s+main\s*\(",
87 Lang::Kotlin => r"\bfun\s+main\s*\(",
88 Lang::Php => r#"^#!.*\bphp\b|\$argv\b|PHP_SAPI\s*===?\s*['"]cli['"]"#,
89 Lang::Csharp => r"\bstatic\s+(?:async\s+)?(?:void|int|Task(?:<int>)?)\s+Main\s*\(",
90 Lang::Powershell => r"(?i)^#!.*\bpwsh\b|\$args\b|^\s*param\s*\(",
91 })
92}
93
94fn fit_label(fit: Option<Fit>) -> &'static str {
95 match fit {
96 Some(Fit::Good) => "good",
97 Some(Fit::Partial) => "partial",
98 Some(Fit::None) => "none",
99 None => "unknown",
100 }
101}
102
103fn read(root: &Path, file: &str) -> String {
104 std::fs::read_to_string(root.join(file)).unwrap_or_default()
105}
106
107fn manifest_entries(root: &Path, lang: Lang) -> Vec<EntryPoint> {
109 let mut out = Vec::new();
110 if let Ok(pkg) = serde_json::from_str::<Value>(&read(root, "package.json")) {
111 let name = pkg["name"].as_str().unwrap_or("app");
112 match &pkg["bin"] {
113 Value::String(path) => out.push(EntryPoint {
114 kind: "cli",
115 path: path.trim_start_matches("./").to_string(),
116 name: Some(name.rsplit('/').next().unwrap_or(name).to_string()),
117 evidence: "package.json `bin`".into(),
118 }),
119 Value::Object(bins) => {
120 for (bin, path) in bins {
121 out.push(EntryPoint {
122 kind: "cli",
123 path: path
124 .as_str()
125 .unwrap_or_default()
126 .trim_start_matches("./")
127 .to_string(),
128 name: Some(bin.clone()),
129 evidence: "package.json `bin`".into(),
130 });
131 }
132 }
133 _ => {}
134 }
135 }
136 if let Ok(doc) = read(root, "pyproject.toml").parse::<DocumentMut>() {
137 let tables = [
138 doc.get("project").and_then(|p| p.get("scripts")),
139 doc.get("tool")
140 .and_then(|t| t.get("poetry"))
141 .and_then(|p| p.get("scripts")),
142 ];
143 for table in tables.into_iter().flatten() {
144 if let Some(t) = table.as_table_like() {
145 for (name, target) in t.iter() {
146 out.push(EntryPoint {
147 kind: "cli",
148 path: target.as_str().unwrap_or_default().to_string(),
149 name: Some(name.to_string()),
150 evidence: "pyproject.toml scripts".into(),
151 });
152 }
153 }
154 }
155 }
156 if lang == Lang::Go
157 && let Ok(entries) = std::fs::read_dir(root.join("cmd"))
158 {
159 let mut dirs: Vec<String> = entries
160 .flatten()
161 .filter(|e| e.file_type().is_ok_and(|t| t.is_dir()))
162 .map(|e| e.file_name().to_string_lossy().into_owned())
163 .collect();
164 dirs.sort();
165 for dir in dirs {
166 out.push(EntryPoint {
167 kind: "cli",
168 path: format!("cmd/{dir}"),
169 name: Some(dir),
170 evidence: "a `cmd/` folder".into(),
171 });
172 }
173 }
174 if lang == Lang::Php {
175 if let Ok(doc) = serde_json::from_str::<Value>(&read(root, "composer.json")) {
176 for bin in doc["bin"]
177 .as_array()
178 .into_iter()
179 .flatten()
180 .filter_map(Value::as_str)
181 {
182 out.push(EntryPoint {
183 kind: "cli",
184 path: bin.trim_start_matches("./").to_string(),
185 name: Some(bin.rsplit('/').next().unwrap_or(bin).to_string()),
186 evidence: "composer.json `bin`".into(),
187 });
188 }
189 }
190 for front in ["public/index.php", "web/index.php", "index.php"] {
191 if root.join(front).is_file() {
192 out.push(EntryPoint {
193 kind: "server",
194 path: front.to_string(),
195 name: None,
196 evidence: format!("`{front}`, a front controller: serve it with `php -S`"),
197 });
198 break;
199 }
200 }
201 }
202 if lang == Lang::Csharp {
203 for project in csproj_files(root) {
204 let text = read(root, &project);
205 let dir = project
206 .rsplit_once('/')
207 .map_or(".".to_string(), |(d, _)| d.to_string());
208 let name = project
209 .rsplit('/')
210 .next()
211 .unwrap_or(&project)
212 .trim_end_matches(".csproj")
213 .to_string();
214 if text.contains("Microsoft.NET.Sdk.Web") {
215 out.push(EntryPoint {
216 kind: "server",
217 path: dir,
218 name: Some(name),
219 evidence: format!("`{project}` uses the web SDK"),
220 });
221 } else if text.contains("<OutputType>Exe</OutputType>") {
222 out.push(EntryPoint {
223 kind: "cli",
224 path: dir,
225 name: Some(name),
226 evidence: format!("`{project}` builds an executable"),
227 });
228 }
229 }
230 }
231 if lang == Lang::Ruby {
232 let gemspec = std::fs::read_dir(root)
233 .into_iter()
234 .flatten()
235 .flatten()
236 .find(|e| e.path().extension().is_some_and(|x| x == "gemspec"))
237 .map(|e| std::fs::read_to_string(e.path()).unwrap_or_default())
238 .unwrap_or_default();
239 let list = Regex::new(r#"executables\s*=\s*(?:\[([^\]]*)\]|%w[\[(]([^\])]*)[\])])"#)
240 .expect("valid regex");
241 if let Some(c) = list.captures(&gemspec) {
242 let names = c.get(1).or(c.get(2)).map_or("", |m| m.as_str());
243 for name in names
244 .split([',', ' ', '\n'])
245 .map(|n| n.trim().trim_matches(['"', '\'']))
246 .filter(|n| !n.is_empty())
247 {
248 out.push(EntryPoint {
249 kind: "cli",
250 path: format!("exe/{name}"),
251 name: Some(name.to_string()),
252 evidence: "gemspec `executables`".into(),
253 });
254 }
255 }
256 }
257 out
258}
259
260fn code_entries(root: &Path, report: &Report) -> Vec<EntryPoint> {
262 let server = Regex::new(SERVER).expect("valid regex");
263 let main = main_pattern(report.language).map(|p| {
264 regex::RegexBuilder::new(p)
265 .multi_line(true)
266 .build()
267 .expect("valid regex")
268 });
269 let mut files: Vec<&String> = report.units.iter().flat_map(|u| &u.files).collect();
270 files.sort();
271 files.dedup();
272 let mut out = Vec::new();
273 for file in files {
274 let text = read(root, file);
275 let line_of = |at: usize| text[..at].matches('\n').count() + 1;
276 if report.language == Lang::Go && !text.contains("package main") {
277 continue;
278 }
279 if let Some(m) = server.find(&text) {
280 out.push(EntryPoint {
281 kind: "server",
282 path: file.clone(),
283 name: None,
284 evidence: format!("`{}` at {file}:{}", m.as_str().trim(), line_of(m.start())),
285 });
286 } else if let Some(m) = main.as_ref().and_then(|re| re.find(&text)) {
287 out.push(EntryPoint {
288 kind: "cli",
289 path: file.clone(),
290 name: None,
291 evidence: format!("`{}` at {file}:{}", m.as_str().trim(), line_of(m.start())),
292 });
293 }
294 }
295 out
296}
297
298fn csproj_files(root: &Path) -> Vec<String> {
300 crate::walk::filtered(root, |e| {
301 !matches!(
302 e.file_name().to_string_lossy().as_ref(),
303 "bin" | "obj" | "node_modules"
304 )
305 })
306 .build()
307 .flatten()
308 .filter(|e| e.path().extension().is_some_and(|x| x == "csproj"))
309 .filter_map(|e| {
310 e.path()
311 .strip_prefix(root)
312 .ok()
313 .map(|p| p.to_string_lossy().replace('\\', "/"))
314 })
315 .collect()
316}
317
318pub fn declared(root: &Path, lang: Lang) -> BTreeSet<String> {
322 let ws = match lang {
323 Lang::Ts => crate::ts::discover::discover(root),
324 _ => crate::lang::discover(lang, root),
325 };
326 let Ok(ws) = ws else {
327 return BTreeSet::new();
328 };
329 let packages = &ws.packages;
330 packages
331 .iter()
332 .flat_map(|p| {
333 p.deps.iter().filter(move |d| {
334 !d.is_empty() && !packages.iter().any(|q| q.dir != p.dir && &q.name == *d)
335 })
336 })
337 .cloned()
338 .collect()
339}
340
341pub fn whole_app(root: &Path, report: &Report) -> WholeApp {
342 let lang = report.language;
343 let mut entry_points = manifest_entries(root, lang);
344 for found in code_entries(root, report) {
345 let covered = entry_points.iter().any(|e| {
346 e.kind == found.kind
347 && (e.path == found.path || found.path.starts_with(&format!("{}/", e.path)))
348 });
349 if !covered {
350 entry_points.push(found);
351 }
352 }
353 let shape = if entry_points.iter().any(|e| e.kind == "server") {
354 "server"
355 } else if entry_points.iter().any(|e| e.kind == "cli") {
356 "cli"
357 } else {
358 "library"
359 };
360 if shape == "library" {
361 for package in &report.packages {
362 entry_points.push(EntryPoint {
363 kind: "library",
364 path: if package.dir.is_empty() {
365 ".".to_string()
366 } else {
367 package.dir.clone()
368 },
369 name: Some(package.name.clone()),
370 evidence: "no main and no server: the package's public API".into(),
371 });
372 }
373 }
374
375 let declared = declared(root, lang);
376 let imported: BTreeSet<&String> = report.units.iter().flat_map(|u| &u.external_deps).collect();
377 let key = |name: &str| match crate_for(lang, name) {
378 Some(m) => (Some(m.row), String::new()),
379 None => (None, name.to_string()),
380 };
381 let mut joined: BTreeMap<(Option<usize>, String), Dependency> = BTreeMap::new();
382 for name in imported.into_iter().chain(&declared) {
383 let found = crate_for(lang, name);
384 let dep = joined.entry(key(name)).or_insert_with(|| Dependency {
385 name: String::new(),
386 names: Vec::new(),
387 declared: false,
388 used_by: 0,
389 crates: found.map(|m| m.crates),
390 fit: fit_label(found.map(|m| m.fit)),
391 note: found.map_or("", |m| m.note),
392 });
393 if !dep.names.contains(name) {
394 dep.names.push(name.clone());
395 }
396 dep.declared |= declared.contains(name);
397 }
398 for unit in &report.units {
399 let keys: BTreeSet<_> = unit.external_deps.iter().map(|n| key(n)).collect();
400 for k in keys {
401 if let Some(dep) = joined.get_mut(&k) {
402 dep.used_by += 1;
403 }
404 }
405 }
406 let mut dependencies: Vec<Dependency> = joined
407 .into_values()
408 .map(|mut dep| {
409 dep.names.sort();
410 dep.name = dep
411 .names
412 .iter()
413 .find(|n| declared.contains(*n))
414 .unwrap_or(&dep.names[0])
415 .clone();
416 dep
417 })
418 .collect();
419 let rank = |fit: &str| match fit {
420 "none" => 0,
421 "unknown" => 1,
422 "partial" => 2,
423 _ => 3,
424 };
425 dependencies.sort_by(|a, b| {
426 rank(a.fit)
427 .cmp(&rank(b.fit))
428 .then(b.used_by.cmp(&a.used_by))
429 .then(a.name.cmp(&b.name))
430 });
431
432 let movable: Vec<&crate::analyze::UnitReport> = report
433 .units
434 .iter()
435 .filter(|u| u.status != Status::Keep)
436 .collect();
437 let index: BTreeMap<&str, usize> = movable
438 .iter()
439 .enumerate()
440 .map(|(i, u)| (u.id.as_str(), i))
441 .collect();
442 let edges: Vec<Vec<usize>> = movable
443 .iter()
444 .map(|u| {
445 u.internal_deps
446 .iter()
447 .filter_map(|d| index.get(d.as_str()).copied())
448 .collect()
449 })
450 .collect();
451 let (_, members) = crate::analyze::waves(&edges);
452 let mut seen = BTreeSet::new();
453 let mut pieces = Vec::new();
454 for (i, unit) in movable.iter().enumerate() {
455 let mut group = members[i].clone();
456 if group.is_empty() {
457 group.push(i);
458 }
459 group.sort_unstable();
460 if !seen.insert(group.clone()) {
461 continue;
462 }
463 pieces.push(Piece {
464 wave: unit.wave,
465 units: group.iter().map(|&j| movable[j].id.clone()).collect(),
466 loc: group.iter().map(|&j| movable[j].loc).sum(),
467 tangled: group.len() > 1,
468 });
469 }
470 pieces.sort_by(|a, b| a.wave.cmp(&b.wave).then(a.units.cmp(&b.units)));
471
472 let mut decisions = Vec::new();
473 let mut ask = |topic: String, question: String, recommendation: String| {
474 decisions.push(Decision {
475 id: format!("D{}", decisions.len() + 1),
476 topic,
477 question,
478 recommendation,
479 });
480 };
481 let entries: Vec<String> = entry_points
482 .iter()
483 .map(|e| match &e.name {
484 Some(n) => format!("{n} ({})", e.path),
485 None => e.path.clone(),
486 })
487 .collect();
488 ask(
489 "shape".into(),
490 format!(
491 "The app is a {shape}, entered through {}. Port every entry point, in that shape?",
492 entries.join(", ")
493 ),
494 match shape {
495 "server" => {
496 "Yes: an axum front door (`app front-door`) takes the server over first".into()
497 }
498 "cli" => {
499 "Yes: a clap front door (`app front-door`) takes every command over first".into()
500 }
501 _ => "Yes: the Rust crate's public API becomes the library's front door".into(),
502 },
503 );
504 let electron = lang == Lang::Ts
505 && serde_json::from_str::<Value>(&read(root, "package.json")).is_ok_and(|pkg| {
506 ["dependencies", "devDependencies"]
507 .iter()
508 .any(|f| pkg[f].get("electron").is_some())
509 });
510 if electron {
511 ask(
512 "desktop shell".into(),
513 "This is an Electron app. Its main process is Node code that can move to Rust; its \
514 windows are web pages. Port the main-process logic and keep the web UI?"
515 .into(),
516 "Yes: port the main process piece by piece and keep the renderer as it is. Whether \
517 the UI later moves to Tauri (the same web UI on a Rust backend) is a separate \
518 choice, made once the logic is Rust"
519 .into(),
520 );
521 }
522 for unit in report.units.iter().filter(|u| u.status == Status::Keep) {
523 ask(
524 format!("keep {}", unit.id),
525 format!(
526 "{} stays in the source language ({}). What replaces it in the Rust app, or does it stay outside?",
527 unit.id,
528 unit.notes
529 .first()
530 .map_or("no Rust equivalent", |n| n.trim_end_matches('.'))
531 ),
532 "Keep it outside the Rust app, behind the front door, and decide its replacement once the rest is Rust".into(),
533 );
534 }
535 for unit in report.units.iter().filter(|u| u.status == Status::Blocked) {
536 ask(
537 format!("blocked {}", unit.id),
538 format!(
539 "{} is blocked: {}. Rework that part in Rust, or keep the unit outside?",
540 unit.id,
541 unit.notes
542 .first()
543 .map_or("see its risks", |n| n.trim_end_matches('.'))
544 ),
545 "Research the blocker first; then port it with the piece that uses it".into(),
546 );
547 }
548 for dep in &dependencies {
549 let users = match dep.used_by {
550 0 => "declared, no unit imports it".to_string(),
551 1 => "used by 1 unit".to_string(),
552 n => format!("used by {n} units"),
553 };
554 let note = dep.note.trim_end_matches('.');
555 match dep.fit {
556 "none" => ask(
557 format!("dependency {}", dep.name),
558 format!(
559 "No crate does what {} does ({users}{}). Reimplement what the app uses, or drop the feature?",
560 dep.name,
561 if note.is_empty() {
562 String::new()
563 } else {
564 format!("; {note}")
565 }
566 ),
567 "Reimplement only the part the app uses, proved by its recorded cases".into(),
568 ),
569 "unknown" => ask(
570 format!("dependency {}", dep.name),
571 format!("Which crate replaces {} ({users})?", dep.name),
572 format!(
573 "Research it against primary sources into rust/research/{}.md before porting what uses it",
574 dep.name.replace(['/', ':'], "-")
575 ),
576 ),
577 "partial" => ask(
578 format!("dependency {}", dep.name),
579 format!(
580 "{} maps to {} only in part ({users}{}). Use it?",
581 dep.name,
582 dep.crates.unwrap_or("?"),
583 if note.is_empty() {
584 String::new()
585 } else {
586 format!("; {note}")
587 }
588 ),
589 format!(
590 "Use {}, and record cases for the behavior it does not cover",
591 dep.crates.unwrap_or("it")
592 ),
593 ),
594 _ => {}
595 }
596 }
597 for piece in pieces.iter().filter(|p| p.tangled) {
598 ask(
599 "tangled units".into(),
600 format!(
601 "{} import each other ({} lines). Port them as one piece?",
602 piece.units.join(", "),
603 piece.loc
604 ),
605 format!(
606 "Yes: one piece in wave {}, no glue between its parts",
607 piece.wave
608 ),
609 );
610 }
611
612 WholeApp {
613 shape,
614 entry_points,
615 dependencies,
616 pieces,
617 decisions,
618 }
619}
620
621#[cfg(test)]
622mod tests {
623 use super::*;
624
625 fn repo(files: &[(&str, &str)]) -> std::path::PathBuf {
626 static NEXT: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0);
627 let dir = std::env::temp_dir().join(format!(
628 "rust-anything-whole-{}-{}",
629 std::process::id(),
630 NEXT.fetch_add(1, std::sync::atomic::Ordering::SeqCst)
631 ));
632 let _ = std::fs::remove_dir_all(&dir);
633 for (path, text) in files {
634 let p = dir.join(path);
635 std::fs::create_dir_all(p.parent().unwrap()).unwrap();
636 std::fs::write(p, text).unwrap();
637 }
638 dir
639 }
640
641 #[test]
642 fn manifests_declare_dependencies_in_every_language() {
643 type Case<'a> = (Lang, &'a [(&'a str, &'a str)], &'a [&'a str]);
644 let cases: [Case; 6] = [
645 (
646 Lang::Ts,
647 &[(
648 "package.json",
649 r#"{"dependencies":{"express":"^4"},"devDependencies":{"vitest":"1"}}"#,
650 )],
651 &["express"],
652 ),
653 (
654 Lang::Python,
655 &[
656 (
657 "pyproject.toml",
658 "[project]\nname = \"x\"\ndependencies = [\"Requests>=2\", \"PyYAML\"]\n",
659 ),
660 ("requirements.txt", "# pinned\nclick==8.1\n-r other.txt\n"),
661 ],
662 &["click", "pyyaml", "requests"],
663 ),
664 (
665 Lang::Go,
666 &[(
667 "go.mod",
668 "module x\n\nrequire (\n\tgithub.com/spf13/cobra v1.8.0\n\tgolang.org/x/sys v0.1.0 // indirect\n)\nrequire github.com/google/uuid v1.6.0\n",
669 )],
670 &["github.com/google/uuid", "github.com/spf13/cobra"],
671 ),
672 (
673 Lang::Ruby,
674 &[
675 (
676 "Gemfile",
677 "source 'x'\ngem \"sinatra\"\ngroup :test do\n gem 'rspec'\nend\n",
678 ),
679 ("x.gemspec", "s.add_dependency 'thor', '~> 1'\n"),
680 ],
681 &["sinatra", "thor"],
682 ),
683 (
684 Lang::Java,
685 &[(
686 "pom.xml",
687 "<dependencies><dependency><groupId>com.google.code.gson</groupId><artifactId>gson</artifactId></dependency><dependency><groupId>org.junit</groupId><artifactId>junit</artifactId><scope>test</scope></dependency></dependencies>",
688 )],
689 &["com.google.code.gson:gson"],
690 ),
691 (
692 Lang::Kotlin,
693 &[(
694 "build.gradle.kts",
695 "dependencies {\n implementation(\"com.google.code.gson:gson:2.11.0\")\n testImplementation(\"junit:junit:4.13.2\")\n}\n",
696 )],
697 &["com.google.code.gson:gson"],
698 ),
699 ];
700 for (lang, files, expected) in cases {
701 let dir = repo(files);
702 let found: Vec<String> = declared(&dir, lang).into_iter().collect();
703 assert_eq!(found, expected, "{lang:?}");
704 std::fs::remove_dir_all(&dir).unwrap();
705 }
706 }
707
708 #[test]
709 fn manifests_name_entry_points() {
710 let dir = repo(&[
711 (
712 "package.json",
713 r#"{"name":"@me/tool","bin":{"tool":"./bin/tool.js"}}"#,
714 ),
715 (
716 "pyproject.toml",
717 "[project.scripts]\nmytool = \"mytool.cli:main\"\n",
718 ),
719 ]);
720 let found: Vec<(String, String)> = manifest_entries(&dir, Lang::Ts)
721 .into_iter()
722 .map(|e| (e.name.unwrap_or_default(), e.path))
723 .collect();
724 assert_eq!(
725 found,
726 [
727 ("tool".to_string(), "bin/tool.js".to_string()),
728 ("mytool".to_string(), "mytool.cli:main".to_string())
729 ]
730 );
731 std::fs::remove_dir_all(&dir).unwrap();
732 }
733
734 #[test]
735 fn a_glob_in_a_gradle_string_does_not_open_a_comment() {
736 let dir = repo(&[(
737 "build.gradle.kts",
738 "android {\n packaging { resources { excludes += \"META-INF/*\" } }\n}\n\
739 dependencies {\n implementation(\"com.google.code.gson:gson:2.11.0\")\n}\n\
740 /* implementation(\"com.example:legacy:1.0\") */\n",
741 )]);
742 let found: Vec<String> = declared(&dir, Lang::Kotlin).into_iter().collect();
743 assert_eq!(found, ["com.google.code.gson:gson"]);
744 std::fs::remove_dir_all(&dir).unwrap();
745 }
746}