Skip to content

Commit

Permalink
Remove unused code.
Browse files Browse the repository at this point in the history
  • Loading branch information
erd committed Apr 17, 2015
1 parent f94b393 commit 0042913
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 32 deletions.
30 changes: 15 additions & 15 deletions src/main/java/org/robolectric/templates/LogHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,30 @@
import org.apache.velocity.runtime.RuntimeServices;
import org.apache.velocity.runtime.log.LogChute;

/**
* Logging adapter for Velocity.
*/
public class LogHandler implements LogChute {
private final AbstractMojo mojo;

public LogHandler(AbstractMojo velocityMojo) {
this.mojo = velocityMojo;
public LogHandler(AbstractMojo mojo) {
this.mojo = mojo;
}

public void init(RuntimeServices runtimeServices) throws Exception {
}

public boolean isLevelEnabled(int level) {
boolean enabled = false;
if (level == DEBUG_ID && mojo.getLog().isDebugEnabled())
enabled = true;
else if (level == INFO_ID && mojo.getLog().isInfoEnabled())
enabled = true;
else if (level == WARN_ID && mojo.getLog().isWarnEnabled())
enabled = true;
else if (level == ERROR_ID && mojo.getLog().isErrorEnabled())
enabled = true;

return enabled;
if (level == DEBUG_ID && mojo.getLog().isDebugEnabled()) {
return true;
} else if (level == INFO_ID && mojo.getLog().isInfoEnabled()) {
return true;
} else if (level == WARN_ID && mojo.getLog().isWarnEnabled()) {
return true;
} else if (level == ERROR_ID && mojo.getLog().isErrorEnabled()) {
return true;
}
return false;
}

public void log(int level, String content) {
Expand All @@ -43,7 +45,6 @@ public void log(int level, String content) {
case ERROR_ID:
mojo.getLog().error(content);
break;
default:
}
}

Expand All @@ -62,7 +63,6 @@ public void log(int level, String content, Throwable throwable) {
case ERROR_ID:
mojo.getLog().error(content, throwable);
break;
default:
}
}
}
17 changes: 0 additions & 17 deletions src/main/java/org/robolectric/templates/ProcessTemplatesMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public void execute() throws MojoExecutionException {
try {
Velocity.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM, new LogHandler(this));
Velocity.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH, project.getBasedir().getAbsolutePath());

Velocity.init();

VelocityContext context = new VelocityContext();
Expand Down Expand Up @@ -98,20 +97,4 @@ private void processTemplate(VelocityContext context, File file) throws Velocity
throw new MojoExecutionException("Error processing template file: " + file.getAbsolutePath() + ": " + e);
}
}

public void setProject(MavenProject project) {
this.project = project;
}

public void setApiLevel(Integer apiLevel) {
this.apiLevel = apiLevel;
}

public void setOutputDirectory(File outputDirectory) {
this.outputDirectory = outputDirectory;
}

public void setTemplateFiles(FileSet templateFiles) {
this.templateFiles = templateFiles;
}
}

0 comments on commit 0042913

Please sign in to comment.