add kjsm option for kotlin js command line compiler

This commit is contained in:
Michael Nedzelsky
2015-11-20 15:59:11 +03:00
parent 24e473f47b
commit c80c33efb6
13 changed files with 69 additions and 12 deletions
@@ -168,11 +168,11 @@ public object KotlinJavascriptSerializationUtil {
return KotlinJavascriptSerializedResourcePaths.getClassMetadataPath(classDescriptor.classId)
}
private fun ModuleDescriptor.toContentMap(): Map<String, ByteArray> {
public fun toContentMap(module: ModuleDescriptor): Map<String, ByteArray> {
val contentMap = hashMapOf<String, ByteArray>()
getPackagesFqNames(this).forEach {
serializePackage(this, it) {
getPackagesFqNames(module).forEach {
serializePackage(module, it) {
fileName, bytes -> contentMap[fileName] = bytes
}
}
@@ -218,7 +218,7 @@ public object KotlinJavascriptSerializationUtil {
}
private fun ModuleDescriptor.toBinaryMetadata(): ByteArray =
KotlinJavascriptSerializationUtil.contentMapToByteArray(this.toContentMap())
KotlinJavascriptSerializationUtil.contentMapToByteArray(toContentMap(this))
}
public fun KotlinJavascriptMetadata.forEachFile(operation: (filePath: String, fileContent: ByteArray) -> Unit): Unit =