Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import hudson.model.UpdateSite.Plugin;
import hudson.util.VersionNumber;
import io.jenkins.lib.versionnumber.JavaSpecificationVersion;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
Expand Down Expand Up @@ -74,6 +75,7 @@
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.io.IOUtils;
Expand Down Expand Up @@ -379,11 +381,11 @@ && new VersionNumber(coreCoordinates.version).compareTo(new VersionNumber("1.485
}

if (failed && config.isFailOnError()) {
throw new AbortException("Execution was aborted due to the failure in a plugin test (-failOnError is set)");
throw new AbortException("Execution was aborted due to the failure in a plugin test (-failOnError is set)");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary whitespace change, and adds tabs to a file that uses spaces

}

return report;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary whitespace change, and adds tabs to a file that uses spaces


protected void generateHtmlReportFile() throws IOException {
if (!config.reportFile.exists() || !config.reportFile.isFile()) {
Expand Down Expand Up @@ -432,7 +434,7 @@ private TestExecutionResult testPluginAgainst(MavenCoordinates coreCoordinates,

File pluginCheckoutDir = new File(config.workDirectory.getAbsolutePath() + File.separator + plugin.name + File.separator);

try {
try {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary whitespace change, and adds tabs to a file that uses spaces

// Run any precheckout hooks
Map<String, Object> beforeCheckout = new HashMap<>();
beforeCheckout.put("pluginName", plugin.name);
Expand Down Expand Up @@ -652,11 +654,11 @@ private UpdateSite.Data extractUpdateCenterData(Map<String, String> groupIDs){
}

private UpdateSite.Data scanBom(HashMap<String, String> pluginGroupIds, String pluginRegExp) throws IOException, PomExecutionException, XmlPullParserException {

JSONObject top = new JSONObject();
top.put("id", DEFAULT_SOURCE_ID);
JSONObject plugins = new JSONObject();

for (File entry : getBomEntries()) {
String name = entry.getName();
Matcher m = Pattern.compile(pluginRegExp).matcher(name);
Expand Down Expand Up @@ -762,9 +764,9 @@ private String solveVersionFromModel(Model model) {
Parent parent = model.getParent();
return version != null ? version : parent != null ? parent.getVersion() : StringUtils.EMPTY;
}

/**
* Given a value and a model, it checks if it is an interpolated value. In negative case it returns the same
* Given a value and a model, it checks if it is an interpolated value. In negative case it returns the same
* value. In affirmative case, it retrieves its value from the properties of the Maven model.
* @param model
* @param version
Expand All @@ -774,11 +776,11 @@ private String getProperty(Model model, String value) {
if (!value.contains("$")) {
return value;
}

String key = value.replaceAll("\\$", "")
.replaceAll("\\{", "")
.replaceAll("\\}", "");

return getProperty(model, model.getProperties().getProperty(key));
}

Expand Down Expand Up @@ -997,6 +999,12 @@ private void addSplitPluginDependencies(String thisPlugin, MavenRunner.Config mc
toAddTest = difference(pluginDeps, toAddTest);
toAddTest = difference(toAdd, toAddTest);

if(toReplaceTest.containsKey("configuration-as-code")){
VersionNumber versionNumber = toReplaceTest.get("configuration-as-code");
pluginGroupIds.put("test-harness", "io.jenkins.configuration-as-code");
toReplaceTest.put("test-harness", versionNumber);
}

if (!toAdd.isEmpty() || !toReplace.isEmpty() || !toAddTest.isEmpty() || !toReplaceTest.isEmpty()) {
System.out.println("Adding/replacing plugin dependencies for compatibility: " + toAdd + " " + toReplace + "\nFor test: " + toAddTest + " " + toReplaceTest);
pom.addDependencies(toAdd, toReplace, toAddTest, toReplaceTest, coreDep, pluginGroupIds, convertFromTestDep);
Expand Down