v.io: v.io/x/ref/lib/vdl/codegen/swift Index | Files

package swift

import "v.io/x/ref/lib/vdl/codegen/swift"

Package swift implements Swift code generation from compiled VDL packages.

Package swift implements Swift code generation from compiled VDL packages.


Package Files

generate.go tmpl_enum.go tmpl_package.go tmpl_primitive.go tmpl_struct.go tmpl_union.go util_doc.go util_file.go util_generate.go util_namespace.go util_template.go util_type.go util_val.go


const V23SwiftFrameworkName = "VanadiumCore"

func SetPkgPathXlator Uses

func SetPkgPathXlator(xlator func(vdlPath string) string)

SetPkgPathXlator sets the function used to translate a VDL package path into a Swift package path.

type SwiftFileInfo Uses

type SwiftFileInfo struct {
    Data   []byte
    Dir    string
    Name   string
    Module string

SwiftFileInfo stores the name and contents of the generated Swift file.

func Generate Uses

func Generate(pkg *compile.Package, env *compile.Env, genPathToDir map[string]string) (ret []SwiftFileInfo)

Generate generates Swift files for all VDL files in the provided package, returning the list of generated Swift files as a slice. We generate Swift files to match the original VDL file layout, with the exception that constants are smushed into a <PackageName>.swift that consolidates the errors, package documentation (if any), and constants for a given package into a struct. This package struct provides a similar context to what would be provided by an import in VDL or Java. TODO(azinman): Run Swift formatters on the generated files.

Package swift imports 19 packages (graph) and is imported by 1 packages. Updated 2021-01-19. Refresh now. Tools for package owners.