mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-15 08:48:52 +00:00
[Kotlin] Make sure namespace path exist for code generation (#7357)
With a change introduce in 385dda5c3785ed8d6a35868bc169f07e40e889087fd2edc66, flatc was not able to emit code for Kotlin if a namespace is specified and the folders do not exist. The fix create folders if neded. Additional changes are introduced in gradle files to bring more visibility to the error messages. Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
@@ -134,9 +134,10 @@ class KotlinGenerator : public BaseGenerator {
|
||||
code += "import com.google.flatbuffers.*\n\n";
|
||||
}
|
||||
code += classcode;
|
||||
auto filename = namer_.Directories(ns)
|
||||
+ namer_.File(defname, SkipFile::Suffix);
|
||||
|
||||
const std::string dirs = namer_.Directories(ns);
|
||||
EnsureDirExists(dirs);
|
||||
const std::string filename =
|
||||
dirs + namer_.File(defname, /*skips=*/SkipFile::Suffix);
|
||||
return SaveFile(filename.c_str(), code, false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user