Skip to content

Instantly share code, notes, and snippets.

@DemkaAge
Last active December 30, 2015 05:29
Show Gist options
  • Save DemkaAge/7782651 to your computer and use it in GitHub Desktop.
Save DemkaAge/7782651 to your computer and use it in GitHub Desktop.
Gwt. LESS. Maven. Chain: * .less to .css (lesscss-maven-plugin) * .css to almost .css (replacer plugin) * .almost .css to gwtResources
@sprite
.mainBackground {
gwt-image: "mainBackground";
background-repeat: repeat;
}
@sprite
.logoBackground {
gwt-image: "logoBackground";
overflow: hidden;
width: 100%;
background-repeat: repeat-x;
height: 70px;
position: relative;
top: 0;
left: 0;
}
/*!gwt @sprite !gwt*/
.mainBackground {
gwt-image: "mainBackground";
background-repeat: repeat;
}
/*!gwt @sprite !gwt*/
.logoBackground {
gwt-image: "logoBackground";
overflow: hidden;
width: 100%;
background-repeat: repeat-x;
height: 70px;
position: relative;
top: 0;
left: 0;
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>webmodules</artifactId>
<groupId>ru.brbpm.lecm</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>styles-wm</artifactId>
<name>LECM / Web Modules / Styles WM</name>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<!--<excludes>-->
<!--<exclude>less</exclude>-->
<!--<exclude>*.less</exclude>-->
<!--</excludes>-->
</resource>
<resource>
<directory>src/main/java</directory>
</resource>
<resource>
<directory>${project.build.directory}/css</directory>
</resource>
<resource>
<directory>${project.build.directory}/generated-sources/gwt</directory>
</resource>
</resources>
<plugins>
<!--<plugin>-->
<!--<groupId>com.github.eirslett</groupId>-->
<!--<artifactId>frontend-maven-plugin</artifactId>-->
<!--&lt;!&ndash; NB! Set <version> to the latest released version of frontend-maven-plugin, like in README.md &ndash;&gt;-->
<!--<version>0.0.7</version>-->
<!--<executions>-->
<!--<execution>-->
<!--<id>install node and npm</id>-->
<!--<goals>-->
<!--<goal>install-node-and-npm</goal>-->
<!--</goals>-->
<!--<configuration>-->
<!--<nodeVersion>v0.10.18</nodeVersion>-->
<!--<npmVersion>1.3.8</npmVersion>-->
<!--</configuration>-->
<!--</execution>-->
<!--</executions>-->
<!--</plugin>-->
<plugin>
<groupId>org.lesscss</groupId>
<artifactId>lesscss-maven-plugin</artifactId>
<version>1.3.3</version>
<configuration>
<sourceDirectory>${project.basedir}/src/main/resources</sourceDirectory>
<outputDirectory>${project.build.directory}/css</outputDirectory>
<excludes>
<exclude>**/Elements.less</exclude>
<exclude>**/Constants.less</exclude>
</excludes>
<compress>false</compress>
</configuration>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.2</version>
<executions>
<execution>
<id>less gwt</id>
<phase>generate-sources</phase>
<goals>
<goal>replace</goal>
</goals>
<configuration>
<includes>
<include>**/css/ru/brbpm/lecm/wm/styles/client/**/*.css</include>
</includes>
<variableTokenValueMap>/\\*!gwt\\s*=,\\s*!gwt\\*/=\u0020</variableTokenValueMap>
</configuration>
</execution>
<execution>
<id>public gwt interface</id>
<phase>process-sources</phase>
<goals>
<goal>replace</goal>
</goals>
<configuration>
<includes>
<include>**/generated-sources/gwt/ru/brbpm/lecm/wm/styles/client/**/*.java</include>
</includes>
<token>^interface</token>
<value>public interface</value>
</configuration>
</execution>
</executions>
<configuration>
<regex>true</regex>
<regexFlags>
<regexFlag>MULTILINE</regexFlag>
</regexFlags>
<unescape>true</unescape>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<configuration>
<cssFiles>
<cssFile>ru/brbpm/lecm/wm/styles/client/MainStyle.css</cssFile>
<cssFile>ru/brbpm/lecm/wm/styles/client/Sprites.css</cssFile>
<cssFile>ru/brbpm/lecm/wm/styles/client/Controls.css</cssFile>
<cssFile>ru/brbpm/lecm/wm/styles/client/widgets/HorizontalScrollbar.css</cssFile>
<cssFile>ru/brbpm/lecm/wm/styles/client/widgets/ScrollPanel.css</cssFile>
<cssFile>ru/brbpm/lecm/wm/styles/client/widgets/VerticalScrollbar.css</cssFile>
<cssFile>ru/brbpm/lecm/wm/styles/client/widgets/InfiniteDataGrid.css</cssFile>
</cssFiles>
</configuration>
<executions>
<execution>
<goals>
<goal>css</goal>
<!--<goal>resources</goal>-->
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment