public String getMavenCoords() { String group = getProject().getGroup().toString(); String id = getProject().getConvention().getPlugin(BasePluginConvention.class).getArchivesBaseName(); String version = getProject().getVersion().toString(); return String.join(":", group, id, version); }
/** * Get the library directory * * @return Library directory */ public File getLibsDir() { BasePluginConvention baseConvention = this.project.getConvention().getPlugin(BasePluginConvention.class); File libsDir = Validate.notNull(baseConvention.getLibsDir(), "The libs dir must not be null"); return libsDir; }
/** * Create a {@link PublishArtifact} for a jar created by a {@link Jar} task * * We use this instead of {@link ArchivePublishArtifact} because we can add the unresolved task dependency by name, * thus avoiding a direct dependency on the task. * * @param project Project to create artifact for * @param name Name of the new artifact * @param classifier Classifier for new artifact * @param type Type of new artifact * @param extension Extension of new artifact * @param producingTask Task that produces the artifact * @return Publish artifact for the jar */ public static PublishArtifact createJarPublishArtifact(Project project, String name, @Nullable String classifier, String type, String extension, Jar producingTask) { BasePluginConvention baseConvention = project.getConvention().getPlugin(BasePluginConvention.class); String jarName = FILE_PART_JOINER.join(name, project.getVersion(), classifier) + "." + extension; File jarFile = baseConvention.getLibsDir().toPath().resolve(jarName).toFile(); DefaultPublishArtifact artifact = new DefaultPublishArtifact(name, extension, type, classifier, null, jarFile, producingTask); return artifact; }
/** * Create a {@link PublishArtifact} for a jar created by a {@link Jar} task * * We use this instead of {@link ArchivePublishArtifact} because we can add the unresolved task dependency by name, * thus avoiding a direct dependency on the task. * * @param project Project to create artifact for * @param name Name of the new artifact * @param classifier Classifier for new artifact * @param type Type of new artifact * @param extension Extension of new artifact * @param producingTask Task that produces the artifact * @return Publish artifact for the jar */ public static PublishArtifact createJarPublishArtifact(Project project, String name, @Nullable String classifier, String type, String extension, Jar producingTask) { BasePluginConvention baseConvention = project.getConvention().getPlugin(BasePluginConvention.class); String jarName = FILE_PART_JOINER.join(name, project.getVersion(), classifier) + "." + extension; File jarFile = baseConvention.getLibsDir().toPath().resolve(jarName).toFile(); DefaultPublishArtifact artifact = new DefaultPublishArtifact(name, extension, type, classifier, null, jarFile, producingTask); return artifact; }
private String getLocalDistFileName(final Project p) { return p.getConvention().getPlugin(BasePluginConvention.class).getArchivesBaseName() + "-dev." + p.getTasks().withType(Jar.class).getByName("jar").getExtension(); } }
/** * Get the library directory * * @return Library directory */ public File getLibsDir() { BasePluginConvention baseConvention = this.project.getConvention().getPlugin(BasePluginConvention.class); File libsDir = Validate.notNull(baseConvention.getLibsDir(), "The libs dir must not be null"); return libsDir; }
"Generates a plugin site. Add '%s' as plugin site in JOSM preferences (expert mode) and you'll be able to install the current development state as plugin '%s-dev'.", localDistListFile.toURI().toURL(), pro.getConvention().getPlugin(BasePluginConvention.class).getArchivesBaseName() )); } catch (MalformedURLException e) { dist.rename( ".*", pro.getConvention().getPlugin(BasePluginConvention.class).getArchivesBaseName() + '.' + pro.getTasks().withType(Jar.class).getByName("jar").getExtension() ); });