Skip to content

Commit

Permalink
Remove reporting
Browse files Browse the repository at this point in the history
Co-authored-by: Marc Philipp <mail@marcphilipp.de>
  • Loading branch information
leonard84 and marcphilipp committed Oct 31, 2019
1 parent 54836dc commit bc297f7
Show file tree
Hide file tree
Showing 62 changed files with 5 additions and 33,026 deletions.
2 changes: 1 addition & 1 deletion .idea/copyright/ASLv2.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ if (JavaVersion.current().isJava8()) {
}

include "spock-unitils"
include "spock-report"
include "spock-gradle"

if (JavaVersion.current().java7Compatible) {
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,56 +14,11 @@

package org.spockframework.report.log;

import java.io.File;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

import org.spockframework.util.IoUtil;
import org.spockframework.util.Nullable;

import spock.config.ConfigurationObject;

@ConfigurationObject("report")
public class ReportLogConfiguration {
public boolean enabled = Boolean.getBoolean("spock.logEnabled");

public String logFileDir = System.getProperty("spock.logFileDir");
public String logFileName = System.getProperty("spock.logFileName");
public String logFileSuffix = System.getProperty("spock.logFileSuffix");

public String issueNamePrefix = "";
public String issueUrlPrefix = "";

public String reportServerAddress = System.getProperty("spock.reportServerAddress");
public int reportServerPort = Integer.valueOf(System.getProperty("spock.reportServerPort", "4242"));

public String getLogFileSuffix() {
if (logFileSuffix != null && logFileSuffix.contains("#timestamp")) {
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd_HH_mm_ss");
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
String timestamp = dateFormat.format(new Date());
logFileSuffix = logFileSuffix.replace("#timestamp", timestamp);
}
return logFileSuffix;
}

@Nullable
public File getLogFile() {
if (logFileDir == null) return null;

String fullName = logFileName;
String suffix = getLogFileSuffix();
if (suffix != null && suffix.length() > 0) {
String extension = IoUtil.getFileExtension(logFileName);
if (extension == null) {
fullName = logFileName + "-" + suffix;
} else {
fullName = logFileName.substring(0, logFileName.length() - extension.length() - 1)
+ "-" + suffix + "." + extension;
}
}
return new File(logFileDir, fullName);
}
}
Loading

0 comments on commit bc297f7

Please sign in to comment.