mirror of
https://github.com/jlengrand/jreleaser.git
synced 2026-03-10 08:31:24 +00:00
[model] Rename gitlab.ref to gitlab.branch. Fixes #117
This commit is contained in:
@@ -17,8 +17,6 @@
|
||||
*/
|
||||
package org.jreleaser.model;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Andres Almiray
|
||||
* @since 0.1.0
|
||||
@@ -26,8 +24,6 @@ import java.util.Map;
|
||||
public class Gitlab extends GitService {
|
||||
public static final String NAME = "gitlab";
|
||||
|
||||
private String ref;
|
||||
|
||||
public Gitlab() {
|
||||
super(NAME);
|
||||
setHost("gitlab.com");
|
||||
@@ -42,36 +38,10 @@ public class Gitlab extends GitService {
|
||||
|
||||
void setAll(Gitlab service) {
|
||||
super.setAll(service);
|
||||
this.ref = service.ref;
|
||||
}
|
||||
|
||||
public String getRef() {
|
||||
return ref;
|
||||
}
|
||||
|
||||
public void setRef(String ref) {
|
||||
this.ref = ref;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBranch() {
|
||||
return getRef();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBranch(String branch) {
|
||||
setRef(branch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getReverseRepoHost() {
|
||||
return "com.gitlab";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> asMap(boolean full) {
|
||||
Map<String, Object> map = super.asMap(full);
|
||||
map.put("ref", ref);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,8 +21,6 @@ import org.jreleaser.model.Gitlab;
|
||||
import org.jreleaser.model.JReleaserContext;
|
||||
import org.jreleaser.util.Errors;
|
||||
|
||||
import static org.jreleaser.model.GitService.BRANCH;
|
||||
|
||||
/**
|
||||
* @author Andres Almiray
|
||||
* @since 0.1.0
|
||||
@@ -34,13 +32,6 @@ public abstract class GitlabValidator extends GitServiceValidator {
|
||||
|
||||
validateGitService(context, mode, gitlab, errors);
|
||||
|
||||
gitlab.setRef(
|
||||
checkProperty(context.getModel().getEnvironment(),
|
||||
BRANCH,
|
||||
"gitlab.ref",
|
||||
gitlab.getRef(),
|
||||
"main"));
|
||||
|
||||
return gitlab.isEnabled();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,5 +27,4 @@ import org.gradle.api.provider.Property
|
||||
*/
|
||||
@CompileStatic
|
||||
interface Gitlab extends GitService {
|
||||
Property<String> getRef()
|
||||
}
|
||||
@@ -33,7 +33,6 @@ import javax.inject.Inject
|
||||
*/
|
||||
@CompileStatic
|
||||
class GitlabImpl extends AbstractGitService implements Gitlab {
|
||||
final Property<String> ref
|
||||
final ChangelogImpl changelog
|
||||
final MilestoneImpl milestone
|
||||
final CommitAuthorImpl commitAuthor
|
||||
@@ -41,7 +40,6 @@ class GitlabImpl extends AbstractGitService implements Gitlab {
|
||||
@Inject
|
||||
GitlabImpl(ObjectFactory objects) {
|
||||
super(objects)
|
||||
ref = objects.property(String).convention(Providers.notDefined())
|
||||
|
||||
changelog = objects.newInstance(ChangelogImpl, objects)
|
||||
milestone = objects.newInstance(MilestoneImpl, objects)
|
||||
@@ -52,7 +50,6 @@ class GitlabImpl extends AbstractGitService implements Gitlab {
|
||||
@Internal
|
||||
boolean isSet() {
|
||||
super.isSet() ||
|
||||
ref.present ||
|
||||
changelog.isSet() ||
|
||||
milestone.isSet() ||
|
||||
commitAuthor.isSet()
|
||||
@@ -61,7 +58,6 @@ class GitlabImpl extends AbstractGitService implements Gitlab {
|
||||
org.jreleaser.model.Gitlab toModel() {
|
||||
org.jreleaser.model.Gitlab service = new org.jreleaser.model.Gitlab()
|
||||
toModel(service)
|
||||
if (ref.present) service.ref = ref.get()
|
||||
if (changelog.isSet()) service.changelog = changelog.toModel()
|
||||
if (milestone.isSet()) service.milestone = milestone.toModel()
|
||||
if (commitAuthor.isSet()) service.commitAuthor = commitAuthor.toModel()
|
||||
|
||||
@@ -22,8 +22,6 @@ package org.jreleaser.maven.plugin;
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public class Gitlab extends GitService {
|
||||
private String ref;
|
||||
|
||||
public Gitlab() {
|
||||
setHost("gitlab.com");
|
||||
setRepoUrlFormat("https://{{repoHost}}/{{repoOwner}}/{{repoName}}");
|
||||
@@ -37,14 +35,5 @@ public class Gitlab extends GitService {
|
||||
|
||||
void setAll(Gitlab service) {
|
||||
super.setAll(service);
|
||||
this.ref = service.ref;
|
||||
}
|
||||
|
||||
public String getRef() {
|
||||
return ref;
|
||||
}
|
||||
|
||||
public void setRef(String ref) {
|
||||
this.ref = ref;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +157,6 @@ public final class JReleaserModelConverter {
|
||||
if (null == gitlab) return null;
|
||||
org.jreleaser.model.Gitlab g = new org.jreleaser.model.Gitlab();
|
||||
convertGitService(gitlab, g);
|
||||
if (isNotBlank(gitlab.getRef())) g.setRef(gitlab.getRef());
|
||||
return g;
|
||||
}
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ public class GitlabReleaser implements Releaser {
|
||||
Release release = new Release();
|
||||
release.setName(gitlab.getEffectiveReleaseName());
|
||||
release.setTagName(tagName);
|
||||
release.setRef(gitlab.getRef());
|
||||
release.setRef(gitlab.getBranch());
|
||||
release.setDescription(changelog);
|
||||
|
||||
// remote tag/release
|
||||
|
||||
Reference in New Issue
Block a user