/** * Initialize the annotations configuration * * @param annotatedProject Annotations configuration to initialize * @param project Project context */ @Defaults public void initializeAnnotationsConfig(AnnotatedProject annotatedProject, ProjectContext project) { Matcher matcher = ID_PATTERN.matcher(project.getName()); if (matcher.matches()) { annotatedProject.setId(matcher.group(1)); } matcher = VERSION_PATTERN.matcher(project.getVersion().toString()); if (matcher.matches()) { annotatedProject.setVersion(matcher.group(1)); } }
/** * Initialize the annotations configuration * * @param annotatedProject Annotations configuration to initialize * @param project Project context */ @Defaults public void initializeAnnotationsConfig(AnnotatedProject annotatedProject, ProjectContext project) { Matcher matcher = ID_PATTERN.matcher(project.getName()); if (matcher.matches()) { annotatedProject.setId(matcher.group(1)); } matcher = VERSION_PATTERN.matcher(project.getVersion().toString()); if (matcher.matches()) { annotatedProject.setVersion(matcher.group(1)); } }
/** * Initialize a Docker image * * @param image Docker image to initialize * @param project Project context * @param files File operations */ @Defaults public void initializeImage(@Each DockerImage image, ProjectContext project, FileOperations files) { image.setDependsOn(new HashSet<>()); image.setFiles(files.copySpec()); image.setRepository(project.getName()); image.setTag(project.getVersion()); }
/** * Configure the Bintray plugin * * <ul> * <li>Set Bintray user and password from Gradle properties file or environment * <li>Configure the Bintray package * </ul> * * @param bintray Bintray plugin's configuration * @param projectConfig Project configuration * @param bintrayConfig Bintray configuration * @param project Project context */ @Defaults public void configureBintrayExtension(BintrayExtension bintray, ProjectConfig projectConfig, BintrayConfig bintrayConfig, ProjectContext project) { bintray.setUser(project.getProperty("bintray.user")); bintray.setKey(project.getProperty("bintray.key")); PackageConfig pkg = bintray.getPkg(); pkg.setName(project.getName()); pkg.setDesc(project.getDescription()); pkg.setRepo(bintrayConfig.getRepository()); pkg.setVcsUrl(projectConfig.getRepository().getConnection()); pkg.setWebsiteUrl(projectConfig.getWebsiteUrl()); pkg.setIssueTrackerUrl(projectConfig.getIssueTracker().getWebsiteUrl()); pkg.setLicenses(projectConfig.getLicense().getId()); VersionConfig version = pkg.getVersion(); version.setName(project.getVersion().toString()); version.setVcsTag(project.getName() + "-" + project.getVersion()); }
/** * Configure the Bintray plugin * * <ul> * <li>Set Bintray user and password from Gradle properties file or environment * <li>Configure the Bintray package * </ul> * * @param bintray Bintray plugin's configuration * @param projectConfig Project configuration * @param bintrayConfig Bintray configuration * @param project Project context */ @Defaults public void configureBintrayExtension(BintrayExtension bintray, ProjectConfig projectConfig, BintrayConfig bintrayConfig, ProjectContext project) { bintray.setUser(project.getProperty("bintray.user")); bintray.setKey(project.getProperty("bintray.key")); PackageConfig pkg = bintray.getPkg(); pkg.setName(project.getName()); pkg.setDesc(project.getDescription()); pkg.setRepo(bintrayConfig.getRepository()); pkg.setVcsUrl(projectConfig.getRepository().getConnection()); pkg.setWebsiteUrl(projectConfig.getWebsiteUrl()); pkg.setIssueTrackerUrl(projectConfig.getIssueTracker().getWebsiteUrl()); pkg.setLicenses(projectConfig.getLicense().getId()); VersionConfig version = pkg.getVersion(); version.setName(project.getVersion().toString()); version.setVcsTag(project.getName() + "-" + project.getVersion()); }
Nodes.setChildValue(dependencyNode, "groupId", this.project.getGroup()); Nodes.setChildValue(dependencyNode, "artifactId", artifact.getName()); Nodes.setChildValue(dependencyNode, "version", this.project.getVersion()); Nodes.setChildValue(dependencyNode, "scope", JavaPlugin.COMPILE_CONFIGURATION_NAME);
Nodes.setChildValue(dependencyNode, "groupId", this.project.getGroup()); Nodes.setChildValue(dependencyNode, "artifactId", artifact.getName()); Nodes.setChildValue(dependencyNode, "version", this.project.getVersion()); Nodes.setChildValue(dependencyNode, "scope", JavaPlugin.COMPILE_CONFIGURATION_NAME);