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); }
@Override public void execute(Task task) { System.out.println(project.getVersion()); } });
private String determineVersion(Project project, File versionFile) { if ("unspecified".equals(project.getVersion())) { LOG.info("'project.version' is unspecified. Version will be set to '{}'. You can change it in '{}'.", FALLBACK_INITIAL_VERSION, versionFile.getName()); return FALLBACK_INITIAL_VERSION; } else { LOG.lifecycle(" Configured '{}' version in '{}' file. Please remove 'version={}' setting from *.gradle file.", project.getVersion(), versionFile.getName(), project.getVersion()); return project.getVersion().toString(); } } }
private String determineVersion(Project project, File versionFile) { if ("unspecified".equals(project.getVersion())) { LOG.info("'project.version' is unspecified. Version will be set to '{}'. You can change it in '{}'.", FALLBACK_INITIAL_VERSION, versionFile.getName()); return FALLBACK_INITIAL_VERSION; } else { LOG.lifecycle(" Configured '{}' version in '{}' file. Please remove 'version={}' setting from *.gradle file.", project.getVersion(), versionFile.getName(), project.getVersion()); return project.getVersion().toString(); } } }
private String determineVersion(Project project){ if("unspecified".equals(project.getVersion()) ){ LOG.lifecycle(" BEWARE! 'project.version' is unspecified. Version will be set to '{}'. You can change it in '{}'.", FALLBACK_INITIAL_VERSION, versionFile.getName()); return FALLBACK_INITIAL_VERSION; } else{ LOG.lifecycle(" Initial project version in '{}' set to '{}' (taken from 'project.version' property).", versionFile.getName(), project.getVersion()); return project.getVersion().toString(); } }
@SuppressWarnings("unchecked") private List<String> renderArgs(List<String> args, Map<String, String> env) { Map<String, Object> context = new HashMap<>(env); context.put("PROJECT_NAME", project.getName()); context.put("PROJECT_VERSION", project.getVersion()); return args.stream().map(s -> render(s, context)).collect(Collectors.toList()); }
protected String getVersionLabel() { String versionLabel = getProject().getVersion().toString(); if (versionLabel.endsWith("-SNAPSHOT")) { String timeLabel = new SimpleDateFormat("yyyyMMdd'.'HHmmss").format(new Date()); versionLabel = versionLabel.replace("SNAPSHOT", timeLabel); // Append time to get unique version label } return deployment.getVersionPrefix() + versionLabel; }
/** * Get the project version * * @return Project version */ public String getVersion() { return Validate.notNull(getProject().getVersion().toString()); }
/** * Get the project version * * @return Project version */ public String getVersion() { return Validate.notNull(getProject().getVersion().toString()); }
@OutputFile public File getSdistOutput() { Project project = getProject(); return new File( getDistDir(), String.format( "%s-%s.tar.gz", project.getName(), // TODO: Is this replace here really necessary? project.getVersion().toString().replace("_", "-"))); }
@OutputFile public File getSdistOutput() { Project project = getProject(); return new File( getDistDir(), String.format( "%s-%s.tar.gz", project.getName(), // TODO: Is this replace here really necessary? project.getVersion().toString().replace("_", "-"))); }
/** * Returns Git tag based on release configuration and project version */ public static String getTag(ShipkitConfiguration conf, Project project) { return conf.getGit().getTagPrefix() + project.getVersion(); }
@Override protected final Map<String, Supplier<Object>> requiredOptions(File file) { return ImmutableMap.of( "packageName", () -> getProject().getName(), "packageVersion", () -> getProject().getVersion().toString(), "productDependencies", () -> getProductDependencyFile().getAbsolutePath()); } }
LiteModJson(Project project, String minecraftVersion, String revision) { this.project = project; this.mcversion = this.minecraftVersion = minecraftVersion; this.revision = revision; this.name = project.getName(); this.displayName = project.hasProperty("displayName") ? project.property("displayName").toString() : project.getDescription(); this.version = project.getVersion().toString(); }
@Override protected final Map<String, Supplier<Object>> requiredOptions(File file) { return ImmutableMap.of( "packageName", () -> getProject().getName(), "packageVersion", () -> formatPythonVersion(getProject().getVersion().toString())); }
private String calculateS3Key() { final String version = getProject().getVersion().toString(); final String md5Checksum = getMD5Checksum(file); return getProject().getName() + "/" + version + "/" + md5Checksum + "/" + file.getName(); }
private String getRenderedOutputLocation(Os os, Arch arch) { Map<String, Object> context = new HashMap<>(getEffectiveEnvironment(os, arch)); context.put("PROJECT_NAME", getProject().getName()); context.put("PROJECT_VERSION", getProject().getVersion()); return StringUtils.render(getOutputLocation(), context); }
@Override public void execute(Project project) { JavaPluginConvention java = project.getConvention().getPlugin(JavaPluginConvention.class); java.setSourceCompatibility("1.8"); java.setTargetCompatibility("1.8"); Map<String, String> jarManifest = new HashMap<>(); jarManifest.put("Implementation-Title", project.getName()); jarManifest.put("Implementation-Version", project.getVersion().toString()); Jar jar = (Jar) project.getTasks().getByName("jar"); jar.getManifest().attributes(jarManifest); } }
private static BuildFullBundleTask createBuildFullBundleTask(@NotNull Project project, GatewayDeveloperPluginConfig pluginConfig, BuildDeploymentBundleTask buildDeploymentBundleTask) { // Create build-full-bundle task final BuildFullBundleTask buildFullBundleTask = project.getTasks().create(BUILD_FULL_BUNDLE, BuildFullBundleTask.class, t -> { t.getEnvironmentConfig().set(pluginConfig.getEnvironmentConfig()); t.getDependencyBundles().setFrom(project.getConfigurations().getByName(BUNDLE_CONFIGURATION)); }); project.afterEvaluate(p -> buildFullBundleTask.getOutputBundle().set(new File(pluginConfig.getBuiltEnvironmentBundleDir().getAsFile().get(), p.getName() + '-' + p.getVersion() + "-full.bundle"))); buildFullBundleTask.dependsOn(buildDeploymentBundleTask); return buildFullBundleTask; }
private ProjectDescriptor deriveProjectDescription(Project project) { ProjectDescriptor projectDescriptor = new ProjectDescriptor(project.getName(), project.getGroup().toString(), project.getDescription(), project.getVersion().toString(), new EnvironmentDescriptor(project.getGradle().getGradleVersion())); addPluginDescription(project, projectDescriptor); addTasksDescription(project, projectDescriptor); addJavaDescription(project, projectDescriptor); return projectDescriptor; }