本文整理汇总了Java中com.vaadin.sass.SassCompiler类的典型用法代码示例。如果您正苦于以下问题:Java SassCompiler类的具体用法?Java SassCompiler怎么用?Java SassCompiler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SassCompiler类属于com.vaadin.sass包,在下文中一共展示了SassCompiler类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: compileTheme
import com.vaadin.sass.SassCompiler; //导入依赖的package包/类
private void compileTheme() {
try {
binder.commit();
ServletContext context = VaadinServlet.getCurrent().getServletContext();
String fullPath = context.getRealPath("/VAADIN/themes/dashboard");
String customScssFileName = fullPath + "/custom.scss";
SassCompiler.writeFile(customScssFileName, module.getModel());
ProcessBuilder processBuilder = new ProcessBuilder("java", "-cp", "../../../WEB-INF/lib/*", "com.vaadin.sass.SassCompiler", "styles.scss", "styles.css");
processBuilder.directory(new File(fullPath));
File error = new File(fullPath, "custom.scss.log");
processBuilder.redirectErrorStream(true);
processBuilder.redirectError(Redirect.PIPE);
Process process = processBuilder.start();
process.waitFor();
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getErrorStream()));
StringBuilder builder = new StringBuilder();
String line = reader.readLine();
while (line != null) {
builder.append(line);
line = reader.readLine();
}
reader.close();
if (!builder.toString().trim().isEmpty()) {
throw new Exception(builder.toString());
}
} catch (Exception ex) {
logger.log(Level.SEVERE, ex.getMessage(), ex);
Notification.show("Error", ex.getMessage(), Notification.Type.ERROR_MESSAGE);
}
}
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:34,代码来源:FormEditor.java
示例2: main
import com.vaadin.sass.SassCompiler; //导入依赖的package包/类
public static void main(String args[]) throws Exception {
SassCompiler.main(new String[]{"src/main/resources/VAADIN/themes/" + Version.THEME_MOBILE_VERSION + "/styles.scss",
"src/main/resources/VAADIN/themes/" + Version.THEME_MOBILE_VERSION + "/styles.css"});
Path source = FileSystems.getDefault().getPath("src/main/resources/VAADIN/themes/" + Version.THEME_MOBILE_VERSION + "/", "styles.css");
Path dest = FileSystems.getDefault().getPath("target/classes/VAADIN/themes/" + Version.THEME_MOBILE_VERSION + "/", "styles.css");
Files.copy(source, dest, StandardCopyOption.REPLACE_EXISTING);
}
开发者ID:MyCollab,项目名称:mycollab,代码行数:8,代码来源:ThemeCompiler.java
示例3: main
import com.vaadin.sass.SassCompiler; //导入依赖的package包/类
public static void main(String args[]) throws Exception {
SassCompiler.main(new String[]{"src/main/resources/VAADIN/themes/" + Version.THEME_VERSION + "/styles.scss",
"src/main/resources/VAADIN/themes/" + Version.THEME_VERSION +"/styles.css"});
Path source = FileSystems.getDefault().getPath("src/main/resources/VAADIN/themes/" + Version.THEME_VERSION + "/", "styles.css");
Path dest = FileSystems.getDefault().getPath("target/classes/VAADIN/themes/" + Version.THEME_VERSION + "/", "styles.css");
Files.copy(source, dest, StandardCopyOption.REPLACE_EXISTING);
}
开发者ID:MyCollab,项目名称:mycollab,代码行数:8,代码来源:ThemeCompiler.java
注:本文中的com.vaadin.sass.SassCompiler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论