File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
codegen/src/main/scala/overflowdb/codegen Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1259,6 +1259,29 @@ class CodeGen(schema: Schema) {
12591259 val srcFile = nodeType.className + " .scala"
12601260 results.append(baseDir.createChild(srcFile).write(src))
12611261 }
1262+
1263+
1264+ val packageObject = {
1265+ val lastSeparatorIdx = basePackage.lastIndexOf('.' )
1266+ val packageParent = basePackage.take(lastSeparatorIdx)
1267+ val packageSimpleName = basePackage.drop(lastSeparatorIdx + 1 )
1268+
1269+ s """ package $packageParent
1270+ |
1271+ |package object $packageSimpleName {
1272+ | // some type aliases so that the domain-specific code can avoid referencing the `overflowdb` namespace
1273+ | type DiffGraphBuilder = _root_.overflowdb.BatchedUpdate.DiffGraphBuilder
1274+ |
1275+ | object help {
1276+ | type Doc = _root_.overflowdb.traversal.help.Doc
1277+ | type Traversal = _root_.overflowdb.traversal.help.Traversal
1278+ | type TraversalSource = _root_.overflowdb.traversal.help.TraversalSource
1279+ | }
1280+ |}
1281+ | """ .stripMargin
1282+ }
1283+ results.append(baseDir.createChild(" package.scala" ).write(packageObject))
1284+
12621285 results.toSeq
12631286 }
12641287
You can’t perform that action at this time.
0 commit comments