/** * Finalize the project configuration * * <ul> * <li>Initialize the license URLs if not set * </ul> * * @param projectConfig Project configuration to finalize */ @Finalize public void finalizeProjectConfig(ProjectConfig projectConfig) { License license = projectConfig.getLicense(); String licenseId = license.getId(); if (licenseId != null) { if (license.getUrl() == null) { license.setUrl("https://opensource.org/licenses/" + licenseId.replace(' ', '-')); } if (license.getSourceUrl() == null) { license.setSourceUrl( "https://raw.githubusercontent.com/github/choosealicense.com/gh-pages/_licenses/" + licenseId.toLowerCase().replace(' ', '-') + ".txt"); } } }
/** * Finalize the project configuration * * <ul> * <li>Initialize the license URLs if not set * </ul> * * @param projectConfig Project configuration to finalize */ @Finalize public void finalizeProjectConfig(ProjectConfig projectConfig) { License license = projectConfig.getLicense(); String licenseId = license.getId(); if (licenseId != null) { if (license.getUrl() == null) { license.setUrl("https://opensource.org/licenses/" + licenseId.replace(' ', '-')); } if (license.getSourceUrl() == null) { license.setSourceUrl( "https://raw.githubusercontent.com/github/choosealicense.com/gh-pages/_licenses/" + licenseId.toLowerCase().replace(' ', '-') + ".txt"); } } }
/** * 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()); }
if (license.getId() == null) { LOGGER.warn("Please configure projectConfig.license.id");
if (license.getId() == null) { LOGGER.warn("Please configure projectConfig.license.id");
Element license = Nodes.child(licenses, "license"); Nodes.setChildValue(license, "name", licenseConfig.getId()); Nodes.setChildValue(license, "url", licenseConfig.getUrl());
Element license = Nodes.child(licenses, "license"); Nodes.setChildValue(license, "name", licenseConfig.getId()); Nodes.setChildValue(license, "url", licenseConfig.getUrl());