Example #1
0
  /**
   * @param root the package root "/"
   * @return the updated Java files.
   */
  static List<File> reloadChanged(String root) {
    try {
      mkdir(root);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }

    TranslateTemplateTask t = new TranslateTemplateTask();
    t.setUsePlay(false);
    File rootDir = new File(root);
    t.setPackageRoot(rootDir);
    t.setInclude(new File(japidviews));
    t.addImport("japidviews ._layouts.*");
    // t.addImport(root + "/" + "._javatags.*");
    t.addImport("japidviews ._tags.*");

    for (String imp : importlines) {
      t.addImport(imp);
    }

    t.execute();
    // List<File> changedFiles = t.getChangedFiles();
    return t.getChangedTargetFiles();
    // return changedFiles;
  }
Example #2
0
  /**
   * The entry point for the command line tool japid.bat and japid.sh
   *
   * <p>The "gen" and "regen" are probably the most useful ones.
   *
   * @param args
   * @throws IOException
   */
  public static void main(String[] args) throws IOException {
    if (args.length > 0) {
      String arg0 = args[0];

      setTemplateRoot(".");
      if ("gen".equals(arg0)) {
        gen(templateRoot);
      } else if ("regen".equals(arg0)) {
        regen(templateRoot);
      } else if ("clean".equals(arg0)) {
        delAllGeneratedJava(getJapidviewsDir(templateRoot));
      } else if ("mkdir".equals(arg0)) {
        mkdir(templateRoot);
      } else if ("changed".equals(arg0)) {
        changed(japidviews);
      } else {
        System.err.println("help:  optionas are: gen, regen, mkdir and clean");
      }
    } else {
      System.err.println("help:  optionas are: gen, regen, mkdir and clean");
    }
  }