@Override public Path packageLocation() { final Project project = projectComponent.getProject(); return Paths.get("", project.getPackageLocation().split("/")); } }
@Override public Path packageLocation() { final Project project = projectComponent.getProject(); return baseDir().resolve(project.getPackageLocation()); }
@Override public void execute(Speedment speedment) throws MojoExecutionException, MojoFailureException { getLog().info("Generating code using JSON configuration file: '" + configLocation().toAbsolutePath() + "'."); if (hasConfigFile()) { try { final Project project = speedment.getOrThrow(ProjectComponent.class).getProject(); speedment.getOrThrow(TranslatorManager.class).accept(project); // after generating the speedment code, the package location needs to be added as a source folder if (!mavenProject.getCompileSourceRoots().contains(mavenProject.getBasedir().getAbsolutePath() + "/" + project.getPackageLocation())) { System.out.println("adding new source location"); mavenProject.addCompileSourceRoot(mavenProject.getBasedir().getAbsolutePath() + "/" + project.getPackageLocation()); } } catch (final Exception ex) { final String err = "Error parsing configFile file."; LOGGER.error(ex, err); getLog().error(err); throw new MojoExecutionException(err, ex); } } else { final String err = "To run speedment:generate a valid configFile needs to be specified."; getLog().error(err); throw new MojoExecutionException(err); } }
ImmutableProject(Map<String, Object> project) { super(project); final Project prototype = new ProjectImpl(project); this.enabled = prototype.isEnabled(); this.id = prototype.getId(); this.name = prototype.getName(); this.companyName = prototype.getCompanyName(); this.packageName = prototype.getPackageName(); this.packageLocation = prototype.getPackageLocation(); this.configPath = prototype.getConfigPath(); this.dbmses = unmodifiableList(super.children(DBMSES, ImmutableDbms::new).collect(toList())); this.tablesByName = MapStream.fromValues( DocumentDbUtil.traverseOver(this, ImmutableTable.class), table -> DocumentUtil.relativeName(table, Dbms.class, DATABASE_NAME) ).toMap(); }
@Override public Path packageLocation() { final Project project = projectComponent.getProject(); return Paths.get("", project.getPackageLocation().split("/")); } }