Initial kotlin support

Allow java libraries to specify .kt sources, precompile them with
kotlin, and then pass them in the classpath to javac.

Bug: 65219535
Test: java_test.go
Change-Id: Ife22b6ef82ced9ec26a9e5392b2dadacbb16546f
This commit is contained in:
Colin Cross
2017-08-15 13:34:18 -07:00
parent f6df17afd1
commit 93e8595044
6 changed files with 174 additions and 3 deletions

View File

@@ -303,6 +303,39 @@ outer:
return list[:k]
}
// HasExt returns true of any of the paths have extension ext, otherwise false
func (p Paths) HasExt(ext string) bool {
for _, path := range p {
if path.Ext() == ext {
return true
}
}
return false
}
// FilterByExt returns the subset of the paths that have extension ext
func (p Paths) FilterByExt(ext string) Paths {
ret := make(Paths, 0, len(p))
for _, path := range p {
if path.Ext() == ext {
ret = append(ret, path)
}
}
return ret
}
// FilterOutByExt returns the subset of the paths that do not have extension ext
func (p Paths) FilterOutByExt(ext string) Paths {
ret := make(Paths, 0, len(p))
for _, path := range p {
if path.Ext() != ext {
ret = append(ret, path)
}
}
return ret
}
// WritablePaths is a slice of WritablePaths, used for multiple outputs.
type WritablePaths []WritablePath