Beispiel #1
0
 private String parseInclude(InputReader reader) throws InvalidSyntaxException, ParserException {
   String inputFileName = reader.nextWord().asBareString();
   File inputFile = new File(baseDir, inputFileName);
   String statement;
   if (excludeFiles.contains(inputFileName)
       || excludeFiles.contains(inputFile.getAbsolutePath())) {
     // Handle excluded file
     logger.info(reader, "Include file '" + inputFileName + "' omitted being marked as excluded.");
     String outputFileName = MakeBridleNSIS.convertToBridleFilename(inputFileName);
     File outputFile = new File(outDir, outputFileName);
     copyFile(inputFile, outputFile, reader.getLinesRead());
     statement = NSISStatements.include(reader.getIndent(), outputFileName);
   } else if (!inputFile.exists()) {
     // Include file not found
     logger.debug(
         reader, "Include file '" + inputFileName + "' not found, assuming it's found by NSIS.");
     statement = reader.getCurrentStatement();
   } else {
     // Parse include file
     logger.debug(reader, "Follow include: " + inputFile.getAbsolutePath());
     String outputFileName = MakeBridleNSIS.convertToBridleFilename(inputFileName);
     try (BufferedWriter writer = getOutputWriter(outputFileName)) {
       parseFile(inputFile, writer);
     } catch (IOException e) {
       throw new InvalidSyntaxException(e.getMessage(), e);
     }
     statement = NSISStatements.include(reader.getIndent(), outputFileName);
   }
   return statement;
 }