-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassemble.kts
35 lines (28 loc) · 1.03 KB
/
assemble.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import java.io.File
import java.util.zip.ZipEntry
import java.util.zip.ZipOutputStream
val THEME_NAME = "Yoga"
val THEME_FILE_NAME = "$THEME_NAME.icls"
val baseDir = File(".")
val themeFile = File(baseDir, THEME_FILE_NAME)
val targetJar = File(baseDir, "$THEME_NAME.jar")
if (targetJar.exists()) targetJar.deleteRecursively()
val colorsScheme = """
""".trimIndent()
ZipOutputStream(targetJar.outputStream()).use { zip ->
zip.putNextEntry(ZipEntry("IntelliJ IDEA Global Settings"))
zip.closeEntry()
zip.putNextEntry(ZipEntry("options/colors.scheme.xml"))
zip.write("""
<?xml version="1.0" encoding="UTF-8"?>
<application>
<component name="EditorColorsManagerImpl">
<option name="USE_ONLY_MONOSPACED_FONTS" value="true" />
<global_color_scheme name="Yoga" />
</component>
</application>""".trimIndent().toByteArray())
zip.closeEntry()
zip.putNextEntry(ZipEntry("colors/$THEME_FILE_NAME"))
zip.write(themeFile.readBytes())
zip.closeEntry()
}