MCPcopy Create free account
hub / github.com/algorithm-archivists/algorithm-archive / Kotlin

Function Kotlin

builders/kotlin.py:83–111  ·  view source on GitHub ↗

A pseudo-Builder wrapper for the kotlinc executable. kotlinc [options] file

(env, target, source=None, *args, **kw)

Source from the content-addressed store, hash-verified

81
82
83def Kotlin(env, target, source=None, *args, **kw):
84 """
85 A pseudo-Builder wrapper for the kotlinc executable.
86 kotlinc [options] file
87 """
88 if not SCons.Util.is_List(target):
89 target = [target]
90 if not source:
91 source = target[:]
92 if not SCons.Util.is_List(source):
93 source = [source]
94
95 result = []
96 kotlinc_suffix = env.subst("$KOTLINCLASSSUFFIX")
97 kotlinc_extension = env.subst("$KOTLINEXTENSION")
98 for t, s in zip(target, source):
99 t_ext = t
100 if not t.endswith(kotlinc_suffix):
101 if not t.endswith(kotlinc_extension):
102 t_ext += kotlinc_extension
103
104 t_ext += kotlinc_suffix
105 # Ensure that the case of first letter is upper-case
106 t_ext = t_ext[:1].upper() + t_ext[1:]
107 # Call builder
108 kotlin_class = kotlinc_builder.__call__(env, t_ext, s, **kw)
109 result.extend(kotlin_class)
110
111 return result
112
113
114def KotlinJar(env, target, source=None, *args, **kw):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected