-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code generation #56
Code generation #56
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far, with minor changes.
Also, please incorporate code generation into the build process, so that the .fs
files for the ontologies get generated the same way we currently generate the .obo
files from yml
see
ARCTokenization/build/BasicTasks.fs
Line 37 in e5280af
let buildOntologies = |
This most likely means that the code generation must move into a separate project, as we must execute it before building the other projects that should contain the generated .fs
files. ideally, make it a console application so we can just build and run it via a fake process
let concattedSingleValues = String.init onto.Terms.Length (fun i -> $"{toCodeString onto.Terms[i]}") | ||
$"{baseString}{concattedSingleValues}" | ||
|
||
toSourceCode onto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please stop committing test scripts to repos. Pls refactor anything relevant to actual unit tests or do not commit it at all.
@@ -124,7 +133,7 @@ let expectedTermValuesSimple = | |||
[""] | |||
[""] | |||
[""] | |||
[""; "Maus"; "Keider"; "m�ller"; "oih"] | |||
[""; "Maus"; "Keider"; "müller"; "oih"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you seriously need to fix your encoding problems 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My initial idea for this has been adding a separate runnable project (basically the same type as the build project) and invoking that from within the build project's pipelines.
However, looking at this PR, i think it would be best to set up OBO.NET.CodeGeneration as a completely separate library. This way, we can cleanly add a dependency to that package in the build project, keep the rest as-is, and also make code generation from obo files usable in other projects. Additionally, we do not bloat this repo further with another project.
I think the only thing to adapt code-wise would be parameterizing the namespace of the generated files.
What do you think @omaus?
@@ -6,6 +6,8 @@ open Fake.DotNet | |||
open Fake.IO.Globbing.Operators | |||
open System.IO | |||
open Fake.IO | |||
open ARCTokenization.StructuralOntology |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While it seems to work, i really do not like this circular dependency, where the build project is dependent on one of the projects it is supposed to build.
Closed due to this and since the functionality is already realized in OBO.NET. |
This PR
Left to do: