Skip to content

Instantly share code, notes, and snippets.

@2m

2m/osgi.py Secret

Created July 14, 2015 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 2m/51fc0490ffea7bdc4cb9 to your computer and use it in GitHub Desktop.
Save 2m/51fc0490ffea7bdc4cb9 to your computer and use it in GitHub Desktop.
import os
import zipfile
def files_in_jar(filename):
with zipfile.ZipFile(filename) as jar:
for info in jar.infolist():
yield info.filename
def files_in_dir(dir):
for root, dirnames, filenames in os.walk(dir):
for filename in filenames:
yield os.path.join(root.replace(dir, ''), filename)
def missing_classes(name, location):
jar_contents = list(files_in_jar('{}/target/{}-experimental_2.10-1.0-SNAPSHOT.jar'.format(location, name)))
for class_file in files_in_dir('{}/target/classes/'.format(location)):
if class_file not in jar_contents:
yield class_file
projects = [
('akka-http', 'akka-http'),
('akka-http-core', 'akka-http-core'),
('akka-http-jackson', 'akka-http-marshallers-java/akka-http-jackson'),
('akka-http-xml', 'akka-http-marshallers-scala/akka-http-xml'),
('akka-http-spray-json', 'akka-http-marshallers-scala/akka-http-spray-json'),
('akka-http-testkit', 'akka-http-testkit'),
('akka-stream', 'akka-stream'),
('akka-stream-tck', 'akka-stream-tck'),
('akka-stream-testkit', 'akka-stream-testkit')
]
for name, location in projects:
print(name, list(missing_classes(name, location)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment