code: private boolean compileIfDirty(CompilationUnit unit) throws IOException {
          if (isDirty(unit)) {
              logger.debug("compiling less: {}", unit);
              long start = System.currentTimeMillis();
  
              try {
                  String sourceMapFileName = unit.getSourceMapFile() != null ? unit.getSourceMapFile().getPath() : null;
                  CompilationDetails compilationResult = lessCompiler.compileWithDetails(unit.getSourceAsString(), unit.getResourceReader(), unit.getOptions(), unit.getSourceLocation(), unit.getDestination().getPath(), sourceMapFileName);
                  if (unit.getDestination() != null) {
                      unit.getDestination().getAbsoluteFile().getParentFile().mkdirs();
                      IOUtils.writeFile(compilationResult.getResult(), unit.getDestination(), unit.getEncoding());
                  }
                  if (unit.getSourceMapFile() != null && compilationResult.getSourceMap() != null) {
                      unit.getSourceMapFile().getAbsoluteFile().getParentFile().mkdirs();
                      IOUtils.writeFile(compilationResult.getSourceMap(), unit.getSourceMapFile(), unit.getEncoding());
                  }
                  updateImportsAndCache(unit, compilationResult.getImports());
                  logger.info("compilation of less {} finished in {} millis", unit, System.currentTimeMillis() - start);
                  return true;
              } catch (LessParseException e) {
                  unit.setExceptionTimestamp(System.currentTimeMillis());
                  cache(unit);
                  throw e;
              }
          }
          return false;
      }
docs: Compile a CompilationUnit if dirty.
  
  @param unit CompilationUnit
  @return true if the CompilationUnit was dirty
  @throws IOException