run sass plugin at build time, should fix openshift deployment issues

This commit is contained in:
Athou
2013-05-18 17:50:30 +02:00
parent 0e6ea30a82
commit 18cc08d7ad
5 changed files with 58 additions and 17 deletions

36
pom.xml
View File

@@ -155,21 +155,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.searls</groupId>
<artifactId>jasmine-maven-plugin</artifactId>
<version>1.3.1.0</version>
<executions>
<execution>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<jsTestSrcDir>${project.basedir}/src/test/javascript/specs</jsTestSrcDir>
</configuration>
</plugin>
</plugins>
</build>
@@ -492,6 +477,23 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<version>1.6.3</version>
<executions>
<execution>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<configuration>
<targetGroups>all</targetGroups>
<wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
<destinationFolder>${basedir}/target/generated-sources/wro4j/</destinationFolder>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
@@ -501,6 +503,10 @@
<directory>target/generated-sources/angularjs/</directory>
<targetPath>templates</targetPath>
</resource>
<resource>
<directory>target/generated-sources/wro4j/</directory>
<targetPath>static</targetPath>
</resource>
<resource>
<directory>src/main/script/</directory>
<includes>

View File

@@ -100,8 +100,8 @@ public abstract class BasePage extends WebPage {
if (getApplication().getConfigurationType() == RuntimeConfigurationType.DEPLOYMENT) {
long startupTime = startupBean.getStartupTime();
String suffix = "?" + startupTime;
response.render(JavaScriptHeaderItem.forUrl("wro/all.js" + suffix));
response.render(CssHeaderItem.forUrl("wro/all.css" + suffix));
response.render(JavaScriptHeaderItem.forUrl("static/all.js" + suffix));
response.render(CssHeaderItem.forUrl("static/all.css" + suffix));
} else {
response.render(JavaScriptHeaderItem.forUrl("wro/lib.js"));
response.render(CssHeaderItem.forUrl("wro/lib.css"));

View File

@@ -5,6 +5,10 @@ import java.util.Map;
import ro.isdc.wro.manager.factory.ConfigurableWroManagerFactory;
import ro.isdc.wro.model.resource.processor.ResourcePreProcessor;
/**
* Runtime solution
*
*/
public class WroManagerFactory extends ConfigurableWroManagerFactory {
@Override

View File

@@ -0,0 +1,30 @@
package com.commafeed.frontend.resources;
import java.util.Map;
import ro.isdc.wro.model.resource.processor.ResourcePostProcessor;
import ro.isdc.wro.model.resource.processor.ResourcePreProcessor;
import ro.isdc.wro.model.resource.processor.support.ProcessorProvider;
import com.google.api.client.util.Maps;
/**
* Build-time solution
*
*/
public class WroSassProvider implements ProcessorProvider {
@Override
public Map<String, ResourcePreProcessor> providePreProcessors() {
Map<String, ResourcePreProcessor> map = Maps.newHashMap();
map.put("sassOnlyProcessor", new SassOnlyProcessor());
map.put("sassImport", new SassImportProcessor());
return map;
}
@Override
public Map<String, ResourcePostProcessor> providePostProcessors() {
return Maps.newHashMap();
}
}

View File

@@ -0,0 +1 @@
com.commafeed.frontend.resources.WroSassProvider