@Test public void testGetDefaultOutputFile() { mojo.cssMinifierSuffix = "-min"; mojo.basedir = new File("target/junk/root"); mojo.buildDirectory = new File(mojo.basedir, "target"); Stylesheets stylesheets = new Stylesheets(); mojo.stylesheets = stylesheets; MavenProject project = mock(MavenProject.class); when(project.getArtifactId()).thenReturn("my-artifact"); mojo.project = project; Aggregation aggregation = new Aggregation(); aggregation.setMinification(true); stylesheets.setAggregations(ImmutableList.of(aggregation)); assertThat(mojo.getDefaultOutputFile(aggregation).getAbsolutePath()).isEqualTo(new File(mojo.buildDirectory, "classes/assets/my-artifact-min.css").getAbsolutePath()); }
protected File getDefaultOutputFile(Aggregation aggregation) { String classifier = cssMinifierSuffix; if (aggregation.isMinification()) { if (stylesheets.getMinifierSuffix() != null) { classifier = stylesheets.getMinifierSuffix(); } } else { classifier = ""; } return new File(getInternalAssetOutputDirectory(), project.getArtifactId() + classifier + ".css"); }
CSSMinifierMojo extends AbstractWisdomWatcherMojo { protected File getDefaultOutputFile(Aggregation aggregation) { String classifier = cssMinifierSuffix; if (aggregation.isMinification()) { if (stylesheets.getMinifierSuffix() != null) { classifier = stylesheets.getMinifierSuffix(); } } else { classifier = ""; } return new File(getInternalAssetOutputDirectory(), project.getArtifactId() + classifier + ".css"); } }
CSSMinifierMojo extends AbstractWisdomWatcherMojo { protected File getDefaultOutputFile(Aggregation aggregation) { String classifier = cssMinifierSuffix; if (aggregation.isMinification()) { if (stylesheets.getMinifierSuffix() != null) { classifier = stylesheets.getMinifierSuffix(); } } else { classifier = ""; } return new File(getInternalAssetOutputDirectory(), project.getArtifactId() + classifier + ".css"); }  }
CSSMinifierMojo extends AbstractWisdomWatcherMojo { protected File getDefaultOutputFile(Aggregation aggregation) { String classifier = cssMinifierSuffix; if (aggregation.isMinification()) { if (stylesheets.getMinifierSuffix() != null) { classifier = stylesheets.getMinifierSuffix(); } } else { classifier = ""; } return new File(getInternalAssetOutputDirectory(), project.getArtifactId() + classifier + ".css"); }  @Override void execute(); @Override boolean accept(File file); boolean isNotMinified(File file); @Override boolean fileCreated(File file); @Override boolean fileUpdated(File file); @Override boolean fileDeleted(File file); File getFilteredVersion(File input); }
CSSMinifierMojo extends AbstractWisdomWatcherMojo { protected File getDefaultOutputFile(Aggregation aggregation) { String classifier = cssMinifierSuffix; if (aggregation.isMinification()) { if (stylesheets.getMinifierSuffix() != null) { classifier = stylesheets.getMinifierSuffix(); } } else { classifier = ""; } return new File(getInternalAssetOutputDirectory(), project.getArtifactId() + classifier + ".css"); }  @Override void execute(); @Override boolean accept(File file); boolean isNotMinified(File file); @Override boolean fileCreated(File file); @Override boolean fileUpdated(File file); @Override boolean fileDeleted(File file); File getFilteredVersion(File input); static final String CLEANCSS_NPM_NAME; static final String CLEANCSS_NPM_VERSION; @Parameter(defaultValue = "${skipCleanCSS}")
    public boolean skipCleanCSS; @Parameter(defaultValue = "-min")
    public String cssMinifierSuffix; }