-
Notifications
You must be signed in to change notification settings - Fork 69
/
Developer.java
45 lines (37 loc) · 1.43 KB
/
Developer.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/********************************************************************************
* Copyright (c) 2016, 2022 GK Software SE and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Stephan Herrmann - initial implementation
********************************************************************************/
package org.eclipse.platform.releng.maven.pom;
import static org.eclipse.platform.releng.maven.pom.ArtifactInfo.element;
import static org.eclipse.platform.releng.maven.pom.ArtifactInfo.subElement;
import java.util.Collections;
import java.util.List;
public class Developer {
private final String url;
public Developer(String url) {
this.url = url;
}
public static void addUrlDevelopers(String projectURL, String indent, StringBuilder buf) {
element("developers", indent, buf,
Developer.pomSubElements(Collections.singletonList(new Developer(projectURL + "/who"))));
}
private static String pomSubElements(List<Developer> devs) {
StringBuilder buf = new StringBuilder();
for (Developer developer : devs)
developer.toPom(buf, "");
return buf.toString();
}
protected void toPom(StringBuilder buf, String indent) {
element("developer", indent, buf, subElement("url", this.url));
}
}