mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Replace the process_fine_grained_swiftdeps.sh with a python equivalent (which also preserves the horrendous handling of YAML and even "faithfully" replicates the horrible global variables). This enables a number of tests on Windows although the instigating macro test is not yet enabled due to the need for further tweaks to the tests.
31 lines
761 B
Python
31 lines
761 B
Python
|
|
import os
|
|
import re
|
|
import subprocess
|
|
import sys
|
|
|
|
output = subprocess.run([
|
|
sys.argv[1],
|
|
"--to-yaml",
|
|
"--input-filename={}".format(sys.argv[2]),
|
|
"--output-filename=-"
|
|
], stdout=subprocess.PIPE)
|
|
entries = []
|
|
k = a = c = n = s = p = ''
|
|
for line in output.stdout.decode('utf-8').split('\n'):
|
|
if 'kind:' in line:
|
|
k = line.split()[1]
|
|
if 'aspect:' in line:
|
|
a = line.split()[1]
|
|
if 'context:' in line:
|
|
c = line.split()[1]
|
|
if 'name:' in line:
|
|
n = ' '.join(line.split()[1:])
|
|
if 'sequenceNumber:' in line:
|
|
s = line.split()[1]
|
|
if 'isProvides:' in line:
|
|
p = line.split()[1]
|
|
entries.append(' '.join([k, a, c, n, p]))
|
|
entries.sort()
|
|
print('\n'.join(entries))
|