mirror of
https://github.com/jlengrand/jreleaser.git
synced 2026-03-10 08:31:24 +00:00
[model] Add a vendor property to Project. Resolves #214
This commit is contained in:
@@ -634,6 +634,9 @@ public abstract class GitService implements Releaser, CommitAuthorAware, OwnerAw
|
||||
if (isNotBlank(project.getCopyright())) {
|
||||
props.put(Constants.KEY_PROJECT_COPYRIGHT, project.getCopyright());
|
||||
}
|
||||
if (isNotBlank(project.getVendor())) {
|
||||
props.put(Constants.KEY_PROJECT_VENDOR, project.getVendor());
|
||||
}
|
||||
|
||||
if (project.getJava().isEnabled()) {
|
||||
props.putAll(project.getJava().getResolvedExtraProperties());
|
||||
|
||||
@@ -259,6 +259,9 @@ public class JReleaserModel implements Domain {
|
||||
if (isNotBlank(project.getCopyright())) {
|
||||
props.put(Constants.KEY_PROJECT_COPYRIGHT, project.getCopyright());
|
||||
}
|
||||
if (isNotBlank(project.getVendor())) {
|
||||
props.put(Constants.KEY_PROJECT_VENDOR, project.getVendor());
|
||||
}
|
||||
props.put(Constants.KEY_PROJECT_AUTHORS_BY_SPACE, String.join(" ", project.getAuthors()));
|
||||
props.put(Constants.KEY_PROJECT_AUTHORS_BY_COMMA, String.join(",", project.getAuthors()));
|
||||
props.put(Constants.KEY_PROJECT_TAGS_BY_SPACE, String.join(" ", project.getTags()));
|
||||
|
||||
@@ -51,6 +51,7 @@ public class Project implements Domain, ExtraProperties {
|
||||
private String website;
|
||||
private String license;
|
||||
private String copyright;
|
||||
private String vendor;
|
||||
private String docsUrl;
|
||||
private String snapshotPattern;
|
||||
private Boolean snapshot;
|
||||
@@ -65,6 +66,7 @@ public class Project implements Domain, ExtraProperties {
|
||||
this.website = project.website;
|
||||
this.license = project.license;
|
||||
this.copyright = project.copyright;
|
||||
this.vendor = project.vendor;
|
||||
this.docsUrl = project.docsUrl;
|
||||
this.java.setAll(project.java);
|
||||
setAuthors(project.authors);
|
||||
@@ -190,6 +192,14 @@ public class Project implements Domain, ExtraProperties {
|
||||
this.copyright = copyright;
|
||||
}
|
||||
|
||||
public String getVendor() {
|
||||
return vendor;
|
||||
}
|
||||
|
||||
public void setVendor(String vendor) {
|
||||
this.vendor = vendor;
|
||||
}
|
||||
|
||||
public String getDocsUrl() {
|
||||
return docsUrl;
|
||||
}
|
||||
@@ -286,6 +296,7 @@ public class Project implements Domain, ExtraProperties {
|
||||
map.put("docsUrl", docsUrl);
|
||||
map.put("license", license);
|
||||
map.put("copyright", copyright);
|
||||
map.put("vendor", vendor);
|
||||
map.put("authors", authors);
|
||||
map.put("tags", tags);
|
||||
map.put("extraProperties", getResolvedExtraProperties());
|
||||
|
||||
@@ -49,6 +49,7 @@ public interface Constants {
|
||||
String KEY_PROJECT_WEBSITE = "projectWebsite";
|
||||
String KEY_PROJECT_DOCS_URL = "projectDocsUrl";
|
||||
String KEY_PROJECT_COPYRIGHT = "projectCopyright";
|
||||
String KEY_PROJECT_VENDOR = "projectVendor";
|
||||
String KEY_PROJECT_LICENSE = "projectLicense";
|
||||
String KEY_PROJECT_AUTHORS_BY_SPACE = "projectAuthorsBySpace";
|
||||
String KEY_PROJECT_AUTHORS_BY_COMMA = "projectAuthorsByComma";
|
||||
|
||||
@@ -50,6 +50,8 @@ interface Project extends ExtraProperties {
|
||||
|
||||
Property<String> getCopyright()
|
||||
|
||||
Property<String> getVendor()
|
||||
|
||||
Property<String> getDocsUrl()
|
||||
|
||||
ListProperty<String> getAuthors()
|
||||
|
||||
@@ -50,6 +50,7 @@ class ProjectImpl implements Project {
|
||||
final Property<String> website
|
||||
final Property<String> license
|
||||
final Property<String> copyright
|
||||
final Property<String> vendor
|
||||
final Property<String> docsUrl
|
||||
final ListProperty<String> authors
|
||||
final ListProperty<String> tags
|
||||
@@ -70,6 +71,7 @@ class ProjectImpl implements Project {
|
||||
website = objects.property(String).convention(Providers.notDefined())
|
||||
license = objects.property(String).convention(Providers.notDefined())
|
||||
copyright = objects.property(String).convention(Providers.notDefined())
|
||||
vendor = objects.property(String).convention(Providers.notDefined())
|
||||
docsUrl = objects.property(String).convention(Providers.notDefined())
|
||||
authors = objects.listProperty(String).convention(Providers.notDefined())
|
||||
tags = objects.listProperty(String).convention(Providers.notDefined())
|
||||
@@ -120,6 +122,7 @@ class ProjectImpl implements Project {
|
||||
if (website.present) project.website = website.get()
|
||||
if (license.present) project.license = license.get()
|
||||
if (copyright.present) project.copyright = copyright.get()
|
||||
if (vendor.present) project.vendor = vendor.get()
|
||||
if (docsUrl.present) project.docsUrl = docsUrl.get()
|
||||
project.authors = (List<String>) authors.getOrElse([])
|
||||
project.tags = (List<String>) tags.getOrElse([])
|
||||
|
||||
@@ -40,6 +40,7 @@ public class Project implements ExtraProperties {
|
||||
private String website;
|
||||
private String license;
|
||||
private String copyright;
|
||||
private String vendor;
|
||||
private String docsUrl;
|
||||
|
||||
void setAll(Project project) {
|
||||
@@ -52,6 +53,7 @@ public class Project implements ExtraProperties {
|
||||
this.website = project.website;
|
||||
this.license = project.license;
|
||||
this.copyright = project.copyright;
|
||||
this.vendor = project.vendor;
|
||||
this.docsUrl = project.docsUrl;
|
||||
this.java.setAll(project.java);
|
||||
setAuthors(project.authors);
|
||||
@@ -135,6 +137,14 @@ public class Project implements ExtraProperties {
|
||||
this.copyright = copyright;
|
||||
}
|
||||
|
||||
public String getVendor() {
|
||||
return vendor;
|
||||
}
|
||||
|
||||
public void setVendor(String vendor) {
|
||||
this.vendor = vendor;
|
||||
}
|
||||
|
||||
public String getDocsUrl() {
|
||||
return docsUrl;
|
||||
}
|
||||
|
||||
@@ -132,6 +132,7 @@ public final class JReleaserModelConverter {
|
||||
p.setWebsite(project.getWebsite());
|
||||
p.setLicense(project.getLicense());
|
||||
p.setCopyright(project.getCopyright());
|
||||
p.setVendor(project.getVendor());
|
||||
p.setDocsUrl(project.getDocsUrl());
|
||||
p.setTags(project.getTags());
|
||||
p.setAuthors(project.getAuthors());
|
||||
|
||||
Reference in New Issue
Block a user