Skip to content
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

muSrcGenIdlType Tweak #839

Merged
merged 3 commits into from
Mar 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/main/docs/guides/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ permalink: guides
These guides are aimed at developers who are already familiar with Mu-Scala.

If you are new to Mu-Scala, we recommend you read the [Getting Started
guide](../getting-started) and the [tutorials](../tutorials).
guide](getting-started) and the [tutorials](tutorials).
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the user is in the index.html, the path is omitted by the browser. It seems that it's not needed to go back with .. .


Each guide introduces a single feature of Mu-Scala and explains how to use it.
4 changes: 2 additions & 2 deletions docs/src/main/docs/tutorials/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ We recommend you read them in roughly the order they appear in the navigation
menu.

Before starting the tutorials, we recommend you read the [Getting Started
guide](../getting-started).
guide](getting-started).

If you are already familiar with Mu-Scala, you may want to read about how to use
its more advanced features in the [How-To Guides](../guides).
its more advanced features in the [How-To Guides](guides).
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same happens in this file (index.md).


Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,22 @@ class GeneratorApplication[T <: Generator](generators: T*) {
serializationType: SerializationType,
inputFiles: Set[File],
outputDir: File
): Seq[File] = {
validate(
idlTypes.contains(idlType),
s"Unknown IDL type '$idlType'. Valid values: ${idlTypes.mkString(", ")}"
)
generatorsByType(idlType).generateFrom(inputFiles, serializationType).map {
case (inputFile, outputFilePath, output) =>
val outputFile = new File(outputDir, outputFilePath)
logger.info(s"$inputFile -> $outputFile")
Option(outputFile.getParentFile).foreach(_.mkdirs())
outputFile.write(output)
outputFile
}
}

private def validate(requirement: Boolean, message: => Any): Unit =
if (!requirement) {
System.err.println(message)
System.exit(1)
): Seq[File] =
if (idlTypes.contains(idlType))
generatorsByType(idlType).generateFrom(inputFiles, serializationType).map {
case (inputFile, outputFilePath, output) =>
val outputFile = new File(outputDir, outputFilePath)
logger.info(s"$inputFile -> $outputFile")
Option(outputFile.getParentFile).foreach(_.mkdirs())
outputFile.write(output)
outputFile
}
else {
System.out.println(
s"Unknown IDL type '$idlType', skipping code generation in this module. " +
s"Valid values: ${idlTypes.mkString(", ")}"
)
Seq.empty[File]
}

// $COVERAGE-ON$
Expand Down