/** * @return URL of artifact in Bintray, eg: * "https://bintray.com/shipkit/examples/download_file?file_path=org/mockito/release-tools-example/api/0.15.0/api-0.15.0.jar" */ @Override public String getDefaultUrl(String extension) { BintrayExtension bintrayExtension = project.getExtensions().getByType(BintrayExtension.class); String userOrgOrName = bintrayExtension.getPkg().getUserOrg(); if (userOrgOrName == null) { userOrgOrName = bintrayExtension.getUser(); } return String.format("https://bintray.com/%s/%s/download_file?file_path=%s/%s/%s/%s-%s%s", userOrgOrName, bintrayExtension.getPkg().getRepo(), project.getGroup().toString().replace('.', '/'), artifactBaseName, previousVersion, artifactBaseName, previousVersion, extension); } }
/** * @return URL of artifact in Bintray, eg: * "https://bintray.com/shipkit/examples/download_file?file_path=org/mockito/release-tools-example/api/0.15.0/api-0.15.0.jar" */ @Override public String getDefaultUrl(String extension) { BintrayExtension bintrayExtension = project.getExtensions().getByType(BintrayExtension.class); String userOrgOrName = bintrayExtension.getPkg().getUserOrg(); if (userOrgOrName == null) { userOrgOrName = bintrayExtension.getUser(); } return String.format("https://bintray.com/%s/%s/download_file?file_path=%s/%s/%s/%s-%s%s", userOrgOrName, bintrayExtension.getPkg().getRepo(), project.getGroup().toString().replace('.', '/'), artifactBaseName, previousVersion, artifactBaseName, previousVersion, extension); } }
public void run() { String key = notNull(bintray.getKey(), "BINTRAY_API_KEY", "Missing 'bintray.key' value.\n" + " Please configure Bintray extension or export 'BINTRAY_API_KEY' env variable."); bintray.setKey(key); // api key is set basing on 'bintray.key' before lazy configuration so it has to be set again here bintrayUpload.setApiKey(key); //workaround for https://github.com/bintray/gradle-bintray-plugin/issues/170 notNull(bintray.getUser(), "Missing 'bintray.user' value.\n" + " Please configure Bintray extension."); } });
/** * Constructs link to bintray repository. * * @param bintray * @return repository link */ public static String getRepoLink(BintrayExtension bintray) { String repo = bintray.getPkg().getRepo(); String pkg = bintray.getPkg().getName(); String org = bintray.getPkg().getUserOrg(); if (org == null) { org = bintray.getUser(); } return MessageFormat.format("https://bintray.com/{0}/{1}/{2}/", org, repo, pkg); } }
/** * Constructs link to bintray repository. * * @param bintray * @return repository link */ public static String getRepoLink(BintrayExtension bintray) { String repo = bintray.getPkg().getRepo(); String pkg = bintray.getPkg().getName(); String org = bintray.getPkg().getUserOrg(); if (org == null) { org = bintray.getUser(); } return MessageFormat.format("https://bintray.com/{0}/{1}/{2}", org, repo, pkg); } }
/** * Constructs link to bintray repository. * * @param bintray * @return repository link */ public static String getRepoLink(BintrayExtension bintray) { String repo = bintray.getPkg().getRepo(); String pkg = bintray.getPkg().getName(); String org = bintray.getPkg().getUserOrg(); if (org == null) { org = bintray.getUser(); } return MessageFormat.format("https://bintray.com/{0}/{1}/{2}/", org, repo, pkg); } }
notNull(bintray.getUser(), "Missing 'bintray.user' value.\n" + " Please configure Bintray extension."); });
notNull(bintray.getUser(), "Missing 'bintray.user' value.\n" + " Please configure Bintray extension."); });