Add git module

This commit is contained in:
Andres Almiray
2021-01-31 19:33:28 +01:00
parent 8d930e576a
commit 77f2079358
214 changed files with 2216 additions and 878 deletions

View File

@@ -1,7 +1,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2020 Andres Almiray.
# Copyright 2020-2021 Andres Almiray.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id 'com.github.johnrengelman.shadow'
id 'application'
@@ -23,6 +22,14 @@ plugins {
mainClassName = 'org.kordamp.jreleaser.tool.JReleaser'
config {
docs {
javadoc {
empty = true
}
}
}
configurations {
uberjar
}

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2020 Andres Almiray.
# Copyright 2020-2021 Andres Almiray.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id 'application'
}

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2020 Andres Almiray.
# Copyright 2020-2021 Andres Almiray.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2020 Andres Almiray.
# Copyright 2020-2021 Andres Almiray.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
config {
info {
description = 'jreleaser'

View File

@@ -1,7 +1,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2020 Andres Almiray.
# Copyright 2020-2021 Andres Almiray.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
dependencies {
api project(':jreleaser-config')
api "org.yaml:snakeyaml:$snakeYamlVersion"

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2020 Andres Almiray.
# Copyright 2020-2021 Andres Almiray.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
dependencies {
api project(':jreleaser-model')
}

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2020 Andres Almiray.
# Copyright 2020-2021 Andres Almiray.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
dependencies {
api project(':jreleaser-utils')
}

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -0,0 +1,92 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.kordamp.jreleaser.model;
import java.io.File;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import static org.kordamp.jreleaser.util.StringUtils.isNotBlank;
/**
* @author Andres Almiray
* @since 0.1.0
*/
public class Changelog extends AbstractDomain {
private Boolean enabled;
private boolean enabledSet;
private Sort sort = Sort.ASC;
private File external;
void setAll(Changelog changelog) {
this.enabled = changelog.enabled;
this.enabledSet = changelog.enabledSet;
this.sort = changelog.sort;
this.external = changelog.external;
}
public Boolean isEnabled() {
return enabled != null && enabled;
}
public void setEnabled(Boolean enabled) {
this.enabledSet = true;
this.enabled = enabled;
}
public boolean isEnabledSet() {
return enabledSet;
}
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public void setSort(String sort) {
if (isNotBlank(sort)) {
setSort(Sort.valueOf(sort.toUpperCase()));
}
}
public File getExternal() {
return external;
}
public void setExternal(File external) {
this.external = external;
}
public Map<String, Object> asMap() {
if (!isEnabled()) return Collections.emptyMap();
Map<String, Object> map = new LinkedHashMap<>();
map.put("enabled", isEnabled());
map.put("sort", sort);
map.put("external", external);
return map;
}
public enum Sort {
ASC, DESC
}
}

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -0,0 +1,191 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.kordamp.jreleaser.model;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* @author Andres Almiray
* @since 0.1.0
*/
public abstract class GitService extends AbstractDomain {
private String repoHost;
private String repoOwner;
private String repoName;
private String downloadUrlFormat;
private String releaseNotesUrlFormat;
private String latestReleaseUrlFormat;
private String issueTrackerUrlFormat;
private String authorization;
private String tagName;
private String releaseName;
private Changelog changelog = new Changelog();
private boolean overwrite;
private boolean allowUploadToExisting;
private String apiEndpoint;
void setAll(GitService service) {
this.repoHost = service.repoHost;
this.repoOwner = service.repoOwner;
this.repoName = service.repoName;
this.downloadUrlFormat = service.downloadUrlFormat;
this.releaseNotesUrlFormat = service.releaseNotesUrlFormat;
this.latestReleaseUrlFormat = service.latestReleaseUrlFormat;
this.issueTrackerUrlFormat = service.issueTrackerUrlFormat;
this.authorization = service.authorization;
this.tagName = service.tagName;
this.releaseName = service.releaseName;
this.overwrite = service.overwrite;
this.allowUploadToExisting = service.allowUploadToExisting;
this.apiEndpoint = service.apiEndpoint;
this.changelog.setAll(service.changelog);
}
public String getRepoHost() {
return repoHost;
}
public void setRepoHost(String repoHost) {
this.repoHost = repoHost;
}
public String getRepoOwner() {
return repoOwner;
}
public void setRepoOwner(String repoOwner) {
this.repoOwner = repoOwner;
}
public String getRepoName() {
return repoName;
}
public void setRepoName(String repoName) {
this.repoName = repoName;
}
public String getDownloadUrlFormat() {
return downloadUrlFormat;
}
public void setDownloadUrlFormat(String downloadUrlFormat) {
this.downloadUrlFormat = downloadUrlFormat;
}
public String getReleaseNotesUrlFormat() {
return releaseNotesUrlFormat;
}
public void setReleaseNotesUrlFormat(String releaseNotesUrlFormat) {
this.releaseNotesUrlFormat = releaseNotesUrlFormat;
}
public String getLatestReleaseUrlFormat() {
return latestReleaseUrlFormat;
}
public void setLatestReleaseUrlFormat(String latestReleaseUrlFormat) {
this.latestReleaseUrlFormat = latestReleaseUrlFormat;
}
public String getIssueTrackerUrlFormat() {
return issueTrackerUrlFormat;
}
public void setIssueTrackerUrlFormat(String issueTrackerUrlFormat) {
this.issueTrackerUrlFormat = issueTrackerUrlFormat;
}
public String getAuthorization() {
return authorization;
}
public void setAuthorization(String authorization) {
this.authorization = authorization;
}
public String getTagName() {
return tagName;
}
public void setTagName(String tagName) {
this.tagName = tagName;
}
public String getReleaseName() {
return releaseName;
}
public void setReleaseName(String releaseName) {
this.releaseName = releaseName;
}
public Changelog getChangelog() {
return changelog;
}
public void setChangelog(Changelog changelog) {
this.changelog = changelog;
}
public boolean isOverwrite() {
return overwrite;
}
public void setOverwrite(boolean overwrite) {
this.overwrite = overwrite;
}
public boolean isAllowUploadToExisting() {
return allowUploadToExisting;
}
public void setAllowUploadToExisting(boolean allowUploadToExisting) {
this.allowUploadToExisting = allowUploadToExisting;
}
public String getApiEndpoint() {
return apiEndpoint;
}
public void setApiEndpoint(String apiEndpoint) {
this.apiEndpoint = apiEndpoint;
}
@Override
public Map<String, Object> asMap() {
Map<String, Object> map = new LinkedHashMap<>();
map.put("repoHost", repoHost);
map.put("repoOwner", repoOwner);
map.put("repoName", repoName);
map.put("downloadUrlFormat", downloadUrlFormat);
map.put("releaseNotesUrlFormat", releaseNotesUrlFormat);
map.put("latestReleaseUrlFormat", latestReleaseUrlFormat);
map.put("issueTrackerUrlFormat", issueTrackerUrlFormat);
map.put("authorization", authorization);
map.put("tagName", tagName);
map.put("releaseName", releaseName);
map.put("overwrite", overwrite);
map.put("allowUploadToExisting", allowUploadToExisting);
map.put("apiEndpoint", apiEndpoint);
map.put("changelog", changelog.asMap());
return map;
}
}

View File

@@ -0,0 +1,78 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.kordamp.jreleaser.model;
import java.util.Map;
/**
* @author Andres Almiray
* @since 0.1.0
*/
public class Gitea extends GitService {
private String targetCommitish = "main";
private boolean draft;
private boolean prerelease;
public Gitea() {
setRepoHost("try.gitea.io");
setDownloadUrlFormat("https://{{repoHost}}/{{repoOwner}}/{{repoName}}/releases/download/v{{projectVersion}}/{{artifactFileName}}");
setReleaseNotesUrlFormat("https://{{repoHost}}/{{repoOwner}}/{{repoName}}/releases/tag/v{{projectVersion}}");
setLatestReleaseUrlFormat("https://{{repoHost}}/{{repoOwner}}/{{repoName}}/releases/latest");
setIssueTrackerUrlFormat("https://{{repoHost}}/{{repoOwner}}/{{repoName}}/issues");
}
void setAll(Gitea service) {
super.setAll(service);
this.targetCommitish = service.targetCommitish;
this.draft = service.draft;
this.prerelease = service.prerelease;
}
public String getTargetCommitish() {
return targetCommitish;
}
public void setTargetCommitish(String targetCommitish) {
this.targetCommitish = targetCommitish;
}
public boolean isDraft() {
return draft;
}
public void setDraft(boolean draft) {
this.draft = draft;
}
public boolean isPrerelease() {
return prerelease;
}
public void setPrerelease(boolean prerelease) {
this.prerelease = prerelease;
}
@Override
public Map<String, Object> asMap() {
Map<String, Object> map = super.asMap();
map.put("targetCommitish", targetCommitish);
map.put("draft", draft);
map.put("prerelease", prerelease);
return map;
}
}

View File

@@ -0,0 +1,78 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.kordamp.jreleaser.model;
import java.util.Map;
/**
* @author Andres Almiray
* @since 0.1.0
*/
public class Github extends GitService {
private String targetCommitish = "main";
private boolean draft;
private boolean prerelease;
public Github() {
setRepoHost("github.com");
setDownloadUrlFormat("https://{{repoHost}}/{{repoOwner}}/{{repoName}}/releases/download/v{{projectVersion}}/{{artifactFileName}}");
setReleaseNotesUrlFormat("https://{{repoHost}}/{{repoOwner}}/{{repoName}}/releases/tag/v{{projectVersion}}");
setLatestReleaseUrlFormat("https://{{repoHost}}/{{repoOwner}}/{{repoName}}/releases/latest");
setIssueTrackerUrlFormat("https://{{repoHost}}/{{repoOwner}}/{{repoName}}/issues");
}
void setAll(Github service) {
super.setAll(service);
this.targetCommitish = service.targetCommitish;
this.draft = service.draft;
this.prerelease = service.prerelease;
}
public String getTargetCommitish() {
return targetCommitish;
}
public void setTargetCommitish(String targetCommitish) {
this.targetCommitish = targetCommitish;
}
public boolean isDraft() {
return draft;
}
public void setDraft(boolean draft) {
this.draft = draft;
}
public boolean isPrerelease() {
return prerelease;
}
public void setPrerelease(boolean prerelease) {
this.prerelease = prerelease;
}
@Override
public Map<String, Object> asMap() {
Map<String, Object> map = super.asMap();
map.put("targetCommitish", targetCommitish);
map.put("draft", draft);
map.put("prerelease", prerelease);
return map;
}
}

View File

@@ -0,0 +1,56 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.kordamp.jreleaser.model;
import java.util.Map;
/**
* @author Andres Almiray
* @since 0.1.0
*/
public class Gitlab extends GitService {
private String ref = "main";
public Gitlab() {
setRepoHost("gitlab.com");
setDownloadUrlFormat("\"https://{{repoHost}}/{{repoOwner}}/{{repoName}}/-/archive/v{{projectVersion}}/{{artifactFileName}}");
setReleaseNotesUrlFormat("https://{{repoHost}}/{{repoOwner}}/{{repoName}}/-/releases/v{{projectVersion}}");
setLatestReleaseUrlFormat("https://{{repoHost}}/{{repoOwner}}/{{repoName}}/-/releases/v{{projectVersion}}");
setIssueTrackerUrlFormat("https://{{repoHost}}/{{repoOwner}}/{{repoName}}/-/issues");
}
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 Map<String, Object> asMap() {
Map<String, Object> map = super.asMap();
map.put("ref", ref);
return map;
}
}

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -80,46 +80,75 @@ public final class JReleaserModelValidator {
}
private static void validateRelease(Logger logger, Path basedir, Project project, Release release, List<String> errors) {
if (isBlank(release.getRepoOwner())) {
errors.add("release.repoOwner must not be blank");
int count = 0;
count += validateGithub(logger, basedir, project, release.getGithub(), errors);
count += validateGitlab(logger, basedir, project, release.getGitlab(), errors);
count += validateGitea(logger, basedir, project, release.getGitea(), errors);
if (0 == count) {
errors.add("One of release.github, release.gitlab, release.gitea must be defined");
return;
}
if (isBlank(release.getRepoName())) {
release.setRepoName(project.getName());
if (count > 1) {
errors.add("Only one of release.github, release.gitlab, release.gitea can be defined");
}
if (null == release.getRepoType()) {
release.setRepoType(Release.RepoType.GITHUB);
}
private static void validateGitService(Logger logger, Path basedir, Project project, GitService service, List<String> errors) {
if (isBlank(service.getRepoOwner())) {
errors.add("service.repoOwner must not be blank");
}
if (isBlank(service.getRepoName())) {
service.setRepoName(project.getName());
}
if (isBlank(release.getRepoHost())) {
release.setRepoHost(release.getRepoType().repoHost());
}
if (isBlank(release.getDownloadUrlFormat())) {
release.setDownloadUrlFormat(release.getRepoType().downloadUrlFormat());
}
if (isBlank(release.getReleaseNotesUrlFormat())) {
release.setReleaseNotesUrlFormat(release.getRepoType().releaseNotesUrlFormat());
}
if (isBlank(release.getLatestReleaseUrlFormat())) {
release.setLatestReleaseUrlFormat(release.getRepoType().latestReleaseUrlFormat());
}
if (isBlank(release.getIssueTrackerUrlFormat())) {
release.setIssueTrackerUrlFormat(release.getRepoType().issueTrackerUrlFormat());
}
if (isBlank(release.getAuthorization())) {
String tokenName = release.getRepoType().name() + "_TOKEN";
logger.warn("release.auhorization is not explicitly defined. Checking environment for {}", tokenName);
if (isBlank(service.getAuthorization())) {
String tokenName = service.getClass().getSimpleName().toUpperCase() + "_TOKEN";
logger.warn("service.auhorization is not explicitly defined. Checking environment for {}", tokenName);
if (isBlank(System.getenv(tokenName))) {
errors.add("release.authorization must not be blank. Alternatively define a " + tokenName + " environment variable.");
errors.add("service.authorization must not be blank. Alternatively define a " + tokenName + " environment variable.");
}
return;
}
if (isBlank(release.getTagName())) {
release.setTagName("v" + project.getVersion());
if (isBlank(service.getTagName())) {
service.setTagName("v" + project.getVersion());
}
if (isBlank(release.getTargetCommitish())) {
release.setTargetCommitish("main");
}
private static int validateGithub(Logger logger, Path basedir, Project project, Github github, List<String> errors) {
if (null == github) return 0;
validateGitService(logger, basedir, project, github, errors);
if (isBlank(github.getTargetCommitish())) {
github.setTargetCommitish("main");
}
return 1;
}
private static int validateGitlab(Logger logger, Path basedir, Project project, Gitlab gitlab, List<String> errors) {
if (null == gitlab) return 0;
validateGitService(logger, basedir, project, gitlab, errors);
if (isBlank(gitlab.getRef())) {
gitlab.setRef("main");
}
return 1;
}
private static int validateGitea(Logger logger, Path basedir, Project project, Gitea gitea, List<String> errors) {
if (null == gitea) return 0;
validateGitService(logger, basedir, project, gitea, errors);
if (isBlank(gitea.getTargetCommitish())) {
gitea.setTargetCommitish("main");
}
return 1;
}
private static void validateDistributions(Logger logger, Path basedir, JReleaserModel model, Map<String, Distribution> distributions, List<String> errors) {
@@ -246,13 +275,13 @@ public final class JReleaserModelValidator {
if (isBlank(tool.getCheckverUrl())) {
tool.setCheckverUrl(commonScoop.getCheckverUrl());
if (isBlank(tool.getCheckverUrl())) {
tool.setCheckverUrl(model.getRelease().getLatestReleaseUrlFormat());
tool.setCheckverUrl(model.getRelease().getGitService().getLatestReleaseUrlFormat());
}
}
if (isBlank(tool.getAutoupdateUrl())) {
tool.setAutoupdateUrl(commonScoop.getAutoupdateUrl());
if (isBlank(tool.getAutoupdateUrl())) {
tool.setAutoupdateUrl(model.getRelease().getDownloadUrlFormat());
tool.setAutoupdateUrl(model.getRelease().getGitService().getDownloadUrlFormat());
}
}
}

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,277 +20,75 @@ package org.kordamp.jreleaser.model;
import java.util.LinkedHashMap;
import java.util.Map;
import static org.kordamp.jreleaser.util.StringUtils.isNotBlank;
/**
* @author Andres Almiray
* @since 0.1.0
*/
public class Release extends AbstractDomain {
private RepoType repoType;
private String repoHost;
private String repoOwner;
private String repoName;
private String downloadUrlFormat;
private String releaseNotesUrlFormat;
private String latestReleaseUrlFormat;
private String issueTrackerUrlFormat;
private String authorization;
private String tagName;
private String targetCommitish = "main";
private String releaseName;
private String body = "";
private boolean draft;
private boolean prerelease;
private boolean overwrite;
private boolean allowUploadToExisting;
private String apiEndpoint;
private Boolean enabled;
private boolean enabledSet;
private Github github;
private Gitlab gitlab;
private Gitea gitea;
void setAll(Release release) {
this.repoType = release.repoType;
this.repoHost = release.repoHost;
this.repoOwner = release.repoOwner;
this.repoName = release.repoName;
this.downloadUrlFormat = release.downloadUrlFormat;
this.releaseNotesUrlFormat = release.releaseNotesUrlFormat;
this.latestReleaseUrlFormat = release.latestReleaseUrlFormat;
this.issueTrackerUrlFormat = release.issueTrackerUrlFormat;
this.authorization = release.authorization;
this.tagName = release.tagName;
this.targetCommitish = release.targetCommitish;
this.releaseName = release.releaseName;
this.body = release.body;
this.draft = release.draft;
this.prerelease = release.prerelease;
this.overwrite = release.overwrite;
this.allowUploadToExisting = release.allowUploadToExisting;
this.apiEndpoint = release.apiEndpoint;
this.enabled = release.enabled;
this.enabledSet = release.enabledSet;
this.github = release.github;
this.gitlab = release.gitlab;
this.gitea = release.gitea;
}
public RepoType getRepoType() {
return repoType;
public Boolean isEnabled() {
return enabled != null && enabled;
}
public void setRepoType(RepoType repoType) {
this.repoType = repoType;
public void setEnabled(Boolean enabled) {
this.enabledSet = true;
this.enabled = enabled;
}
public void setRepoType(String repoType) {
if (isNotBlank(repoType)) {
this.repoType = RepoType.valueOf(repoType.toUpperCase());
}
public boolean isEnabledSet() {
return enabledSet;
}
public String getRepoHost() {
return repoHost;
public Github getGithub() {
return github;
}
public void setRepoHost(String repoHost) {
this.repoHost = repoHost;
public void setGithub(Github github) {
this.github = github;
}
public String getRepoOwner() {
return repoOwner;
public Gitlab getGitlab() {
return gitlab;
}
public void setRepoOwner(String repoOwner) {
this.repoOwner = repoOwner;
public void setGitlab(Gitlab gitlab) {
this.gitlab = gitlab;
}
public String getRepoName() {
return repoName;
public Gitea getGitea() {
return gitea;
}
public void setRepoName(String repoName) {
this.repoName = repoName;
public void setGitea(Gitea gitea) {
this.gitea = gitea;
}
public String getDownloadUrlFormat() {
return downloadUrlFormat;
}
public void setDownloadUrlFormat(String downloadUrlFormat) {
this.downloadUrlFormat = downloadUrlFormat;
}
public String getReleaseNotesUrlFormat() {
return releaseNotesUrlFormat;
}
public void setReleaseNotesUrlFormat(String releaseNotesUrlFormat) {
this.releaseNotesUrlFormat = releaseNotesUrlFormat;
}
public String getLatestReleaseUrlFormat() {
return latestReleaseUrlFormat;
}
public void setLatestReleaseUrlFormat(String latestReleaseUrlFormat) {
this.latestReleaseUrlFormat = latestReleaseUrlFormat;
}
public String getIssueTrackerUrlFormat() {
return issueTrackerUrlFormat;
}
public void setIssueTrackerUrlFormat(String issueTrackerUrlFormat) {
this.issueTrackerUrlFormat = issueTrackerUrlFormat;
}
public String getAuthorization() {
return authorization;
}
public void setAuthorization(String authorization) {
this.authorization = authorization;
}
public String getTagName() {
return tagName;
}
public void setTagName(String tagName) {
this.tagName = tagName;
}
public String getTargetCommitish() {
return targetCommitish;
}
public void setTargetCommitish(String targetCommitish) {
this.targetCommitish = targetCommitish;
}
public String getReleaseName() {
return releaseName;
}
public void setReleaseName(String releaseName) {
this.releaseName = releaseName;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public boolean isDraft() {
return draft;
}
public void setDraft(boolean draft) {
this.draft = draft;
}
public boolean isPrerelease() {
return prerelease;
}
public void setPrerelease(boolean prerelease) {
this.prerelease = prerelease;
}
public boolean isOverwrite() {
return overwrite;
}
public void setOverwrite(boolean overwrite) {
this.overwrite = overwrite;
}
public boolean isAllowUploadToExisting() {
return allowUploadToExisting;
}
public void setAllowUploadToExisting(boolean allowUploadToExisting) {
this.allowUploadToExisting = allowUploadToExisting;
}
public String getApiEndpoint() {
return apiEndpoint;
}
public void setApiEndpoint(String apiEndpoint) {
this.apiEndpoint = apiEndpoint;
public GitService getGitService() {
if (null != github) return github;
if (null != gitlab) return gitlab;
return gitea;
}
@Override
public Map<String, Object> asMap() {
Map<String, Object> map = new LinkedHashMap<>();
map.put("repoHost", repoHost);
map.put("repoType", repoType);
map.put("repoOwner", repoOwner);
map.put("repoName", repoName);
map.put("downloadUrlFormat", downloadUrlFormat);
map.put("releaseNotesUrlFormat", releaseNotesUrlFormat);
map.put("latestReleaseUrlFormat", latestReleaseUrlFormat);
map.put("issueTrackerUrlFormat", issueTrackerUrlFormat);
map.put("authorization", authorization);
map.put("tagName", tagName);
map.put("targetCommitish", targetCommitish);
map.put("releaseName", releaseName);
map.put("body ", isNotBlank(body));
map.put("draft", draft);
map.put("prerelease", prerelease);
map.put("overwrite", overwrite);
map.put("allowUploadToExisting", allowUploadToExisting);
map.put("apiEndpoint", apiEndpoint);
map.put("enabled", isEnabled());
if (null != github) map.put("github", github);
if (null != gitlab) map.put("gitlab", gitlab);
if (null != gitea) map.put("gitea", gitea);
return map;
}
public enum RepoType {
GITHUB("github.com",
"https://{{repoHost}}/{{repoOwner}}/{{repoName}}/releases/download/v{{projectVersion}}/{{artifactFileName}}",
"https://{{repoHost}}/{{repoOwner}}/{{repoName}}/releases/tag/v{{projectVersion}}",
"https://{{repoHost}}/{{repoOwner}}/{{repoName}}/releases/latest",
"https://{{repoHost}}/{{repoOwner}}/{{repoName}}/issues");
/*
GITLAB("gitlab.com",
"https://{{repoHost}}/{{repoOwner}}/{{repoName}}/-/archive/v{{projectVersion}}/{{artifactFileName}}",
"https://{{repoHost}}/{{repoOwner}}/{{repoName}}/-/releases/v{{projectVersion}}",
"https://{{repoHost}}/{{repoOwner}}/{{repoName}}/-/releases/v{{projectVersion}}",
"https://{{repoHost}}/{{repoOwner}}/{{repoName}}/-/issues");
*/
private final String repoHost;
private final String downloadUrlFormat;
private final String releaseNotesUrlFormat;
private final String latestReleaseUrlFormat;
private final String issueTrackerUrlFormat;
RepoType(String repoHost,
String downloadUrlFormat,
String releaseNotesUrlFormat,
String latestReleaseUrlFormat,
String issueTrackerUrlFormat) {
this.repoHost = repoHost;
this.downloadUrlFormat = downloadUrlFormat;
this.releaseNotesUrlFormat = releaseNotesUrlFormat;
this.latestReleaseUrlFormat = latestReleaseUrlFormat;
this.issueTrackerUrlFormat = issueTrackerUrlFormat;
}
String repoHost() {
return this.repoHost;
}
String downloadUrlFormat() {
return this.downloadUrlFormat;
}
String releaseNotesUrlFormat() {
return this.releaseNotesUrlFormat;
}
String latestReleaseUrlFormat() {
return this.latestReleaseUrlFormat;
}
String issueTrackerUrlFormat() {
return this.issueTrackerUrlFormat;
}
}
}

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,6 +19,8 @@ package org.kordamp.jreleaser.model.releaser;
import org.kordamp.jreleaser.model.JReleaserModel;
import java.nio.file.Path;
/**
* @author Andres Almiray
* @since 0.1.0
@@ -26,5 +28,5 @@ import org.kordamp.jreleaser.model.JReleaserModel;
public interface ReleaserBuilder<R extends Releaser> {
R build();
R buildFromModel(JReleaserModel model);
R buildFromModel(Path basedir, JReleaserModel model);
}

View File

@@ -1,7 +1,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2020 Andres Almiray.
# Copyright 2020-2021 Andres Almiray.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
dependencies {
api project(':jreleaser-model')
api project(':jreleaser-templates')

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,11 +28,15 @@ import org.kordamp.jreleaser.util.Logger;
*/
public class Releasers {
public static <RB extends ReleaserBuilder> RB findReleaser(Logger logger, JReleaserModel model) {
switch (model.getRelease().getRepoType()) {
case GITHUB:
return (RB) GithubReleaser.builder();
default:
throw new IllegalArgumentException("Unsupported releaser " + model.getRelease().getRepoType());
if (null != model.getRelease().getGithub()) {
return (RB) GithubReleaser.builder();
}
// if(null != model.getRelease().getGitlab()) {
// return (RB) GitlabReleaser.builder();
// }
// if(null != model.getRelease().getGitea()) {
// return (RB) GiteaReleaser.builder();
// }
throw new IllegalArgumentException("No suitable git releaser has been configured");
}
}

View File

@@ -1,7 +1,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2020 Andres Almiray.
# Copyright 2020-2021 Andres Almiray.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
dependencies {
api project(':jreleaser-model')
api "com.github.spullara.mustache.java:compiler:$mustacheVersion"

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2020 Andres Almiray.
# Copyright 2020-2021 Andres Almiray.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
dependencies {
api project(':jreleaser-model')
api project(':jreleaser-templates')

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -182,9 +182,9 @@ abstract class AbstractToolProcessor<T extends Tool> implements ToolProcessor<T>
}
protected void fillReleaseProperties(Map<String, Object> context, Release release) {
context.put(Constants.KEY_REPO_HOST, release.getRepoHost());
context.put(Constants.KEY_REPO_OWNER, release.getRepoOwner());
context.put(Constants.KEY_REPO_NAME, release.getRepoName());
context.put(Constants.KEY_REPO_HOST, release.getGitService().getRepoHost());
context.put(Constants.KEY_REPO_OWNER, release.getGitService().getRepoOwner());
context.put(Constants.KEY_REPO_NAME, release.getGitService().getRepoName());
}
protected void fillDistributionProperties(Map<String, Object> context, Distribution distribution, Release release) {
@@ -192,9 +192,9 @@ abstract class AbstractToolProcessor<T extends Tool> implements ToolProcessor<T>
context.put(Constants.KEY_DISTRIBUTION_EXECUTABLE, distribution.getExecutable());
context.put(Constants.KEY_DISTRIBUTION_TAGS_BY_SPACE, String.join(" ", distribution.getTags()));
context.put(Constants.KEY_DISTRIBUTION_TAGS_BY_COMMA, String.join(",", distribution.getTags()));
context.put(Constants.KEY_DISTRIBUTION_RELEASE_NOTES, applyTemplate(new StringReader(release.getReleaseNotesUrlFormat()), context));
context.put(Constants.KEY_DISTRIBUTION_ISSUE_TRACKER, applyTemplate(new StringReader(release.getIssueTrackerUrlFormat()), context));
context.put(Constants.KEY_DISTRIBUTION_LATEST_RELEASE, applyTemplate(new StringReader(release.getLatestReleaseUrlFormat()), context));
context.put(Constants.KEY_DISTRIBUTION_RELEASE_NOTES, applyTemplate(new StringReader(release.getGitService().getReleaseNotesUrlFormat()), context));
context.put(Constants.KEY_DISTRIBUTION_ISSUE_TRACKER, applyTemplate(new StringReader(release.getGitService().getIssueTrackerUrlFormat()), context));
context.put(Constants.KEY_DISTRIBUTION_LATEST_RELEASE, applyTemplate(new StringReader(release.getGitService().getLatestReleaseUrlFormat()), context));
context.putAll(distribution.getExtraProperties());
}
@@ -247,7 +247,7 @@ abstract class AbstractToolProcessor<T extends Tool> implements ToolProcessor<T>
context.put("artifact" + classifier + "Hash", artifact.getHash());
Map<String, Object> newContext = new LinkedHashMap<>(context);
newContext.put("artifactFileName", artifactFileName);
String artifactUrl = applyTemplate(new StringReader(model.getRelease().getDownloadUrlFormat()), newContext, "downloadUrl");
String artifactUrl = applyTemplate(new StringReader(model.getRelease().getGitService().getDownloadUrlFormat()), newContext, "downloadUrl");
context.put("artifact" + classifier + "Url", artifactUrl);
if (0 == i) {

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -77,7 +77,7 @@ final class ProcessorUtils {
context.put("artifact" + classifier + "Hash", artifact.getHash());
Map<String, Object> newContext = new LinkedHashMap<>(context);
newContext.put("artifactFileName", artifactFileName);
String artifactUrl = applyTemplate(new StringReader(model.getRelease().getDownloadUrlFormat()), newContext, "downloadUrl");
String artifactUrl = applyTemplate(new StringReader(model.getRelease().getGitService().getDownloadUrlFormat()), newContext, "downloadUrl");
context.put("artifact" + classifier + "Url", artifactUrl);
if (0 == i) {

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2020 Andres Almiray.
# Copyright 2020-2021 Andres Almiray.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
dependencies {
api('kr.motd.maven:os-maven-plugin:1.6.2') { transitive = false }
}

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2020 Andres Almiray.
# Copyright 2020-2021 Andres Almiray.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -21,14 +21,15 @@ version = 0.1.0-SNAPSHOT
sourceCompatibility = 1.8
targetCompatibility = 1.8
kordampPluginVersion = 0.42.0
kordampBuildVersion = 2.1.0
kordampPluginVersion = 0.43.0
kordampBuildVersion = 2.2.0
gitPluginVersion = 3.0.0
checksumPluginVersion = 1.1.0
shadowPluginVersion = 6.1.0
asmVersion = 8.0.1
jacksonVersion = 2.11.3
jgitVersion = 5.10.0.202012080955-r
jipsyVersion = 0.6.0
junitVersion = 5.7.0
hamcrestVersion = 2.2

View File

@@ -1,7 +1,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2020 Andres Almiray.
# Copyright 2020-2021 Andres Almiray.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id 'groovy'
id 'org.kordamp.gradle.groovy-project'

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -0,0 +1,38 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.kordamp.jreleaser.gradle.plugin.dsl
import groovy.transform.CompileStatic
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.provider.Property
/**
*
* @author Andres Almiray
* @since 0.1.0
*/
@CompileStatic
interface Changelog {
Property<org.kordamp.jreleaser.model.Changelog.Sort> getSort()
Property<Boolean> getEnabled()
RegularFileProperty getExternal()
void setSort(String sort)
}

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
* Copyright 2020-2021 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

Some files were not shown because too many files have changed in this diff Show More