Make sure codegen directory exists

This commit is contained in:
dotasek 2024-11-05 09:56:06 -05:00
parent 31764fc016
commit 6775a09adb
1 changed files with 7 additions and 2 deletions

View File

@ -51,6 +51,7 @@ import org.hl7.fhir.r5.test.utils.TestPackageLoader;
import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.utilities.TextFile;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.filesystem.ManagedFileAccess;
import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager;
import org.hl7.fhir.utilities.npm.NpmPackage;
import org.junit.jupiter.api.Assertions;
@ -390,8 +391,12 @@ public class PETests {
public void testGenerate() throws IOException {
load();
PECodeGenerator gen = new PECodeGenerator(ctxt);
gen.setFolder(Utilities.path("[tmp]", "codegen"));
String codeGenFolder = Utilities.path("[tmp]", "codegen");
if (!ManagedFileAccess.csfile(codeGenFolder).exists()) {
ManagedFileAccess.csfile(codeGenFolder).mkdirs();
}
gen.setFolder(codeGenFolder);
gen.setExtensionPolicy(ExtensionPolicy.Complexes);
gen.setNarrative(false);
gen.setMeta(false);